E-commerce API Services - Auto-generated Documentation v0.0.0
E-commerce API Services - Auto-generated Documentation / AgentApiService / AgentApiService
Class: AgentApiService
Defined in: AgentApiService.ts:12
AgentApiService - 客服相關的 API 服務
Extends
BaseApiService<AgentDetail,DbAgentDetail>
Constructors
Constructor
new AgentApiService(
supabase):AgentApiService
Defined in: AgentApiService.ts:16
Parameters
supabase
SupabaseClient
Returns
AgentApiService
Overrides
BaseApiService< AgentDetail, DbAgentDetail >.constructor
Properties
supabase
protectedsupabase:SupabaseClient
Defined in: base/BaseApiService.ts:11
Inherited from
BaseApiService.supabase
tableName
protectedtableName:string
Defined in: base/BaseApiService.ts:12
Inherited from
BaseApiService.tableName
viewName?
protectedoptionalviewName:string
Defined in: base/BaseApiService.ts:13
Inherited from
BaseApiService.viewName
Methods
applySearch()
protectedapplySearch(query,search):any
Defined in: AgentApiService.ts:59
應用搜尋條件
Parameters
query
any
search
string
Returns
any
Overrides
BaseApiService.applySearch
assignConversation()
assignConversation(
conversationId,agentId,reason,assignedBy?):Promise<ApiResponse>
Defined in: AgentApiService.ts:99
分配對話給客服
Parameters
conversationId
string
agentId
null | string
reason
string = 'by platform system'
assignedBy?
string
Returns
Promise<ApiResponse>
create()
create(
entity):Promise<ApiResponse<AgentDetail>>
Defined in: base/BaseApiService.ts:107
建立新資料
Parameters
entity
Partial<TEntity>
Returns
Promise<ApiResponse<AgentDetail>>
Inherited from
BaseApiService.create
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<AgentDetail>>
Defined in: base/BaseApiService.ts:82
根據 ID 查詢單筆資料
Parameters
id
string
Returns
Promise<ApiResponse<AgentDetail>>
Inherited from
BaseApiService.findById
findMany()
findMany(
options):Promise<ApiResponse<AgentDetail[]>>
Defined in: base/BaseApiService.ts:24
查詢多筆資料
Parameters
options
QueryOptions = {}
Returns
Promise<ApiResponse<AgentDetail[]>>
Inherited from
BaseApiService.findMany
getAgents()
getAgents(
options?):Promise<ApiResponse<AgentDetail[]>>
Defined in: AgentApiService.ts:68
獲取客服列表
Parameters
options?
status?
AgentStatusFilter
Returns
Promise<ApiResponse<AgentDetail[]>>
getQueryBuilder()
protectedgetQueryBuilder():QueryBuilder<DbAgentDetail>
Defined in: base/BaseApiService.ts:184
獲取查詢建構器
Returns
QueryBuilder<DbAgentDetail>
Inherited from
BaseApiService.getQueryBuilder
handleError()
protectedhandleError(error):ApiResponse<any>
Defined in: base/BaseApiService.ts:200
統一的錯誤處理
Parameters
error
any
Returns
ApiResponse<any>
Inherited from
BaseApiService.handleError
mapDbToEntity()
protectedmapDbToEntity(dbAgent):AgentDetail
Defined in: AgentApiService.ts:23
將資料庫實體轉換為前端實體
Parameters
dbAgent
any
Returns
AgentDetail
Overrides
BaseApiService.mapDbToEntity
mapEntityToDb()
protectedmapEntityToDb(agent):Partial<DbAgentDetail>
Defined in: AgentApiService.ts:41
將前端實體轉換為資料庫實體
Parameters
agent
Partial<AgentDetail>
Returns
Partial<DbAgentDetail>
Overrides
BaseApiService.mapEntityToDb
update()
update(
id,updates):Promise<ApiResponse<AgentDetail>>
Defined in: base/BaseApiService.ts:132
更新資料
Parameters
id
string
updates
Partial<TEntity>
Returns
Promise<ApiResponse<AgentDetail>>
Inherited from
BaseApiService.update