Skip to content

SudoSOS Back-end API / service/user-notification-preference-service / UserNotificationPreferenceService

Class: UserNotificationPreferenceService ​

Extends ​

Constructors ​

Constructor ​

ts
new UserNotificationPreferenceService(manager?): UserNotificationPreferenceService;

Parameters ​

ParameterType
manager?EntityManager

Returns ​

UserNotificationPreferenceService

Inherited from ​

WithManager.constructor

Properties ​

PropertyModifierTypeInherited from
managerprotectedEntityManagerWithManager.manager

Methods ​

createUserNotificationPreference() ​

ts
createUserNotificationPreference(requestParams): Promise<UserNotificationPreference>;

Creates an UserNotificationPreference from an UserNotificationPreferenceRequest

Parameters ​

ParameterTypeDescription
requestParamsUserNotificationPreferenceRequestParams-

Returns ​

Promise<UserNotificationPreference>


getPaginatedUserNotificationPreference() ​

ts
getPaginatedUserNotificationPreference(params?, pagination?): Promise<PaginatedUserNotificationPreferenceResponse>;

Returns all UserNotificationPreferences based on given params

Parameters ​

ParameterTypeDescription
paramsUserNotificationPreferenceFilterParams-
paginationPaginationParametersThe pagination to apply

Returns ​

Promise<PaginatedUserNotificationPreferenceResponse>


getUserNotificationPreferences() ​

ts
getUserNotificationPreferences(params?): Promise<UserNotificationPreference[]>;

Returns UserNotificationPreferences based on the given filter params

Parameters ​

ParameterTypeDescription
paramsUserNotificationPreferenceFilterParams-

Returns ​

Promise<UserNotificationPreference[]>


syncAllUserNotificationPreferences() ​

ts
syncAllUserNotificationPreferences(): Promise<void>;

Sync all users with all types of notification and channels

Returns ​

Promise<void>


updateUserNotificationPreference() ​

ts
updateUserNotificationPreference(update): Promise<UserNotificationPreference>;

Updates the UserNotificationPreference

It is only possible to change the enabled boolean in the database.

Parameters ​

ParameterTypeDescription
updateUserNotificationPreferenceUpdateParams-

Returns ​

Promise<UserNotificationPreference>


asResponse() ​

ts
static asResponse(userNotificationPreference): BaseUserNotificationPreferenceResponse;

Parses an UserNotificationPreference Object to a BaseUserNotificationPreferenceResponse

Parameters ​

ParameterTypeDescription
userNotificationPreferenceUserNotificationPreferenceThe UserNotificationPreference to parse

Returns ​

BaseUserNotificationPreferenceResponse


getOptions() ​

ts
static getOptions(params): FindManyOptions<UserNotificationPreference>;

Parameters ​

ParameterType
paramsUserNotificationPreferenceFilterParams

Returns ​

FindManyOptions<UserNotificationPreference>


toArrayResponse() ​

ts
static toArrayResponse(userNotificationPreferences): BaseUserNotificationPreferenceResponse[];

Parameters ​

ParameterType
userNotificationPreferencesUserNotificationPreference[]

Returns ​

BaseUserNotificationPreferenceResponse[]