You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.7 KiB
Python
84 lines
1.7 KiB
Python
from dataclasses import dataclass
|
|
from datetime import date, datetime
|
|
from enum import Enum
|
|
from typing import Any, Dict, List, Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from src.models import DefultBase, Pagination
|
|
|
|
|
|
class ActivityMaster(DefultBase):
|
|
pass
|
|
|
|
|
|
class ActivityMasterDetail(DefultBase):
|
|
name: str
|
|
|
|
|
|
class ActivityMasterCreate(ActivityMaster):
|
|
description: str
|
|
|
|
|
|
class ActivityMasterTasks(DefultBase):
|
|
description: str
|
|
oh_type: str
|
|
|
|
|
|
class ActivityMasterRead(ActivityMaster):
|
|
id: UUID
|
|
workscope: str
|
|
system: str
|
|
subsystem: str
|
|
tasks: List[ActivityMasterTasks]
|
|
|
|
|
|
class ActivityMasterPagination(Pagination):
|
|
items: List[ActivityMasterRead] = []
|
|
|
|
class ProcurementStatus(Enum):
|
|
PLANNED = "planned"
|
|
ORDERED = "ordered"
|
|
RECEIVED = "received"
|
|
CANCELLED = "cancelled"
|
|
|
|
@dataclass
|
|
class SparepartRequirement:
|
|
"""Sparepart requirement for equipment overhaul"""
|
|
sparepart_id: str
|
|
quantity_required: int
|
|
lead_time: int
|
|
sparepart_name: str
|
|
unit_cost: float
|
|
avg_cost: float
|
|
remark:str
|
|
|
|
@dataclass
|
|
class SparepartStock:
|
|
"""Current sparepart stock information"""
|
|
sparepart_id: str
|
|
sparepart_name: str
|
|
current_stock: int
|
|
unit_cost: float
|
|
location: str
|
|
remark:str
|
|
|
|
@dataclass
|
|
class ProcurementRecord:
|
|
"""Purchase Order/Purchase Request record"""
|
|
po_pr_id: str
|
|
sparepart_id: str
|
|
sparepart_name: str
|
|
quantity: int
|
|
unit_cost: float
|
|
total_cost: float
|
|
order_date: date
|
|
expected_delivery_date: date
|
|
status: ProcurementStatus
|
|
po_vendor_delivery_date: date
|
|
|
|
|
|
class SparepartRemark(DefultBase):
|
|
itemnum: str
|
|
remark:str |