feat: Adds script to generate database seeded values and removes old mock storage.

This commit is contained in:
2025-01-16 21:00:27 -05:00
parent 09b46f672a
commit e1d07008a1
16 changed files with 399 additions and 535 deletions

View File

@@ -41,3 +41,40 @@ public extension Vendor {
}
}
}
#if DEBUG
//
// public extension Vendor {
//
// static func generateMocks(count: Int = 20) -> [Self] {
// @Dependency(\.date.now) var now
// @Dependency(\.uuid) var uuid
//
// var output = [Self]()
//
// for _ in 0 ... count {
// output.append(.init(
// id: uuid(),
// name: RandomNames.companyNames.randomElement()!,
// branches: nil,
// createdAt: now,
// updatedAt: now
// ))
// }
//
// return output
// }
// }
public extension Vendor.Create {
static func generateMocks(count: Int = 5) -> [Self] {
(0 ... count).reduce(into: [Self]()) { array, _ in
array.append(.init(
name: RandomNames.companyNames.randomElement()! + String(RandomNames.characterString.randomElement()!)
))
}
}
}
#endif