Skip to content

Commit

Permalink
Merge pull request #137 from lahirulakruwan/main
Browse files Browse the repository at this point in the history
Previous quantity field changes added
  • Loading branch information
YujithIsura authored Jul 12, 2024
2 parents 77bc483 + 39ca117 commit 875a567
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions api/inventory_data.bal
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public isolated service class InventoryData{
}
}


isolated resource function get prev_quantity() returns decimal?|error {
lock {
return self.inventory.prev_quantity;
}
}

isolated resource function get resource_property() returns ResourcePropertyData|error? {
int id = 0;
lock {
Expand Down
9 changes: 8 additions & 1 deletion api/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -4780,6 +4780,7 @@ lock {
COALESCE(I.quantity, 0.0) AS quantity,
COALESCE(I.quantity_in, 0.0) AS quantity_in,
COALESCE(I.quantity_out, 0.0) AS quantity_out,
COALESCE(I.prev_quantity, 0.0) AS prev_quantity,
RP.id AS resource_property_id,
RP.value AS resource_property_value,
C.name,
Expand Down Expand Up @@ -4810,6 +4811,7 @@ lock {
I.quantity,
I.quantity_in,
I.quantity_out,
I.prev_quantity,
RP.id AS resource_property_id,
RP.value AS resource_property_value,
C.name,
Expand Down Expand Up @@ -4856,7 +4858,8 @@ lock {
I.person_id,
I.quantity,
I.quantity_in,
I.quantity_out,
I.quantity_out,
I.prev_quantity,
RP.id AS resource_property_id,
RP.value AS resource_property_value,
C.name,
Expand Down Expand Up @@ -4920,6 +4923,7 @@ lock {
person_id,
quantity,
quantity_in,
prev_quantity,
created,
updated
) VALUES (
Expand All @@ -4929,6 +4933,7 @@ lock {
${person_id},
${totalQuantity},
${inventory.quantity_in},
${inventory.prev_quantity},
${date},
${date}
);`
Expand Down Expand Up @@ -4964,6 +4969,7 @@ lock {
person_id,
quantity,
quantity_out,
prev_quantity,
created,
updated
) VALUES (
Expand All @@ -4973,6 +4979,7 @@ lock {
${person_id},
${totalQuantity},
${inventory.quantity_out},
${inventory.prev_quantity},
${date},
${date}
);`
Expand Down
1 change: 1 addition & 0 deletions api/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ public type Inventory record {|
decimal? quantity;
decimal? quantity_in;
decimal? quantity_out;
decimal? prev_quantity;
int? resource_property_id;
string? resource_property_value;
string? created;
Expand Down

0 comments on commit 875a567

Please sign in to comment.