Implemented phase 1 for the POC prototype in the Website service.

This commit is contained in:
javier committed 2026-09-21 11:16:52 +02:00
1 parent 6d7ab4bcba
commit ea89ea892a
37 files changed
+4173 -43

No files matched your search

@@ -0,0 +1,44 @@
import Foundation
import Persistence
extension Listing {
/// A listing for tests: a slabbed single issue unless told otherwise.
static func stub(
slug: String = "nightward-1",
shop: Shop = .stub(),
title: String = "Nightward #1",
format: String = "single-issues",
grader: String? = "CGC",
grade: Double? = 9.8,
condition: String = "NM/M",
keyNotes: String? = nil,
priceCents: Int = 24_000,
acceptsOffers: Bool = true
) -> Self {
.init(
slug: slug, shop: shop, title: title, seriesTitle: "Nightward (2019 series)", issueLabel: "#1",
publisher: "Meridian Comics", year: 2019, format: format, printing: "1st print",
printingDetail: "First printing", isFirstPrint: true, grader: grader, grade: grade,
condition: condition, certNumber: grader == nil ? nil : "4312087-002", pageQuality: "White",
keyNotes: keyNotes, sellerNotes: "Clean case.", priceCents: priceCents, shippingCents: 600,
acceptsOffers: acceptsOffers,
cover: .init(tone: "navy", title: "NIGHT\nWARD", imprint: "MERIDIAN", number: "1"),
listedAt: .init(timeIntervalSince1970: 0)
)
}
}
extension Shop {
/// A shop for tests: a verified Amsterdam seller unless told otherwise.
static func stub(
slug: String = "kestrel-row-comics",
name: String = "Kestrel Row Comics",
isVerified: Bool = true
) -> Self {
.init(
slug: slug, name: name, city: "Amsterdam", country: "NL", sinceYear: 2023, isVerified: isVerified,
rating: 4.9, ratedSales: 312, soldCount: 1108, handlingDays: 2, shipsNote: "ships worldwide, tracked",
returnsNote: "14-day returns", about: "Modern keys."
)
}
}