Initial commit: G3FO recurring investment schedule frontend

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
justin
2026-10-10 09:21:25 +08:00
co-authored by Cursor
commit 9ed161d93e
69 changed files with 10097 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
export type AssetType = 'etf' | 'stock'
export type IntervalKey =
| 'daily'
| 'weekly'
| 'biweekly'
| 'monthly'
| 'quarterly'
| 'semiannual'
| 'annual'
export type EndMode = 'date' | 'count'
export type PlanStatus = 'active' | 'created' | 'cancelled'
export interface InvestAsset {
code: string
name: string
type: AssetType
/** 产品英文名称(来自 getSimpleStockPage) */
engName?: string
/** 产品本地名称(来自 getSimpleStockPage) */
localName?: string
/** 对接产品接口时的主键,如 SZMK-2728 */
productKey?: string
exchangeCode?: string
productCodeUnique?: string
}
export interface RecurringPlan {
id: string
/** 接口计划编号,如 SI-2026-10-08-… */
planNo?: string
assets: InvestAsset[]
amount: number
/** 按数量定投时的每次股数 */
quantity?: number | null
investmentType?: 'AMOUNT' | 'QUANTITY'
frequencyType?: 'DAILY' | 'WEEKLY' | 'MONTHLY'
frequencyDay?: string
interval: IntervalKey
startDate: string
endMode: EndMode
endDate: string
endCount: number | null
noEnd: boolean
endDisplay: string
status: PlanStatus
/** 接口原始状态,如 ACTIVE */
apiStatus?: string
}
export interface RecurringPlanDraft {
assets: InvestAsset[]
amount: number
interval: IntervalKey
startDate: string
endDisplay: string
endMode: EndMode
endDate: string
endCount: number | null
noEnd: boolean
investmentType?: 'AMOUNT' | 'QUANTITY'
quantity?: number
orderPriceType?: 'MARKET' | 'LIMIT'
limitPrice?: number
frequencyDay?: string
ctOffsetMinutes?: number
}
export const INTERVAL_KEYS: IntervalKey[] = [
'daily',
'weekly',
'biweekly',
'monthly',
'quarterly',
'semiannual',
'annual',
]