80 lines
2.1 KiB
TypeScript
80 lines
2.1 KiB
TypeScript
|
|
import api, { unwrap } from './request';
|
||
|
|
|
||
|
|
export interface CommissionRateResp {
|
||
|
|
rateId: number;
|
||
|
|
productId: number;
|
||
|
|
productName?: string;
|
||
|
|
commissionYear: number;
|
||
|
|
ratePct: number;
|
||
|
|
payMethodCond?: string;
|
||
|
|
minPremium?: number;
|
||
|
|
effectiveFrom?: string;
|
||
|
|
effectiveTo?: string;
|
||
|
|
version: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface PayoutRuleResp {
|
||
|
|
ruleId: number;
|
||
|
|
gradeId: number;
|
||
|
|
gradeName?: string;
|
||
|
|
insuranceType: string;
|
||
|
|
commissionYear: number;
|
||
|
|
payoutPct: number;
|
||
|
|
payMethodCond?: string;
|
||
|
|
performanceGrade?: string;
|
||
|
|
effectiveFrom?: string;
|
||
|
|
effectiveTo?: string;
|
||
|
|
version: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OverrideRuleResp {
|
||
|
|
overrideId: number;
|
||
|
|
fromGrade: number;
|
||
|
|
toGrade: number;
|
||
|
|
fromGradeName?: string;
|
||
|
|
toGradeName?: string;
|
||
|
|
overridePct: number;
|
||
|
|
calcType?: string;
|
||
|
|
insuranceTypeCond?: string;
|
||
|
|
capAmount?: number;
|
||
|
|
effectiveFrom?: string;
|
||
|
|
effectiveTo?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ChargebackRuleResp {
|
||
|
|
cbRuleId: number;
|
||
|
|
companyCode: string;
|
||
|
|
insuranceType: string;
|
||
|
|
lapseMonthFrom: number;
|
||
|
|
lapseMonthTo: number;
|
||
|
|
cbRate: number;
|
||
|
|
includeOverride: string;
|
||
|
|
installmentAllowed: string;
|
||
|
|
maxInstallments?: number;
|
||
|
|
effectiveFrom?: string;
|
||
|
|
effectiveTo?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ExceptionCodeResp {
|
||
|
|
exceptionCode: string;
|
||
|
|
exceptionName: string;
|
||
|
|
category?: string;
|
||
|
|
direction: string;
|
||
|
|
autoCalcYn: string;
|
||
|
|
approvalRequired: string;
|
||
|
|
taxIncluded: string;
|
||
|
|
description?: string;
|
||
|
|
isActive: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const ruleApi = {
|
||
|
|
commissionRates: (params?: { productId?: number; year?: number }) =>
|
||
|
|
unwrap<CommissionRateResp[]>(api.get('/api/rules/commission-rates', { params })),
|
||
|
|
payoutRules: (params?: { gradeId?: number; insuranceType?: string }) =>
|
||
|
|
unwrap<PayoutRuleResp[]>(api.get('/api/rules/payout', { params })),
|
||
|
|
overrideRules: () => unwrap<OverrideRuleResp[]>(api.get('/api/rules/override')),
|
||
|
|
chargebackRules: (params?: { companyCode?: string }) =>
|
||
|
|
unwrap<ChargebackRuleResp[]>(api.get('/api/rules/chargeback', { params })),
|
||
|
|
exceptionCodes: () => unwrap<ExceptionCodeResp[]>(api.get('/api/rules/exception-codes')),
|
||
|
|
};
|