Added the catalogue models and seed to support phase 1 of the POC prototype in the Persistence package.

This commit is contained in:
javier committed 2026-09-21 11:16:30 +02:00
1 parent 717df5208c
commit 6d7ab4bcba
19 files changed
+1381 -151

No files matched your search

@@ -0,0 +1,65 @@
/// A `Sendable` snapshot of a seller's shop.
public struct Shop: Sendable, Equatable {
// MARK: Properties
/// The shop's URL slug.
public let slug: String
/// The shop's name.
public let name: String
/// The city the shop ships from.
public let city: String
/// The ISO 3166-1 alpha-2 code of the country the shop ships from.
public let country: String
/// The year the shop started selling on the site.
public let sinceYear: Int
/// Whether the shop's identity has been verified.
public let isVerified: Bool
/// The shop's average rating, out of five.
public let rating: Double
/// The number of rated sales behind ``rating``.
public let ratedSales: Int
/// The number of items the shop has sold.
public let soldCount: Int
/// The shop's handling time, in business days.
public let handlingDays: Int
/// Where and how the shop ships.
public let shipsNote: String
/// The shop's returns policy, in a few words.
public let returnsNote: String
/// The shop's description of itself.
public let about: String
// MARK: Initializers
public init(
slug: String,
name: String,
city: String,
country: String,
sinceYear: Int,
isVerified: Bool,
rating: Double,
ratedSales: Int,
soldCount: Int,
handlingDays: Int,
shipsNote: String,
returnsNote: String,
about: String
) {
self.slug = slug
self.name = name
self.city = city
self.country = country
self.sinceYear = sinceYear
self.isVerified = isVerified
self.rating = rating
self.ratedSales = ratedSales
self.soldCount = soldCount
self.handlingDays = handlingDays
self.shipsNote = shipsNote
self.returnsNote = returnsNote
self.about = about
}
}