FriendlyFez

final class FriendlyFez : Model, Searchable
extension FriendlyFez: Reportable

A 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.

Properties

  • id

    Unique ID for this Fez.

    Declaration

    Swift

    @ID
    var id: UUID?
  • The type of fez; what its purpose is..

    Declaration

    Swift

    @Field
    var fezType: FezType
  • The title of the fez.

    Declaration

    Swift

    @Field
    var title: String
  • A longer description of what the fez is about? Seems like this info could just go in the first post.

    Declaration

    Swift

    @Field
    var info: String
  • Where the fez is happening.

    Declaration

    Swift

    @OptionalField
    var location: String?
  • Moderators can set several statuses on fezPosts that modify editability and visibility.

    Declaration

    Swift

    @Enum
    var moderationStatus: ContentModerationStatus
  • Start time for the fez. Only meaningful for public fezzes that are organizing an activity.

    Declaration

    Swift

    @OptionalField
    var startTime: Date?
  • End time for the fez.

    Declaration

    Swift

    @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.

    Declaration

    Swift

    @Field
    var minCapacity: Int
  • The max numbert of participants. The first max_capacity members of participantArrayare the current participants; the rest of the array is the waitlist.

    Declaration

    Swift

    @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 hiddenCount from the user’s FezParticipant structure. Thus, different users could see differnt counts for the same fez.

    Declaration

    Swift

    @Field
    var postCount: Int
  • Declaration

    Swift

    @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..

    Declaration

    Swift

    @Field
    var participantArray: [UUID]

Relationships

Record-keeping

  • Timestamp of the model’s creation, set automatically.

    Declaration

    Swift

    @Timestamp
    var createdAt: Date?
  • Timestamp of the model’s last update, set automatically.

    Declaration

    Swift

    @Timestamp
    var updatedAt: Date?
  • Timestamp of the model’s soft-deletion, set automatically.

    Declaration

    Swift

    @Timestamp
    var deletedAt: Date?

Initialization