-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added new column to big order table view #1577
Conversation
WalkthroughThe pull request introduces a new field called Changes
Sequence DiagramsequenceDiagram
participant Client
participant OrdersAdminsPageService
participant BigOrderTableDTO
participant Database
Client->>OrdersAdminsPageService: Request order table parameters
OrdersAdminsPageService->>Database: Fetch order data
Database-->>OrdersAdminsPageService: Return order details
OrdersAdminsPageService->>BigOrderTableDTO: Map order data including otherPackages
BigOrderTableDTO-->>Client: Return order table with new column
Poem
🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
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: 0
🧹 Nitpick comments (3)
service-api/src/main/java/greencity/dto/order/BigOrderTableDTO.java (1)
35-35
: Document or annotate the new field.
Consider adding brief inline documentation or class-level comments forotherPackages
to clarify its usage and significance, helping future maintainers understand its purpose.service/src/main/java/greencity/mapping/order/BigOrderTableDtoMapper.java (1)
50-51
: Confirm the placeholder value.
Using"-"
as a placeholder is consistent with related fields. Ensure that a hyphen is acceptable in all contexts (UI display, reporting, etc.) or consider returning an empty string if that’s more appropriate.service/src/test/java/greencity/ModelUtils.java (1)
3891-3891
: Setting the default value of 'otherPackages' to "-" ingetBigOrderTableDto
.Initializing the new field ensures clarity for downstream usage, but verify that the default value ("-") is acceptable or if you need a more descriptive placeholder (e.g., "N/A").
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
dao/src/main/java/greencity/entity/order/BigOrderTableViews.java
(1 hunks)dao/src/main/java/greencity/entity/table/TableColumnWidthForEmployee.java
(1 hunks)dao/src/main/resources/db/changelog/db.changelog-master.xml
(1 hunks)dao/src/main/resources/db/changelog/logs/add-new-column-to-big_order_table-view.xml
(1 hunks)dao/src/main/resources/db/changelog/logs/add-other-packages-to-column_width_for_employee-table.xml
(1 hunks)dao/src/main/resources/db/changelog/logs/update-custom_table_view-table.xml
(1 hunks)service-api/src/main/java/greencity/dto/order/BigOrderTableDTO.java
(1 hunks)service/src/main/java/greencity/mapping/order/BigOrderTableDtoMapper.java
(1 hunks)service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java
(2 hunks)service/src/test/java/greencity/ModelUtils.java
(2 hunks)
👮 Files not reviewed due to content moderation or server errors (2)
- dao/src/main/resources/db/changelog/logs/add-new-column-to-big_order_table-view.xml
- dao/src/main/resources/db/changelog/db.changelog-master.xml
🔇 Additional comments (10)
dao/src/main/java/greencity/entity/order/BigOrderTableViews.java (1)
48-49
: Verify column length or constraints forotherPackages
.
IfotherPackages
can potentially contain lengthy text, ensure that database column constraints (like length) are correctly defined. Otherwise, the default length might truncate data.dao/src/main/java/greencity/entity/table/TableColumnWidthForEmployee.java (1)
35-36
: Field consistency looks good.
Storing the default width forotherPackages
aligns with the existing approach for other columns. No issues found.service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java (4)
199-199
: Indices updated from 35 to 38 for the 'region' column.The updated index 38 for "region" appears consistent with shifting the existing column ordering to accommodate the new "otherPackages" column. Ensure any client-side or UI logic that references the old column order is also updated accordingly.
202-202
: Indices updated from 36 to 39 for the 'city' column.The updated index 39 for "city" follows the new arrangement of columns. Confirm that front-end references to the old positional index have been addressed.
204-204
: Indices updated from 37 to 40 for the 'district' column.The updated index 40 for "district" maintains consistent shifting of columns. Validate that the corresponding references in any integration tests or front-end code have been updated to avoid off-by-one errors.
228-232
: New 'otherPackages' column introduced.A new read-only column at index 37 has been added for displaying additional package details. This aligns with the newly added field in the database. Confirm that incoming data properly populates the new field.
service/src/test/java/greencity/ModelUtils.java (1)
3927-3927
: Setting the default value of 'otherPackages' to "-" ingetBigOrderTableDtoByDateNullTest
.Consistently initializing the new field for test scenarios is good. Ensure that test validations reflect this default value rather than expecting null or an empty string.
dao/src/main/resources/db/changelog/logs/update-custom_table_view-table.xml (1)
1-13
: SQL update tocustom_table_view
: adding 'otherPackages' to the list of columns.This SQL statement correctly modifies the
custom_table_view
to include the new column name intitles
. Ensure that this aligns with any client or service code that uses these titles for table rendering or queries.dao/src/main/resources/db/changelog/logs/add-other-packages-to-column_width_for_employee-table.xml (2)
7-11
: Adding newother_packages
column tocolumn_width_for_employee
.The schema change is straightforward. Double-check that no constraints (e.g., NOT NULL) are needed. If it can remain null or if zero is an important default, consider specifying a default value in the Liquibase script.
13-53
: Batch updating column widths, including the newother_packages
width.The script updates multiple fields to 165 and sets
other_packages
to 106. Confirm these values match the expected UI or PDF layout constraints. If columns are resizable on the client side, consider verifying alignment to avoid layout issues.
Summary by CodeRabbit
New Features
Database Changes
Improvements