Announcement
final class Announcement : ModelAdmins can create Announcements, which are text strings intended to be shown to all users. All announcements have a ‘display until’ time, and are considered ‘active’ until their display until time expires.
Announcement IDs are ints, and increase with each announcement created. The User model stores the highest Announcement ID the user
has seen.
Announcements are global, and are retrieveable while logged out. However, endpoints returning announcement data will only return all active announcements for logged-out users. Logged-in users will additionally get data indicating which announcements are unread. Clients may implement local solutions for determining which announcements are unread for logged-out users.
See
See Also: AnnouncementData the DTO for returning info on Announcements.See
See Also: AnnouncementCreateData the DTO for creating and editing Announcements.See
See Also: CreateAnnouncementSchema the Migration that creates the Announcement table in the database.- 
                  
                  DeclarationSwift static let schema: String
- 
                  
                  The announcement’s ID. DeclarationSwift @ID var id: Int?
- 
                  
                  The text content of the announcement. DeclarationSwift @Field var text: String
- 
                  
                  The announcement is considered ‘active’ until this time. Most API endpoints only return info on active announcements. DeclarationSwift @Field var displayUntil: Date
- 
                  
                  Timestamp of the model’s creation, set automatically. DeclarationSwift @Timestamp var createdAt: Date?
- 
                  
                  Timestamp of the model’s last update, set automatically. DeclarationSwift @Timestamp var updatedAt: Date?
- 
                  
                  Timestamp of the model’s soft-deletion, set automatically. DeclarationSwift @Timestamp var deletedAt: Date?
- 
                  
                  Used by Fluent DeclarationSwift init()
- 
                  
                  Initializes a new Announcement. DeclarationSwift init(authorID: UUID, text: String, displayUntil: Date)ParametersauthorThe author of the Announcement. textThe text content of the Announcement. 
 View on GitHub
            View on GitHub
           Announcement Class Reference
      Announcement Class Reference