Skip to content

E-commerce API Services - Auto-generated Documentation v0.0.0


E-commerce API Services - Auto-generated Documentation / GroupNotificationApiService / GroupNotificationApiService

Class: GroupNotificationApiService

Defined in: GroupNotificationApiService.ts:18

群組通知 API 服務類別

Extends

  • BaseApiService<NotificationGroup, any>

Constructors

Constructor

new GroupNotificationApiService(supabase): GroupNotificationApiService

Defined in: GroupNotificationApiService.ts:22

Parameters

supabase

SupabaseClient

Returns

GroupNotificationApiService

Overrides

BaseApiService< NotificationGroup, any >.constructor

Properties

supabase

protected supabase: SupabaseClient

Defined in: base/BaseApiService.ts:11

Inherited from

BaseApiService.supabase


tableName

protected tableName: string

Defined in: base/BaseApiService.ts:12

Inherited from

BaseApiService.tableName


viewName?

protected optional viewName: string

Defined in: base/BaseApiService.ts:13

Inherited from

BaseApiService.viewName

Methods

applySearch()

protected applySearch(query, _search): any

Defined in: base/BaseApiService.ts:192

應用搜尋條件(子類別可覆寫)

Parameters

query

any

string

Returns

any

Inherited from

BaseApiService.applySearch


create()

create(entity): Promise<ApiResponse<NotificationGroup>>

Defined in: base/BaseApiService.ts:107

建立新資料

Parameters

entity

Partial<TEntity>

Returns

Promise<ApiResponse<NotificationGroup>>

Inherited from

BaseApiService.create


createGroupNotification()

createGroupNotification(request): Promise<ApiResponse<{ distributionId: string; }>>

Defined in: GroupNotificationApiService.ts:29

創建群組通知

Parameters

request

CreateGroupNotificationRequest

Returns

Promise<ApiResponse<{ distributionId: string; }>>


delete()

delete(id): Promise<ApiResponse<boolean>>

Defined in: base/BaseApiService.ts:161

刪除資料

Parameters

id

string

Returns

Promise<ApiResponse<boolean>>

Inherited from

BaseApiService.delete


findById()

findById(id): Promise<ApiResponse<NotificationGroup>>

Defined in: base/BaseApiService.ts:82

根據 ID 查詢單筆資料

Parameters

id

string

Returns

Promise<ApiResponse<NotificationGroup>>

Inherited from

BaseApiService.findById


findMany()

findMany(options): Promise<ApiResponse<NotificationGroup[]>>

Defined in: base/BaseApiService.ts:24

查詢多筆資料

Parameters

options

QueryOptions = {}

Returns

Promise<ApiResponse<NotificationGroup[]>>

Inherited from

BaseApiService.findMany


getDistributionDetails()

getDistributionDetails(distributionId): Promise<ApiResponse<{ distribution: NotificationDistribution; recipients: any[]; stats: NotificationDistributionStats; }>>

Defined in: GroupNotificationApiService.ts:492

獲取特定分發的詳細信息

Parameters

distributionId

string

Returns

Promise<ApiResponse<{ distribution: NotificationDistribution; recipients: any[]; stats: NotificationDistributionStats; }>>


getDistributionRecipients()

getDistributionRecipients(distributionId): Promise<ApiResponse<any[]>>

Defined in: GroupNotificationApiService.ts:591

獲取特定分發的接收者列表

Parameters

distributionId

string

Returns

Promise<ApiResponse<any[]>>


getDistributionStats()

getDistributionStats(limit): Promise<ApiResponse<NotificationDistributionStats[]>>

Defined in: GroupNotificationApiService.ts:314

獲取群組通知統計

Parameters

limit

number = 20

Returns

Promise<ApiResponse<NotificationDistributionStats[]>>


getGroupNotificationStats()

getGroupNotificationStats(): Promise<ApiResponse<GroupNotificationStats>>

Defined in: GroupNotificationApiService.ts:365

獲取群組通知統計概覽

Returns

Promise<ApiResponse<GroupNotificationStats>>


