实现企业银行账户与建行制单(corporate-bank-account-payment-order)

这个提交包含在:
2026-08-02 23:36:40 +08:00
父节点 f946d64539
当前提交 5261d2849b
共修改 46 个文件,包含 2751 行新增和 73 行删除
+61
查看文件
@@ -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 }),
});
}
+27
查看文件
@@ -49,6 +49,18 @@ export type PaymentBatch = {
secondaryReviewComment: string | null;
executionSummaryJson: Record<string, unknown> | null;
receiptAttachmentCount?: number;
paymentAccount: {
accountName: string;
bankName: string;
bankInstitutionCode: string;
accountNumberMasked: string;
} | null;
paymentOrderExportCount: number;
paymentOrderLastExportedAt: string | null;
paymentOrderLastExportedBy: string | null;
canExportPaymentOrder: boolean;
paymentOrderExportBlockReason: string | null;
paymentOrderExportBlockers: Array<{ code: string; entityCode?: string }>;
createdAt: string | null;
createdBy: string | null;
reviewedAt: string | null;
@@ -171,6 +183,21 @@ export async function cancelPaymentBatch(batchId: string, reason: string) {
});
}
export async function downloadPaymentOrder(batchId: string, reason: string): Promise<ApiBlobResponse> {
return apiRequestBlob(`/api/payment-batches/${batchId}/payment-order`, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ reason }),
});
}
export async function revealPaymentBatchPayeeBank(batchId: string, itemId: string, reason: string) {
return apiRequestData<{ bankAccount: string }>(
`/api/payment-batches/${batchId}/items/${itemId}/payee-bank/reveal`,
{ method: "POST", body: JSON.stringify({ reason }) },
);
}
export async function fetchPaymentBatchReceiptAttachments(batchId: string) {
return apiRequestData<{ items: PaymentBatchReceiptAttachment[] }>(
`/api/payment-batches/${batchId}/receipt-attachments`,
+5
查看文件
@@ -42,6 +42,11 @@ export type MeResponse = {
status: string;
notificationPushEnabled: boolean;
roleCodes: string[];
bankAccount: {
bankName: string | null;
bankInstitutionCode: string | null;
accountNumberMasked: string | null;
};
profileCompleteness: ProfileCompleteness;
wecomBinding?: {
externalUserId: string;
+28
查看文件
@@ -0,0 +1,28 @@
import { apiRequestData } from "./http";
export type EmployeeBankSummary = {
bankInstitution: { id: string; code: string; name: string } | null;
bankName: string | null;
bankAccountMasked: string | null;
};
export async function fetchUserSensitive(userId: string) {
return apiRequestData<EmployeeBankSummary & { idNumber?: string | null }>(`/api/users/${userId}/sensitive`);
}
export async function updateUserBank(userId: string, payload: {
bankInstitutionId: string | null;
bankAccount?: string | null;
}) {
return apiRequestData<{ id: string; updatedFields: string[] }>(`/api/users/${userId}/sensitive`, {
method: "PATCH",
body: JSON.stringify(payload),
});
}
export async function revealUserBank(userId: string, reason: string) {
return apiRequestData<{ bankAccount: string | null }>(`/api/users/${userId}/sensitive/bank/reveal`, {
method: "POST",
body: JSON.stringify({ reason }),
});
}