This commit is contained in:
ysukkyu
2026-05-14 18:14:49 +09:00
parent c0105c6847
commit 88e14edffd
50 changed files with 4870 additions and 172 deletions
+66
View File
@@ -0,0 +1,66 @@
import api, { PageResponse, unwrap } from './request';
// ── Response VO ────────────────────────────────────────────────────────────────
export interface TaxInvoiceResp {
invoiceId: number;
invoiceNo: string;
invoiceType: string;
invoiceTypeName: string;
issueDate: string;
supplyAmount: number;
taxAmount: number;
totalAmount: number;
counterpartName: string;
counterpartBizNo: string;
counterpartRep?: string;
counterpartAddr?: string;
agentId?: number;
agentName?: string;
settleMonth?: string;
description?: string;
cancelDate?: string;
cancelReason?: string;
issuedByName?: string;
createdAt: string;
}
// ── Save Request ───────────────────────────────────────────────────────────────
export interface TaxInvoiceSaveReq {
invoiceNo: string;
invoiceType: 'SUPPLY' | 'PURCHASE';
issueDate: string;
supplyAmount: number;
taxAmount: number;
counterpartName: string;
counterpartBizNo: string;
counterpartRep?: string;
counterpartAddr?: string;
agentId?: number;
settleMonth?: string;
settleId?: number;
description?: string;
}
// ── Search Param ───────────────────────────────────────────────────────────────
export interface TaxInvoiceSearchParam {
agentId?: number;
settleMonth?: string;
invoiceType?: string;
pageNum?: number;
pageSize?: number;
}
// ── API ────────────────────────────────────────────────────────────────────────
export const taxInvoiceApi = {
list: (p: TaxInvoiceSearchParam) =>
unwrap<PageResponse<TaxInvoiceResp>>(api.get('/api/tax-invoices', { params: p })),
get: (invoiceId: number) =>
unwrap<TaxInvoiceResp>(api.get(`/api/tax-invoices/${invoiceId}`)),
create: (body: TaxInvoiceSaveReq) =>
unwrap<TaxInvoiceResp>(api.post('/api/tax-invoices', body)),
cancel: (invoiceId: number, cancelReason: string) =>
unwrap<void>(api.post(`/api/tax-invoices/${invoiceId}/cancel`, { cancelReason })),
};