This commit is contained in:
efrilm
2025-11-01 16:17:45 +07:00
parent ef23839761
commit 069c2296de
24 changed files with 2670 additions and 133 deletions
@@ -32,6 +32,7 @@ class Order with _$Order {
required int remainingAmount,
required String paymentStatus,
required int refundAmount,
required String refundReason,
required bool isVoid,
required bool isRefund,
required String notes,
@@ -72,6 +73,7 @@ class Order with _$Order {
totalPaid: 0,
paymentCount: 0,
splitType: '',
refundReason: '',
);
}
+23 -1
View File
@@ -269,6 +269,7 @@ mixin _$Order {
int get remainingAmount => throw _privateConstructorUsedError;
String get paymentStatus => throw _privateConstructorUsedError;
int get refundAmount => throw _privateConstructorUsedError;
String get refundReason => throw _privateConstructorUsedError;
bool get isVoid => throw _privateConstructorUsedError;
bool get isRefund => throw _privateConstructorUsedError;
String get notes => throw _privateConstructorUsedError;
@@ -308,6 +309,7 @@ abstract class $OrderCopyWith<$Res> {
int remainingAmount,
String paymentStatus,
int refundAmount,
String refundReason,
bool isVoid,
bool isRefund,
String notes,
@@ -352,6 +354,7 @@ class _$OrderCopyWithImpl<$Res, $Val extends Order>
Object? remainingAmount = null,
Object? paymentStatus = null,
Object? refundAmount = null,
Object? refundReason = null,
Object? isVoid = null,
Object? isRefund = null,
Object? notes = null,
@@ -426,6 +429,10 @@ class _$OrderCopyWithImpl<$Res, $Val extends Order>
? _value.refundAmount
: refundAmount // ignore: cast_nullable_to_non_nullable
as int,
refundReason: null == refundReason
? _value.refundReason
: refundReason // ignore: cast_nullable_to_non_nullable
as String,
isVoid: null == isVoid
? _value.isVoid
: isVoid // ignore: cast_nullable_to_non_nullable
@@ -500,6 +507,7 @@ abstract class _$$OrderImplCopyWith<$Res> implements $OrderCopyWith<$Res> {
int remainingAmount,
String paymentStatus,
int refundAmount,
String refundReason,
bool isVoid,
bool isRefund,
String notes,
@@ -543,6 +551,7 @@ class __$$OrderImplCopyWithImpl<$Res>
Object? remainingAmount = null,
Object? paymentStatus = null,
Object? refundAmount = null,
Object? refundReason = null,
Object? isVoid = null,
Object? isRefund = null,
Object? notes = null,
@@ -617,6 +626,10 @@ class __$$OrderImplCopyWithImpl<$Res>
? _value.refundAmount
: refundAmount // ignore: cast_nullable_to_non_nullable
as int,
refundReason: null == refundReason
? _value.refundReason
: refundReason // ignore: cast_nullable_to_non_nullable
as String,
isVoid: null == isVoid
? _value.isVoid
: isVoid // ignore: cast_nullable_to_non_nullable
@@ -685,6 +698,7 @@ class _$OrderImpl implements _Order {
required this.remainingAmount,
required this.paymentStatus,
required this.refundAmount,
required this.refundReason,
required this.isVoid,
required this.isRefund,
required this.notes,
@@ -731,6 +745,8 @@ class _$OrderImpl implements _Order {
@override
final int refundAmount;
@override
final String refundReason;
@override
final bool isVoid;
@override
final bool isRefund;
@@ -773,7 +789,7 @@ class _$OrderImpl implements _Order {
@override
String toString() {
return 'Order(id: $id, orderNumber: $orderNumber, outletId: $outletId, userId: $userId, tableNumber: $tableNumber, orderType: $orderType, status: $status, subtotal: $subtotal, taxAmount: $taxAmount, discountAmount: $discountAmount, totalAmount: $totalAmount, totalCost: $totalCost, remainingAmount: $remainingAmount, paymentStatus: $paymentStatus, refundAmount: $refundAmount, isVoid: $isVoid, isRefund: $isRefund, notes: $notes, metadata: $metadata, createdAt: $createdAt, updatedAt: $updatedAt, orderItems: $orderItems, payments: $payments, totalPaid: $totalPaid, paymentCount: $paymentCount, splitType: $splitType)';
return 'Order(id: $id, orderNumber: $orderNumber, outletId: $outletId, userId: $userId, tableNumber: $tableNumber, orderType: $orderType, status: $status, subtotal: $subtotal, taxAmount: $taxAmount, discountAmount: $discountAmount, totalAmount: $totalAmount, totalCost: $totalCost, remainingAmount: $remainingAmount, paymentStatus: $paymentStatus, refundAmount: $refundAmount, refundReason: $refundReason, isVoid: $isVoid, isRefund: $isRefund, notes: $notes, metadata: $metadata, createdAt: $createdAt, updatedAt: $updatedAt, orderItems: $orderItems, payments: $payments, totalPaid: $totalPaid, paymentCount: $paymentCount, splitType: $splitType)';
}
@override
@@ -808,6 +824,8 @@ class _$OrderImpl implements _Order {
other.paymentStatus == paymentStatus) &&
(identical(other.refundAmount, refundAmount) ||
other.refundAmount == refundAmount) &&
(identical(other.refundReason, refundReason) ||
other.refundReason == refundReason) &&
(identical(other.isVoid, isVoid) || other.isVoid == isVoid) &&
(identical(other.isRefund, isRefund) ||
other.isRefund == isRefund) &&
@@ -848,6 +866,7 @@ class _$OrderImpl implements _Order {
remainingAmount,
paymentStatus,
refundAmount,
refundReason,
isVoid,
isRefund,
notes,
@@ -887,6 +906,7 @@ abstract class _Order implements Order {
required final int remainingAmount,
required final String paymentStatus,
required final int refundAmount,
required final String refundReason,
required final bool isVoid,
required final bool isRefund,
required final String notes,
@@ -931,6 +951,8 @@ abstract class _Order implements Order {
@override
int get refundAmount;
@override
String get refundReason;
@override
bool get isVoid;
@override
bool get isRefund;
@@ -40,4 +40,10 @@ abstract class IOrderRepository {
Future<Either<OrderFailure, Payment>> createSplitBill(
PaymentSplitBillRequest request,
);
Future<Either<OrderFailure, Unit>> refundOrder({
required String id,
required String reason,
required int refundAmount,
});
}