DailyTheme
final class DailyTheme : Model
Every day during the cruise, there’s a theme. This model lets us store the themes for each day, with a bit of text explaining the theme and an image related to the theme somehow.
For an 8 day cruise, there shouldn’t be more than ~10 of these records. Each day of the cruise tends to have an ‘officall’ theme day, and it might be appropriate to add unofficial themes for a day or two before embarkation?
See
See Also: DailyThemeData the DTO for returning info on DailyThemes.See
See Also: DailyThemeUploadData the DTO for mutating DailyThemes..See
See Also: CreateDailyThemeSchema the Migration for creating the DailyTheme table in the database.-
Declaration
Swift
static let schema: String
-
The theme’s ID.
Declaration
Swift
@ID var id: UUID?
-
The title of the theme.
Declaration
Swift
@Field var title: String
-
A paragraph-length description of the theme, including info on how to participate.
Declaration
Swift
@Field var info: String
-
An image that relates to the theme.
Declaration
Swift
@OptionalField var image: String?
-
Day of cruise, counted from
Settings.shared.cruiseStartDate
. 0 is embarkation day. Values could be negative (e.g. Day -1 is “Anticipation Day”) Values for this field are uniqued in the database, meaning switching two theme days requires extra steps.Declaration
Swift
@Field var cruiseDay: Int32
-
Declaration
Swift
init()
-
Initializes a new DailyTheme.
Declaration
Swift
init(title: String, info: String, image: String?, day: Int32)
Parameters
title
The title for the the theme day.
info
Extra info about the daily theme.
image
An image relating to the theme somehow..
day
Which day of the cruise this DailyTheme pertains to. Day 0 is embarkation day; days are midnight to midnight in the ship’s time zone.