description
This commit is contained in:
@@ -10,6 +10,7 @@ import { ApplyCouponDto } from '../dto/apply-coupon.dto';
|
||||
import { SetAddressDto } from '../dto/set-address.dto';
|
||||
import { SetPaymentMethodDto } from '../dto/set-payment-method.dto';
|
||||
import { SetDeliveryMethodDto } from '../dto/set-delivery-method.dto';
|
||||
import { SetDescriptionDto } from '../dto/set-description.dto';
|
||||
import { UserAddress } from '../../users/entities/user-address.entity';
|
||||
import { User } from '../../users/entities/user.entity';
|
||||
import { PaymentMethod } from '../../payments/entities/payment-method.entity';
|
||||
@@ -590,6 +591,24 @@ export class CartService {
|
||||
return cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description for cart
|
||||
*/
|
||||
async setDescription(
|
||||
userId: string,
|
||||
restaurantId: string,
|
||||
setDescriptionDto: SetDescriptionDto,
|
||||
): Promise<Cart> {
|
||||
const cart = await this.findOneOrFail(userId, restaurantId);
|
||||
|
||||
cart.description = setDescriptionDto.description;
|
||||
cart.updatedAt = new Date().toISOString();
|
||||
|
||||
await this.saveCart(cart);
|
||||
|
||||
return cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recalculate cart totals (including coupon discount and tax)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user