迁移合同费用通用附件
1、删除旧费用附件 API、CRUD、模型和专用前端面板,统一改用通用附件能力。 2、调整合同费用接口为 study_id 语义,并补充合同、凭证、发票等附件类型的权限映射。 3、将合同费用新建和编辑改为抽屉流程,详情页与列表页复用同一编辑组件。 4、补充数据库迁移、附件列表、合同费用抽屉和权限场景测试,覆盖旧权限移除与新流程。
This commit is contained in:
@@ -5,12 +5,12 @@ from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from app.schemas.attachment import AttachmentRead
|
||||
from app.schemas.contract_fee_payment import ContractFeePaymentRead
|
||||
from app.schemas.fee_attachment import FeeAttachmentRead
|
||||
|
||||
|
||||
class ContractFeeCreate(BaseModel):
|
||||
project_id: uuid.UUID
|
||||
study_id: uuid.UUID
|
||||
center_id: uuid.UUID
|
||||
contract_no: Optional[str] = None
|
||||
signed_date: Optional[date] = None
|
||||
@@ -37,7 +37,7 @@ class ContractFeeUpdate(BaseModel):
|
||||
|
||||
class ContractFeeRead(BaseModel):
|
||||
id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
study_id: uuid.UUID
|
||||
center_id: uuid.UUID
|
||||
contract_no: Optional[str]
|
||||
signed_date: Optional[date]
|
||||
@@ -66,4 +66,4 @@ class ContractFeeListItem(ContractFeeRead):
|
||||
|
||||
class ContractFeeDetail(ContractFeeRead):
|
||||
payments: list[ContractFeePaymentRead]
|
||||
attachments: dict[str, list[FeeAttachmentRead]]
|
||||
attachments: dict[str, list[AttachmentRead]]
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
from app.schemas.user import UserDisplay
|
||||
|
||||
|
||||
class FeeAttachmentRead(BaseModel):
|
||||
id: uuid.UUID
|
||||
entity_type: str
|
||||
entity_id: uuid.UUID
|
||||
file_type: str
|
||||
filename: str
|
||||
mime_type: Optional[str]
|
||||
size: int
|
||||
storage_key: Optional[str]
|
||||
url: Optional[str]
|
||||
uploaded_by: Optional[UserDisplay]
|
||||
uploaded_by_id: Optional[uuid.UUID] = None
|
||||
uploaded_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user