refactor cart

This commit is contained in:
2025-12-20 19:33:09 +03:30
parent 6bfef28886
commit 6485e51dce
8 changed files with 931 additions and 737 deletions
@@ -87,73 +87,7 @@ export class CartController {
return this.cartService.removeCoupon(userId, restaurantId);
}
// @Patch('address')
// @ApiOperation({ summary: 'Set address for cart' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetAddressDto })
// async setAddress(@UserId() userId: string, @RestId() restaurantId: string, @Body() setAddressDto: SetAddressDto) {
// return this.cartService.setAddress(userId, restaurantId, setAddressDto);
// }
// @Patch('payment-method')
// @ApiOperation({ summary: 'Set payment method for cart' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetPaymentMethodDto })
// async setPaymentMethod(
// @UserId() userId: string,
// @RestId() restaurantId: string,
// @Body() setPaymentMethodDto: SetPaymentMethodDto,
// ) {
// return this.cartService.setPaymentMethod(userId, restaurantId, setPaymentMethodDto);
// }
// @Patch('delivery-method')
// @ApiOperation({ summary: 'Set delivery method for cart' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetDeliveryMethodDto })
// setDeliveryMethod(
// @UserId() userId: string,
// @RestId() restaurantId: string,
// @Body() setDeliveryMethodDto: SetDeliveryMethodDto,
// ) {
// return this.cartService.setDeliveryMethod(userId, restaurantId, setDeliveryMethodDto);
// }
// @Patch('description')
// @ApiOperation({ summary: 'Set description for cart' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetDescriptionDto })
// setDescription(
// @UserId() userId: string,
// @RestId() restaurantId: string,
// @Body() setDescriptionDto: SetDescriptionDto,
// ) {
// return this.cartService.setDescription(userId, restaurantId, setDescriptionDto);
// }
// @Patch('table-number')
// @ApiOperation({ summary: 'Set table number for cart (required when delivery method is DineIn)' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetTableNumberDto })
// setTableNumber(
// @UserId() userId: string,
// @RestId() restaurantId: string,
// @Body() setTableNumberDto: SetTableNumberDto,
// ) {
// return this.cartService.setTableNumber(userId, restaurantId, setTableNumberDto);
// }
// @Patch('car-delivery')
// @ApiOperation({ summary: 'Set car delivery for cart' })
// @ApiHeader(API_HEADER_SLUG)
// @ApiBody({ type: SetCarDeliveryDto })
// setCarDelivery(
// @UserId() userId: string,
// @RestId() restaurantId: string,
// @Body() setCarDeliveryDto: SetCarDeliveryDto,
// ) {
// return this.cartService.setCarDelivery(userId, restaurantId, setCarDeliveryDto);
// }
@Patch('all')
@ApiOperation({ summary: 'Set all cart params' })
@ApiHeader(API_HEADER_SLUG)