feat: 完善预算中心图表与确认对话框交互
后端预算服务增加汇总查询和辅助计算,前端预算中心优化趋 势图组件和数据展示,增强确认对话框通用性和样式,完善预 算编辑对话框布局,补充预算端点单元测试。
This commit is contained in:
@@ -92,6 +92,37 @@ class BudgetTransactionRead(BaseModel):
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class BudgetTrendPointRead(BaseModel):
|
||||
period_key: str
|
||||
label: str
|
||||
total_amount: Decimal
|
||||
reserved_amount: Decimal
|
||||
consumed_amount: Decimal
|
||||
used_amount: Decimal
|
||||
available_amount: Decimal
|
||||
usage_rate: Decimal
|
||||
|
||||
|
||||
class BudgetWarningRead(BaseModel):
|
||||
allocation_id: str
|
||||
budget_no: str
|
||||
fiscal_year: int
|
||||
period_key: str
|
||||
department_name: str
|
||||
cost_center: str | None = None
|
||||
subject_code: str
|
||||
subject_name: str
|
||||
total_amount: Decimal
|
||||
reserved_amount: Decimal
|
||||
consumed_amount: Decimal
|
||||
available_amount: Decimal
|
||||
usage_rate: Decimal
|
||||
warning_threshold: Decimal
|
||||
severity: str
|
||||
message: str
|
||||
occurred_at: datetime | None = None
|
||||
|
||||
|
||||
class BudgetSummaryRead(BaseModel):
|
||||
fiscal_year: int | None = None
|
||||
period_key: str | None = None
|
||||
@@ -102,6 +133,8 @@ class BudgetSummaryRead(BaseModel):
|
||||
warning_count: int
|
||||
over_budget_count: int
|
||||
allocations: list[BudgetAllocationRead] = Field(default_factory=list)
|
||||
trend: list[BudgetTrendPointRead] = Field(default_factory=list)
|
||||
warnings: list[BudgetWarningRead] = Field(default_factory=list)
|
||||
|
||||
|
||||
class BudgetCheckRead(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user