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

This commit is contained in:
javier committed 2026-09-21 13:31:44 +02:00
1 parent 9403931109
commit 89a7a7b8e5
19 files changed
+990 -15

No files matched your search

@@ -152,6 +152,24 @@ public extension Listing {
keyNotes != nil
}
/// The issue's number within its series, or `nil` for a copy that is not a numbered single issue.
var issueNumber: Int? {
format == "single-issues"
? Int(issueLabel.drop { !$0.isNumber }.prefix { $0.isNumber })
: nil
}
/// The name of the series the copy belongs to: its series title, less the `(2019 series)` a single issue's carries.
var seriesName: String {
seriesTitle
.replacing(#/\s\(\d{4} series\)$/#, with: "")
}
/// The slug of the series the copy belongs to.
var seriesSlug: String {
ListingDraft.slug(seriesName)
}
/// Whether the copy is graded and slabbed by a grading company.
var isSlabbed: Bool {
grader != nil