Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consumable module completed #140

Merged
merged 26 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
90590e9
Asset gdapi changes added
lahirulakruwan May 22, 2024
e48302b
Merge pull request #132 from lahirulakruwan/main
YujithIsura May 22, 2024
06d953c
Asset get inventory data api gdapi changes added
lahirulakruwan May 27, 2024
4a4c51a
Merge remote-tracking branch 'upstream/main'
lahirulakruwan May 27, 2024
c9de6cf
Merge pull request #133 from lahirulakruwan/main
YujithIsura May 28, 2024
7cd8cab
Asset Add inventories api function backend development changes added
lahirulakruwan May 30, 2024
8e550db
Merge remote-tracking branch 'upstream/main'
lahirulakruwan May 30, 2024
ccd8d31
Consumable replenishment api changes added
lahirulakruwan Jun 4, 2024
63d36ea
Consumable depletion backend api function changes added
lahirulakruwan Jun 5, 2024
8f25833
Consumable depletion api changes added
lahirulakruwan Jun 11, 2024
e3d3469
Merge pull request #134 from lahirulakruwan/main
YujithIsura Jun 12, 2024
13a0e58
Consumable weekly report backend api changes added
lahirulakruwan Jun 17, 2024
44b478a
Consumable update api functions changes added
lahirulakruwan Jun 21, 2024
25440b3
Consumable monthly report changes added
lahirulakruwan Jun 26, 2024
a85f56a
Merge pull request #135 from lahirulakruwan/main
YujithIsura Jun 26, 2024
7a2096f
Consumable replenishment and depletion changes added
lahirulakruwan Jul 7, 2024
2257bca
Merge remote-tracking branch 'upstream/main'
lahirulakruwan Jul 8, 2024
77bc483
Merge pull request #136 from lahirulakruwan/main
YujithIsura Jul 8, 2024
ec4edfd
Previous quantity field changes added
lahirulakruwan Jul 12, 2024
39ca117
Merge remote-tracking branch 'upstream/main'
lahirulakruwan Jul 12, 2024
875a567
Merge pull request #137 from lahirulakruwan/main
YujithIsura Jul 12, 2024
cb82208
Updated the innventory data by organization method
lahirulakruwan Jul 13, 2024
19c570b
Consumablr add & update replenishment and depletion methods changes a…
lahirulakruwan Jul 16, 2024
ee0fe14
Merge pull request #138 from lahirulakruwan/main
YujithIsura Jul 16, 2024
3116e64
Consumable weekly report api sql query changes added
lahirulakruwan Jul 23, 2024
6078302
Merge pull request #139 from lahirulakruwan/main
YujithIsura Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.8.6"
version = "2.8.7"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down
54 changes: 49 additions & 5 deletions api/inventory_data.bal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public isolated service class InventoryData{
private Inventory inventory;

isolated function init(int id,Inventory? inventory=null) returns error?{
isolated function init(int? id = 0, Inventory? inventory = null) returns error? {
if(inventory != null){
self.inventory = inventory.cloneReadOnly();
return;
Expand Down Expand Up @@ -44,7 +44,6 @@ public isolated service class InventoryData{

}


isolated resource function get asset() returns AssetData|error? {
int id = 0;
lock {
Expand All @@ -67,6 +66,12 @@ public isolated service class InventoryData{
return new ConsumableData(id);
}

isolated resource function get consumable_id() returns int|error? {
lock {
return self.inventory.consumable_id ?: 0;
}
}

isolated resource function get organization() returns OrganizationData|error? {
int id = 0;
lock {
Expand All @@ -89,24 +94,63 @@ public isolated service class InventoryData{
return new PersonData((),id);
}

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

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

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


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 {
id = self.inventory.resource_property_id ?: 0;
if( id == 0) {
return null; // no point in querying if address id is null
}
}
return new ResourcePropertyData(id);
}


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


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


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

isolated resource function get created() returns string?|error {
lock {
return self.inventory.created;
Expand Down
Loading
Loading