package com.aistudio.bonjuteri.jwlry.model import com.google.firebase.Timestamp import com.google.firebase.firestore.DocumentId import com.google.firebase.firestore.IgnoreExtraProperties import com.google.firebase.firestore.ServerTimestamp @IgnoreExtraProperties data class CartItem( @DocumentId val id: String = "", val productId: String = "", val title: String = "", val imageUrl: String = "", val price: Double = 0.0, val quantity: Long = 1L, val maxStock: Long = 99L, @ServerTimestamp val updatedAt: Timestamp? = null ) { val totalPrice: Double get() = price * quantity val formattedTotalPrice: String get() = Product.formatCurrency(totalPrice) val formattedUnitPrice: String get() = Product.formatCurrency(price) }