package org.raddatz.familienarchiv.audit;

import java.util.Set;

public enum AuditKind {

    /** Payload: none */
    FILE_UPLOADED,

    /** Payload: {@code {"oldStatus": "UPLOADED", "newStatus": "TRANSCRIBED"}} */
    STATUS_CHANGED,

    /** Payload: none */
    METADATA_UPDATED,

    /** Payload: {@code {"pageNumber": 3}} */
    TEXT_SAVED,

    /** Payload: none */
    BLOCK_REVIEWED,

    /** Payload: {@code {"pageNumber": 3}} */
    ANNOTATION_CREATED,

    /** Payload: {@code {"commentId": "uuid"}} */
    COMMENT_ADDED,

    /** Payload: {@code {"commentId": "uuid", "mentionedUserId": "uuid"}} */
    MENTION_CREATED,

    /** Payload: {@code {"userId": "uuid", "email": "addr"}} */
    USER_CREATED,

    /** Payload: {@code {"userId": "uuid", "email": "addr"}} */
    USER_DELETED,

    /** Payload: {@code {"userId": "uuid", "email": "addr", "addedGroups": ["Admin"], "removedGroups": []}} */
    GROUP_MEMBERSHIP_CHANGED;

    public static final Set<AuditKind> ROLLUP_ELIGIBLE = Set.of(
            TEXT_SAVED, FILE_UPLOADED, ANNOTATION_CREATED,
            BLOCK_REVIEWED, COMMENT_ADDED, MENTION_CREATED
    );
}
