import { type NotificationReason } from '../../common/user-notification.ts';
export interface UserNotificationDomainRecords {
    ":user-notification": UserNotificationRecord;
    ":user-notification.readAt": UserNotificationDomainReadAtRecord;
}
export interface UserNotificationCommon {
    /** The user that the notification is for. */
    userId: string;
    /** The type of the notification, which will determine the shape of the payload. */
    type: string;
    /** Type specific data. */
    payload: object;
    /** When the notification was created. */
    timestamp: string;
    /** For what reasons the notification was created. */
    reasons: NotificationReason[];
    /**
     * Asset that triggered this notification. Not necessarily the same asset that
     * the notification is mainly about.
     */
    triggerId?: string;
}
export interface UserNotificationAssigned extends UserNotificationCommon {
    type: "assigned";
    payload: {
        assetId: string;
        actionBy?: string;
    };
}
export interface UserNotificationUnassigned extends UserNotificationCommon {
    type: "unassigned";
    payload: {
        assetId: string;
        actionBy?: string;
    };
}
export interface UserNotificationComment extends UserNotificationCommon {
    type: "comment";
    payload: {
        commentId: string;
    };
}
export interface UserNotificationAddedToSearch extends UserNotificationCommon {
    type: "added-to-search";
    payload: {
        searchId: string;
        assetId: string;
    };
}
export interface UserNotificationPublishSucceeded extends UserNotificationCommon {
    type: "publishSucceeded";
    payload: {
        /** The user that published the asset. */
        userId?: string;
        /** The asset that was published. */
        assetId: string;
        /** The publish asset representing the publish. */
        publishId: string;
        /** The connection that was used to publish the asset. */
        connectionId: string;
    };
}
export type UserNotificationRecord = UserNotificationAssigned | UserNotificationUnassigned | UserNotificationComment | UserNotificationAddedToSearch | UserNotificationPublishSucceeded;
export interface UserNotificationDomainReadAtRecord {
    /**
     * ISO8601 date string. If set, the user has marked the notification as read at that timestamp.
     */
    value?: string;
}
