|
|
|
@ -14,6 +14,9 @@ from src.overhaul_activity.utils import get_material_cost, get_service_cost
|
|
|
|
from src.overhaul_scope.model import OverhaulScope
|
|
|
|
from src.overhaul_scope.model import OverhaulScope
|
|
|
|
from src.overhaul_scope.service import get as get_session
|
|
|
|
from src.overhaul_scope.service import get as get_session
|
|
|
|
from src.scope_equipment.model import MasterEquipment
|
|
|
|
from src.scope_equipment.model import MasterEquipment
|
|
|
|
|
|
|
|
from src.job.model import MasterActivity
|
|
|
|
|
|
|
|
from src.scope_equipment_job.model import ScopeEquipmentJob
|
|
|
|
|
|
|
|
from src.overhaul_job.model import OverhaulJob
|
|
|
|
|
|
|
|
|
|
|
|
from .model import OverhaulActivity
|
|
|
|
from .model import OverhaulActivity
|
|
|
|
from .schema import (OverhaulActivityCreate, OverhaulActivityRead,
|
|
|
|
from .schema import (OverhaulActivityCreate, OverhaulActivityRead,
|
|
|
|
@ -50,6 +53,7 @@ async def get_all(
|
|
|
|
.where(OverhaulActivity.overhaul_scope_id == overhaul_session_id)
|
|
|
|
.where(OverhaulActivity.overhaul_scope_id == overhaul_session_id)
|
|
|
|
.options(joinedload(OverhaulActivity.equipment).options(joinedload(MasterEquipment.parent).options(joinedload(MasterEquipment.parent))))
|
|
|
|
.options(joinedload(OverhaulActivity.equipment).options(joinedload(MasterEquipment.parent).options(joinedload(MasterEquipment.parent))))
|
|
|
|
.options(selectinload(OverhaulActivity.overhaul_scope))
|
|
|
|
.options(selectinload(OverhaulActivity.overhaul_scope))
|
|
|
|
|
|
|
|
.options(selectinload(OverhaulActivity.overhaul_jobs).options(joinedload(OverhaulJob.scope_equipment_job).options(joinedload(ScopeEquipmentJob.job))))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if assetnum:
|
|
|
|
if assetnum:
|
|
|
|
@ -73,7 +77,7 @@ async def get_all_by_session_id(*, db_session: DbSession, overhaul_session_id):
|
|
|
|
query = (
|
|
|
|
query = (
|
|
|
|
Select(OverhaulActivity)
|
|
|
|
Select(OverhaulActivity)
|
|
|
|
.where(OverhaulActivity.overhaul_scope_id == overhaul_session_id)
|
|
|
|
.where(OverhaulActivity.overhaul_scope_id == overhaul_session_id)
|
|
|
|
.options(joinedload(OverhaulActivity.equipment).options(MasterEquipment.parent).options(MasterEquipment.parent))
|
|
|
|
.options(joinedload(OverhaulActivity.equipment).options(joinedload(MasterEquipment.parent).options(joinedload(MasterEquipment.parent))))
|
|
|
|
.options(selectinload(OverhaulActivity.overhaul_scope))
|
|
|
|
.options(selectinload(OverhaulActivity.overhaul_scope))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|