import {Microservice} from "./EgovUser";

export interface EgovNotification {
    module: string;
    role: any;
    id: number;
    published_at: string;
    title: string;
    body?: string
    tag: string;
    is_read:  0 | 1;
    issuer_id?: number;
}

export type NotificationType = 'beams' | 'channel' | 'email'

export type SettingState = {
    beams_enabled: boolean,
    // sms_enabled: boolean,
    microservices: Partial<Record<Microservice, MicroserviceNotificationSettings>>
}

export type MicroserviceNotificationSettings = Record<NotificationType, boolean>

/***
 * used in post notifications api
 */
export type UpdateNotificationsData = {

    notification_type: NotificationType | 'all',
    setting_value: boolean,
    microservice: Microservice

}

export type UpdateGeneralNotificationsData = {
    notification_type: Extract<NotificationType, 'sms' | 'beams'>,
    setting_value: boolean,
}
