完善个人中心资金功能
This commit is contained in:
@@ -3,9 +3,12 @@ import type {
|
||||
CollectLookupResponse,
|
||||
UploadedFile,
|
||||
WorkOrder,
|
||||
WorkerFinanceRequest,
|
||||
WorkerListResponse,
|
||||
WorkerLoginResponse,
|
||||
WorkerProfileResponse,
|
||||
WorkerUser,
|
||||
WorkerWalletLedger,
|
||||
} from '@/types/worker-platform'
|
||||
|
||||
export function registerWorker(payload: {
|
||||
@@ -37,8 +40,53 @@ export function logoutWorker() {
|
||||
}
|
||||
|
||||
export function fetchWorkerProfile() {
|
||||
return apiGet<{ worker: WorkerUser; permissions: Record<string, unknown> }>(
|
||||
'/api/v1/worker/profile',
|
||||
return apiGet<WorkerProfileResponse>('/api/v1/worker/profile')
|
||||
}
|
||||
|
||||
export function fetchWorkerWalletLedgers(params?: Record<string, unknown>) {
|
||||
return apiGet<WorkerListResponse<WorkerWalletLedger>>(
|
||||
'/api/v1/worker/profile/wallet-ledgers',
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
export function fetchWorkerFinanceRequests(params?: Record<string, unknown>) {
|
||||
return apiGet<WorkerListResponse<WorkerFinanceRequest>>(
|
||||
'/api/v1/worker/profile/finance-requests',
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
export function createWorkerRechargeRequest(payload: {
|
||||
amount?: number
|
||||
note?: string
|
||||
}) {
|
||||
return apiPost<{ request: WorkerFinanceRequest }>(
|
||||
'/api/v1/worker/profile/recharge-requests',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function createWorkerWithdrawRequest(payload: {
|
||||
amount?: number
|
||||
accountChannel?: string
|
||||
accountName?: string
|
||||
accountNo?: string
|
||||
note?: string
|
||||
}) {
|
||||
return apiPost<{ request: WorkerFinanceRequest }>(
|
||||
'/api/v1/worker/profile/withdraw-requests',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
export function changeWorkerPassword(payload: {
|
||||
currentPassword: string
|
||||
newPassword: string
|
||||
}) {
|
||||
return apiPost<{ worker: WorkerUser; reloginRequired: boolean }>(
|
||||
'/api/v1/worker/profile/change-password',
|
||||
payload,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user