feat: implement comprehensive notification engine with policies, preferences, and automated dispatching services
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import ApiRequest from "@services/Api.Service";
|
||||
import {
|
||||
CompanyNotificationPolicy,
|
||||
ClientNotificationPreferences,
|
||||
ClientCompanyNotificationOverride,
|
||||
UpsertCompanyPolicyParams,
|
||||
UpsertClientPreferencesParams,
|
||||
UpsertClientCompanyOverrideParams
|
||||
} from "@models/NotificationPreferences.model";
|
||||
|
||||
export const getCompanyPolicy = (companyId: string, sessionUser: string): Promise<CompanyNotificationPolicy> =>
|
||||
ApiRequest.post<CompanyNotificationPolicy>("notifications/policy/find", { companyId, sessionUser });
|
||||
|
||||
export const upsertCompanyPolicy = (companyId: string, sessionUser: string, data: UpsertCompanyPolicyParams): Promise<CompanyNotificationPolicy> =>
|
||||
ApiRequest.post<CompanyNotificationPolicy>("notifications/policy/save", { companyId, sessionUser, ...data });
|
||||
|
||||
export const getClientPreferences = (userId: string, sessionUser: string): Promise<ClientNotificationPreferences> =>
|
||||
ApiRequest.post<ClientNotificationPreferences>("notifications/preferences/find", { clientId: userId, sessionUser });
|
||||
|
||||
export const upsertClientPreferences = (userId: string, sessionUser: string, data: UpsertClientPreferencesParams): Promise<ClientNotificationPreferences> =>
|
||||
ApiRequest.post<ClientNotificationPreferences>("notifications/preferences/save", { clientId: userId, sessionUser, ...data });
|
||||
|
||||
export const getClientCompanyOverride = (clientId: string, companyId: string, sessionUser: string): Promise<ClientCompanyNotificationOverride> =>
|
||||
ApiRequest.post<ClientCompanyNotificationOverride>("notifications/override/find", { clientId, companyId, sessionUser });
|
||||
|
||||
export const upsertClientCompanyOverride = (clientId: string, companyId: string, sessionUser: string, data: UpsertClientCompanyOverrideParams): Promise<ClientCompanyNotificationOverride> =>
|
||||
ApiRequest.post<ClientCompanyNotificationOverride>("notifications/override/save", { clientId, companyId, sessionUser, ...data });
|
||||
Reference in New Issue
Block a user