EnakPoint & EnakCoin wallet, PIN, outlet, order, community, reward
- Wallet EnakPoint & EnakCoin: beranda, riwayat, saldo kedaluwarsa, kode bayar, tukar EnakCoin, transfer - PIN (buat, ganti, lupa), outlet, riwayat order, game spin - Halaman community, webview, coming soon, dan ikon menu beranda baru - Redesign Reward Saya: kartu tiket, filter chip, detail kode + QR - Hapus customer point loader, menu, dan checkout lama - Base URL ke enaklo-pos-api.altru.id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5954510b93
commit
f5e3075205
@@ -0,0 +1,88 @@
|
||||
part of '../wallet.dart';
|
||||
|
||||
/// Order milik customer di daftar riwayat (§4.5).
|
||||
@freezed
|
||||
abstract class CustomerOrder with _$CustomerOrder {
|
||||
const CustomerOrder._();
|
||||
|
||||
const factory CustomerOrder({
|
||||
required String id,
|
||||
required String orderNumber,
|
||||
required String outletName,
|
||||
required String orderType,
|
||||
required String status,
|
||||
required String paymentStatus,
|
||||
required int totalAmount,
|
||||
required int itemCount,
|
||||
required bool isVoid,
|
||||
required bool isRefund,
|
||||
required int pointsEarned,
|
||||
required int coinsEarned,
|
||||
DateTime? createdAt,
|
||||
}) = _CustomerOrder;
|
||||
|
||||
bool get isDineIn => orderType == 'dine_in';
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CustomerOrderPage with _$CustomerOrderPage {
|
||||
const factory CustomerOrderPage({
|
||||
required List<CustomerOrder> items,
|
||||
required int page,
|
||||
required int totalPages,
|
||||
}) = _CustomerOrderPage;
|
||||
}
|
||||
|
||||
/// Detail order: field [order] ditambah rincian item dan pembayaran.
|
||||
@freezed
|
||||
abstract class CustomerOrderDetail with _$CustomerOrderDetail {
|
||||
const factory CustomerOrderDetail({
|
||||
required CustomerOrder order,
|
||||
String? tableNumber,
|
||||
required int subtotal,
|
||||
required int discountAmount,
|
||||
required int taxAmount,
|
||||
required int refundAmount,
|
||||
required List<CustomerOrderItem> items,
|
||||
required List<CustomerOrderPayment> payments,
|
||||
}) = _CustomerOrderDetail;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CustomerOrderItem with _$CustomerOrderItem {
|
||||
const CustomerOrderItem._();
|
||||
|
||||
const factory CustomerOrderItem({
|
||||
required String id,
|
||||
required String productName,
|
||||
String? variantName,
|
||||
required int quantity,
|
||||
|
||||
/// Hanya untuk item timbangan, mis. 4,2 [unitName].
|
||||
double? weight,
|
||||
String? unitName,
|
||||
required int unitPrice,
|
||||
required int totalPrice,
|
||||
required int refundQuantity,
|
||||
}) = _CustomerOrderItem;
|
||||
|
||||
bool get isWeighted => weight != null;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CustomerOrderPayment with _$CustomerOrderPayment {
|
||||
const CustomerOrderPayment._();
|
||||
|
||||
const factory CustomerOrderPayment({
|
||||
required String id,
|
||||
required String methodName,
|
||||
required String methodType,
|
||||
required int amount,
|
||||
required int refundAmount,
|
||||
|
||||
/// Hanya pada pembayaran EnakPoint.
|
||||
int? pointsUsed,
|
||||
}) = _CustomerOrderPayment;
|
||||
|
||||
bool get isPoint => methodType == 'point';
|
||||
}
|
||||
Reference in New Issue
Block a user