ModeratorAction

final class ModeratorAction : Model, @unchecked Sendable

Each time a moderator performs a moderation action–editing, locking, or deleting a post, forum, or fez, changing a user’s access level, issuing a temp quarantine, or other moderation-only activities, we log the action by creating one of these records in the database..

The data collected may only be viewed by moderators. The intent is to make it easier for mods to coordinate.

See

See Also: ModeratorActionLogData the DTO for returning data about moderator actions.

See

See Also: CreateModeratorActionSchema the Migration for creating the ModeratorAction table in the database.

Properties

  • id

    The edit’s ID.

    Declaration

    Swift

    @ModeratorAction
    .ID var id: UUID? { get set }
  • The action taken.

    Declaration

    Swift

    @ModeratorAction
    .Field var actionType: ModeratorActionType { get set }
  • The type of content that got changed..

    Declaration

    Swift

    @ModeratorAction
    .Field var contentType: ReportType { get set }
  • The ID of the content that was affected, converted into a string. The actuial @id could be an Int or a UUID, depending on the value of contentType.

    Declaration

    Swift

    @ModeratorAction
    .Field var contentID: String { get set }
  • If the mod is in the process of handling reports when taking this action, this gets set to the reports’ actionGroup, making it easier to correllate user reports amd mod actions.

    Declaration

    Swift

    @ModeratorAction
    .OptionalField var actionGroup: UUID? { get set }
  • Timestamp of the model’s creation, set automatically.

    Declaration

    Swift

    @ModeratorAction
    .Timestamp var createdAt: Date? { get set }

Relations

  • The moderator that took the action.

    Declaration

    Swift

    @ModeratorAction
    .Parent var actor: User { get set }
  • The user whose content got moderated

    Declaration

    Swift

    @ModeratorAction
    .Parent var target: User { get set }

Initialization