getNotificationGroups()

getNotificationGroups(): Promise<ApiResponse<NotificationGroup[]>>

Defined in: GroupNotificationApiService.ts:457

獲取可用的通知群組

Returns

Promise<ApiResponse<NotificationGroup[]>>


getNotificationRoutingRules()

getNotificationRoutingRules(): Promise<ApiResponse<any[]>>

Defined in: GroupNotificationApiService.ts:206

獲取通知路由規則

Returns

Promise<ApiResponse<any[]>>


getQueryBuilder()

protected getQueryBuilder(): QueryBuilder<any>

Defined in: base/BaseApiService.ts:184

獲取查詢建構器

Returns

QueryBuilder<any>

Inherited from

BaseApiService.getQueryBuilder


handleError()

protected handleError(error): ApiResponse<any>

Defined in: base/BaseApiService.ts:200

統一的錯誤處理

Parameters

error

any

Returns

ApiResponse<any>

Inherited from

BaseApiService.handleError


mapDbToEntity()

protected mapDbToEntity(dbEntity): NotificationGroup

Defined in: GroupNotificationApiService.ts:575

將資料庫實體轉換為前端實體 子類別必須實作此方法

Parameters

dbEntity

any

Returns

NotificationGroup

Overrides

BaseApiService.mapDbToEntity


mapEntityToDb()

protected mapEntityToDb(entity): any

Defined in: GroupNotificationApiService.ts:624

將前端實體轉換為資料庫實體 子類別可覆寫此方法

Parameters

entity

Partial<NotificationGroup>

Returns

any

Overrides

BaseApiService.mapEntityToDb


notifyBroadcast()

notifyBroadcast(request): Promise<ApiResponse<{ distributionId: string; }>>

Defined in: GroupNotificationApiService.ts:93

發送廣播通知

Parameters

request

BroadcastNotificationRequest

Returns

Promise<ApiResponse<{ distributionId: string; }>>


notifyCustomGroup()

notifyCustomGroup(userIds, type, title, message, priority, actionUrl?): Promise<ApiResponse<{ distributionId: string; }>>

Defined in: GroupNotificationApiService.ts:121

發送自定義群組通知

Parameters

userIds

string[]

type

string

title

string

message

string

priority

string = 'medium'

actionUrl?

string

Returns

Promise<ApiResponse<{ distributionId: string; }>>


notifyRole()

notifyRole(request): Promise<ApiResponse<{ distributionId: string; }>>

Defined in: GroupNotificationApiService.ts:64

發送角色通知

Parameters

request

RoleNotificationRequest

Returns

Promise<ApiResponse<{ distributionId: string; }>>


retryFailedNotifications()

retryFailedNotifications(distributionId): Promise<ApiResponse<{ retriedCount: number; }>>

Defined in: GroupNotificationApiService.ts:265

重新發送失敗的通知

Parameters

distributionId

string

Returns

Promise<ApiResponse<{ retriedCount: number; }>>


testNotificationDistribution()

testNotificationDistribution(targetType, targetCriteria): Promise<ApiResponse<{ users: any[]; }>>

Defined in: GroupNotificationApiService.ts:155

測試通知分發 (不實際發送,只返回預期的接收者)

Parameters

targetType

NotificationTargetType

targetCriteria

any

Returns

Promise<ApiResponse<{ users: any[]; }>>


update()

update(id, updates): Promise<ApiResponse<NotificationGroup>>

Defined in: base/BaseApiService.ts:132

更新資料

Parameters

id

string

updates

Partial<TEntity>

Returns

Promise<ApiResponse<NotificationGroup>>

Inherited from

BaseApiService.update


updateNotificationRoutingRule()

updateNotificationRoutingRule(notificationType, targetType, targetCriteria, sendToUser): Promise<ApiResponse<any>>

Defined in: GroupNotificationApiService.ts:230

更新通知路由規則

Parameters

notificationType

string

targetType

NotificationTargetType

targetCriteria

any

sendToUser

boolean = false

Returns

Promise<ApiResponse<any>>