decision book decision book items updated

This commit is contained in:
2024-11-18 12:41:10 +03:00
parent ac20226aa1
commit b4dc24cf50
4 changed files with 31 additions and 26 deletions

View File

@@ -228,10 +228,12 @@ class DecisionBookDecisionBookItemsCreateEventMethods(MethodToEvent):
BuildDecisionBookProjects.build_decision_book_id == decision_book.id,
BuildDecisionBookProjects.project_type
== f"{decision_book.decision_type}_{data_info_type.key}",
system=True
)
management_room = BuildParts.filter_one(
BuildParts.build_id == build_id,
BuildParts.part_no == 0,
system=True
).data
occupant_man = OccupantTypes.filter_by_one(
system=True, occupant_code="MT-VPR", occupant_category_type="MT"
@@ -288,6 +290,8 @@ class DecisionBookDecisionBookItemsCreateEventMethods(MethodToEvent):
status_code=status.HTTP_400_BAD_REQUEST,
detail="BDT-S is not implemented yet. Check info type and try again",
)
elif data_info_type.key == "BDT-I":
return
else:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
@@ -356,7 +360,7 @@ class DecisionBookDecisionBookItemsCreateEventMethods(MethodToEvent):
row_is_debit = str(data_info_type.key).upper() in ["BDT-A", "BDT-D"]
row_is_project = str(data_info_type.key).upper() in ["BDT-R", "BDT-L", "BDT-S"]
debit_dates_required = not data_dict["debit_start_date"] or not data_dict["debit_end_date"]
if any([row_is_debit, row_is_project]) and debit_dates_required:
if row_is_project and debit_dates_required:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="Debit Start Date and Debit End Date is required for this payment type. "