- Add delivery address list, add, edit, delete, set default functionality - Add order history screen - Add profile settings screen - Add account screen with avatar upload - Update restaurant select gradient direction - Add states API endpoint for address forms - Fix table names (tt_States) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.6 KiB
Dart
48 lines
1.6 KiB
Dart
class OrderHistoryItem {
|
|
final int orderId;
|
|
final String orderUuid;
|
|
final int businessId;
|
|
final String businessName;
|
|
final double total;
|
|
final int statusId;
|
|
final String statusName;
|
|
final int orderTypeId;
|
|
final String typeName;
|
|
final int itemCount;
|
|
final DateTime createdAt;
|
|
final DateTime? completedAt;
|
|
|
|
const OrderHistoryItem({
|
|
required this.orderId,
|
|
required this.orderUuid,
|
|
required this.businessId,
|
|
required this.businessName,
|
|
required this.total,
|
|
required this.statusId,
|
|
required this.statusName,
|
|
required this.orderTypeId,
|
|
required this.typeName,
|
|
required this.itemCount,
|
|
required this.createdAt,
|
|
this.completedAt,
|
|
});
|
|
|
|
factory OrderHistoryItem.fromJson(Map<String, dynamic> json) {
|
|
return OrderHistoryItem(
|
|
orderId: (json["OrderID"] as num).toInt(),
|
|
orderUuid: json["OrderUUID"] as String? ?? "",
|
|
businessId: (json["BusinessID"] as num).toInt(),
|
|
businessName: json["BusinessName"] as String? ?? "Unknown",
|
|
total: (json["OrderTotal"] as num?)?.toDouble() ?? 0.0,
|
|
statusId: (json["OrderStatusID"] as num).toInt(),
|
|
statusName: json["StatusName"] as String? ?? "Unknown",
|
|
orderTypeId: (json["OrderTypeID"] as num?)?.toInt() ?? 0,
|
|
typeName: json["TypeName"] as String? ?? "Unknown",
|
|
itemCount: (json["ItemCount"] as num?)?.toInt() ?? 0,
|
|
createdAt: DateTime.tryParse(json["CreatedAt"] as String? ?? "") ?? DateTime.now(),
|
|
completedAt: json["CompletedAt"] != null && (json["CompletedAt"] as String).isNotEmpty
|
|
? DateTime.tryParse(json["CompletedAt"] as String)
|
|
: null,
|
|
);
|
|
}
|
|
}
|