refactor: the user setting and change to be cateogry based

This commit is contained in:
mahyargdz
2025-02-28 16:34:11 +03:30
parent 207e0e46ea
commit 5b1b574d41
21 changed files with 242 additions and 341 deletions
@@ -1,23 +1,56 @@
export enum NotifSettingsEnum {
ANNOUNCE_NOTIF = "ANNOUNCE_NOTIF",
BILL_PAYMENT = "BILL_PAYMENT",
CREATE_SERVICE = "CREATE_SERVICE",
UNBLOCKING_SERVICE = "UNBLOCKING_SERVICE",
ANSWER_TICKET = "ANSWER_TICKET",
export enum NotifCategory {
SUPPORT = "SUPPORT", //TICKET
SERVICE = "SERVICE",
INVOICE = "INVOICE",
ACCOUNT = "ACCOUNT",
FINANCE = "FINANCE", //WALLET AND ...
// ANNOUNCEMENT = "ANNOUNCEMENT",
}
export enum NotifType {
// Account category
USER_LOGIN = "USER_LOGIN",
ANNOUNCEMENT = "ANNOUNCEMENT",
// Finance category
WALLET_CHARGE = "WALLET_CHARGE",
WALLET_DEDUCTION = "WALLET_DEDUCTION",
//Invoice
BILL_INVOICE_REMINDER = "BILL_INVOICE_REMINDER",
BILL_INVOICE = "BILL_INVOICE",
CREATE_INVOICE = "CREATE_INVOICE",
BILL_PAYMENT_REMINDER = "BILL_PAYMENT_REMINDER",
BLOCKING_SERVICE = "BLOCKING_SERVICE",
// Service category
CREATE_SERVICE = "CREATE_SERVICE",
UNBLOCK_SERVICE = "UNBLOCK_SERVICE",
BLOCK_SERVICE = "BLOCK_SERVICE",
// Support category
ANSWER_TICKET = "ANSWER_TICKET",
CREATE_TICKET = "CREATE_TICKET",
}
export enum FarsiNotifSettingsEnum {
ANNOUNCE_NOTIF = "اعلانات و اطلاعیه ها",
BILL_PAYMENT = "پرداخت صورت حساب",
CREATE_SERVICE = "ایجاد سرویس",
UNBLOCKING_SERVICE = "رفع انسداد سرویس",
ANSWER_TICKET = "پاسخ تیکت",
CREATE_INVOICE = "ایجاد صورت حساب",
BILL_PAYMENT_REMINDER = "یادآوری پرداخت صورت حساب",
BLOCKING_SERVICE = "انسداد سرویس",
CREATE_TICKET = "ثبت تیکت جدبد",
}
export const NotifDescriptions: Record<NotifType, { fa: string; category: NotifCategory }> = {
// Account category
[NotifType.USER_LOGIN]: { fa: "ورود به ناحیه کاربری", category: NotifCategory.ACCOUNT },
[NotifType.ANNOUNCEMENT]: { fa: "اعلانات و اطلاعیه ها", category: NotifCategory.ACCOUNT },
// Finance category
[NotifType.WALLET_CHARGE]: { fa: "شارژ کیف پول", category: NotifCategory.FINANCE },
[NotifType.WALLET_DEDUCTION]: { fa: "کسر از کیف پول", category: NotifCategory.FINANCE },
// Invoice category
[NotifType.CREATE_INVOICE]: { fa: "ایجاد صورت حساب", category: NotifCategory.INVOICE },
[NotifType.BILL_INVOICE_REMINDER]: { fa: "یادآوری پرداخت صورت حساب", category: NotifCategory.INVOICE },
[NotifType.BILL_INVOICE]: { fa: "پرداخت صورت حساب", category: NotifCategory.INVOICE },
// Service category
[NotifType.CREATE_SERVICE]: { fa: "ایجاد سرویس", category: NotifCategory.SERVICE },
[NotifType.UNBLOCK_SERVICE]: { fa: "رفع انسداد سرویس", category: NotifCategory.SERVICE },
[NotifType.BLOCK_SERVICE]: { fa: "انسداد سرویس", category: NotifCategory.SERVICE },
// Support category
[NotifType.ANSWER_TICKET]: { fa: "پاسخ تیکت", category: NotifCategory.SUPPORT },
[NotifType.CREATE_TICKET]: { fa: "ثبت تیکت جدید", category: NotifCategory.SUPPORT },
};