66 lines
1.9 KiB
Swift
66 lines
1.9 KiB
Swift
/// 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
|
|
}
|
|
|
|
}
|