Closed chrisK00 closed 2 years ago
On a CartController there should be a Get endpoint that returns a Cart including its CartItems and then include the Product inside the CartItem.
including
then include
We need a response model for a cart that should have:
and a response model for a Cart Item that should have:
Product.Price * Amount
You can configure mapster to automatically make the calculations when mapping from a Cart to a CartResponse and CartItem to CartItemResponse.
TypeAdapterConfig.GlobalSettings
.Scan
config.NewConfig<FromType, ToType>().Map(destination => , source => )
child of #70
On a CartController there should be a Get endpoint that returns a Cart
including
its CartItems andthen include
the Product inside the CartItem.We need a response model for a cart that should have:
and a response model for a Cart Item that should have:
Product.Price * Amount
You can configure mapster to automatically make the calculations when mapping from a Cart to a CartResponse and CartItem to CartItemResponse.
TypeAdapterConfig.GlobalSettings
and a.Scan
method that can be used to scan the assembly for mappingsconfig.NewConfig<FromType, ToType>().Map(destination => , source => )
child of #70