Closed italopessoa closed 3 months ago
The changes encompass a variety of updates across different parts of the system, including renaming database columns, adding new methods and classes for handling order statuses, and updating error messages. The primary focus is on improving the order management functionality, specifically by introducing a new TrackingCode
for orders and adding capabilities to update order statuses more effectively.
File Path | Change Summary |
---|---|
database/init.sql |
Renamed Code column to TrackingCode in Orders table. |
src/.../Controllers/OrdersController.cs |
Reformatted code for readability; added UpdateStatus method. |
src/.../Model/OrderDto.cs |
Changed Status property type from OrderStatus to OrderStatusDto . |
src/.../Model/OrderStatusDto.cs |
Introduced OrderStatusDto enum defining various order statuses. |
src/.../Model/UpdateOrderStatusCommandDto.cs |
Added command DTO for updating order status. |
src/.../Services/OrderService.cs |
Added IUpdateOrderStatusUseCase dependency and UpdateStatusAsync method. |
src/.../Entities/Order.cs |
Updated error message in DeliverOrder method. |
src/.../Interfaces/IOrderService.cs |
Added UpdateStatusAsync method to IOrderService interface. |
src/.../ValueObjects/OrderTrackingCode.cs |
Added implicit conversion operator from string to OrderTrackingCode . |
src/.../Persistence/Dto/OrderListDto.cs |
Renamed Code property to TrackingCode . |
src/.../Persistence/Repository/OrderRepositoryDapper.cs |
Updated queries to use TrackingCode instead of Code . |
tests/.../Controllers/OrdersControllerTest.cs |
Added UpdateOrderStatusAsync test method. |
tests/.../Services/OrderServiceTest.cs |
Added mock for IUpdateOrderStatusUseCase and related test for UpdateStatusAsync . |
tests/.../Entities/OrderTests.cs |
Updated error message in Order_Deliver_NotFinished_ThrowsError test. |
tests/.../Repository/OrderRepositoryDapperTest.cs |
Updated Create_Success() test to use TrackingCode in SQL query. |
sequenceDiagram
participant Client
participant OrdersController
participant OrderService
participant IUpdateOrderStatusUseCase
Client->>OrdersController: UpdateStatus(orderId, newStatus)
OrdersController->>OrderService: UpdateStatusAsync(orderId, newStatus)
OrderService->>IUpdateOrderStatusUseCase: UpdateStatus(orderId, newStatus)
IUpdateOrderStatusUseCase-->>OrderService: Status Updated
OrderService-->>OrdersController: Status Updated
OrdersController-->>Client: Status Updated
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?