feat(settlement, admin): introduce new types and functions for downline share and settlement period hints
Added new types for downline share breakdown and settlement period open hints to enhance the agent settlement API. Updated the admin console components to support these new features, improving the user experience with better data presentation and interaction. Additionally, refined the date range field to accommodate new calendar markers and hints, ensuring a more intuitive interface for managing settlement periods.
This commit is contained in:
@@ -43,6 +43,17 @@ export type AgentSettlementReportType =
|
||||
| "platform_pnl"
|
||||
| "draw_period";
|
||||
|
||||
export type DownlineShareItem = {
|
||||
owner_id: number;
|
||||
owner_label: string;
|
||||
share_profit: number;
|
||||
};
|
||||
|
||||
export type DownlineShareBreakdown = {
|
||||
total: number;
|
||||
items: DownlineShareItem[];
|
||||
};
|
||||
|
||||
export type SettlementBillRow = {
|
||||
id: number;
|
||||
settlement_period_id: number;
|
||||
@@ -88,6 +99,20 @@ export async function postSettlementPeriod(body: {
|
||||
return adminRequest.post(`${A}/settlement-periods`, body);
|
||||
}
|
||||
|
||||
export type SettlementPeriodOpenHints = {
|
||||
suggested_start: string;
|
||||
suggested_end: string;
|
||||
occupied_period_dates: string[];
|
||||
pending_activity_dates: string[];
|
||||
unpaid_bill_dates: string[];
|
||||
};
|
||||
|
||||
export async function getSettlementPeriodOpenHints(params: {
|
||||
admin_site_id: number;
|
||||
}): Promise<SettlementPeriodOpenHints> {
|
||||
return adminRequest.get(`${A}/settlement-periods/open-hints`, { params });
|
||||
}
|
||||
|
||||
export type SettlementPeriodCloseResult = {
|
||||
period_id: number;
|
||||
unsettled_ticket_count?: number;
|
||||
@@ -262,6 +287,7 @@ export async function getSettlementBill(billId: number): Promise<{
|
||||
rebate_allocations: RebateAllocationRow[];
|
||||
adjustments: Array<{ id: number; amount: number; adjustment_type: string; reason: string | null }>;
|
||||
tier_edge?: string | null;
|
||||
downline_shares?: DownlineShareBreakdown;
|
||||
}> {
|
||||
return adminRequest.get(`${A}/settlement-bills/${billId}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user