FriendlyFez
final class FriendlyFez : Model, Searchableextension FriendlyFez: ReportableA FriendlyFez (Fez for short) is a multi person chat facilty.
Broadly speaking, Fezzes may be open or closed, chosen at creation time.
- Open fezzes generally have a publicly stated purpose, and may be for an event at a specific time and place. Open fezzes allow users to join and leave the fez at any time. Open fezzes may have posts with images, and can get moderated by mods. There is a search API for finding and joining public fezzes.
- Closed fezzes have a membership set at creation time (by the fez creator), and cannot have images in posts. Closed fezzes are very similar to V2’s Seamail facility.
Considered but not yet built are semi-open fezzes:
- A semi-open fez would allow users to join after creation, but either the creator would have to invite new members or perhaps users could join via an invite link. Semi-open fezzes would not be searchable, would not be moderated, could not have images. Importantly, semi-open fezzes would indicate their semi-open state to their members, so that current members would know the membership list could change. New members to a semi-open fez would be able to read all past messages. 
See
See Also: FezData the DTO for returning basic data on Fezzes.
See
See Also: FezContentData the DTO for creating or editing Fezzes.
See
See Also: CreateFriendlyFezSchema the Migration for creating the Fez table in the database.
- 
                  
                  DeclarationSwift static let schema: String
- 
                  
                  Unique ID for this Fez. DeclarationSwift @ID var id: UUID?
- 
                  
                  The type of fez; what its purpose is.. DeclarationSwift @Field var fezType: FezType
- 
                  
                  The title of the fez. DeclarationSwift @Field var title: String
- 
                  
                  A longer description of what the fez is about? Seems like this info could just go in the first post. DeclarationSwift @Field var info: String
- 
                  
                  Where the fez is happening. DeclarationSwift @OptionalField var location: String?
- 
                  
                  Moderators can set several statuses on fezPosts that modify editability and visibility. DeclarationSwift @Enum var moderationStatus: ContentModerationStatus
- 
                  
                  Start time for the fez. Only meaningful for public fezzes that are organizing an activity. DeclarationSwift @OptionalField var startTime: Date?
- 
                  
                  End time for the fez. DeclarationSwift @OptionalField var endTime: Date?
- 
                  
                  A minimum headcount needed for the fez to happen. Clients may want to highlight fezzes that are below min capacity in order to encourage users to join. DeclarationSwift @Field var minCapacity: Int
- 
                  
                  The max numbert of participants. The first max_capacitymembers ofparticipantArrayare the current participants; the rest of the array is the waitlist.DeclarationSwift @Field var maxCapacity: Int
- 
                  
                  The number of posts in the fez. Should be equal to fezPosts.count. Value is cached here for quick access. When returning this value to a user, we subtrract the hiddenCountfrom the user’sFezParticipantstructure. Thus, different users could see differnt counts for the same fez.DeclarationSwift @Field var postCount: Int
- 
                  
                  DeclarationSwift @Field var cancelled: Bool
- 
                  
                  An ordered list of participants in the fez. Newly joined members are appended to the array, meaning this array stays sorted by join time.. DeclarationSwift @Field var participantArray: [UUID]
- 
                  
                  The creator of the fez. DeclarationSwift @Parent var owner: User
- 
                  
                  The participants in the fez. The pivot FezParticipantalso maintains the read count for each participant.DeclarationSwift @Siblings var participants: [User]
- 
                  
                  The posts participants have made in the fez. DeclarationSwift @Children var fezPosts: [FezPost]
- 
                  
                  The child FriendlyFezEditaccountability records of the fez.DeclarationSwift @Children var edits: [FriendlyFezEdit]
- 
                  
                  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?
- 
                  
                  DeclarationSwift init()
- 
                  
                  Initializes a new FriendlyFez. DeclarationSwift init( owner: UUID, fezType: FezType, title: String = "", info: String = "", location: String?, startTime: Date?, endTime: Date?, minCapacity: Int = 0, maxCapacity: Int = 0 )ParametersownerThe ID of the owning entity. fezTypeThe type of fez being created. titleThe title of the Fez. locationWhere the Fez is being held. startTimeWhen participants should arrive. endTimeEstimated time the fez will complete. minCapacityHow many people are needed make a quorum. maxCapactiyThe max # of people who can attend. Users who join past this number are waitlisted. 
- 
                  
                  Initializes a closed FriendlyFez, also known as a Chat session. DeclarationSwift init(owner: UUID)
- 
                  
                  The report type for FriendlyFezreports.DeclarationSwift var reportType: ReportType { get }
- 
                  
                  Standardizes how to get the author ID of a Reportable object. DeclarationSwift var authorUUID: UUID { get }
- 
                  
                  No auto quarantine for fezzes. DeclarationSwift var autoQuarantineThreshold: Int { get }
- 
                  
                  DeclarationSwift func notificationType() throws -> NotificationType
 View on GitHub
            View on GitHub
           FriendlyFez Class Reference
      FriendlyFez Class Reference