update cart/favorite
This commit is contained in:
@@ -6,7 +6,7 @@ library;
|
||||
/// Cart Item Entity
|
||||
///
|
||||
/// Contains item-level information:
|
||||
/// - Product reference
|
||||
/// - Product reference and basic info
|
||||
/// - Quantity
|
||||
/// - Pricing
|
||||
class CartItem {
|
||||
@@ -31,6 +31,15 @@ class CartItem {
|
||||
/// Timestamp when item was added
|
||||
final DateTime addedAt;
|
||||
|
||||
/// Product name from cart API
|
||||
final String? itemName;
|
||||
|
||||
/// Product image URL from cart API
|
||||
final String? image;
|
||||
|
||||
/// Conversion factor (m² to tiles) from cart API
|
||||
final double? conversionOfSm;
|
||||
|
||||
const CartItem({
|
||||
required this.cartItemId,
|
||||
required this.cartId,
|
||||
@@ -39,6 +48,9 @@ class CartItem {
|
||||
required this.unitPrice,
|
||||
required this.subtotal,
|
||||
required this.addedAt,
|
||||
this.itemName,
|
||||
this.image,
|
||||
this.conversionOfSm,
|
||||
});
|
||||
|
||||
/// Calculate subtotal (for verification)
|
||||
@@ -53,6 +65,9 @@ class CartItem {
|
||||
double? unitPrice,
|
||||
double? subtotal,
|
||||
DateTime? addedAt,
|
||||
String? itemName,
|
||||
String? image,
|
||||
double? conversionOfSm,
|
||||
}) {
|
||||
return CartItem(
|
||||
cartItemId: cartItemId ?? this.cartItemId,
|
||||
@@ -62,6 +77,9 @@ class CartItem {
|
||||
unitPrice: unitPrice ?? this.unitPrice,
|
||||
subtotal: subtotal ?? this.subtotal,
|
||||
addedAt: addedAt ?? this.addedAt,
|
||||
itemName: itemName ?? this.itemName,
|
||||
image: image ?? this.image,
|
||||
conversionOfSm: conversionOfSm ?? this.conversionOfSm,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user