MS-238/Add @ToString to DTOs and @ToString.Exclude to entity relationships
Summary
This MR adds Lombok @ToString annotations to DTOs and @ToString.Exclude to entity relationship fields in mydressin-common.
Motivation
- @ToString on DTOs: Simplifies debugging and logging by providing consistent string representation
- @ToString.Exclude on entities: Prevents circular references and lazy loading exceptions when converting entities to strings
Changes
Entities (added @ToString.Exclude on relationships)
| Entity | Excluded Fields |
|---|---|
| ItemCart | cart, unregisteredCart, order |
| SaleSession | orders |
| SessionOrder | itemCart, saleSession |
| UnregisteredCart | items |
DTOs (added @ToString)
| DTO | Package |
|---|---|
| CartDTO | com.marketingconfort.mydressin.common.cart.dtos |
| GiftCardDTO | com.marketingconfort.mydressin.common.cart.dtos |
| ItemCartDTO | com.marketingconfort.mydressin.common.cart.dtos |
| ProductCartDTO | com.marketingconfort.mydressin.common.cart.dtos |
| ProductStockDTO | com.marketingconfort.mydressin.common.cart.dtos |
| ProductStockRequestDTO | com.marketingconfort.mydressin.common.cart.dtos |
| PromoCodeCartDTO | com.marketingconfort.mydressin.common.cart.dtos |
| VoucherDTO | com.marketingconfort.mydressin.common.cart.dtos |
Testing
- Verified that entity toString() calls no longer trigger lazy loading exceptions
- Confirmed DTOs produce readable string output for logging purposes
Closes MS-238