Added test_add_items_to_work_order and fixed Decimal128 in model Workorder #148
No reviewers
Labels
No labels
CI/CD
MongoDB
PostgreSQL
api
authentication
bug
documentation
duplicate
enhancement
example issue
fix
good first issue
help wanted
high-level requirement
infrastructure
invalid
low-level requirement
medium-level requirement
question
security
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AndreFerreira5/starranja!148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "workOrders-quote&item-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added the test_add_items_to_work_order to test adding items to a workworder.
Updated test_update_work_order_success to simulate a more complete quote.
Fixed the error using Decimal128 in the WorkOrder. The model was trying to compare the Decimal 128 with an Int for a validation. The fix was creating a Custom Validators for Decimal128.
Closes #147
@ -51,13 +51,31 @@ class WorkOrderItem(BaseModel):type: WorkOrderItemTypeIn these two validators (
validate_positive_decimalandvalidate_iva_rate) is theclsargument needed? Since it looks like we do not need to access the class model itself, it seems redundant.@ -51,13 +51,31 @@ class WorkOrderItem(BaseModel):type: WorkOrderItemTypeYou are absolutely right. The
clsargument is not necessary and, in fact, it's incorrect to keep it there when using the@staticmethoddecorator.When using
@staticmethod, the function stops receiving the first implicit argument (which would becls).Tank you for your comment.
absolutely exquisite piece of work, approved!