-
Notifications
You must be signed in to change notification settings - Fork 20
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
Develop #931
Develop #931
Conversation
Added Mdms-migration-tollkit
ISTE-389 adding missing Ledger report label
Report fixes and frontend
[ISTE-357] - created new table to store duplicate calls for bill
Update V20240821000600__wsc_bulk_create_ddl.sql
updated createdtime configuration
[ISTE-357] - updated createdtime
…--btn-fix Google play update and back btn fix
…--btn-fix Home card key removed (checking)
WalkthroughThe recent changes encompass updates to both the frontend and backend components of the application. Key modifications include enhancements to the Android SDK configuration, the introduction of new classes and methods for managing bulk demand processes, and improvements in navigation handling across various screens. Additionally, several UI components have been refined to enhance user experience, while configuration files have been updated to support new features and functionalities. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 29
Outside diff range, codebase verification and nitpick comments (12)
municipal-services/ws-calculator/src/main/resources/db/migration/ddl/V20240826000600__wsc_bulk_create_ddl.sql (2)
4-4
: Missing default value forcreatedTime
columnThe
createdTime
column is added with aBIGINT NOT NULL
constraint, but there is no default value specified. This could lead to issues with existing rows in theeg_ws_bulk_demand_batch
table. Consider setting a default value to ensure data integrity.Analysis chain
Verify the default value for the
createdTime
column.Ensure that all existing rows have a valid value for the
createdTime
column when adding it with aNOT NULL
constraint.Run the following script to verify the default value for the
createdTime
column:Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the default value for the `createdTime` column. # Test: Check if the `createdTime` column has a default value. Expect: A default value is set. rg --type sql 'createdTime BIGINT NOT NULL'Length of output: 231
2-2
: Dropping thecreatedTime
column may cause issues.The
createdTime
column is actively used in the codebase, particularly in theWSCalculationDaoImpl
class, where it is part of an SQL update query. Dropping this column without addressing its usage could lead to runtime errors or broken functionality.
- Location of concern:
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/WSCalculationDaoImpl.java
Please ensure that all references to the
createdTime
column are appropriately handled before proceeding with its removal.Analysis chain
Verify the impact of dropping the
createdTime
column.Ensure that the
createdTime
column is not used elsewhere in the codebase before dropping it.Run the following script to verify the usage of the
createdTime
column:Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the `createdTime` column in the codebase. # Test: Search for the `createdTime` column usage. Expect: No occurrences. rg --type sql --type java --type xml 'createdTime'Length of output: 20022
utilities/mdms-migration/output/README.md (2)
13-13
: Fix grammatical error.Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound.
- Start your server as an simple java application + Start your server as a simple java applicationTools
LanguageTool
[misspelling] ~13-~13: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...gfox/springfox) Start your server as an simple java application You can view...(EN_A_VS_AN)
15-16
: Fix bare URL.Use Markdown syntax to format the URL.
- http://localhost:8080/ + [http://localhost:8080/](http://localhost:8080/)Tools
Markdownlint
16-16: null
Bare URL used(MD034, no-bare-urls)
utilities/mdms-migration/output/src/main/java/digit/web/models/MasterDataMigrationRequest.java (2)
1-1
: Consider adding a license header.It's a good practice to include a license header at the top of the file.
19-19
: Remove autogenerated annotation.The
@Generated
annotation is typically used to indicate that the class was generated by a tool. If this class is not autogenerated, consider removing this annotation.utilities/mdms-migration/output/src/main/java/digit/util/ResponseInfoFactory.java (1)
1-1
: Consider adding a license header.It's a good practice to include a license header at the top of the file.
utilities/mdms-migration/output/src/main/java/digit/util/FileWriter.java (1)
1-1
: Consider adding a license header.It's a good practice to include a license header at the top of the file.
utilities/mdms-migration/output/src/main/java/digit/web/models/Mdms.java (1)
1-1
: Add a class-level Javadoc comment.Consider adding a Javadoc comment to describe the purpose of the
Mdms
class.utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinitionResponse.java (1)
1-1
: Add a class-level Javadoc comment.Consider adding a Javadoc comment to describe the purpose of the
SchemaDefinitionResponse
class.frontend/mgramseva/lib/widgets/common_success_page.dart (1)
38-47
: Add documentation.The method should include documentation to explain the purpose and behavior of the
PopScope
widget.Apply this diff to add documentation:
@override Widget build(BuildContext context) { + // The PopScope widget is used to manage the back navigation behavior. + // The canPop property is set to false to prevent popping the current route. + // The onPopInvoked callback is used to handle the pop event. return PopScope( canPop: false, onPopInvoked: (didPop) async { if (didPop) { CommonMethods.home(); return; } }, child: Scaffold(frontend/mgramseva/lib/screeens/household_register/household_register.dart (1)
53-56
: Add documentation.The method should include documentation to explain the purpose and behavior of the
PopScope
widget.Apply this diff to add documentation:
@override Widget build(BuildContext context) { + // The PopScope widget is used to manage the back navigation behavior. + // The canPop property is set to false to prevent popping the current route. + // The onPopInvoked callback is used to handle the pop event. return PopScope( canPop: householdRegisterProvider.removeOverLay(_overlayEntry) ? false: true, onPopInvoked : (didPop){ },
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (78)
- frontend/mgramseva/android/app/build.gradle (3 hunks)
- frontend/mgramseva/lib/components/dashboard/bills_table.dart (2 hunks)
- frontend/mgramseva/lib/main.dart (3 hunks)
- frontend/mgramseva/lib/providers/common_provider.dart (15 hunks)
- frontend/mgramseva/lib/providers/consumer_details_provider.dart (1 hunks)
- frontend/mgramseva/lib/providers/reports_provider.dart (6 hunks)
- frontend/mgramseva/lib/screeens/dashboard/dashboard.dart (1 hunks)
- frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart (1 hunks)
- frontend/mgramseva/lib/screeens/home/home.dart (2 hunks)
- frontend/mgramseva/lib/screeens/home/home_card.dart (1 hunks)
- frontend/mgramseva/lib/screeens/household_register/household_register.dart (1 hunks)
- frontend/mgramseva/lib/screeens/leadger_report/ledger_report.dart (1 hunks)
- frontend/mgramseva/lib/utils/common_methods.dart (4 hunks)
- frontend/mgramseva/lib/utils/constants.dart (1 hunks)
- frontend/mgramseva/lib/utils/loaders.dart (4 hunks)
- frontend/mgramseva/lib/widgets/common_success_page.dart (1 hunks)
- frontend/mgramseva/lib/widgets/custom_app_bar.dart (4 hunks)
- frontend/mgramseva/lib/widgets/error_page.dart (2 hunks)
- frontend/micro-ui/web/.babelrc (1 hunks)
- frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss (1 hunks)
- frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js (2 hunks)
- frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js (2 hunks)
- frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js (1 hunks)
- frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TopBar.js (3 hunks)
- frontend/micro-ui/web/public/index.html (1 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java (1 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/WSCalculationDao.java (2 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/WSCalculationDaoImpl.java (3 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/builder/WSCalculatorQueryBuilder.java (3 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java (2 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/WSCalculationServiceImpl.java (3 hunks)
- municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/web/models/BulkDemandBatch.java (1 hunks)
- municipal-services/ws-calculator/src/main/resources/application.properties (1 hunks)
- municipal-services/ws-calculator/src/main/resources/db/migration/ddl/V20240821000600__wsc_bulk_create_ddl.sql (1 hunks)
- municipal-services/ws-calculator/src/main/resources/db/migration/ddl/V20240826000600__wsc_bulk_create_ddl.sql (1 hunks)
- utilities/mdms-migration/mdms-migration-toolkit.yaml (1 hunks)
- utilities/mdms-migration/output/README.md (1 hunks)
- utilities/mdms-migration/output/pom.xml (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/Main.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/config/Configuration.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/config/MainConfiguration.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/constants/ErrorCodes.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/constants/MDMSMigrationToolkitConstants.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/kafka/Consumer.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/kafka/Producer.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/repository/ServiceRequestRepository.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/service/MDMSApplicationRunnerImpl.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/service/MasterDataMigrationService.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/service/SchemaDefinitionMigrationService.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/FileReader.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/FileWriter.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/IdgenUtil.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/MdmsUtil.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/ResponseInfoFactory.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/UrlShortenerUtil.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/UserUtil.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/util/WorkflowUtil.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/controllers/DataApiController.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/controllers/SchemaApiController.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/Error.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/ErrorRes.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/MasterDataMigrationCriteria.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/MasterDataMigrationRequest.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/Mdms.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/MdmsRequest.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/RequestInfoWrapper.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/ResponseInfo.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/Role.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinition.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinitionRequest.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinitionResponse.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaMigrationCriteria.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaMigrationRequest.java (1 hunks)
- utilities/mdms-migration/output/src/main/java/digit/web/models/User.java (1 hunks)
- utilities/mdms-migration/output/src/main/resources/application.properties (1 hunks)
- utilities/mdms-migration/output/src/test/java/digit/TestConfiguration.java (1 hunks)
- utilities/mdms-migration/output/src/test/java/digit/web/controllers/DataApiControllerTest.java (1 hunks)
- utilities/mdms-migration/output/src/test/java/digit/web/controllers/SchemaApiControllerTest.java (1 hunks)
Files skipped from review due to trivial changes (11)
- frontend/mgramseva/lib/main.dart
- frontend/mgramseva/lib/screeens/home/home_card.dart
- frontend/mgramseva/lib/utils/constants.dart
- frontend/micro-ui/web/.babelrc
- frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js
- frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/OpenLinkContainer.js
- frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/TopBar.js
- frontend/micro-ui/web/public/index.html
- utilities/mdms-migration/output/src/main/java/digit/constants/ErrorCodes.java
- utilities/mdms-migration/output/src/main/java/digit/constants/MDMSMigrationToolkitConstants.java
- utilities/mdms-migration/output/src/test/java/digit/TestConfiguration.java
Additional context used
LanguageTool
utilities/mdms-migration/output/README.md
[misspelling] ~13-~13: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...gfox/springfox) Start your server as an simple java application You can view...(EN_A_VS_AN)
Markdownlint
utilities/mdms-migration/output/README.md
16-16: null
Bare URL used(MD034, no-bare-urls)
yamllint
utilities/mdms-migration/mdms-migration-toolkit.yaml
[error] 63-63: trailing spaces
(trailing-spaces)
[error] 111-111: no new line character at the end of file
(new-line-at-end-of-file)
[error] 111-111: trailing spaces
(trailing-spaces)
checkov
utilities/mdms-migration/mdms-migration-toolkit.yaml
[HIGH] 1-112: Ensure that the global security field has rules defined
(CKV_OPENAPI_4)
[HIGH] 1-112: Ensure that security operations is not empty.
(CKV_OPENAPI_5)
Additional comments not posted (177)
municipal-services/ws-calculator/src/main/resources/db/migration/ddl/V20240826000600__wsc_bulk_create_ddl.sql (2)
6-6
: Verify the impact of changing the column type forlastModifiedBy
.Ensure that the data stored in the
lastModifiedBy
column is compatible with the new typeVARCHAR(64)
.Run the following script to verify the impact of changing the column type:
8-8
: Verify the default value for thelastModifiedTime
column.Ensure that all existing rows have a valid value for the
lastModifiedTime
column when setting it asNOT NULL
.Run the following script to verify the default value for the
lastModifiedTime
column:utilities/mdms-migration/output/src/main/java/digit/web/models/RequestInfoWrapper.java (1)
1-18
: LGTM!The class is well-structured and uses Lombok annotations to reduce boilerplate code. The
JsonProperty
annotation ensures proper serialization and deserialization.The code changes are approved.
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/web/models/BulkDemandBatch.java (1)
1-23
: LGTM!The class is well-structured and uses Lombok annotations to reduce boilerplate code. The fields cover essential information for a bulk demand batch.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/kafka/Producer.java (4)
1-6
: LGTM!The package and import statements are correct and necessary for the functionality.
The code changes are approved.
10-12
: LGTM!The class-level annotations and class definition are correct and follow best practices.
The code changes are approved.
14-15
: LGTM!The field-level annotations and field definition are correct and necessary for the functionality.
The code changes are approved.
17-19
: LGTM!The method definition is correct and follows best practices.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/kafka/Consumer.java (3)
1-7
: LGTM!The package and import statements are correct and necessary for the functionality.
The code changes are approved.
8-9
: LGTM!The class-level annotations and class definition are correct and follow best practices.
The code changes are approved.
16-20
: LGTM!The method-level comments and method definition are correct, but the method is not yet implemented.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/Main.java (3)
1-9
: LGTM!The package and import statements are correct and necessary for the functionality.
The code changes are approved.
10-13
: LGTM!The class-level annotations and class definition are correct and follow best practices.
The code changes are approved.
16-18
: LGTM!The method definition is correct and follows best practices.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/MdmsRequest.java (3)
1-11
: LGTM!The package declaration and imports are standard and correctly implemented.
The code changes are approved.
12-17
: LGTM!The class annotations and declaration are correctly implemented.
The code changes are approved.
19-25
: LGTM!The fields and their annotations are correctly implemented.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinitionRequest.java (3)
1-10
: LGTM!The package declaration and imports are standard and correctly implemented.
The code changes are approved.
11-17
: LGTM!The class annotations and declaration are correctly implemented.
The code changes are approved.
18-26
: LGTM!The fields and their annotations are correctly implemented.
The code changes are approved.
utilities/mdms-migration/output/README.md (1)
18-18
: LGTM!The content is informative and correctly implemented.
The code changes are approved.
municipal-services/ws-calculator/src/main/resources/db/migration/ddl/V20240821000600__wsc_bulk_create_ddl.sql (5)
1-11
: Improve table schema and ensure consistency.
- Ensure that
tenantId
andbillingPeriod
columns have appropriate constraints (e.g., foreign keys).- The
lastModifiedBy
column is of typebigint
whilecreatedBy
is of typecharacter varying(64)
, which might be inconsistent. Ensure consistency in data types.- Consider adding comments to describe the purpose of each column.
CREATE TABLE IF NOT EXISTS eg_ws_bulk_demand_batch ( id VARCHAR(64) PRIMARY KEY, tenantId VARCHAR(64) NOT NULL, billingPeriod VARCHAR(64) NOT NULL, createdTime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, status VARCHAR(50) NOT NULL, createdBy character varying(64) NOT NULL, lastModifiedBy character varying(64) NOT NULL, -- Changed to match createdBy lastModifiedTime TIMESTAMP -- Changed to TIMESTAMP for consistency );
12-17
: LGTM!The sequence creation statement is correctly implemented.
The code changes are approved.
18-18
: LGTM!The alter table statement is correctly implemented.
The code changes are approved.
20-20
: LGTM!The index creation statement is correctly implemented.
The code changes are approved.
21-21
: LGTM!The index creation statement is correctly implemented.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaMigrationCriteria.java (1)
1-33
: Improve validation and documentation.
- Ensure that the
tenantId
property is validated for length and format.- Consider adding comments to describe the purpose of the class and its properties.
package digit.web.models; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.*; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Data; import lombok.Builder; /** * SchemaMigrationCriteria */ @Validated @javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-06-20T09:54:35.237+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor @Builder public class SchemaMigrationCriteria { @JsonProperty("tenantId") @NotNull @Size(min = 1, max = 64) // Added length validation private String tenantId = null; }utilities/mdms-migration/output/src/main/java/digit/web/models/MasterDataMigrationCriteria.java (1)
1-36
: Improve validation and documentation.
- Ensure that the
tenantId
property is validated for format.- Consider adding comments to describe the purpose of the class and its properties.
package digit.web.models; import java.util.List; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.v3.oas.annotations.media.Schema; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.*; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.Data; import lombok.Builder; /** * MasterDataMigrationCriteria */ @Validated @javax.annotation.Generated(value = "org.egov.codegen.SpringBootCodegen", date = "2023-06-20T09:54:35.237+05:30[Asia/Calcutta]") @Data @AllArgsConstructor @NoArgsConstructor @Builder public class MasterDataMigrationCriteria { @JsonProperty("tenantId") @NotNull @Size(min = 1, max = 2000) @Pattern(regexp = "^[a-zA-Z0-9-]+$") // Added format validation private List<String> tenantId = null; }utilities/mdms-migration/output/src/main/java/digit/web/models/MasterDataMigrationRequest.java (4)
18-18
: Ensure proper validation.The
@Validated
annotation ensures that the fields are validated. Ensure that the validation logic is correctly implemented in theMasterDataMigrationCriteria
andRequestInfo
classes.
20-23
: LGTM!The Lombok annotations (
@Data
,@AllArgsConstructor
,@NoArgsConstructor
,@Builder
) are correctly used to generate boilerplate code.
25-27
: EnsureMasterDataMigrationCriteria
is correctly defined.The
masterDataMigrationCriteria
field is annotated with@JsonProperty
and@Valid
. Ensure that theMasterDataMigrationCriteria
class is correctly defined and validated.
29-32
: LGTM!The
requestInfo
field is annotated with@JsonProperty
,@NotNull
, and@Valid
. The annotations are correctly used to ensure that the field is not null and is validated.utilities/mdms-migration/output/src/main/java/digit/util/ResponseInfoFactory.java (1)
21-22
: LGTM!The method correctly creates a
ResponseInfo
object from theRequestInfo
object.utilities/mdms-migration/output/src/main/java/digit/util/FileWriter.java (1)
20-21
: Ensure the property is correctly defined.The
masterSchemaFilesDirectory
property is injected using@Value
. Ensure that the property is correctly defined in the configuration files.utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaMigrationRequest.java (1)
1-39
: LGTM!The class is correctly implemented with appropriate annotations and validation.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinition.java (1)
1-52
: LGTM!The class is correctly implemented with appropriate annotations and validation.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/Mdms.java (8)
3-5
: Ensure proper import organization.The imports are well-organized and relevant to the class.
17-21
: Annotations for validation and Lombok.The class is annotated with
@Validated
,@Data
,@AllArgsConstructor
,@NoArgsConstructor
, and@Builder
, which are appropriate for this data model.
23-26
: PropertytenantId
should be non-null and have a size constraint.The
tenantId
property is correctly annotated with@JsonProperty
,@NotNull
, and@Size
to ensure it meets the required constraints.
28-30
: PropertyschemaCode
should have a size constraint.The
schemaCode
property is correctly annotated with@JsonProperty
and@Size
to ensure it meets the required constraints.
32-34
: PropertyuniqueIdentifier
should have a size constraint.The
uniqueIdentifier
property is correctly annotated with@JsonProperty
and@Size
to ensure it meets the required constraints.
36-38
: Propertydata
should be non-null.The
data
property is correctly annotated with@JsonProperty
and@NotNull
to ensure it meets the required constraints.
40-41
: PropertyisActive
should have a default value.The
isActive
property is correctly annotated with@JsonProperty
and has a default value oftrue
.
43-45
: PropertyauditDetails
should be valid.The
auditDetails
property is correctly annotated with@JsonProperty
and@Valid
to ensure it meets the required constraints.utilities/mdms-migration/output/src/main/java/digit/web/models/SchemaDefinitionResponse.java (6)
3-5
: Ensure proper import organization.The imports are well-organized and relevant to the class.
16-19
: Class-level Javadoc comment.The class has a Javadoc comment describing it as a response from the server, which is helpful for understanding its purpose.
20-25
: Annotations for validation and Lombok.The class is annotated with
@Schema
,@Validated
,@Data
,@AllArgsConstructor
,@NoArgsConstructor
, and@Builder
, which are appropriate for this data model.
27-30
: PropertyresponseInfo
should be valid.The
responseInfo
property is correctly annotated with@JsonProperty
and@Valid
to ensure it meets the required constraints.
32-34
: PropertyschemaDefinitions
should be valid.The
schemaDefinitions
property is correctly annotated with@JsonProperty
and@Valid
to ensure it meets the required constraints.
37-43
: MethodaddSchemaDefinitionsItem
should handle null list.The
addSchemaDefinitionsItem
method correctly handles the case whereschemaDefinitions
is null by initializing it as a newArrayList
.municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/WSCalculationDao.java (3)
33-33
: MethodisDuplicateBulkDemandCall
should handle potential null values.Ensure that the implementation of this method handles potential null values for
tenantId
,billingPeriod
, andfromTime
.
35-35
: MethodinsertBulkDemandCall
should handle potential null values.Ensure that the implementation of this method handles potential null values for
tenantId
,billingPeriod
,status
, andauditDetails
.
37-37
: MethodupdateStatusForOldRecords
should handle potential null values.Ensure that the implementation of this method handles potential null values for
tenantId
,durationAgo
,billingPeriod
, andauditDetails
.utilities/mdms-migration/output/src/main/java/digit/repository/ServiceRequestRepository.java (2)
4-14
: LGTM!The imports are appropriate and necessary for the class functionality.
The code changes are approved.
15-45
: LGTM!The class is well-structured and follows Spring's dependency injection principles.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/Role.java (2)
3-9
: LGTM!The imports are appropriate and necessary for the class functionality.
The code changes are approved.
15-44
: LGTM!The class is well-structured and follows best practices for model classes.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/util/FileReader.java (2)
3-19
: LGTM!The imports are appropriate and necessary for the class functionality.
The code changes are approved.
21-47
: LGTM!The class is well-structured and follows Spring's dependency injection principles.
The code changes are approved.
utilities/mdms-migration/output/src/test/java/digit/web/controllers/DataApiControllerTest.java (4)
1-26
: LGTM!The imports are appropriate and necessary for the test class.
The code changes are approved.
27-34
: LGTM!The class definition and annotations are appropriate for the test class.
The code changes are approved.
39-44
: LGTM!The method is correctly implemented to test the success scenario.
The code changes are approved.
46-51
: LGTM!The method is correctly implemented to test the failure scenario.
The code changes are approved.
utilities/mdms-migration/output/src/test/java/digit/web/controllers/SchemaApiControllerTest.java (4)
1-26
: LGTM!The imports are appropriate and necessary for the test class.
The code changes are approved.
27-34
: LGTM!The class definition and annotations are appropriate for the test class.
The code changes are approved.
39-44
: LGTM!The method is correctly implemented to test the success scenario.
The code changes are approved.
46-51
: LGTM!The method is correctly implemented to test the failure scenario.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/ErrorRes.java (2)
1-18
: LGTM!The imports are appropriate and necessary for the class.
The code changes are approved.
19-49
: LGTM!The class definition and annotations are appropriate for the model class. The
addErrorsItem
method is correctly implemented.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/Error.java (4)
1-15
: LGTM!The package and import statements are appropriate and necessary for the functionality of the
Error
class.The code changes are approved.
17-27
: LGTM!The class-level annotations and documentation are appropriate and provide necessary metadata for the
Error
class.The code changes are approved.
28-44
: LGTM!The property declarations and annotations are appropriate for the
Error
class.The code changes are approved.
47-53
: LGTM!The
addParamsItem
method is correctly implemented and handles null initialization.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/util/IdgenUtil.java (3)
1-19
: LGTM!The package and import statements are appropriate and necessary for the functionality of the
IdgenUtil
class.The code changes are approved.
20-30
: LGTM!The class-level annotations and member variables are appropriate and provide necessary dependencies for the
IdgenUtil
class.The code changes are approved.
32-48
: Add error handling forfetchResult
call.The
getIdList
method is correctly implemented but lacks error handling for thefetchResult
call. Consider adding a try-catch block to handle potential exceptions.public List<String> getIdList(RequestInfo requestInfo, String tenantId, String idName, String idformat, Integer count) { List<IdRequest> reqList = new ArrayList<>(); for (int i = 0; i < count; i++) { reqList.add(IdRequest.builder().idName(idName).format(idformat).tenantId(tenantId).build()); } IdGenerationRequest request = IdGenerationRequest.builder().idRequests(reqList).requestInfo(requestInfo).build(); StringBuilder uri = new StringBuilder(configs.getIdGenHost()).append(configs.getIdGenPath()); - IdGenerationResponse response = mapper.convertValue(restRepo.fetchResult(uri, request), IdGenerationResponse.class); + IdGenerationResponse response; + try { + response = mapper.convertValue(restRepo.fetchResult(uri, request), IdGenerationResponse.class); + } catch (Exception e) { + throw new CustomException("IDGEN ERROR", "Error while fetching result from idgen Service: " + e.getMessage()); + } List<IdResponse> idResponses = response.getIdResponses(); if (CollectionUtils.isEmpty(idResponses)) throw new CustomException("IDGEN ERROR", "No ids returned from idgen Service"); return idResponses.stream().map(IdResponse::getId).collect(Collectors.toList()); }frontend/micro-ui/web/micro-ui-internals/packages/css/src/components/topbar.scss (2)
Line range hint
1-100
: LGTM!The existing CSS rules are appropriate for the topbar component.
The code changes are approved.
101-104
: LGTM!The new CSS rule is appropriate and ensures that
.rmv-padding
and.employee-select-wrap
elements will not have any bottom margin.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/config/MainConfiguration.java (6)
3-18
: LGTM!The import statements are appropriate and necessary for the functionality provided in the file.
The code changes are approved.
25-26
: LGTM!The field is correctly defined to inject the application timezone.
The code changes are approved.
28-31
: LGTM!The method is correctly implemented to set the default timezone.
The code changes are approved.
33-40
: LGTM!The method is correctly implemented to provide a
JsonSchemaInferrer
bean.The code changes are approved.
43-45
: LGTM!The method is correctly implemented to provide a configured
ObjectMapper
.The code changes are approved.
47-53
: LGTM!The method is correctly implemented to provide a
MappingJackson2HttpMessageConverter
bean.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/controllers/SchemaApiController.java (4)
4-26
: LGTM!The import statements are appropriate and necessary for the functionality provided in the file.
The code changes are approved.
33-43
: LGTM!The fields are correctly defined and initialized via constructor injection.
The code changes are approved.
46-50
: LGTM!The method is correctly implemented to handle the request and call the service method.
The code changes are approved.
52-56
: LGTM!The method is correctly implemented to handle the request and call the service method.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/controllers/DataApiController.java (3)
4-33
: LGTM!The import statements are appropriate and necessary for the functionality provided in the file.
The code changes are approved.
40-47
: LGTM!The fields are correctly defined and initialized via constructor injection.
The code changes are approved.
50-54
: LGTM!The method is correctly implemented to handle the request and call the service method.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/config/Configuration.java (9)
3-15
: LGTM!The import statements are appropriate and necessary for the functionality provided in the class.
The code changes are approved.
16-23
: LGTM!The class annotations and declaration are appropriate and necessary for the functionality provided in the class.
The code changes are approved.
26-40
: LGTM!The User Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
43-48
: LGTM!The Idgen Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
51-62
: LGTM!The Workflow Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
65-70
: LGTM!The MDMS Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
73-78
: LGTM!The HRMS Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
81-86
: LGTM!The URLShortening Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
89-91
: LGTM!The SMSNotification Config section is appropriately defined with necessary configuration properties.
The code changes are approved.
frontend/mgramseva/android/app/build.gradle (3)
36-36
: LGTM!The
compileSdkVersion
has been appropriately updated to the latest SDK version.The code changes are approved.
45-45
: LGTM!The
minSdkVersion
has been appropriately set to 21, clarifying the minimum supported version for the application.The code changes are approved.
68-68
: LGTM!The
minifyEnabled
has been appropriately set to true for the release build type, indicating that code shrinking will be applied during the release build process.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/ResponseInfo.java (6)
3-15
: LGTM!The import statements are appropriate and necessary for the functionality provided in the class.
The code changes are approved.
16-25
: LGTM!The class annotations and declaration are appropriate and necessary for the functionality provided in the class.
The code changes are approved.
27-30
: LGTM!The
apiId
property is appropriately defined with necessary annotations.The code changes are approved.
32-35
: LGTM!The
ver
property is appropriately defined with necessary annotations.The code changes are approved.
37-40
: LGTM!The
ts
property is appropriately defined with necessary annotations.The code changes are approved.
42-82
: LGTM!The
resMsgId
,msgId
, andstatus
properties are appropriately defined with necessary annotations.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/util/MdmsUtil.java (1)
54-77
: LGTM!The method is correctly implemented.
The code changes are approved.
frontend/mgramseva/lib/widgets/error_page.dart (1)
20-26
: LGTM! But verify theCommonMethods.home()
method.The changes improve the handling of back navigation. Ensure that the
CommonMethods.home()
method handles navigation correctly.The code changes are approved.
Run the following script to verify the
CommonMethods.home()
method:frontend/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ChangeCity.js (2)
57-57
: LGTM!The changes improve the robustness of the code.
The code changes are approved.
84-87
: LGTM!The changes enhance the user experience by preventing the dropdown from becoming excessively large or small.
The code changes are approved.
utilities/mdms-migration/output/src/main/resources/application.properties (10)
23-29
: Ensure Kafka configurations are correct.Verify that the Kafka configurations are correct and appropriate for the application. Consider using environment variables for sensitive information.
Ensure that the Kafka configurations are correct and appropriate for the application.
44-49
: Verify localization configurations.Ensure that the localization configurations are correct and appropriate for the application.
Ensure that the localization configurations are correct and appropriate for the application.
51-56
: Verify MDMS and HRMS configurations.Ensure that the MDMS and HRMS configurations are correct and appropriate for the application.
Ensure that the MDMS and HRMS configurations are correct and appropriate for the application.
59-63
: Verify user configurations.Ensure that the user configurations are correct and appropriate for the application.
Ensure that the user configurations are correct and appropriate for the application.
66-67
: Verify ID generation configurations.Ensure that the ID generation configurations are correct and appropriate for the application.
Ensure that the ID generation configurations are correct and appropriate for the application.
70-74
: Verify workflow configurations.Ensure that the workflow configurations are correct and appropriate for the application.
Ensure that the workflow configurations are correct and appropriate for the application.
77-78
: Verify URL shortener configurations.Ensure that the URL shortener configurations are correct and appropriate for the application.
Ensure that the URL shortener configurations are correct and appropriate for the application.
80-84
: Verify Kafka topics configurations.Ensure that the Kafka topics configurations are correct and appropriate for the application.
Ensure that the Kafka topics configurations are correct and appropriate for the application.
86-88
: Verify MDMS configuration path and URL.Ensure that the MDMS configuration path and URL are correct and appropriate for the application.
Ensure that the MDMS configuration path and URL are correct and appropriate for the application.
90-90
: Verify master schema files directory.Ensure that the master schema files directory is correct and appropriate for the application.
Ensure that the master schema files directory is correct and appropriate for the application.
utilities/mdms-migration/mdms-migration-toolkit.yaml (5)
1-8
: Ensure API information is correct.Verify that the API information, including title, description, contact, and version, is correct and appropriate for the application.
Ensure that the API information is correct and appropriate for the application.
Tools
checkov
[HIGH] 1-112: Ensure that the global security field has rules defined
(CKV_OPENAPI_4)
[HIGH] 1-112: Ensure that security operations is not empty.
(CKV_OPENAPI_5)
10-35
: Ensure schema migration API specifications are correct.Verify that the schema migration API specifications, including paths, request body, and responses, are correct and appropriate for the application.
Ensure that the schema migration API specifications are correct and appropriate for the application.
37-63
: Ensure master data migration API specifications are correct.Verify that the master data migration API specifications, including paths, request body, and responses, are correct and appropriate for the application.
Ensure that the master data migration API specifications are correct and appropriate for the application.
Tools
yamllint
[error] 63-63: trailing spaces
(trailing-spaces)
65-93
: Ensure schema and master data migration criteria are correct.Verify that the schema and master data migration criteria, including required fields and properties, are correct and appropriate for the application.
Ensure that the schema and master data migration criteria are correct and appropriate for the application.
95-111
: Ensure schema and master data migration request specifications are correct.Verify that the schema and master data migration request specifications, including required fields and properties, are correct and appropriate for the application.
Ensure that the schema and master data migration request specifications are correct and appropriate for the application.
Tools
yamllint
[error] 111-111: no new line character at the end of file
(new-line-at-end-of-file)
[error] 111-111: trailing spaces
(trailing-spaces)
utilities/mdms-migration/output/src/main/java/digit/util/UserUtil.java (4)
91-100
: LGTM!The method is correctly implemented.
The code changes are approved.
109-116
: LGTM!The method is correctly implemented.
The code changes are approved.
123-129
: LGTM!The method is correctly implemented.
The code changes are approved.
31-35
: Remove redundant field initialization.The fields
mapper
andserviceRequestRepository
are already initialized by dependency injection. Remove the redundant field initialization in the constructor.@Autowired public UserUtil(ObjectMapper mapper, ServiceRequestRepository serviceRequestRepository) { - this.mapper = mapper; - this.serviceRequestRepository = serviceRequestRepository; }Likely invalid or redundant comment.
utilities/mdms-migration/output/pom.xml (3)
1-7
: LGTM!The project metadata section is correctly implemented.
The code changes are approved.
8-12
: LGTM!The properties section is correctly implemented.
The code changes are approved.
13-17
: LGTM!The parent section is correctly implemented.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/web/models/User.java (3)
1-28
: LGTM!The class-level annotations and metadata are correctly implemented.
The code changes are approved.
30-189
: LGTM!The field declarations and annotations are correctly implemented.
The code changes are approved.
192-195
: LGTM!The method is correctly implemented.
The code changes are approved.
municipal-services/ws-calculator/src/main/resources/application.properties (1)
170-170
: LGTM!The new property
bulk.demand.duplicateCheck.duration.hours
is appropriately named and the value is set correctly.The code changes are approved.
frontend/mgramseva/lib/utils/loaders.dart (4)
20-21
: LGTM!The use of
PopScope
withcanPop: false
is appropriate for a loading dialog to prevent dismissal.The code changes are approved.
63-70
: LGTM!The use of
PopScope
withcanPop: false
andcanPop: true
appropriately controls the dismissal behavior of the dialog.The code changes are approved.
95-102
: LGTM!The use of
PopScope
withcanPop: false
andcanPop: true
appropriately controls the dismissal behavior of the dialog.The code changes are approved.
135-142
: LGTM!The use of
PopScope
withcanPop: false
andcanPop: true
appropriately controls the dismissal behavior of the dialog.The code changes are approved.
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java (1)
277-278
: LGTM!The new field
duplicateBulkDemandDurationHours
is appropriately named and the@Value
annotation is correctly used.The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/util/WorkflowUtil.java (6)
39-55
: LGTM!The method is correctly implemented with proper error handling.
The code changes are approved.
68-76
: LGTM!The method is correctly implemented.
The code changes are approved.
84-92
: LGTM!The method is correctly implemented.
The code changes are approved.
104-129
: LGTM!The method is correctly implemented with proper handling of user assignments.
The code changes are approved.
136-158
: LGTM!The method is correctly implemented.
The code changes are approved.
165-171
: LGTM!The method is correctly implemented.
The code changes are approved.
frontend/mgramseva/lib/screeens/home/home.dart (1)
42-50
: LGTM!The changes enhance the functionality of the method by updating the app bar based on the common provider's state.
The code changes are approved.
utilities/mdms-migration/output/src/main/java/digit/service/MDMSApplicationRunnerImpl.java (2)
198-200
: LGTM!The method is correctly implemented.
The code changes are approved.
202-204
: LGTM!The method is correctly implemented.
The code changes are approved.
frontend/mgramseva/lib/components/dashboard/bills_table.dart (1)
132-134
: LGTM!The conditional rendering is correctly implemented.
The code changes are approved.
frontend/mgramseva/lib/screeens/leadger_report/ledger_report.dart (1)
79-81
: Verify the change.The commenting out of these lines indicates a shift in control flow. Ensure that this change is intentional and does not affect the functionality.
Please confirm that the commenting out of these lines is intentional and does not affect the functionality.
frontend/mgramseva/lib/widgets/custom_app_bar.dart (3)
35-38
: Verify the intention behind commenting out the original logic.The original logic for handling tenant selection is commented out. Ensure this is intentional and not an oversight.
59-59
: LGTM!Filtering tenants based on
city?.districtCode
refines the tenant list displayed to the user.
107-107
: LGTM!The updated navigation logic ensures the correct context is used when dismissing the dialog.
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/repository/builder/WSCalculatorQueryBuilder.java (3)
49-49
: LGTM!The constant
duplicateBulkDemandCallQuery
is correctly defined.
207-220
: LGTM!The method
getDuplicateBulkDemandCallQuery
is correctly implemented and enhances the ability to check for duplicate processing of bulk demands.
222-235
: LGTM!The method
getInsertBulkDemandCallQuery
is correctly implemented and ensures all necessary information is captured when creating a new record.frontend/mgramseva/lib/utils/common_methods.dart (2)
24-29
: LGTM!The new approach simplifies the navigation process to the home screen by removing all previous routes and pushing a new route to the stack.
Line range hint
381-402
: LGTM!The new callback mechanism for handling pop actions enhances the user experience during updates.
frontend/mgramseva/lib/screeens/dashboard/dashboard.dart (2)
90-95
: Implement theonPopInvoked
callback.The
onPopInvoked
callback is currently incomplete. Ensure to implement the necessary logic to handle the pop event.Verify the intended functionality and error handling during the pop event.
91-92
: LGTM!The
canPop
property is correctly set based on the result ofCustomOverlay.removeOverLay()
.The code changes are approved.
municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/WSCalculationServiceImpl.java (4)
81-82
: LGTM!The
EnrichmentService
is correctly injected into the class.The code changes are approved.
402-410
: LGTM!The logic for handling duplicate bulk demand requests is correctly implemented.
The code changes are approved.
417-422
: LGTM!The processing of audit details through the
EnrichmentService
is correctly implemented.The code changes are approved.
418-418
: LGTM!The status update for old records is correctly implemented.
The code changes are approved.
frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart (1)
81-82
: LGTM!The change to use the root navigator for popping the route is correct and can address issues related to navigation hierarchy.
The code changes are approved.
frontend/mgramseva/lib/providers/consumer_details_provider.dart (2)
388-388
: LGTM!The change to use
Navigator.of(context, rootNavigator: true).pop()
ensures that the pop operation targets the root navigator, which is useful when multiple navigators are present in the widget tree.The code changes are approved.
392-392
: LGTM!The change to use
Navigator.of(context, rootNavigator: true).pop()
ensures that the pop operation targets the root navigator, which is useful when multiple navigators are present in the widget tree.The code changes are approved.
frontend/mgramseva/lib/providers/common_provider.dart (2)
14-14
: LGTM!The import of
tenants.dart
is necessary for the new tenant selection logic introduced in the file.The code changes are approved.
995-1172
: LGTM!The introduction of the
appBarUpdate
andshowDialogBox
methods enhances the app bar's functionality by integrating tenant selection logic and improving user interactivity and experience.The code changes are approved.
frontend/mgramseva/lib/providers/reports_provider.dart (3)
Line range hint
224-233
: LGTM!The updated calculation for total dues is robust and prevents potential null reference errors.
The code changes are approved.
374-380
: LGTM!The addition of the
hideSerialNo
parameter adds flexibility in report generation.The code changes are approved.
392-395
: LGTM!The conditional statement for displaying the serial number based on the
hideSerialNo
parameter is correctly implemented.The code changes are approved.
/* | ||
* Uncomment the below line to start consuming record from kafka.topics.consumer | ||
* Value of the variable kafka.topics.consumer should be overwritten in application.properties | ||
*/ | ||
//@KafkaListener(topics = {"kafka.topics.consumer"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder: Implement the method.
The method listen
is commented out and has a TODO comment.
Do you want me to generate the implementation code or open a GitHub issue to track this task?
public ResponseInfo createResponseInfoFromRequestInfo(final RequestInfo requestInfo, final Boolean success) { | ||
|
||
final String apiId = requestInfo != null ? requestInfo.getApiId() : ""; | ||
final String ver = requestInfo != null ? requestInfo.getVer() : ""; | ||
Long ts = null; | ||
if(requestInfo!=null) | ||
ts = requestInfo.getTs(); | ||
final String resMsgId = "uief87324"; // FIXME : Hard-coded | ||
final String msgId = requestInfo != null ? requestInfo.getMsgId() : ""; | ||
final String responseStatus = success ? "successful" : "failed"; | ||
|
||
return ResponseInfo.builder().apiId(apiId).ver(ver).ts(ts).resMsgId(resMsgId).msgId(msgId).resMsgId(resMsgId) | ||
.status(responseStatus).build(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hardcoding values.
The resMsgId
is hardcoded. Consider making it configurable or generating it dynamically.
Apply this diff to avoid hardcoding the value:
- final String resMsgId = "uief87324"; // FIXME : Hard-coded
+ final String resMsgId = UUID.randomUUID().toString(); // Generate dynamically
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public ResponseInfo createResponseInfoFromRequestInfo(final RequestInfo requestInfo, final Boolean success) { | |
final String apiId = requestInfo != null ? requestInfo.getApiId() : ""; | |
final String ver = requestInfo != null ? requestInfo.getVer() : ""; | |
Long ts = null; | |
if(requestInfo!=null) | |
ts = requestInfo.getTs(); | |
final String resMsgId = "uief87324"; // FIXME : Hard-coded | |
final String msgId = requestInfo != null ? requestInfo.getMsgId() : ""; | |
final String responseStatus = success ? "successful" : "failed"; | |
return ResponseInfo.builder().apiId(apiId).ver(ver).ts(ts).resMsgId(resMsgId).msgId(msgId).resMsgId(resMsgId) | |
.status(responseStatus).build(); | |
} | |
public ResponseInfo createResponseInfoFromRequestInfo(final RequestInfo requestInfo, final Boolean success) { | |
final String apiId = requestInfo != null ? requestInfo.getApiId() : ""; | |
final String ver = requestInfo != null ? requestInfo.getVer() : ""; | |
Long ts = null; | |
if(requestInfo!=null) | |
ts = requestInfo.getTs(); | |
final String resMsgId = UUID.randomUUID().toString(); // Generate dynamically | |
final String msgId = requestInfo != null ? requestInfo.getMsgId() : ""; | |
final String responseStatus = success ? "successful" : "failed"; | |
return ResponseInfo.builder().apiId(apiId).ver(ver).ts(ts).resMsgId(resMsgId).msgId(msgId).resMsgId(resMsgId) | |
.status(responseStatus).build(); | |
} |
public void writeJsonToFile(JsonNode content, String fileName) { | ||
try { | ||
objectMapper.writeValue(new File(masterSchemaFilesDirectory + fileName + JSON_EXTENSION), content); | ||
}catch (Exception e){ | ||
throw new CustomException(IO_ERROR_CODE, IO_WRITE_ERROR_MESSAGE); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve error handling.
The method catches a generic Exception
. Consider catching more specific exceptions or adding more context to the CustomException
.
Apply this diff to improve error handling:
- }catch (Exception e){
+ } catch (IOException e) {
+ throw new CustomException(IO_ERROR_CODE, IO_WRITE_ERROR_MESSAGE + ": " + e.getMessage());
Committable suggestion was skipped due to low confidence.
public String getShortenedUrl(String url){ | ||
|
||
HashMap<String,String> body = new HashMap<>(); | ||
body.put("url",url); | ||
StringBuilder builder = new StringBuilder(configs.getUrlShortnerHost()); | ||
builder.append(configs.getUrlShortnerEndpoint()); | ||
String res = restTemplate.postForObject(builder.toString(), body, String.class); | ||
|
||
if(StringUtils.isEmpty(res)){ | ||
log.error("URL_SHORTENING_ERROR", "Unable to shorten url: " + url); ; | ||
return url; | ||
} | ||
else return res; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve error handling and logging.
The current implementation logs an error if the response is empty but does not handle other potential exceptions that may occur during the HTTP request. Additionally, consider using a more specific exception handling mechanism.
Apply this diff to improve error handling:
public String getShortenedUrl(String url){
HashMap<String,String> body = new HashMap<>();
body.put("url",url);
StringBuilder builder = new StringBuilder(configs.getUrlShortnerHost());
builder.append(configs.getUrlShortnerEndpoint());
- String res = restTemplate.postForObject(builder.toString(), body, String.class);
+ String res;
+ try {
+ res = restTemplate.postForObject(builder.toString(), body, String.class);
+ } catch (Exception e) {
+ log.error("URL_SHORTENING_ERROR", "Exception occurred while shortening url: " + url, e);
+ return url;
+ }
if(StringUtils.isEmpty(res)){
log.error("URL_SHORTENING_ERROR", "Unable to shorten url: " + url);
return url;
} else {
return res;
}
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public String getShortenedUrl(String url){ | |
HashMap<String,String> body = new HashMap<>(); | |
body.put("url",url); | |
StringBuilder builder = new StringBuilder(configs.getUrlShortnerHost()); | |
builder.append(configs.getUrlShortnerEndpoint()); | |
String res = restTemplate.postForObject(builder.toString(), body, String.class); | |
if(StringUtils.isEmpty(res)){ | |
log.error("URL_SHORTENING_ERROR", "Unable to shorten url: " + url); ; | |
return url; | |
} | |
else return res; | |
} | |
public String getShortenedUrl(String url){ | |
HashMap<String,String> body = new HashMap<>(); | |
body.put("url",url); | |
StringBuilder builder = new StringBuilder(configs.getUrlShortnerHost()); | |
builder.append(configs.getUrlShortnerEndpoint()); | |
String res; | |
try { | |
res = restTemplate.postForObject(builder.toString(), body, String.class); | |
} catch (Exception e) { | |
log.error("URL_SHORTENING_ERROR", "Exception occurred while shortening url: " + url, e); | |
return url; | |
} | |
if(StringUtils.isEmpty(res)){ | |
log.error("URL_SHORTENING_ERROR", "Unable to shorten url: " + url); | |
return url; | |
} else { | |
return res; | |
} | |
} |
public Object fetchResult(StringBuilder uri, Object request) { | ||
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); | ||
Object response = null; | ||
try { | ||
response = restTemplate.postForObject(uri.toString(), request, Map.class); | ||
}catch(HttpClientErrorException e) { | ||
log.error("External Service threw an Exception: ",e); | ||
throw new ServiceCallException(e.getResponseBodyAsString()); | ||
}catch(Exception e) { | ||
log.error("Exception while fetching from searcher: ",e); | ||
} | ||
|
||
return response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhance error handling.
The method is well-implemented but lacks a generic exception handling strategy. Consider throwing a custom exception for generic errors to maintain consistency.
Apply this diff to enhance error handling:
catch(Exception e) {
log.error("Exception while fetching from searcher: ",e);
-}
+throw new ServiceCallException("An error occurred while fetching the result.");
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public Object fetchResult(StringBuilder uri, Object request) { | |
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); | |
Object response = null; | |
try { | |
response = restTemplate.postForObject(uri.toString(), request, Map.class); | |
}catch(HttpClientErrorException e) { | |
log.error("External Service threw an Exception: ",e); | |
throw new ServiceCallException(e.getResponseBodyAsString()); | |
}catch(Exception e) { | |
log.error("Exception while fetching from searcher: ",e); | |
} | |
return response; | |
public Object fetchResult(StringBuilder uri, Object request) { | |
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); | |
Object response = null; | |
try { | |
response = restTemplate.postForObject(uri.toString(), request, Map.class); | |
}catch(HttpClientErrorException e) { | |
log.error("External Service threw an Exception: ",e); | |
throw new ServiceCallException(e.getResponseBodyAsString()); | |
}catch(Exception e) { | |
log.error("Exception while fetching from searcher: ",e); | |
throw new ServiceCallException("An error occurred while fetching the result."); | |
} | |
return response; |
public void prepareTenantMap(Map<String, Object> map) { | ||
|
||
String tenantId = (String) map.get("tenantId"); | ||
String moduleName = (String) map.get("moduleName"); | ||
Set<String> masterKeys = map.keySet(); | ||
String nonMasterKeys = "tenantId,moduleName"; | ||
List<String> ignoreKey = new ArrayList<String>(Arrays.asList(nonMasterKeys.split(","))); | ||
masterKeys.removeAll(ignoreKey); | ||
boolean isMergeAllowed; | ||
Map<String, JSONArray> masterDataMap = new HashMap<>(); | ||
Iterator<String> masterKeyIterator = masterKeys.iterator(); | ||
String masterName = null; | ||
JSONArray masterDataJsonArray = null; | ||
while (masterKeyIterator.hasNext()) { | ||
masterName = masterKeyIterator.next(); | ||
try { | ||
masterDataJsonArray = JsonPath.read(objectMapper.writeValueAsString(map.get(masterName)), | ||
"$"); | ||
} catch (JsonProcessingException e) { | ||
log.error("Error while parsing file", e); | ||
} | ||
|
||
if (!tenantMap.containsKey(tenantId)) { | ||
Map<String, Map<String, JSONArray>> moduleMap = new HashMap<>(); | ||
moduleMap.put(moduleName, masterDataMap); | ||
tenantMap.put(tenantId, moduleMap); | ||
} else { | ||
Map<String, Map<String, JSONArray>> tenantModule = tenantMap.get(tenantId); | ||
|
||
if (!tenantModule.containsKey(moduleName)) { | ||
tenantModule.put(moduleName, masterDataMap); | ||
} else { | ||
Map<String, JSONArray> moduleMaster = tenantModule.get(moduleName); | ||
isMergeAllowed = isMergeAllowedForMaster(moduleName, masterName); | ||
|
||
if (!moduleMaster.containsKey(masterName)) { | ||
masterDataMap.put(masterName, masterDataJsonArray); | ||
moduleMaster.putAll(masterDataMap); | ||
tenantModule.put(moduleName, moduleMaster); | ||
} else if (moduleMaster.containsKey(masterName) && isMergeAllowed) { | ||
JSONArray existingMasterDataJsonArray = moduleMaster.get(masterName); | ||
existingMasterDataJsonArray.merge(masterDataJsonArray); | ||
} else if ((moduleMaster.containsKey(masterName) && !isMergeAllowed)) { | ||
log.error("merge is not allowed for master ++" + moduleName + " " + masterName); | ||
} | ||
} | ||
tenantMap.put(tenantId, tenantModule); | ||
} | ||
masterDataMap.put(masterName, masterDataJsonArray); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve readability and error handling.
Consider refactoring the method to improve readability and adding more specific error handling.
public void prepareTenantMap(Map<String, Object> map) {
String tenantId = (String) map.get("tenantId");
String moduleName = (String) map.get("moduleName");
Set<String> masterKeys = map.keySet();
String nonMasterKeys = "tenantId,moduleName";
List<String> ignoreKey = new ArrayList<>(Arrays.asList(nonMasterKeys.split(",")));
masterKeys.removeAll(ignoreKey);
boolean isMergeAllowed;
Map<String, JSONArray> masterDataMap = new HashMap<>();
for (String masterName : masterKeys) {
JSONArray masterDataJsonArray = null;
try {
masterDataJsonArray = JsonPath.read(objectMapper.writeValueAsString(map.get(masterName)), "$");
} catch (JsonProcessingException e) {
log.error("Error while parsing master data for {}: {}", masterName, e.getMessage(), e);
}
if (!tenantMap.containsKey(tenantId)) {
Map<String, Map<String, JSONArray>> moduleMap = new HashMap<>();
moduleMap.put(moduleName, masterDataMap);
tenantMap.put(tenantId, moduleMap);
} else {
Map<String, Map<String, JSONArray>> tenantModule = tenantMap.get(tenantId);
if (!tenantModule.containsKey(moduleName)) {
tenantModule.put(moduleName, masterDataMap);
} else {
Map<String, JSONArray> moduleMaster = tenantModule.get(moduleName);
isMergeAllowed = isMergeAllowedForMaster(moduleName, masterName);
if (!moduleMaster.containsKey(masterName)) {
masterDataMap.put(masterName, masterDataJsonArray);
moduleMaster.putAll(masterDataMap);
} else if (moduleMaster.containsKey(masterName) && isMergeAllowed) {
JSONArray existingMasterDataJsonArray = moduleMaster.get(masterName);
existingMasterDataJsonArray.merge(masterDataJsonArray);
} else if (moduleMaster.containsKey(masterName) && !isMergeAllowed) {
log.error("Merge is not allowed for master {}: {}", moduleName, masterName);
}
}
tenantMap.put(tenantId, tenantModule);
}
masterDataMap.put(masterName, masterDataJsonArray);
}
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public void prepareTenantMap(Map<String, Object> map) { | |
String tenantId = (String) map.get("tenantId"); | |
String moduleName = (String) map.get("moduleName"); | |
Set<String> masterKeys = map.keySet(); | |
String nonMasterKeys = "tenantId,moduleName"; | |
List<String> ignoreKey = new ArrayList<String>(Arrays.asList(nonMasterKeys.split(","))); | |
masterKeys.removeAll(ignoreKey); | |
boolean isMergeAllowed; | |
Map<String, JSONArray> masterDataMap = new HashMap<>(); | |
Iterator<String> masterKeyIterator = masterKeys.iterator(); | |
String masterName = null; | |
JSONArray masterDataJsonArray = null; | |
while (masterKeyIterator.hasNext()) { | |
masterName = masterKeyIterator.next(); | |
try { | |
masterDataJsonArray = JsonPath.read(objectMapper.writeValueAsString(map.get(masterName)), | |
"$"); | |
} catch (JsonProcessingException e) { | |
log.error("Error while parsing file", e); | |
} | |
if (!tenantMap.containsKey(tenantId)) { | |
Map<String, Map<String, JSONArray>> moduleMap = new HashMap<>(); | |
moduleMap.put(moduleName, masterDataMap); | |
tenantMap.put(tenantId, moduleMap); | |
} else { | |
Map<String, Map<String, JSONArray>> tenantModule = tenantMap.get(tenantId); | |
if (!tenantModule.containsKey(moduleName)) { | |
tenantModule.put(moduleName, masterDataMap); | |
} else { | |
Map<String, JSONArray> moduleMaster = tenantModule.get(moduleName); | |
isMergeAllowed = isMergeAllowedForMaster(moduleName, masterName); | |
if (!moduleMaster.containsKey(masterName)) { | |
masterDataMap.put(masterName, masterDataJsonArray); | |
moduleMaster.putAll(masterDataMap); | |
tenantModule.put(moduleName, moduleMaster); | |
} else if (moduleMaster.containsKey(masterName) && isMergeAllowed) { | |
JSONArray existingMasterDataJsonArray = moduleMaster.get(masterName); | |
existingMasterDataJsonArray.merge(masterDataJsonArray); | |
} else if ((moduleMaster.containsKey(masterName) && !isMergeAllowed)) { | |
log.error("merge is not allowed for master ++" + moduleName + " " + masterName); | |
} | |
} | |
tenantMap.put(tenantId, tenantModule); | |
} | |
masterDataMap.put(masterName, masterDataJsonArray); | |
} | |
public void prepareTenantMap(Map<String, Object> map) { | |
String tenantId = (String) map.get("tenantId"); | |
String moduleName = (String) map.get("moduleName"); | |
Set<String> masterKeys = map.keySet(); | |
String nonMasterKeys = "tenantId,moduleName"; | |
List<String> ignoreKey = new ArrayList<>(Arrays.asList(nonMasterKeys.split(","))); | |
masterKeys.removeAll(ignoreKey); | |
boolean isMergeAllowed; | |
Map<String, JSONArray> masterDataMap = new HashMap<>(); | |
for (String masterName : masterKeys) { | |
JSONArray masterDataJsonArray = null; | |
try { | |
masterDataJsonArray = JsonPath.read(objectMapper.writeValueAsString(map.get(masterName)), "$"); | |
} catch (JsonProcessingException e) { | |
log.error("Error while parsing master data for {}: {}", masterName, e.getMessage(), e); | |
} | |
if (!tenantMap.containsKey(tenantId)) { | |
Map<String, Map<String, JSONArray>> moduleMap = new HashMap<>(); | |
moduleMap.put(moduleName, masterDataMap); | |
tenantMap.put(tenantId, moduleMap); | |
} else { | |
Map<String, Map<String, JSONArray>> tenantModule = tenantMap.get(tenantId); | |
if (!tenantModule.containsKey(moduleName)) { | |
tenantModule.put(moduleName, masterDataMap); | |
} else { | |
Map<String, JSONArray> moduleMaster = tenantModule.get(moduleName); | |
isMergeAllowed = isMergeAllowedForMaster(moduleName, masterName); | |
if (!moduleMaster.containsKey(masterName)) { | |
masterDataMap.put(masterName, masterDataJsonArray); | |
moduleMaster.putAll(masterDataMap); | |
} else if (moduleMaster.containsKey(masterName) && isMergeAllowed) { | |
JSONArray existingMasterDataJsonArray = moduleMaster.get(masterName); | |
existingMasterDataJsonArray.merge(masterDataJsonArray); | |
} else if (moduleMaster.containsKey(masterName) && !isMergeAllowed) { | |
log.error("Merge is not allowed for master {}: {}", moduleName, masterName); | |
} | |
} | |
tenantMap.put(tenantId, tenantModule); | |
} | |
masterDataMap.put(masterName, masterDataJsonArray); | |
} | |
} |
public void readFiles(String baseFolderPath, LinkedList<String> errorList) { | ||
File folder = new File(baseFolderPath); | ||
File[] listOfFiles = folder.listFiles(); | ||
if (listOfFiles != null) { | ||
for (File file : listOfFiles) { | ||
if (file.isFile()) { | ||
String name = file.getName(); | ||
String fileExtension = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase(); | ||
|
||
|
||
if (fileExtension.equalsIgnoreCase("json") | ||
|| fileExtension.equalsIgnoreCase("yaml") | ||
|| fileExtension.equalsIgnoreCase("yml") | ||
) { | ||
log.debug("Reading file....:- " + file.getAbsolutePath()); | ||
try { | ||
Map<String, Object> jsonMap = objectMapper.readValue(file, new TypeReference<Map<String, Object>>() { | ||
@Override | ||
public Type getType() { | ||
return super.getType(); | ||
} | ||
}); | ||
prepareTenantMap(jsonMap); | ||
} catch (Exception e) { | ||
log.error("Error occurred while loading file", e); | ||
errorList.add(file.getAbsolutePath()); | ||
} | ||
} | ||
} else if (file.isDirectory()) { | ||
readFiles(file.getAbsolutePath(), errorList); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve readability and error handling.
Consider refactoring the method to improve readability and adding more specific error handling.
public void readFiles(String baseFolderPath, LinkedList<String> errorList) {
File folder = new File(baseFolderPath);
File[] listOfFiles = folder.listFiles();
if (listOfFiles != null) {
for (File file : listOfFiles) {
if (file.isFile()) {
processFile(file, errorList);
} else if (file.isDirectory()) {
readFiles(file.getAbsolutePath(), errorList);
}
}
} else {
log.warn("No files found in directory: {}", baseFolderPath);
}
}
private void processFile(File file, LinkedList<String> errorList) {
String name = file.getName();
String fileExtension = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase();
if (fileExtension.equalsIgnoreCase("json")
|| fileExtension.equalsIgnoreCase("yaml")
|| fileExtension.equalsIgnoreCase("yml")
) {
log.debug("Reading file....:- " + file.getAbsolutePath());
try {
Map<String, Object> jsonMap = objectMapper.readValue(file, new TypeReference<Map<String, Object>>() {});
prepareTenantMap(jsonMap);
} catch (Exception e) {
log.error("Error occurred while loading file: {}", file.getAbsolutePath(), e);
errorList.add(file.getAbsolutePath());
}
}
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public void readFiles(String baseFolderPath, LinkedList<String> errorList) { | |
File folder = new File(baseFolderPath); | |
File[] listOfFiles = folder.listFiles(); | |
if (listOfFiles != null) { | |
for (File file : listOfFiles) { | |
if (file.isFile()) { | |
String name = file.getName(); | |
String fileExtension = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase(); | |
if (fileExtension.equalsIgnoreCase("json") | |
|| fileExtension.equalsIgnoreCase("yaml") | |
|| fileExtension.equalsIgnoreCase("yml") | |
) { | |
log.debug("Reading file....:- " + file.getAbsolutePath()); | |
try { | |
Map<String, Object> jsonMap = objectMapper.readValue(file, new TypeReference<Map<String, Object>>() { | |
@Override | |
public Type getType() { | |
return super.getType(); | |
} | |
}); | |
prepareTenantMap(jsonMap); | |
} catch (Exception e) { | |
log.error("Error occurred while loading file", e); | |
errorList.add(file.getAbsolutePath()); | |
} | |
} | |
} else if (file.isDirectory()) { | |
readFiles(file.getAbsolutePath(), errorList); | |
} | |
} | |
} | |
} | |
public void readFiles(String baseFolderPath, LinkedList<String> errorList) { | |
File folder = new File(baseFolderPath); | |
File[] listOfFiles = folder.listFiles(); | |
if (listOfFiles != null) { | |
for (File file : listOfFiles) { | |
if (file.isFile()) { | |
processFile(file, errorList); | |
} else if (file.isDirectory()) { | |
readFiles(file.getAbsolutePath(), errorList); | |
} | |
} | |
} else { | |
log.warn("No files found in directory: {}", baseFolderPath); | |
} | |
} | |
private void processFile(File file, LinkedList<String> errorList) { | |
String name = file.getName(); | |
String fileExtension = FilenameUtils.getExtension(file.getAbsolutePath()).toLowerCase(); | |
if (fileExtension.equalsIgnoreCase("json") | |
|| fileExtension.equalsIgnoreCase("yaml") | |
|| fileExtension.equalsIgnoreCase("yml") | |
) { | |
log.debug("Reading file....:- " + file.getAbsolutePath()); | |
try { | |
Map<String, Object> jsonMap = objectMapper.readValue(file, new TypeReference<Map<String, Object>>() {}); | |
prepareTenantMap(jsonMap); | |
} catch (Exception e) { | |
log.error("Error occurred while loading file: {}", file.getAbsolutePath(), e); | |
errorList.add(file.getAbsolutePath()); | |
} | |
} | |
} |
var LedgerLabelText = Text(ApplicationLocalizations.of(context).translate("ledger_label"),style: TextStyle( | ||
fontWeight: FontWeight.w700, color: Colors.black, fontSize: 12)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve readability.
Consider renaming LedgerLabelText
to ledgerLabelText
to follow naming conventions for variables.
var ledgerLabelText = Text(ApplicationLocalizations.of(context).translate("ledger_label"),style: TextStyle(
fontWeight: FontWeight.w700, color: Colors.black, fontSize: 12));
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
var LedgerLabelText = Text(ApplicationLocalizations.of(context).translate("ledger_label"),style: TextStyle( | |
fontWeight: FontWeight.w700, color: Colors.black, fontSize: 12)); | |
var ledgerLabelText = Text(ApplicationLocalizations.of(context).translate("ledger_label"),style: TextStyle( | |
fontWeight: FontWeight.w700, color: Colors.black, fontSize: 12)); |
public void insertBulkDemandCall(String tenantId, String billingPeriod, String status,AuditDetails auditDetails) { | ||
waterCalculatorDao.insertBulkDemandCall(tenantId, billingPeriod, status,auditDetails); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null checks for parameters.
To ensure robustness, consider adding null checks for the parameters tenantId
, billingPeriod
, status
, and auditDetails
.
Apply this diff to add null checks:
public void insertBulkDemandCall(String tenantId, String billingPeriod, String status, AuditDetails auditDetails) {
+ if (tenantId == null || billingPeriod == null || status == null || auditDetails == null) {
+ throw new IllegalArgumentException("Parameters cannot be null");
+ }
waterCalculatorDao.insertBulkDemandCall(tenantId, billingPeriod, status, auditDetails);
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public void insertBulkDemandCall(String tenantId, String billingPeriod, String status,AuditDetails auditDetails) { | |
waterCalculatorDao.insertBulkDemandCall(tenantId, billingPeriod, status,auditDetails); | |
} | |
public void insertBulkDemandCall(String tenantId, String billingPeriod, String status, AuditDetails auditDetails) { | |
if (tenantId == null || billingPeriod == null || status == null || auditDetails == null) { | |
throw new IllegalArgumentException("Parameters cannot be null"); | |
} | |
waterCalculatorDao.insertBulkDemandCall(tenantId, billingPeriod, status, auditDetails); | |
} |
public boolean isDuplicateBulkDemandCall(String tenantId, String billingPeriod, Timestamp fromTime) { | ||
return waterCalculatorDao.isDuplicateBulkDemandCall(tenantId, billingPeriod, fromTime); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null checks for parameters.
To ensure robustness, consider adding null checks for the parameters tenantId
, billingPeriod
, and fromTime
.
Apply this diff to add null checks:
public boolean isDuplicateBulkDemandCall(String tenantId, String billingPeriod, Timestamp fromTime) {
+ if (tenantId == null || billingPeriod == null || fromTime == null) {
+ throw new IllegalArgumentException("Parameters cannot be null");
+ }
return waterCalculatorDao.isDuplicateBulkDemandCall(tenantId, billingPeriod, fromTime);
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
public boolean isDuplicateBulkDemandCall(String tenantId, String billingPeriod, Timestamp fromTime) { | |
return waterCalculatorDao.isDuplicateBulkDemandCall(tenantId, billingPeriod, fromTime); | |
} | |
public boolean isDuplicateBulkDemandCall(String tenantId, String billingPeriod, Timestamp fromTime) { | |
if (tenantId == null || billingPeriod == null || fromTime == null) { | |
throw new IllegalArgumentException("Parameters cannot be null"); | |
} | |
return waterCalculatorDao.isDuplicateBulkDemandCall(tenantId, billingPeriod, fromTime); | |
} |
Summary by CodeRabbit
New Features
LedgerLabelText
widget for enhanced dashboard context.DataApiController
andSchemaApiController
.Bug Fixes
Documentation
Style
Chores