동기화
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface AgentContractRow extends Record<string, unknown> {
|
||||
contractId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
carrierId: number;
|
||||
carrierName: string;
|
||||
contractType: string;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
commissionRate: number;
|
||||
status: string;
|
||||
terminatedAt?: string;
|
||||
terminationReason?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface AgentContractSaveReq {
|
||||
agentId: number;
|
||||
carrierId: number;
|
||||
contractType: string;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
commissionRate: number;
|
||||
}
|
||||
|
||||
export interface AgentContractSearchParam {
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
carrierId?: number;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const agentContractApi = {
|
||||
list: (p: AgentContractSearchParam) =>
|
||||
unwrap<PageResponse<AgentContractRow>>(
|
||||
api.get('/api/agent-contracts', { params: p }),
|
||||
),
|
||||
create: (body: AgentContractSaveReq) =>
|
||||
unwrap<AgentContractRow>(api.post('/api/agent-contracts', body)),
|
||||
update: (id: number, body: Partial<AgentContractSaveReq>) =>
|
||||
unwrap<AgentContractRow>(api.put(`/api/agent-contracts/${id}`, body)),
|
||||
terminate: (id: number, reason: string) =>
|
||||
unwrap<void>(api.post(`/api/agent-contracts/${id}/terminate`, { reason })),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/agent-contracts/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,101 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface ApprovalLineRow extends Record<string, unknown> {
|
||||
lineId: number;
|
||||
lineName: string;
|
||||
description: string;
|
||||
stepCount: number;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
steps?: ApprovalStep[];
|
||||
}
|
||||
|
||||
export interface ApprovalStep extends Record<string, unknown> {
|
||||
stepId: number;
|
||||
lineId: number;
|
||||
stepOrder: number;
|
||||
approverId: number;
|
||||
approverName: string;
|
||||
approverTitle?: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
export interface ApprovalRequestRow extends Record<string, unknown> {
|
||||
requestId: number;
|
||||
lineId: number;
|
||||
lineName: string;
|
||||
requesterId: number;
|
||||
requesterName: string;
|
||||
title: string;
|
||||
content: string;
|
||||
currentStep: number;
|
||||
totalSteps: number;
|
||||
status: string; // PENDING / IN_PROGRESS / APPROVED / REJECTED
|
||||
currentApproverName?: string;
|
||||
requestedAt: string;
|
||||
completedAt?: string;
|
||||
steps?: ApprovalRequestStep[];
|
||||
}
|
||||
|
||||
export interface ApprovalRequestStep extends Record<string, unknown> {
|
||||
stepId: number;
|
||||
stepOrder: number;
|
||||
approverId: number;
|
||||
approverName: string;
|
||||
status: string; // PENDING / APPROVED / REJECTED
|
||||
comment?: string;
|
||||
processedAt?: string;
|
||||
}
|
||||
|
||||
export interface ApprovalLineSaveReq {
|
||||
lineName: string;
|
||||
description: string;
|
||||
steps: { stepOrder: number; approverId: number; role: string }[];
|
||||
}
|
||||
|
||||
export interface ApprovalRequestSaveReq {
|
||||
lineId: number;
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface ApprovalSearchParam {
|
||||
status?: string;
|
||||
requesterId?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const approvalApi = {
|
||||
// Lines
|
||||
lines: (p?: ApprovalSearchParam) =>
|
||||
unwrap<PageResponse<ApprovalLineRow>>(
|
||||
api.get('/api/approvals/lines', { params: p }),
|
||||
),
|
||||
lineCreate: (body: ApprovalLineSaveReq) =>
|
||||
unwrap<ApprovalLineRow>(api.post('/api/approvals/lines', body)),
|
||||
lineUpdate: (id: number, body: Partial<ApprovalLineSaveReq>) =>
|
||||
unwrap<ApprovalLineRow>(api.put(`/api/approvals/lines/${id}`, body)),
|
||||
lineDelete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/approvals/lines/${id}`)),
|
||||
|
||||
// Requests
|
||||
requests: (p?: ApprovalSearchParam) =>
|
||||
unwrap<PageResponse<ApprovalRequestRow>>(
|
||||
api.get('/api/approvals/requests', { params: p }),
|
||||
),
|
||||
myRequests: (p?: ApprovalSearchParam) =>
|
||||
unwrap<PageResponse<ApprovalRequestRow>>(
|
||||
api.get('/api/approvals/requests/mine', { params: p }),
|
||||
),
|
||||
pendingRequests: (p?: ApprovalSearchParam) =>
|
||||
unwrap<PageResponse<ApprovalRequestRow>>(
|
||||
api.get('/api/approvals/requests/pending', { params: p }),
|
||||
),
|
||||
requestCreate: (body: ApprovalRequestSaveReq) =>
|
||||
unwrap<ApprovalRequestRow>(api.post('/api/approvals/requests', body)),
|
||||
requestDetail: (id: number) =>
|
||||
unwrap<ApprovalRequestRow>(api.get(`/api/approvals/requests/${id}`)),
|
||||
advance: (id: number, body: { approved: boolean; comment?: string }) =>
|
||||
unwrap<void>(api.post(`/api/approvals/requests/${id}/advance`, body)),
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
import api, { unwrap } from './request';
|
||||
|
||||
export interface AttachmentMeta extends Record<string, unknown> {
|
||||
attachmentId: number;
|
||||
refType: string;
|
||||
refId: number;
|
||||
originalName: string;
|
||||
storedPath: string;
|
||||
fileSize: number;
|
||||
mimeType: string;
|
||||
uploadedBy: number;
|
||||
uploaderName: string;
|
||||
uploadedAt: string;
|
||||
}
|
||||
|
||||
export const attachmentApi = {
|
||||
list: (refType: string, refId: number) =>
|
||||
unwrap<AttachmentMeta[]>(
|
||||
api.get('/api/attachments', { params: { refType, refId } }),
|
||||
),
|
||||
upload: (refType: string, refId: number, file: File, onProgress?: (pct: number) => void) => {
|
||||
const form = new FormData();
|
||||
form.append('file', file);
|
||||
form.append('refType', refType);
|
||||
form.append('refId', String(refId));
|
||||
return unwrap<AttachmentMeta>(
|
||||
api.post('/api/attachments', form, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
onUploadProgress: (evt) => {
|
||||
if (onProgress && evt.total) {
|
||||
onProgress(Math.round((evt.loaded / evt.total) * 100));
|
||||
}
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/attachments/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,230 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ── 공통 ──────────────────────────────────────────
|
||||
export interface CommissionSearchParam {
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
settleMonth?: string; // YYYYMM
|
||||
commissionType?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── CommissionMaster ──────────────────────────────
|
||||
export interface CommissionMasterRow extends Record<string, unknown> {
|
||||
masterId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
settleMonth: string;
|
||||
commissionType: string;
|
||||
commissionTypeName: string;
|
||||
grossAmount: number;
|
||||
netAmount: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
// ── CollectionCommission ──────────────────────────
|
||||
export interface CollectionRuleRow extends Record<string, unknown> {
|
||||
ruleId: number;
|
||||
carrierId: number;
|
||||
carrierName: string;
|
||||
productType: string;
|
||||
paymentCycle: string;
|
||||
ratePercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface CollectionLedgerRow extends Record<string, unknown> {
|
||||
ledgerId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
contractNo: string;
|
||||
settleMonth: string;
|
||||
collectionAmount: number;
|
||||
commissionAmount: number;
|
||||
ratePercent: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
// ── RenewalCommission ─────────────────────────────
|
||||
export interface RenewalRuleRow extends Record<string, unknown> {
|
||||
ruleId: number;
|
||||
carrierId: number;
|
||||
carrierName: string;
|
||||
productType: string;
|
||||
ratePercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface RenewalLedgerRow extends Record<string, unknown> {
|
||||
ledgerId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
contractNo: string;
|
||||
settleMonth: string;
|
||||
renewalPremium: number;
|
||||
commissionAmount: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
// ── ReinstatementCommission ───────────────────────
|
||||
export interface ReinstatementRuleRow extends Record<string, unknown> {
|
||||
ruleId: number;
|
||||
carrierId: number;
|
||||
carrierName: string;
|
||||
productType: string;
|
||||
ratePercent: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface ReinstatementLedgerRow extends Record<string, unknown> {
|
||||
ledgerId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
contractNo: string;
|
||||
settleMonth: string;
|
||||
reinstatementPremium: number;
|
||||
commissionAmount: number;
|
||||
status: string;
|
||||
}
|
||||
|
||||
// ── PersistencyBonus ──────────────────────────────
|
||||
export interface PersistencyRuleRow extends Record<string, unknown> {
|
||||
ruleId: number;
|
||||
bonusType: string; // 13M/25M/37M/49M
|
||||
minRate: number;
|
||||
bonusAmount?: number;
|
||||
bonusRate?: number;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface PersistencyBonusRow extends Record<string, unknown> {
|
||||
bonusId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
bonusType: string;
|
||||
evaluationMonth: string;
|
||||
retentionRate: number;
|
||||
bonusAmount: number;
|
||||
paidYn: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
// ── OverrideLedger ────────────────────────────────
|
||||
export interface OverrideLedgerRow extends Record<string, unknown> {
|
||||
ledgerId: number;
|
||||
fromAgentId: number;
|
||||
fromAgentName: string;
|
||||
toAgentId: number;
|
||||
toAgentName: string;
|
||||
settleMonth: string;
|
||||
baseCommission: number;
|
||||
overrideRate: number;
|
||||
overrideAmount: number;
|
||||
orgId: number;
|
||||
orgName: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface OverrideLedgerSearchParam {
|
||||
fromAgentId?: number;
|
||||
toAgentId?: number;
|
||||
agentName?: string;
|
||||
settleMonth?: string;
|
||||
orgId?: number;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ── API ───────────────────────────────────────────
|
||||
export const commissionApi = {
|
||||
// CommissionMaster
|
||||
masterList: (p: CommissionSearchParam) =>
|
||||
unwrap<PageResponse<CommissionMasterRow>>(
|
||||
api.get('/api/commissions', { params: p }),
|
||||
),
|
||||
masterByAgent: (agentId: number, yyyymm: string) =>
|
||||
unwrap<CommissionMasterRow[]>(
|
||||
api.get(`/api/commissions/agent/${agentId}`, { params: { yyyymm } }),
|
||||
),
|
||||
|
||||
// CollectionCommission
|
||||
collectionRules: (p?: Partial<CommissionSearchParam>) =>
|
||||
unwrap<PageResponse<CollectionRuleRow>>(
|
||||
api.get('/api/collection-commissions/rules', { params: p }),
|
||||
),
|
||||
collectionRuleCreate: (body: Partial<CollectionRuleRow>) =>
|
||||
unwrap<CollectionRuleRow>(api.post('/api/collection-commissions/rules', body)),
|
||||
collectionRuleUpdate: (id: number, body: Partial<CollectionRuleRow>) =>
|
||||
unwrap<CollectionRuleRow>(api.put(`/api/collection-commissions/rules/${id}`, body)),
|
||||
collectionRuleDelete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/collection-commissions/rules/${id}`)),
|
||||
collectionLedgers: (p: CommissionSearchParam) =>
|
||||
unwrap<PageResponse<CollectionLedgerRow>>(
|
||||
api.get('/api/collection-commissions/ledgers', { params: p }),
|
||||
),
|
||||
|
||||
// RenewalCommission
|
||||
renewalRules: (p?: Partial<CommissionSearchParam>) =>
|
||||
unwrap<PageResponse<RenewalRuleRow>>(
|
||||
api.get('/api/renewal-commissions/rules', { params: p }),
|
||||
),
|
||||
renewalRuleCreate: (body: Partial<RenewalRuleRow>) =>
|
||||
unwrap<RenewalRuleRow>(api.post('/api/renewal-commissions/rules', body)),
|
||||
renewalRuleUpdate: (id: number, body: Partial<RenewalRuleRow>) =>
|
||||
unwrap<RenewalRuleRow>(api.put(`/api/renewal-commissions/rules/${id}`, body)),
|
||||
renewalRuleDelete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/renewal-commissions/rules/${id}`)),
|
||||
renewalLedgers: (p: CommissionSearchParam) =>
|
||||
unwrap<PageResponse<RenewalLedgerRow>>(
|
||||
api.get('/api/renewal-commissions/ledgers', { params: p }),
|
||||
),
|
||||
|
||||
// ReinstatementCommission
|
||||
reinstatementRules: (p?: Partial<CommissionSearchParam>) =>
|
||||
unwrap<PageResponse<ReinstatementRuleRow>>(
|
||||
api.get('/api/reinstatement-commissions/rules', { params: p }),
|
||||
),
|
||||
reinstatementRuleCreate: (body: Partial<ReinstatementRuleRow>) =>
|
||||
unwrap<ReinstatementRuleRow>(api.post('/api/reinstatement-commissions/rules', body)),
|
||||
reinstatementRuleUpdate: (id: number, body: Partial<ReinstatementRuleRow>) =>
|
||||
unwrap<ReinstatementRuleRow>(api.put(`/api/reinstatement-commissions/rules/${id}`, body)),
|
||||
reinstatementRuleDelete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/reinstatement-commissions/rules/${id}`)),
|
||||
reinstatementLedgers: (p: CommissionSearchParam) =>
|
||||
unwrap<PageResponse<ReinstatementLedgerRow>>(
|
||||
api.get('/api/reinstatement-commissions/ledgers', { params: p }),
|
||||
),
|
||||
|
||||
// PersistencyBonus
|
||||
persistencyRules: (p?: Partial<CommissionSearchParam>) =>
|
||||
unwrap<PageResponse<PersistencyRuleRow>>(
|
||||
api.get('/api/persistency-bonus/rules', { params: p }),
|
||||
),
|
||||
persistencyRuleCreate: (body: Partial<PersistencyRuleRow>) =>
|
||||
unwrap<PersistencyRuleRow>(api.post('/api/persistency-bonus/rules', body)),
|
||||
persistencyRuleUpdate: (id: number, body: Partial<PersistencyRuleRow>) =>
|
||||
unwrap<PersistencyRuleRow>(api.put(`/api/persistency-bonus/rules/${id}`, body)),
|
||||
persistencyRuleDelete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/persistency-bonus/rules/${id}`)),
|
||||
persistencyBonuses: (p: CommissionSearchParam) =>
|
||||
unwrap<PageResponse<PersistencyBonusRow>>(
|
||||
api.get('/api/persistency-bonus/bonuses', { params: p }),
|
||||
),
|
||||
persistencyBonusUpsert: (body: Partial<PersistencyBonusRow>) =>
|
||||
unwrap<PersistencyBonusRow>(api.post('/api/persistency-bonus/bonuses', body)),
|
||||
|
||||
// OverrideLedger
|
||||
overrideLedgers: (p: OverrideLedgerSearchParam) =>
|
||||
unwrap<PageResponse<OverrideLedgerRow>>(
|
||||
api.get('/api/override-ledgers', { params: p }),
|
||||
),
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface ComplaintRow extends Record<string, unknown> {
|
||||
complaintId: number;
|
||||
contractNo: string;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
complaintType: string;
|
||||
content: string;
|
||||
receivedDate: string;
|
||||
status: string;
|
||||
closedAt?: string;
|
||||
chargebackTriggered: boolean;
|
||||
chargebackAmount?: number;
|
||||
processNote?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface ComplaintSaveReq {
|
||||
contractNo: string;
|
||||
agentId: number;
|
||||
complaintType: string;
|
||||
content: string;
|
||||
receivedDate: string;
|
||||
chargebackTriggered: boolean;
|
||||
}
|
||||
|
||||
export interface ComplaintSearchParam {
|
||||
contractNo?: string;
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
complaintType?: string;
|
||||
status?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const complaintApi = {
|
||||
list: (p: ComplaintSearchParam) =>
|
||||
unwrap<PageResponse<ComplaintRow>>(
|
||||
api.get('/api/complaints', { params: p }),
|
||||
),
|
||||
create: (body: ComplaintSaveReq) =>
|
||||
unwrap<ComplaintRow>(api.post('/api/complaints', body)),
|
||||
update: (id: number, body: Partial<ComplaintSaveReq>) =>
|
||||
unwrap<ComplaintRow>(api.put(`/api/complaints/${id}`, body)),
|
||||
close: (id: number, processNote: string) =>
|
||||
unwrap<void>(api.post(`/api/complaints/${id}/close`, { processNote })),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/complaints/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface ContractEndorsementRow extends Record<string, unknown> {
|
||||
endorsementId: number;
|
||||
contractNo: string;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
endorsementType: string; // PREMIUM / INSURED / BENEFICIARY / ETC
|
||||
endorsementTypeName: string;
|
||||
changeDescription: string;
|
||||
endorsementDate: string;
|
||||
recalculateRequired: boolean;
|
||||
recalculatedAt?: string;
|
||||
status: string;
|
||||
processedAt?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface ContractEndorsementSaveReq {
|
||||
contractNo: string;
|
||||
agentId: number;
|
||||
endorsementType: string;
|
||||
changeDescription: string;
|
||||
endorsementDate: string;
|
||||
recalculateRequired: boolean;
|
||||
}
|
||||
|
||||
export interface EndorsementSearchParam {
|
||||
contractNo?: string;
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
endorsementType?: string;
|
||||
status?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const endorsementApi = {
|
||||
list: (p: EndorsementSearchParam) =>
|
||||
unwrap<PageResponse<ContractEndorsementRow>>(
|
||||
api.get('/api/contract-endorsements', { params: p }),
|
||||
),
|
||||
create: (body: ContractEndorsementSaveReq) =>
|
||||
unwrap<ContractEndorsementRow>(api.post('/api/contract-endorsements', body)),
|
||||
update: (id: number, body: Partial<ContractEndorsementSaveReq>) =>
|
||||
unwrap<ContractEndorsementRow>(api.put(`/api/contract-endorsements/${id}`, body)),
|
||||
process: (id: number) =>
|
||||
unwrap<void>(api.post(`/api/contract-endorsements/${id}/process`)),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/contract-endorsements/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,102 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
// ────────────────────────────────────────────────
|
||||
// 공통 검색 파라미터
|
||||
// ────────────────────────────────────────────────
|
||||
|
||||
export interface KpiSearchParam {
|
||||
fromMonth?: string; // YYYYMM
|
||||
toMonth?: string; // YYYYMM
|
||||
orgId?: number;
|
||||
agentId?: number;
|
||||
carrierId?: number;
|
||||
levelType?: 'AGENT' | 'ORG';
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────
|
||||
// 응답 타입
|
||||
// ────────────────────────────────────────────────
|
||||
|
||||
export interface MonthlySummaryRow extends Record<string, unknown> {
|
||||
yyyymm: string;
|
||||
agentCount: number;
|
||||
totalRecruit: number;
|
||||
totalMaintain: number;
|
||||
totalOverride: number;
|
||||
totalChargeback: number;
|
||||
totalGross: number;
|
||||
totalTax: number;
|
||||
totalNet: number;
|
||||
totalIncentive: number;
|
||||
refreshedAt?: string;
|
||||
}
|
||||
|
||||
export interface OrgSummaryRow extends Record<string, unknown> {
|
||||
orgId: number;
|
||||
orgName: string;
|
||||
orgType?: string;
|
||||
yyyymm: string;
|
||||
agentCount: number;
|
||||
totalRecruit: number;
|
||||
totalMaintain: number;
|
||||
totalGross: number;
|
||||
totalNet: number;
|
||||
refreshedAt?: string;
|
||||
}
|
||||
|
||||
export interface RetentionRow extends Record<string, unknown> {
|
||||
contractMonth: string;
|
||||
carrierId?: number;
|
||||
carrierName?: string;
|
||||
totalContracts: number;
|
||||
retained13m: number;
|
||||
retained25m: number;
|
||||
retentionRate13m: number;
|
||||
retentionRate25m: number;
|
||||
refreshedAt?: string;
|
||||
}
|
||||
|
||||
export interface CumulativeRow extends Record<string, unknown> {
|
||||
levelType: 'AGENT' | 'ORG';
|
||||
entityId: number;
|
||||
entityName: string;
|
||||
orgId?: number;
|
||||
orgName?: string;
|
||||
firstSettleMonth?: string;
|
||||
lastSettleMonth?: string;
|
||||
settleMonthCount: number;
|
||||
cumGross: number;
|
||||
cumNet: number;
|
||||
cumChargeback: number;
|
||||
cumOverride: number;
|
||||
cumIncentive: number;
|
||||
refreshedAt?: string;
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────
|
||||
// API 함수
|
||||
// ────────────────────────────────────────────────
|
||||
|
||||
export const kpiApi = {
|
||||
monthlySummary: (p: KpiSearchParam) =>
|
||||
unwrap<PageResponse<MonthlySummaryRow>>(
|
||||
api.get('/api/kpi/monthly-summary', { params: p }),
|
||||
),
|
||||
|
||||
orgSummary: (p: KpiSearchParam) =>
|
||||
unwrap<PageResponse<OrgSummaryRow>>(
|
||||
api.get('/api/kpi/org-summary', { params: p }),
|
||||
),
|
||||
|
||||
retention: (p: KpiSearchParam) =>
|
||||
unwrap<PageResponse<RetentionRow>>(
|
||||
api.get('/api/kpi/retention', { params: p }),
|
||||
),
|
||||
|
||||
cumulative: (p: KpiSearchParam) =>
|
||||
unwrap<PageResponse<CumulativeRow>>(
|
||||
api.get('/api/kpi/cumulative', { params: p }),
|
||||
),
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface AgentLicenseRow extends Record<string, unknown> {
|
||||
licenseId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
licenseType: string; // LIFE / NONLIFE / VARIABLE
|
||||
licenseTypeName: string;
|
||||
licenseNo: string;
|
||||
issuedAt: string;
|
||||
expiresAt: string;
|
||||
renewedAt?: string;
|
||||
status: string;
|
||||
daysUntilExpiry?: number;
|
||||
}
|
||||
|
||||
export interface AgentLicenseSaveReq {
|
||||
agentId: number;
|
||||
licenseType: string;
|
||||
licenseNo: string;
|
||||
issuedAt: string;
|
||||
expiresAt: string;
|
||||
}
|
||||
|
||||
export interface AgentLicenseSearchParam {
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
licenseType?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const licenseApi = {
|
||||
list: (p: AgentLicenseSearchParam) =>
|
||||
unwrap<PageResponse<AgentLicenseRow>>(
|
||||
api.get('/api/agent-licenses', { params: p }),
|
||||
),
|
||||
expiring: (days = 30) =>
|
||||
unwrap<AgentLicenseRow[]>(
|
||||
api.get('/api/agent-licenses/expiring', { params: { days } }),
|
||||
),
|
||||
create: (body: AgentLicenseSaveReq) =>
|
||||
unwrap<AgentLicenseRow>(api.post('/api/agent-licenses', body)),
|
||||
update: (id: number, body: Partial<AgentLicenseSaveReq>) =>
|
||||
unwrap<AgentLicenseRow>(api.put(`/api/agent-licenses/${id}`, body)),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/agent-licenses/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface NoticeRow extends Record<string, unknown> {
|
||||
noticeId: number;
|
||||
title: string;
|
||||
content: string;
|
||||
noticeType: string; // GENERAL / IMPORTANT / SYSTEM
|
||||
isPinned: boolean;
|
||||
authorId: number;
|
||||
authorName: string;
|
||||
viewCount: number;
|
||||
publishedAt?: string;
|
||||
expiresAt?: string;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface NoticeSaveReq {
|
||||
title: string;
|
||||
content: string;
|
||||
noticeType: string;
|
||||
isPinned: boolean;
|
||||
publishedAt?: string;
|
||||
expiresAt?: string;
|
||||
}
|
||||
|
||||
export interface NoticeSearchParam {
|
||||
title?: string;
|
||||
noticeType?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const noticeApi = {
|
||||
list: (p?: NoticeSearchParam) =>
|
||||
unwrap<PageResponse<NoticeRow>>(
|
||||
api.get('/api/notices', { params: p }),
|
||||
),
|
||||
detail: (id: number) =>
|
||||
unwrap<NoticeRow>(api.get(`/api/notices/${id}`)),
|
||||
create: (body: NoticeSaveReq) =>
|
||||
unwrap<NoticeRow>(api.post('/api/notices', body)),
|
||||
update: (id: number, body: Partial<NoticeSaveReq>) =>
|
||||
unwrap<NoticeRow>(api.put(`/api/notices/${id}`, body)),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/notices/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface UserNotificationRow extends Record<string, unknown> {
|
||||
notificationId: number;
|
||||
userId: number;
|
||||
title: string;
|
||||
content: string;
|
||||
notificationType: string;
|
||||
refType?: string;
|
||||
refId?: number;
|
||||
isRead: boolean;
|
||||
readAt?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export const notificationApi = {
|
||||
list: (p?: { isRead?: boolean; pageNum?: number; pageSize?: number }) =>
|
||||
unwrap<PageResponse<UserNotificationRow>>(
|
||||
api.get('/api/user-notifications', { params: p }),
|
||||
),
|
||||
unreadCount: () =>
|
||||
unwrap<number>(api.get('/api/user-notifications/unread-count')),
|
||||
markRead: (id: number) =>
|
||||
unwrap<void>(api.post(`/api/user-notifications/${id}/read`)),
|
||||
markAllRead: () =>
|
||||
unwrap<void>(api.post('/api/user-notifications/read-all')),
|
||||
};
|
||||
@@ -0,0 +1,70 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface AgentTrainingRow extends Record<string, unknown> {
|
||||
trainingId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
trainingName: string;
|
||||
trainingType: string;
|
||||
completedHours: number;
|
||||
trainingDate: string;
|
||||
provider: string;
|
||||
status: string;
|
||||
year: number;
|
||||
}
|
||||
|
||||
export interface TrainingRequirement extends Record<string, unknown> {
|
||||
requirementId: number;
|
||||
trainingType: string;
|
||||
requiredHours: number;
|
||||
year: number;
|
||||
}
|
||||
|
||||
export interface AnnualHoursSummary extends Record<string, unknown> {
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
year: number;
|
||||
completedHours: number;
|
||||
requiredHours: number;
|
||||
satisfactionRate: number;
|
||||
satisfied: boolean;
|
||||
}
|
||||
|
||||
export interface AgentTrainingSaveReq {
|
||||
agentId: number;
|
||||
trainingName: string;
|
||||
trainingType: string;
|
||||
completedHours: number;
|
||||
trainingDate: string;
|
||||
provider: string;
|
||||
}
|
||||
|
||||
export interface AgentTrainingSearchParam {
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
year?: number;
|
||||
trainingType?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const trainingApi = {
|
||||
list: (p: AgentTrainingSearchParam) =>
|
||||
unwrap<PageResponse<AgentTrainingRow>>(
|
||||
api.get('/api/agent-trainings', { params: p }),
|
||||
),
|
||||
annualHours: (agentId: number, year: number) =>
|
||||
unwrap<AnnualHoursSummary>(
|
||||
api.get('/api/agent-trainings/annual-hours', { params: { agentId, year } }),
|
||||
),
|
||||
requirements: () =>
|
||||
unwrap<TrainingRequirement[]>(
|
||||
api.get('/api/training-requirements'),
|
||||
),
|
||||
create: (body: AgentTrainingSaveReq) =>
|
||||
unwrap<AgentTrainingRow>(api.post('/api/agent-trainings', body)),
|
||||
update: (id: number, body: Partial<AgentTrainingSaveReq>) =>
|
||||
unwrap<AgentTrainingRow>(api.put(`/api/agent-trainings/${id}`, body)),
|
||||
delete: (id: number) =>
|
||||
unwrap<void>(api.delete(`/api/agent-trainings/${id}`)),
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
import api, { PageResponse, unwrap } from './request';
|
||||
|
||||
export interface WithdrawRequestRow extends Record<string, unknown> {
|
||||
withdrawId: number;
|
||||
agentId: number;
|
||||
agentName: string;
|
||||
settleMonth: string;
|
||||
requestAmount: number;
|
||||
bankCode: string;
|
||||
accountNo: string;
|
||||
accountHolder: string;
|
||||
status: string; // PENDING / IN_APPROVAL / APPROVED / SENT / COMPLETED / FAILED
|
||||
approvalRequestId?: number;
|
||||
approvalStatus?: string;
|
||||
requestedAt: string;
|
||||
completedAt?: string;
|
||||
failReason?: string;
|
||||
}
|
||||
|
||||
export interface WithdrawRequestSaveReq {
|
||||
settleMonth: string;
|
||||
requestAmount: number;
|
||||
bankCode: string;
|
||||
accountNo: string;
|
||||
accountHolder: string;
|
||||
}
|
||||
|
||||
export interface WithdrawSearchParam {
|
||||
agentId?: number;
|
||||
agentName?: string;
|
||||
settleMonth?: string;
|
||||
status?: string;
|
||||
viewAll?: boolean;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export const withdrawApi = {
|
||||
list: (p: WithdrawSearchParam) =>
|
||||
unwrap<PageResponse<WithdrawRequestRow>>(
|
||||
api.get('/api/withdraw-requests', { params: p }),
|
||||
),
|
||||
create: (body: WithdrawRequestSaveReq) =>
|
||||
unwrap<WithdrawRequestRow>(api.post('/api/withdraw-requests', body)),
|
||||
};
|
||||
Reference in New Issue
Block a user