费用管理内容优化-初步
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { apiDelete, apiGet, apiPatch, apiPost } from "./axios";
|
||||
import type { FeeApiResponse } from "../types/api";
|
||||
|
||||
export interface ContractFeePayload {
|
||||
project_id: string;
|
||||
center_id: string;
|
||||
contract_amount: number;
|
||||
contract_cases: number;
|
||||
actual_cases?: number | null;
|
||||
settlement_amount?: number | null;
|
||||
final_payment_amount?: number | null;
|
||||
}
|
||||
|
||||
export interface ContractFeeUpdatePayload {
|
||||
contract_amount?: number;
|
||||
contract_cases?: number;
|
||||
actual_cases?: number | null;
|
||||
settlement_amount?: number | null;
|
||||
final_payment_amount?: number | null;
|
||||
}
|
||||
|
||||
export interface ContractPaymentPayload {
|
||||
amount: number;
|
||||
paid_date?: string | null;
|
||||
verified_date?: string | null;
|
||||
is_paid?: boolean;
|
||||
is_verified?: boolean;
|
||||
remark?: string | null;
|
||||
}
|
||||
|
||||
export const listContractFees = (params: { projectId: string; centerId?: string; q?: string }) =>
|
||||
apiGet<FeeApiResponse<any[]>>("/api/v1/fees/contracts", { params });
|
||||
|
||||
export const getContractFee = (contractId: string) => apiGet<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}`);
|
||||
|
||||
export const createContractFee = (payload: ContractFeePayload) =>
|
||||
apiPost<FeeApiResponse<any>>("/api/v1/fees/contracts", payload);
|
||||
|
||||
export const updateContractFee = (contractId: string, payload: ContractFeeUpdatePayload) =>
|
||||
apiPatch<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}`, payload);
|
||||
|
||||
export const deleteContractFee = (contractId: string) => apiDelete(`/api/v1/fees/contracts/${contractId}`);
|
||||
|
||||
export const createContractPayment = (contractId: string, payload: ContractPaymentPayload) =>
|
||||
apiPost<FeeApiResponse<any>>(`/api/v1/fees/contracts/${contractId}/payments`, payload);
|
||||
|
||||
export const updateContractPayment = (paymentId: string, payload: ContractPaymentPayload) =>
|
||||
apiPatch<FeeApiResponse<any>>(`/api/v1/fees/payments/${paymentId}`, payload);
|
||||
|
||||
export const deleteContractPayment = (paymentId: string) => apiDelete(`/api/v1/fees/payments/${paymentId}`);
|
||||
Reference in New Issue
Block a user