- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
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',
|
|
});
|
|
}
|
|
};
|