35 lines
758 B
Python
35 lines
758 B
Python
from datetime import datetime
|
|
from typing import List, Optional
|
|
|
|
from beanie import Document
|
|
from pydantic import BaseModel
|
|
from decimal import Decimal
|
|
|
|
from backend.services.project.constants import MilestoneStatus
|
|
|
|
|
|
class Milestone(BaseModel):
|
|
index: int
|
|
status: MilestoneStatus
|
|
description: str
|
|
update_time: datetime
|
|
expected_payment: Decimal
|
|
actual_paid: Decimal
|
|
|
|
|
|
class ProjectDoc(Document):
|
|
product_id: str
|
|
request_id: str
|
|
requester_id: str
|
|
proposal_id: str
|
|
proposer_id: str
|
|
current_milestone: int
|
|
milestones: List[Milestone] = []
|
|
code_depot_id: Optional[str]
|
|
payment_currency: str
|
|
providers: List[str] = []
|
|
issuers: List[str] = []
|
|
|
|
class Settings:
|
|
name = "project_store"
|