feat: change total to amount
This commit is contained in:
@@ -159,3 +159,12 @@ class PaymentOrderItem with _$PaymentOrderItem {
|
||||
updatedAt: '',
|
||||
);
|
||||
}
|
||||
|
||||
/// Ringkasan order untuk kartu summary: jumlah order + total nominalnya.
|
||||
@freezed
|
||||
class OrderTotal with _$OrderTotal {
|
||||
const factory OrderTotal({required int count, required int amount}) =
|
||||
_OrderTotal;
|
||||
|
||||
factory OrderTotal.empty() => const OrderTotal(count: 0, amount: 0);
|
||||
}
|
||||
|
||||
@@ -1904,6 +1904,155 @@ abstract class _PaymentOrderItem implements PaymentOrderItem {
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$OrderTotal {
|
||||
int get count => throw _privateConstructorUsedError;
|
||||
int get amount => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of OrderTotal
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$OrderTotalCopyWith<OrderTotal> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $OrderTotalCopyWith<$Res> {
|
||||
factory $OrderTotalCopyWith(
|
||||
OrderTotal value,
|
||||
$Res Function(OrderTotal) then,
|
||||
) = _$OrderTotalCopyWithImpl<$Res, OrderTotal>;
|
||||
@useResult
|
||||
$Res call({int count, int amount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$OrderTotalCopyWithImpl<$Res, $Val extends OrderTotal>
|
||||
implements $OrderTotalCopyWith<$Res> {
|
||||
_$OrderTotalCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of OrderTotal
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? count = null, Object? amount = null}) {
|
||||
return _then(
|
||||
_value.copyWith(
|
||||
count: null == count
|
||||
? _value.count
|
||||
: count // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
amount: null == amount
|
||||
? _value.amount
|
||||
: amount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
)
|
||||
as $Val,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$OrderTotalImplCopyWith<$Res>
|
||||
implements $OrderTotalCopyWith<$Res> {
|
||||
factory _$$OrderTotalImplCopyWith(
|
||||
_$OrderTotalImpl value,
|
||||
$Res Function(_$OrderTotalImpl) then,
|
||||
) = __$$OrderTotalImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int count, int amount});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$OrderTotalImplCopyWithImpl<$Res>
|
||||
extends _$OrderTotalCopyWithImpl<$Res, _$OrderTotalImpl>
|
||||
implements _$$OrderTotalImplCopyWith<$Res> {
|
||||
__$$OrderTotalImplCopyWithImpl(
|
||||
_$OrderTotalImpl _value,
|
||||
$Res Function(_$OrderTotalImpl) _then,
|
||||
) : super(_value, _then);
|
||||
|
||||
/// Create a copy of OrderTotal
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? count = null, Object? amount = null}) {
|
||||
return _then(
|
||||
_$OrderTotalImpl(
|
||||
count: null == count
|
||||
? _value.count
|
||||
: count // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
amount: null == amount
|
||||
? _value.amount
|
||||
: amount // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$OrderTotalImpl implements _OrderTotal {
|
||||
const _$OrderTotalImpl({required this.count, required this.amount});
|
||||
|
||||
@override
|
||||
final int count;
|
||||
@override
|
||||
final int amount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'OrderTotal(count: $count, amount: $amount)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$OrderTotalImpl &&
|
||||
(identical(other.count, count) || other.count == count) &&
|
||||
(identical(other.amount, amount) || other.amount == amount));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, count, amount);
|
||||
|
||||
/// Create a copy of OrderTotal
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$OrderTotalImplCopyWith<_$OrderTotalImpl> get copyWith =>
|
||||
__$$OrderTotalImplCopyWithImpl<_$OrderTotalImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class _OrderTotal implements OrderTotal {
|
||||
const factory _OrderTotal({
|
||||
required final int count,
|
||||
required final int amount,
|
||||
}) = _$OrderTotalImpl;
|
||||
|
||||
@override
|
||||
int get count;
|
||||
@override
|
||||
int get amount;
|
||||
|
||||
/// Create a copy of OrderTotal
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$OrderTotalImplCopyWith<_$OrderTotalImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$OrderFailure {
|
||||
@optionalTypeArgs
|
||||
|
||||
@@ -11,7 +11,7 @@ abstract class IOrderRepository {
|
||||
required DateTime dateTo,
|
||||
});
|
||||
|
||||
Future<Either<OrderFailure, int>> getTotalCount({
|
||||
Future<Either<OrderFailure, OrderTotal>> getTotal({
|
||||
String? status,
|
||||
String? outletId,
|
||||
required DateTime dateFrom,
|
||||
|
||||
Reference in New Issue
Block a user