New pages: - app/(admin)/warranties/ — full warranty management with claims - app/(admin)/refunds/ — refund management - app/(admin)/notification-templates/ — email/SMS template editor - app/(admin)/user-pos-analytics/ — per-user POS analytics New components: - components/quotations/ — quotation components - components/ui/PartNumbersModal.tsx — part numbers selection New services: - creditService.ts, deliverySettingsService.ts - notificationTemplateService.ts, roleNotificationSettingsService.ts Updated: - Sidebar navigation, dashboard, orders, POS sessions, products - Bulk quotations, CRM leads/quotations, notifications gateway - settings, service invoices, quotes, technician, users pages - adminService, billingFinanceService, catalogService, client - inventoryPosService, notificationGatewayService, openwaService, userService - Removed pos-sync page (merged into POS sessions)
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { apiFetch } from './client';
|
|
|
|
export interface RoleNotificationSetting {
|
|
setting_id: string;
|
|
role_name: string;
|
|
event_type: string;
|
|
channel_email: boolean;
|
|
channel_whatsapp: boolean;
|
|
}
|
|
|
|
export interface RoleNotificationSettingCreate {
|
|
role_name: string;
|
|
event_type: string;
|
|
channel_email?: boolean;
|
|
channel_whatsapp?: boolean;
|
|
}
|
|
|
|
export interface RoleNotificationSettingUpdate {
|
|
channel_email?: boolean;
|
|
channel_whatsapp?: boolean;
|
|
}
|
|
|
|
export const roleNotificationSettingsService = {
|
|
getSettings: async () => {
|
|
return apiFetch<RoleNotificationSetting[]>('/api/v1/settings/notifications/');
|
|
},
|
|
|
|
createSetting: async (payload: RoleNotificationSettingCreate) => {
|
|
return apiFetch<RoleNotificationSetting>('/api/v1/settings/notifications/', {
|
|
method: 'POST',
|
|
body: JSON.stringify(payload),
|
|
});
|
|
},
|
|
|
|
updateSetting: async (settingId: string, payload: RoleNotificationSettingUpdate) => {
|
|
return apiFetch<RoleNotificationSetting>(`/api/v1/settings/notifications/${settingId}`, {
|
|
method: 'PUT',
|
|
body: JSON.stringify(payload),
|
|
});
|
|
},
|
|
|
|
deleteSetting: async (settingId: string) => {
|
|
return apiFetch(`/api/v1/settings/notifications/${settingId}`, {
|
|
method: 'DELETE',
|
|
});
|
|
}
|
|
};
|