calculate delivery fee based on distance
This commit is contained in:
@@ -87,73 +87,73 @@ 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('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('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('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('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('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('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)
|
||||
|
||||
Reference in New Issue
Block a user