forked from wangziqi/gongxue-base
feat: add commission settlement exports and proofs
This commit is contained in:
@@ -511,6 +511,41 @@ export interface CommissionSettlementItem {
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface CommissionSettlementExportItem {
|
||||
settlementId?: string;
|
||||
filename?: string;
|
||||
format?: 'csv' | 'json';
|
||||
mimeType?: string;
|
||||
rowCount?: number;
|
||||
contentBase64?: string;
|
||||
sha256?: string;
|
||||
sizeBytes?: number;
|
||||
}
|
||||
|
||||
export interface CommissionSettlementProofItem {
|
||||
id: string;
|
||||
settlementId?: string;
|
||||
proofType?: string;
|
||||
status?: string;
|
||||
title?: string | null;
|
||||
description?: string | null;
|
||||
assetId?: string | null;
|
||||
externalUrl?: string | null;
|
||||
amountCents?: number | null;
|
||||
paymentMethod?: string | null;
|
||||
paymentAccount?: string | null;
|
||||
paidAt?: string | null;
|
||||
submittedBy?: string | null;
|
||||
submittedByName?: string | null;
|
||||
reviewedBy?: string | null;
|
||||
reviewedByName?: string | null;
|
||||
reviewedAt?: string | null;
|
||||
reviewNote?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface TenantOverview {
|
||||
id?: string;
|
||||
name?: string;
|
||||
@@ -1078,6 +1113,18 @@ export async function loadCommissionSettlements(query: { status?: string; referr
|
||||
});
|
||||
}
|
||||
|
||||
export async function exportCommissionSettlement(settlementId: string, format: 'csv' | 'json' = 'csv') {
|
||||
return apiRequest<{ item?: CommissionSettlementExportItem }>('/api/commission/settlements/export', {
|
||||
query: { settlementId, format },
|
||||
});
|
||||
}
|
||||
|
||||
export async function loadCommissionSettlementProofs(settlementId: string) {
|
||||
return apiRequest<{ items?: CommissionSettlementProofItem[] }>('/api/commission/settlements/proofs', {
|
||||
query: { settlementId },
|
||||
});
|
||||
}
|
||||
|
||||
export async function generateCommissionSettlement(input: {
|
||||
referrerUserId: string;
|
||||
startDate: string;
|
||||
@@ -1104,3 +1151,34 @@ export async function updateCommissionSettlementStatus(input: {
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createCommissionSettlementProof(input: {
|
||||
settlementId: string;
|
||||
proofType?: string;
|
||||
title?: string | null;
|
||||
description?: string | null;
|
||||
assetId?: string | null;
|
||||
externalUrl?: string | null;
|
||||
amountCents?: number | null;
|
||||
paymentMethod?: string | null;
|
||||
paymentAccount?: string | null;
|
||||
paidAt?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
}) {
|
||||
return apiRequest<{ item?: CommissionSettlementProofItem }>('/api/commission/settlements/proofs', {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateCommissionSettlementProofStatus(input: {
|
||||
proofId: string;
|
||||
status: string;
|
||||
reviewNote?: string | null;
|
||||
metadata?: Record<string, unknown>;
|
||||
}) {
|
||||
return apiRequest<{ item?: CommissionSettlementProofItem }>('/api/commission/settlements/proofs/status', {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user