1
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface ChargebackGradeResp {
|
||||
gradeId: number;
|
||||
productCategory: string | null;
|
||||
productCategoryName: string | null;
|
||||
monthsFrom: number;
|
||||
monthsTo: number | null;
|
||||
monthsRange: string;
|
||||
chargebackPercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo: string | null;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface ChargebackGradeSaveReq {
|
||||
productCategory?: string | null;
|
||||
monthsFrom: number;
|
||||
monthsTo?: number | null;
|
||||
chargebackPercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string | null;
|
||||
}
|
||||
|
||||
export interface ChargebackGradeSearchParam {
|
||||
productCategory?: string;
|
||||
effectiveDate?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const chargebackGradeApi = {
|
||||
list: (params: ChargebackGradeSearchParam) =>
|
||||
unwrap<PageResponse<ChargebackGradeResp>>(
|
||||
api.get('/api/chargeback-grades', { params }),
|
||||
),
|
||||
|
||||
get: (gradeId: number) =>
|
||||
unwrap<ChargebackGradeResp>(api.get(`/api/chargeback-grades/${gradeId}`)),
|
||||
|
||||
create: (req: ChargebackGradeSaveReq) =>
|
||||
unwrap<number>(api.post('/api/chargeback-grades', req)),
|
||||
|
||||
update: (gradeId: number, req: ChargebackGradeSaveReq) =>
|
||||
unwrap<void>(api.put(`/api/chargeback-grades/${gradeId}`, req)),
|
||||
|
||||
deactivate: (gradeId: number) =>
|
||||
unwrap<void>(api.put(`/api/chargeback-grades/${gradeId}/deactivate`)),
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── Response VO ────────────────────────────────────────────────────────────
|
||||
export interface DeductionResp {
|
||||
deductionId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
settleMonth: string; // YYYYMM
|
||||
deductionType: string;
|
||||
deductionTypeName: string;
|
||||
amount: number; // BigDecimal → number
|
||||
description?: string;
|
||||
status: string;
|
||||
statusName: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// ── Request VO ─────────────────────────────────────────────────────────────
|
||||
export interface DeductionSaveReq {
|
||||
agentId: number;
|
||||
settleMonth: string; // YYYYMM 6자리
|
||||
deductionType: string;
|
||||
amount: number; // 양수
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// ── Search Params ──────────────────────────────────────────────────────────
|
||||
export interface DeductionSearchParam {
|
||||
agentId?: number;
|
||||
settleMonth?: string;
|
||||
deductionType?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ────────────────────────────────────────────────────────────────────
|
||||
export const deductionApi = {
|
||||
list: (p: DeductionSearchParam) =>
|
||||
unwrap<PageResponse<DeductionResp>>(api.get('/api/deductions', { params: p })),
|
||||
|
||||
get: (deductionId: number) =>
|
||||
unwrap<DeductionResp>(api.get(`/api/deductions/${deductionId}`)),
|
||||
|
||||
create: (req: DeductionSaveReq) =>
|
||||
unwrap<number>(api.post('/api/deductions', req)),
|
||||
|
||||
update: (deductionId: number, req: DeductionSaveReq) =>
|
||||
unwrap<void>(api.put(`/api/deductions/${deductionId}`, req)),
|
||||
|
||||
cancel: (deductionId: number) =>
|
||||
unwrap<void>(api.put(`/api/deductions/${deductionId}/cancel`)),
|
||||
};
|
||||
@@ -0,0 +1,66 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── Response VO ────────────────────────────────────────────────────────────────
|
||||
export interface DisputeResp {
|
||||
disputeId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
orgName?: string;
|
||||
settleMonth: string;
|
||||
settleId?: number;
|
||||
status: string;
|
||||
statusName?: string;
|
||||
disputedAmount?: number;
|
||||
claimAmount?: number;
|
||||
reason: string;
|
||||
evidenceUrl?: string;
|
||||
reviewerName?: string;
|
||||
reviewedAt?: string;
|
||||
resolvedByName?: string;
|
||||
resolvedAt?: string;
|
||||
resolution?: string;
|
||||
adjustmentAmount?: number;
|
||||
correctionId?: number;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// ── Save Request ───────────────────────────────────────────────────────────────
|
||||
export interface DisputeSaveReq {
|
||||
agentId: number;
|
||||
settleMonth: string;
|
||||
settleId?: number;
|
||||
disputedAmount?: number;
|
||||
claimAmount?: number;
|
||||
reason: string;
|
||||
evidenceUrl?: string;
|
||||
}
|
||||
|
||||
// ── Search Param ───────────────────────────────────────────────────────────────
|
||||
export interface DisputeSearchParam {
|
||||
agentId?: number;
|
||||
settleMonth?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ────────────────────────────────────────────────────────────────────────
|
||||
export const disputeApi = {
|
||||
list: (p: DisputeSearchParam) =>
|
||||
unwrap<PageResponse<DisputeResp>>(api.get('/api/disputes', { params: p })),
|
||||
|
||||
get: (disputeId: number) =>
|
||||
unwrap<DisputeResp>(api.get(`/api/disputes/${disputeId}`)),
|
||||
|
||||
create: (body: DisputeSaveReq) =>
|
||||
unwrap<DisputeResp>(api.post('/api/disputes', body)),
|
||||
|
||||
review: (disputeId: number) =>
|
||||
unwrap<void>(api.post(`/api/disputes/${disputeId}/review`)),
|
||||
|
||||
approve: (disputeId: number, resolution: string, adjustmentAmount?: number) =>
|
||||
unwrap<void>(api.post(`/api/disputes/${disputeId}/approve`, { resolution, adjustmentAmount })),
|
||||
|
||||
reject: (disputeId: number, resolution: string) =>
|
||||
unwrap<void>(api.post(`/api/disputes/${disputeId}/reject`, { resolution })),
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── Response VO ────────────────────────────────────────────────────────────────
|
||||
export interface IncentiveProgramResp {
|
||||
programId: number;
|
||||
programName: string;
|
||||
programType: string;
|
||||
programTypeName?: string;
|
||||
targetType: string;
|
||||
targetGradeId?: number;
|
||||
targetGradeName?: string;
|
||||
targetOrgId?: number;
|
||||
targetOrgName?: string;
|
||||
productCategory?: string;
|
||||
startMonth: string;
|
||||
endMonth: string;
|
||||
conditionDesc?: string;
|
||||
payRate?: number;
|
||||
payAmountFixed?: number;
|
||||
payType: 'RATE' | 'FIXED_AMOUNT';
|
||||
budgetAmount?: number;
|
||||
isActive: boolean;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// ── Save Request ───────────────────────────────────────────────────────────────
|
||||
export interface IncentiveProgramSaveReq {
|
||||
programName: string;
|
||||
programType: string;
|
||||
targetType: 'AGENT' | 'ORG' | 'GRADE';
|
||||
targetGradeId?: number;
|
||||
targetOrgId?: number;
|
||||
productCategory?: string;
|
||||
startMonth: string;
|
||||
endMonth: string;
|
||||
conditionDesc?: string;
|
||||
payRate?: number;
|
||||
payAmountFixed?: number;
|
||||
payType: 'RATE' | 'FIXED_AMOUNT';
|
||||
budgetAmount?: number;
|
||||
}
|
||||
|
||||
// ── Search Param ───────────────────────────────────────────────────────────────
|
||||
export interface IncentiveProgramSearchParam {
|
||||
programType?: string;
|
||||
targetType?: string;
|
||||
startMonth?: string;
|
||||
endMonth?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ────────────────────────────────────────────────────────────────────────
|
||||
export const incentiveApi = {
|
||||
list: (p: IncentiveProgramSearchParam) =>
|
||||
unwrap<PageResponse<IncentiveProgramResp>>(api.get('/api/incentive-programs', { params: p })),
|
||||
|
||||
get: (programId: number) =>
|
||||
unwrap<IncentiveProgramResp>(api.get(`/api/incentive-programs/${programId}`)),
|
||||
|
||||
create: (body: IncentiveProgramSaveReq) =>
|
||||
unwrap<IncentiveProgramResp>(api.post('/api/incentive-programs', body)),
|
||||
|
||||
update: (programId: number, body: IncentiveProgramSaveReq) =>
|
||||
unwrap<IncentiveProgramResp>(api.put(`/api/incentive-programs/${programId}`, body)),
|
||||
|
||||
deactivate: (programId: number) =>
|
||||
unwrap<void>(api.put(`/api/incentive-programs/${programId}/deactivate`)),
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface InstallmentRatioResp {
|
||||
ratioId: number;
|
||||
productCategory: string | null;
|
||||
productCategoryName: string | null;
|
||||
planYear: number;
|
||||
ratioPercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo: string | null;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface InstallmentRatioSaveReq {
|
||||
productCategory?: string | null;
|
||||
planYear: number;
|
||||
ratioPercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string | null;
|
||||
}
|
||||
|
||||
export interface InstallmentRatioSearchParam {
|
||||
productCategory?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const installmentApi = {
|
||||
list: (params: InstallmentRatioSearchParam) =>
|
||||
unwrap<PageResponse<InstallmentRatioResp>>(
|
||||
api.get('/api/installment-ratios', { params }),
|
||||
),
|
||||
|
||||
create: (req: InstallmentRatioSaveReq) =>
|
||||
unwrap<number>(api.post('/api/installment-ratios', req)),
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── Response VO ────────────────────────────────────────────────────────────
|
||||
export interface PeriodCloseResp {
|
||||
closeId: number;
|
||||
closeMonth: string; // YYYYMM
|
||||
closedAt?: string;
|
||||
closedByName?: string;
|
||||
reopenAt?: string;
|
||||
reopenByName?: string;
|
||||
reopenReason?: string;
|
||||
note?: string;
|
||||
closeStatus: 'CLOSED' | 'REOPENED';
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// ── Request VOs ────────────────────────────────────────────────────────────
|
||||
export interface PeriodCloseCreateReq {
|
||||
closeMonth: string; // YYYYMM
|
||||
note?: string;
|
||||
}
|
||||
|
||||
export interface PeriodReopenReq {
|
||||
reopenReason: string;
|
||||
}
|
||||
|
||||
// ── Search Params ──────────────────────────────────────────────────────────
|
||||
export interface PeriodCloseSearchParam {
|
||||
settleMonth?: string;
|
||||
closeStatus?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ────────────────────────────────────────────────────────────────────
|
||||
export const periodCloseApi = {
|
||||
list: (p: PeriodCloseSearchParam) =>
|
||||
unwrap<PageResponse<PeriodCloseResp>>(api.get('/api/period-close', { params: p })),
|
||||
|
||||
get: (closeId: number) =>
|
||||
unwrap<PeriodCloseResp>(api.get(`/api/period-close/${closeId}`)),
|
||||
|
||||
close: (req: PeriodCloseCreateReq) =>
|
||||
unwrap<number>(api.post('/api/period-close', req)),
|
||||
|
||||
reopen: (closeId: number, req: PeriodReopenReq) =>
|
||||
unwrap<void>(api.post(`/api/period-close/${closeId}/reopen`, req)),
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
import api, { unwrap } from './request';
|
||||
|
||||
export interface RegulatoryLimitResp {
|
||||
limitId: number;
|
||||
limitType: string;
|
||||
limitTypeName?: string;
|
||||
productCategory?: string;
|
||||
productCategoryName?: string;
|
||||
limitValue: number;
|
||||
unit: string;
|
||||
unitName?: string;
|
||||
effectiveFrom?: string;
|
||||
effectiveTo?: string;
|
||||
regulationRef?: string;
|
||||
description?: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface RegulatoryLimitSaveReq {
|
||||
limitType: string;
|
||||
productCategory?: string;
|
||||
limitValue: number;
|
||||
unit: string;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
regulationRef?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export const regulatoryApi = {
|
||||
list: (params?: { limitType?: string; productCategory?: string }) =>
|
||||
unwrap<{ list: RegulatoryLimitResp[]; total: number }>(
|
||||
api.get('/api/regulatory-limits', { params })
|
||||
),
|
||||
detail: (id: number) =>
|
||||
unwrap<RegulatoryLimitResp>(api.get(`/api/regulatory-limits/${id}`)),
|
||||
create: (req: RegulatoryLimitSaveReq) =>
|
||||
unwrap<void>(api.post('/api/regulatory-limits', req)),
|
||||
update: (id: number, req: RegulatoryLimitSaveReq) =>
|
||||
unwrap<void>(api.put(`/api/regulatory-limits/${id}`, req)),
|
||||
deactivate: (id: number) =>
|
||||
unwrap<void>(api.put(`/api/regulatory-limits/${id}/deactivate`)),
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── Response VO ────────────────────────────────────────────────────────────
|
||||
export interface SettleCorrectionResp {
|
||||
correctionId: number;
|
||||
originalSettleId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
orgName?: string;
|
||||
settleMonth: string; // YYYYMM
|
||||
diffAmount: number; // afterAmount - beforeAmount
|
||||
beforeAmount: number;
|
||||
afterAmount: number;
|
||||
reasonCode: string;
|
||||
reasonCodeName: string;
|
||||
reasonDetail?: string;
|
||||
status: 'DRAFT' | 'APPROVED' | 'APPLIED' | 'CANCELLED';
|
||||
statusName: string;
|
||||
requestedByName?: string;
|
||||
requestedAt?: string;
|
||||
approvedByName?: string;
|
||||
approvedAt?: string;
|
||||
cancelReason?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// ── Request VO ─────────────────────────────────────────────────────────────
|
||||
export interface SettleCorrectionSaveReq {
|
||||
originalSettleId: number;
|
||||
agentId: number;
|
||||
settleMonth: string; // YYYYMM
|
||||
beforeAmount: number;
|
||||
afterAmount: number;
|
||||
reasonCode: string;
|
||||
reasonDetail?: string;
|
||||
}
|
||||
|
||||
// ── Search Params ──────────────────────────────────────────────────────────
|
||||
export interface SettleCorrectionSearchParam {
|
||||
agentId?: number;
|
||||
settleMonth?: string;
|
||||
status?: string;
|
||||
reasonCode?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ────────────────────────────────────────────────────────────────────
|
||||
export const settleCorrectionApi = {
|
||||
list: (p: SettleCorrectionSearchParam) =>
|
||||
unwrap<PageResponse<SettleCorrectionResp>>(api.get('/api/settle-corrections', { params: p })),
|
||||
|
||||
get: (correctionId: number) =>
|
||||
unwrap<SettleCorrectionResp>(api.get(`/api/settle-corrections/${correctionId}`)),
|
||||
|
||||
create: (req: SettleCorrectionSaveReq) =>
|
||||
unwrap<number>(api.post('/api/settle-corrections', req)),
|
||||
|
||||
approve: (correctionId: number) =>
|
||||
unwrap<void>(api.put(`/api/settle-corrections/${correctionId}/approve`)),
|
||||
|
||||
cancel: (correctionId: number, cancelReason: string) =>
|
||||
unwrap<void>(api.put(`/api/settle-corrections/${correctionId}/cancel`, { cancelReason })),
|
||||
};
|
||||
@@ -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 })),
|
||||
};
|
||||
@@ -86,10 +86,14 @@ export const commonCodeApi = {
|
||||
unwrap<void>(api.post('/api/common/codes/groups', vo)),
|
||||
updateGroup: (groupCode: string, vo: Partial<CommonCodeGroup>) =>
|
||||
unwrap<void>(api.put(`/api/common/codes/groups/${groupCode}`, vo)),
|
||||
deleteGroup: (groupCode: string) =>
|
||||
unwrap<void>(api.delete(`/api/common/codes/groups/${groupCode}`)),
|
||||
createCode: (groupCode: string, vo: Partial<CommonCode>) =>
|
||||
unwrap<void>(api.post(`/api/common/codes/groups/${groupCode}/codes`, vo)),
|
||||
updateCode: (codeId: number, vo: Partial<CommonCode>) =>
|
||||
unwrap<void>(api.put(`/api/common/codes/codes/${codeId}`, vo)),
|
||||
unwrap<void>(api.put(`/api/common/codes/${codeId}`, vo)),
|
||||
deleteCode: (codeId: number) =>
|
||||
unwrap<void>(api.delete(`/api/common/codes/codes/${codeId}`)),
|
||||
unwrap<void>(api.delete(`/api/common/codes/${codeId}`)),
|
||||
refreshCache: (groupCode?: string) =>
|
||||
unwrap<void>(api.post('/api/common/codes/refresh', null, { params: { groupCode } })),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user