实现企业银行账户与建行制单(corporate-bank-account-payment-order)
这个提交包含在:
@@ -0,0 +1,61 @@
|
||||
import { apiRequestData } from "./http";
|
||||
|
||||
export type BankInstitution = { id: string; code: string; name: string };
|
||||
|
||||
export type PaymentAccount = {
|
||||
id: string;
|
||||
legalEntity: { id: string; code: string; name: string };
|
||||
bankInstitution: BankInstitution;
|
||||
accountName: string;
|
||||
accountNumberMasked: string | null;
|
||||
enabled: boolean;
|
||||
archivedAt: string | null;
|
||||
createdAt: string | null;
|
||||
updatedAt: string | null;
|
||||
};
|
||||
|
||||
export async function fetchBankInstitutions() {
|
||||
return apiRequestData<{ items: BankInstitution[] }>("/api/bank-institutions");
|
||||
}
|
||||
|
||||
export async function fetchPaymentAccounts() {
|
||||
return apiRequestData<{ items: PaymentAccount[] }>("/api/payment-accounts");
|
||||
}
|
||||
|
||||
export async function createPaymentAccount(payload: {
|
||||
legalEntityId: string;
|
||||
bankInstitutionId: string;
|
||||
accountName: string;
|
||||
accountNumber: string;
|
||||
}) {
|
||||
return apiRequestData<PaymentAccount>("/api/payment-accounts", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export async function replacePaymentAccount(accountId: string, payload: {
|
||||
legalEntityId: string;
|
||||
bankInstitutionId: string;
|
||||
accountName: string;
|
||||
accountNumber: string;
|
||||
}) {
|
||||
return apiRequestData<PaymentAccount>(`/api/payment-accounts/${accountId}/replace`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
export async function disablePaymentAccount(accountId: string) {
|
||||
return apiRequestData<{ id: string; disabled: boolean }>(`/api/payment-accounts/${accountId}/disable`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({}),
|
||||
});
|
||||
}
|
||||
|
||||
export async function revealPaymentAccount(accountId: string, reason: string) {
|
||||
return apiRequestData<{ accountNumber: string }>(`/api/payment-accounts/${accountId}/reveal`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ reason }),
|
||||
});
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户