initial commit
This commit is contained in:
40
back/app/contract/models.py
Normal file
40
back/app/contract/models.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from beanie import Document
|
||||
|
||||
from ..entity.models import Entity
|
||||
|
||||
|
||||
class ContractType(str, Enum):
|
||||
employment = 'employment'
|
||||
location = 'location'
|
||||
|
||||
|
||||
class ContractStatus(str, Enum):
|
||||
new = 'new'
|
||||
signed = 'signed'
|
||||
in_effect = 'in_effect'
|
||||
executed = 'executed'
|
||||
|
||||
|
||||
class Party(BaseModel):
|
||||
entity: Entity
|
||||
part: str
|
||||
|
||||
|
||||
class Clause(BaseModel):
|
||||
name: str
|
||||
body: str
|
||||
|
||||
|
||||
class Contract(Document):
|
||||
_id: str
|
||||
type: ContractType
|
||||
parties: List[Party]
|
||||
clauses: List[Clause]
|
||||
status: ContractStatus = Field(default=ContractStatus.new)
|
||||
created_at: datetime = Field(default=datetime.utcnow(), nullable=False)
|
||||
updated_at: datetime = Field(default_factory=datetime.utcnow, nullable=False)
|
||||
Reference in New Issue
Block a user