feat: add more detailed history and group per day
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import 'tab_item_purchase.dart';
|
||||
import '../utils/collection_utils.dart';
|
||||
|
||||
class TabItem {
|
||||
final String id;
|
||||
final String tabId;
|
||||
@@ -5,6 +8,7 @@ class TabItem {
|
||||
final String productName;
|
||||
final int quantity;
|
||||
final int unitPriceInCents;
|
||||
final List<TabItemPurchase> purchases;
|
||||
|
||||
const TabItem({
|
||||
required this.id,
|
||||
@@ -13,6 +17,7 @@ class TabItem {
|
||||
required this.productName,
|
||||
required this.quantity,
|
||||
required this.unitPriceInCents,
|
||||
this.purchases = const [],
|
||||
});
|
||||
|
||||
int get lineTotalInCents => quantity * unitPriceInCents;
|
||||
@@ -34,15 +39,17 @@ class TabItem {
|
||||
productId == other.productId &&
|
||||
productName == other.productName &&
|
||||
quantity == other.quantity &&
|
||||
unitPriceInCents == other.unitPriceInCents;
|
||||
unitPriceInCents == other.unitPriceInCents &&
|
||||
listEquals(purchases, other.purchases);
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
id,
|
||||
tabId,
|
||||
productId,
|
||||
productName,
|
||||
quantity,
|
||||
unitPriceInCents,
|
||||
);
|
||||
id,
|
||||
tabId,
|
||||
productId,
|
||||
productName,
|
||||
quantity,
|
||||
unitPriceInCents,
|
||||
Object.hashAll(purchases),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user