This commit is contained in:
2026-09-09 15:26:43 +08:00
parent a2515119b7
commit a869467efb
13 changed files with 420 additions and 85 deletions
+16
View File
@@ -465,3 +465,19 @@ export async function createFinanceCost(payload: Record<string, unknown>, vouche
const response = await http.post<ApiEnvelope<FinanceCostResource>, ApiEnvelope<FinanceCostResource>>(`${basePath}/cost-entries`, { ...payload, currency: 'CNY', voucherFileIds }, { headers: { 'Idempotency-Key': idempotencyKey('cost') } })
return unwrapApiResponse(response)
}
export interface FinancePaymentVoucher {
fileId: string
fileName: string
contentType: string
sizeBytes: number
}
export async function getFinancePaymentVoucher(customerId: string, fileId: string): Promise<FinancePaymentVoucher> {
return unwrapApiResponse(await http.get<ApiEnvelope<FinancePaymentVoucher>, ApiEnvelope<FinancePaymentVoucher>>(
`${basePath}/vouchers/${encodeURIComponent(fileId)}`, { params: { customerId } }))
}
export function downloadFinancePaymentVoucher(customerId: string, fileId: string): Promise<Blob> {
return http.get<Blob, Blob>(`${basePath}/vouchers/${encodeURIComponent(fileId)}/content`, {
params: { customerId }, responseType: 'blob',
})
}