description

This commit is contained in:
2025-12-07 11:33:37 +03:30
parent 6b7ead553a
commit 14967bec6e
8 changed files with 49 additions and 2 deletions
@@ -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)
*/