From 1017a10a69837db26393a36d7a471d27b1064d90 Mon Sep 17 00:00:00 2001 From: lahirulakruwan Date: Tue, 23 Jul 2024 14:59:24 +0530 Subject: [PATCH] Consumable weekly report api graphql query changes added --- campus/bffs/asset/api/client.bal | 2 +- campus/bffs/asset/api/types.bal | 2 +- campus/bffs/asset/graphql_client/asset.graphql | 2 +- .../graphql_client/graphql_client_cg_src/client.bal | 2 +- .../graphql_client/graphql_client_cg_src/types.bal | 2 +- .../lib/widgets/resource_allocation_report.dart | 11 +++++------ 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/campus/bffs/asset/api/client.bal b/campus/bffs/asset/api/client.bal index abdd252d..db9d0859 100644 --- a/campus/bffs/asset/api/client.bal +++ b/campus/bffs/asset/api/client.bal @@ -300,7 +300,7 @@ public isolated client class GraphqlClient { } remote isolated function getConsumableWeeklyReport(string from_date, string to_date, int organization_id) returns GetConsumableWeeklyReportResponse|graphql:ClientError { - string query = string `query getConsumableWeeklyReport($organization_id:Int!,$from_date:String!,$to_date:String!) {consumable_weekly_report(organization_id:$organization_id,from_date:$from_date,to_date:$to_date) {id avinya_type {id global_type name} consumable {id name description manufacturer} quantity quantity_in quantity_out resource_property {id property value} updated}}`; + string query = string `query getConsumableWeeklyReport($organization_id:Int!,$from_date:String!,$to_date:String!) {consumable_weekly_report(organization_id:$organization_id,from_date:$from_date,to_date:$to_date) {id avinya_type {id global_type name} consumable {id name description manufacturer} prev_quantity quantity_in quantity_out resource_property {id property value} updated}}`; map variables = {"from_date": from_date, "to_date": to_date, "organization_id": organization_id}; json graphqlResponse = check self.graphqlClient->executeWithType(query, variables); return check performDataBinding(graphqlResponse, GetConsumableWeeklyReportResponse); diff --git a/campus/bffs/asset/api/types.bal b/campus/bffs/asset/api/types.bal index bd707ea9..911a11eb 100644 --- a/campus/bffs/asset/api/types.bal +++ b/campus/bffs/asset/api/types.bal @@ -1119,7 +1119,7 @@ public type GetConsumableWeeklyReportResponse record {| string? description; string? manufacturer; |}? consumable; - anydata? quantity; + anydata? prev_quantity; anydata? quantity_in; anydata? quantity_out; record {| diff --git a/campus/bffs/asset/graphql_client/asset.graphql b/campus/bffs/asset/graphql_client/asset.graphql index adc0edd7..0b09ec86 100644 --- a/campus/bffs/asset/graphql_client/asset.graphql +++ b/campus/bffs/asset/graphql_client/asset.graphql @@ -679,7 +679,7 @@ query getConsumableWeeklyReport($organization_id: Int!,$from_date: String!,$to_d description manufacturer } - quantity + prev_quantity quantity_in quantity_out resource_property{ diff --git a/campus/bffs/asset/graphql_client/graphql_client_cg_src/client.bal b/campus/bffs/asset/graphql_client/graphql_client_cg_src/client.bal index 548772da..5c5b63f3 100644 --- a/campus/bffs/asset/graphql_client/graphql_client_cg_src/client.bal +++ b/campus/bffs/asset/graphql_client/graphql_client_cg_src/client.bal @@ -238,7 +238,7 @@ public isolated client class GraphqlClient { return check performDataBinding(graphqlResponse, GetInventoryDataByOrganizationResponse); } remote isolated function getConsumableWeeklyReport(string from_date, string to_date, int organization_id) returns GetConsumableWeeklyReportResponse|graphql:ClientError { - string query = string `query getConsumableWeeklyReport($organization_id:Int!,$from_date:String!,$to_date:String!) {consumable_weekly_report(organization_id:$organization_id,from_date:$from_date,to_date:$to_date) {id avinya_type {id global_type name} consumable {id name description manufacturer} quantity quantity_in quantity_out resource_property {id property value} updated}}`; + string query = string `query getConsumableWeeklyReport($organization_id:Int!,$from_date:String!,$to_date:String!) {consumable_weekly_report(organization_id:$organization_id,from_date:$from_date,to_date:$to_date) {id avinya_type {id global_type name} consumable {id name description manufacturer} prev_quantity quantity_in quantity_out resource_property {id property value} updated}}`; map variables = {"from_date": from_date, "to_date": to_date, "organization_id": organization_id}; json graphqlResponse = check self.graphqlClient->executeWithType(query, variables); return check performDataBinding(graphqlResponse, GetConsumableWeeklyReportResponse); diff --git a/campus/bffs/asset/graphql_client/graphql_client_cg_src/types.bal b/campus/bffs/asset/graphql_client/graphql_client_cg_src/types.bal index ad7d364a..2ddd2705 100644 --- a/campus/bffs/asset/graphql_client/graphql_client_cg_src/types.bal +++ b/campus/bffs/asset/graphql_client/graphql_client_cg_src/types.bal @@ -1125,7 +1125,7 @@ public type GetConsumableWeeklyReportResponse record {| string? description; string? manufacturer; |}? consumable; - anydata? quantity; + anydata? prev_quantity; anydata? quantity_in; anydata? quantity_out; record {| diff --git a/campus/frontend/lib/avinya/asset_admin/lib/widgets/resource_allocation_report.dart b/campus/frontend/lib/avinya/asset_admin/lib/widgets/resource_allocation_report.dart index a2b1a5d9..74bcb2e8 100644 --- a/campus/frontend/lib/avinya/asset_admin/lib/widgets/resource_allocation_report.dart +++ b/campus/frontend/lib/avinya/asset_admin/lib/widgets/resource_allocation_report.dart @@ -50,7 +50,7 @@ bool organizationsLoaded = false; } setState(() { - assetTypesLoaded = true; + assetTypesLoaded = false; }); } @@ -60,6 +60,7 @@ bool organizationsLoaded = false; setState(() { organizationsLoaded = true; + assetTypesLoaded = true; }); } @@ -170,8 +171,7 @@ bool organizationsLoaded = false; Container( margin: EdgeInsets.only(top: 10), child: SpinKitCircle( - color: (Colors - .blue), // Customize the color of the indicator + color: (Colors.yellow[700]), // Customize the color of the indicator size: 40, // Customize the size of the indicator ), ), @@ -217,12 +217,11 @@ bool organizationsLoaded = false; ); }).toList(), ), - if (!assetTypesLoaded) + if (!assetTypesLoaded) Container( margin: EdgeInsets.only(top: 10), child: SpinKitCircle( - color: (Colors - .blue), // Customize the color of the indicator + color: (Colors.yellow[700]), // Customize the color of the indicator size: 40, // Customize the size of the indicator ), ),