E-commerce API Services - Auto-generated Documentation v0.0.0
E-commerce API Services - Auto-generated Documentation / HolidayApiService / HolidayApiService
Class: HolidayApiService
Defined in: HolidayApiService.ts:9
HolidayApiService - 假期相關的 API 服務
Extends
BaseApiService<Holiday,Holiday>
Constructors
Constructor
new HolidayApiService(
supabase):HolidayApiService
Defined in: HolidayApiService.ts:10
Parameters
supabase
SupabaseClient
Returns
HolidayApiService
Overrides
BaseApiService<Holiday, Holiday>.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: base/BaseApiService.ts:192
應用搜尋條件(子類別可覆寫)
Parameters
query
any
_search
string
Returns
any
Inherited from
BaseApiService.applySearch
create()
create(
entity):Promise<ApiResponse<Holiday>>
Defined in: base/BaseApiService.ts:107
建立新資料
Parameters
entity
Partial<TEntity>
Returns
Promise<ApiResponse<Holiday>>
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
fetchAllHolidays()
fetchAllHolidays():
Promise<ApiResponse<Holiday[]>>
Defined in: HolidayApiService.ts:37
獲取所有假期並排序
Returns
Promise<ApiResponse<Holiday[]>>
findById()
findById(
id):Promise<ApiResponse<Holiday>>
Defined in: base/BaseApiService.ts:82
根據 ID 查詢單筆資料
Parameters
id
string
Returns
Promise<ApiResponse<Holiday>>
Inherited from
BaseApiService.findById
findMany()
findMany(
options):Promise<ApiResponse<Holiday[]>>
Defined in: base/BaseApiService.ts:24
查詢多筆資料
Parameters
options
QueryOptions = {}
Returns
Promise<ApiResponse<Holiday[]>>
Inherited from
BaseApiService.findMany
getQueryBuilder()
protectedgetQueryBuilder():QueryBuilder<Holiday>
Defined in: base/BaseApiService.ts:184
獲取查詢建構器
Returns
QueryBuilder<Holiday>
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(dbHoliday):Holiday
Defined in: HolidayApiService.ts:17
將資料庫實體轉換為前端實體
Parameters
dbHoliday
any
Returns
Holiday
Overrides
BaseApiService.mapDbToEntity
mapEntityToDb()
protectedmapEntityToDb(holiday):Partial<Holiday>
Defined in: HolidayApiService.ts:27
將前端實體轉換為資料庫實體
Parameters
holiday
Partial<Holiday>
Returns
Partial<Holiday>
Overrides
BaseApiService.mapEntityToDb
update()
update(
id,updates):Promise<ApiResponse<Holiday>>
Defined in: base/BaseApiService.ts:132
更新資料
Parameters
id
string
updates
Partial<TEntity>
Returns
Promise<ApiResponse<Holiday>>
Inherited from
BaseApiService.update