feat: 添加设置页面,采用玻璃拟态设计并支持分配规则管理
This commit is contained in:
@@ -17,6 +17,7 @@ function transformAllocationRule(data: Record<string, unknown>): AllocationRule
|
||||
sourceAccountId: (data.source_account_id ?? data.sourceAccountId) as number | undefined,
|
||||
sourceAccount: data.source_account ? transformSourceAccount(data.source_account as Record<string, unknown>) : undefined,
|
||||
isActive: (data.is_active ?? data.isActive) as boolean,
|
||||
autoExecute: (data.auto_execute ?? data.autoExecute) as boolean | undefined,
|
||||
targets: ((data.targets as Record<string, unknown>[]) || []).map(transformAllocationTarget),
|
||||
createdAt: (data.created_at ?? data.createdAt) as string,
|
||||
};
|
||||
@@ -58,6 +59,7 @@ export interface AllocationRuleFormInput {
|
||||
triggerType: 'income' | 'manual';
|
||||
sourceAccountId?: number;
|
||||
isActive: boolean;
|
||||
autoExecute?: boolean;
|
||||
targets: AllocationTargetInput[];
|
||||
}
|
||||
|
||||
@@ -143,6 +145,7 @@ export const createAllocationRule = async (
|
||||
trigger_type: data.triggerType,
|
||||
source_account_id: data.sourceAccountId,
|
||||
is_active: data.isActive,
|
||||
auto_execute: data.autoExecute,
|
||||
targets: data.targets.map(t => ({
|
||||
target_type: t.targetType,
|
||||
target_id: t.targetId,
|
||||
@@ -170,6 +173,7 @@ export const updateAllocationRule = async (
|
||||
trigger_type: data.triggerType,
|
||||
source_account_id: data.sourceAccountId,
|
||||
is_active: data.isActive,
|
||||
auto_execute: data.autoExecute,
|
||||
targets: data.targets.map(t => ({
|
||||
target_type: t.targetType,
|
||||
target_id: t.targetId,
|
||||
|
||||
Reference in New Issue
Block a user