421 lines
15 KiB
Dart
421 lines
15 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'wallet_dtos.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_WalletSummaryDto _$WalletSummaryDtoFromJson(Map<String, dynamic> json) =>
|
|
_WalletSummaryDto(
|
|
pointBalance: (json['point_balance'] as num?)?.toInt(),
|
|
coinBalance: (json['coin_balance'] as num?)?.toInt(),
|
|
pointValue: (json['point_value'] as num?)?.toInt(),
|
|
pointDiscountValue: (json['point_discount_value'] as num?)?.toInt(),
|
|
nearestExpiring: json['nearest_expiring'] == null
|
|
? null
|
|
: NearestExpiringDto.fromJson(
|
|
json['nearest_expiring'] as Map<String, dynamic>,
|
|
),
|
|
recentTransactions: (json['recent_transactions'] as List<dynamic>?)
|
|
?.map((e) => WalletTransactionDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
);
|
|
|
|
Map<String, dynamic> _$WalletSummaryDtoToJson(_WalletSummaryDto instance) =>
|
|
<String, dynamic>{
|
|
'point_balance': instance.pointBalance,
|
|
'coin_balance': instance.coinBalance,
|
|
'point_value': instance.pointValue,
|
|
'point_discount_value': instance.pointDiscountValue,
|
|
'nearest_expiring': instance.nearestExpiring,
|
|
'recent_transactions': instance.recentTransactions,
|
|
};
|
|
|
|
_NearestExpiringDto _$NearestExpiringDtoFromJson(Map<String, dynamic> json) =>
|
|
_NearestExpiringDto(
|
|
point: json['point'] == null
|
|
? null
|
|
: ExpiringAmountDto.fromJson(json['point'] as Map<String, dynamic>),
|
|
coin: json['coin'] == null
|
|
? null
|
|
: ExpiringAmountDto.fromJson(json['coin'] as Map<String, dynamic>),
|
|
);
|
|
|
|
Map<String, dynamic> _$NearestExpiringDtoToJson(_NearestExpiringDto instance) =>
|
|
<String, dynamic>{'point': instance.point, 'coin': instance.coin};
|
|
|
|
_ExpiringAmountDto _$ExpiringAmountDtoFromJson(Map<String, dynamic> json) =>
|
|
_ExpiringAmountDto(
|
|
amount: (json['amount'] as num?)?.toInt(),
|
|
date: json['date'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ExpiringAmountDtoToJson(_ExpiringAmountDto instance) =>
|
|
<String, dynamic>{'amount': instance.amount, 'date': instance.date};
|
|
|
|
_WalletTransactionDto _$WalletTransactionDtoFromJson(
|
|
Map<String, dynamic> json,
|
|
) => _WalletTransactionDto(
|
|
id: json['id'] as String?,
|
|
currency: json['currency'] as String?,
|
|
type: json['type'] as String?,
|
|
amount: (json['amount'] as num?)?.toInt(),
|
|
balanceAfter: (json['balance_after'] as num?)?.toInt(),
|
|
description: json['description'] as String?,
|
|
groupId: json['group_id'] as String?,
|
|
expiresAt: json['expires_at'] as String?,
|
|
createdAt: json['created_at'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$WalletTransactionDtoToJson(
|
|
_WalletTransactionDto instance,
|
|
) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'currency': instance.currency,
|
|
'type': instance.type,
|
|
'amount': instance.amount,
|
|
'balance_after': instance.balanceAfter,
|
|
'description': instance.description,
|
|
'group_id': instance.groupId,
|
|
'expires_at': instance.expiresAt,
|
|
'created_at': instance.createdAt,
|
|
};
|
|
|
|
_WalletPaginationDto _$WalletPaginationDtoFromJson(Map<String, dynamic> json) =>
|
|
_WalletPaginationDto(
|
|
page: (json['page'] as num?)?.toInt(),
|
|
limit: (json['limit'] as num?)?.toInt(),
|
|
totalCount: (json['total_count'] as num?)?.toInt(),
|
|
totalPages: (json['total_pages'] as num?)?.toInt(),
|
|
);
|
|
|
|
Map<String, dynamic> _$WalletPaginationDtoToJson(
|
|
_WalletPaginationDto instance,
|
|
) => <String, dynamic>{
|
|
'page': instance.page,
|
|
'limit': instance.limit,
|
|
'total_count': instance.totalCount,
|
|
'total_pages': instance.totalPages,
|
|
};
|
|
|
|
_WalletExpiringDto _$WalletExpiringDtoFromJson(Map<String, dynamic> json) =>
|
|
_WalletExpiringDto(
|
|
point: (json['point'] as List<dynamic>?)
|
|
?.map((e) => ExpiringAmountDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
coin: (json['coin'] as List<dynamic>?)
|
|
?.map((e) => ExpiringAmountDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
);
|
|
|
|
Map<String, dynamic> _$WalletExpiringDtoToJson(_WalletExpiringDto instance) =>
|
|
<String, dynamic>{'point': instance.point, 'coin': instance.coin};
|
|
|
|
_ExchangePreviewDto _$ExchangePreviewDtoFromJson(Map<String, dynamic> json) =>
|
|
_ExchangePreviewDto(
|
|
coinAmount: (json['coin_amount'] as num?)?.toInt(),
|
|
pointAmount: (json['point_amount'] as num?)?.toInt(),
|
|
coinBalance: (json['coin_balance'] as num?)?.toInt(),
|
|
coins: (json['coins'] as num?)?.toInt(),
|
|
points: (json['points'] as num?)?.toInt(),
|
|
valid: json['valid'] as bool?,
|
|
reason: json['reason'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ExchangePreviewDtoToJson(_ExchangePreviewDto instance) =>
|
|
<String, dynamic>{
|
|
'coin_amount': instance.coinAmount,
|
|
'point_amount': instance.pointAmount,
|
|
'coin_balance': instance.coinBalance,
|
|
'coins': instance.coins,
|
|
'points': instance.points,
|
|
'valid': instance.valid,
|
|
'reason': instance.reason,
|
|
};
|
|
|
|
_ExchangeResultDto _$ExchangeResultDtoFromJson(Map<String, dynamic> json) =>
|
|
_ExchangeResultDto(
|
|
coins: (json['coins'] as num?)?.toInt(),
|
|
points: (json['points'] as num?)?.toInt(),
|
|
coinBalance: (json['coin_balance'] as num?)?.toInt(),
|
|
pointBalance: (json['point_balance'] as num?)?.toInt(),
|
|
lots: (json['lots'] as List<dynamic>?)
|
|
?.map((e) => WalletLotDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
replayed: json['replayed'] as bool?,
|
|
);
|
|
|
|
Map<String, dynamic> _$ExchangeResultDtoToJson(_ExchangeResultDto instance) =>
|
|
<String, dynamic>{
|
|
'coins': instance.coins,
|
|
'points': instance.points,
|
|
'coin_balance': instance.coinBalance,
|
|
'point_balance': instance.pointBalance,
|
|
'lots': instance.lots,
|
|
'replayed': instance.replayed,
|
|
};
|
|
|
|
_WalletLotDto _$WalletLotDtoFromJson(Map<String, dynamic> json) =>
|
|
_WalletLotDto(
|
|
amount: (json['amount'] as num?)?.toInt(),
|
|
expiresAt: json['expires_at'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$WalletLotDtoToJson(_WalletLotDto instance) =>
|
|
<String, dynamic>{
|
|
'amount': instance.amount,
|
|
'expires_at': instance.expiresAt,
|
|
};
|
|
|
|
_TransferRecipientDto _$TransferRecipientDtoFromJson(
|
|
Map<String, dynamic> json,
|
|
) => _TransferRecipientDto(
|
|
name: json['name'] as String?,
|
|
phoneNumber: json['phone_number'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$TransferRecipientDtoToJson(
|
|
_TransferRecipientDto instance,
|
|
) => <String, dynamic>{
|
|
'name': instance.name,
|
|
'phone_number': instance.phoneNumber,
|
|
};
|
|
|
|
_TransferResultDto _$TransferResultDtoFromJson(Map<String, dynamic> json) =>
|
|
_TransferResultDto(
|
|
currency: json['currency'] as String?,
|
|
amount: (json['amount'] as num?)?.toInt(),
|
|
recipient: json['recipient'] == null
|
|
? null
|
|
: TransferRecipientDto.fromJson(
|
|
json['recipient'] as Map<String, dynamic>,
|
|
),
|
|
lots: (json['lots'] as List<dynamic>?)
|
|
?.map((e) => WalletLotDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
balance: (json['balance'] as num?)?.toInt(),
|
|
replayed: json['replayed'] as bool?,
|
|
);
|
|
|
|
Map<String, dynamic> _$TransferResultDtoToJson(_TransferResultDto instance) =>
|
|
<String, dynamic>{
|
|
'currency': instance.currency,
|
|
'amount': instance.amount,
|
|
'recipient': instance.recipient,
|
|
'lots': instance.lots,
|
|
'balance': instance.balance,
|
|
'replayed': instance.replayed,
|
|
};
|
|
|
|
_PinStatusDto _$PinStatusDtoFromJson(Map<String, dynamic> json) =>
|
|
_PinStatusDto(
|
|
hasPin: json['has_pin'] as bool?,
|
|
lockedUntil: json['locked_until'] as String?,
|
|
transferBlockedUntil: json['transfer_blocked_until'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$PinStatusDtoToJson(_PinStatusDto instance) =>
|
|
<String, dynamic>{
|
|
'has_pin': instance.hasPin,
|
|
'locked_until': instance.lockedUntil,
|
|
'transfer_blocked_until': instance.transferBlockedUntil,
|
|
};
|
|
|
|
_PinOtpDto _$PinOtpDtoFromJson(Map<String, dynamic> json) => _PinOtpDto(
|
|
purpose: json['purpose'] as String?,
|
|
otpToken: json['otp_token'] as String?,
|
|
expiresAt: json['expires_at'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$PinOtpDtoToJson(_PinOtpDto instance) =>
|
|
<String, dynamic>{
|
|
'purpose': instance.purpose,
|
|
'otp_token': instance.otpToken,
|
|
'expires_at': instance.expiresAt,
|
|
};
|
|
|
|
_OutletDto _$OutletDtoFromJson(Map<String, dynamic> json) => _OutletDto(
|
|
id: json['id'] as String?,
|
|
name: json['name'] as String?,
|
|
address: json['address'] as String?,
|
|
earnsPoints: json['earns_points'] as bool?,
|
|
earnsCoins: json['earns_coins'] as bool?,
|
|
);
|
|
|
|
Map<String, dynamic> _$OutletDtoToJson(_OutletDto instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
'address': instance.address,
|
|
'earns_points': instance.earnsPoints,
|
|
'earns_coins': instance.earnsCoins,
|
|
};
|
|
|
|
_CustomerOrderDto _$CustomerOrderDtoFromJson(Map<String, dynamic> json) =>
|
|
_CustomerOrderDto(
|
|
id: json['id'] as String?,
|
|
orderNumber: json['order_number'] as String?,
|
|
outletName: json['outlet_name'] as String?,
|
|
orderType: json['order_type'] as String?,
|
|
status: json['status'] as String?,
|
|
paymentStatus: json['payment_status'] as String?,
|
|
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
|
itemCount: (json['item_count'] as num?)?.toInt(),
|
|
isVoid: json['is_void'] as bool?,
|
|
isRefund: json['is_refund'] as bool?,
|
|
pointsEarned: (json['points_earned'] as num?)?.toInt(),
|
|
coinsEarned: (json['coins_earned'] as num?)?.toInt(),
|
|
createdAt: json['created_at'] as String?,
|
|
tableNumber: json['table_number'] as String?,
|
|
subtotal: (json['subtotal'] as num?)?.toInt(),
|
|
discountAmount: (json['discount_amount'] as num?)?.toInt(),
|
|
taxAmount: (json['tax_amount'] as num?)?.toInt(),
|
|
refundAmount: (json['refund_amount'] as num?)?.toInt(),
|
|
items: (json['items'] as List<dynamic>?)
|
|
?.map((e) => CustomerOrderItemDto.fromJson(e as Map<String, dynamic>))
|
|
.toList(),
|
|
payments: (json['payments'] as List<dynamic>?)
|
|
?.map(
|
|
(e) => CustomerOrderPaymentDto.fromJson(e as Map<String, dynamic>),
|
|
)
|
|
.toList(),
|
|
);
|
|
|
|
Map<String, dynamic> _$CustomerOrderDtoToJson(_CustomerOrderDto instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'order_number': instance.orderNumber,
|
|
'outlet_name': instance.outletName,
|
|
'order_type': instance.orderType,
|
|
'status': instance.status,
|
|
'payment_status': instance.paymentStatus,
|
|
'total_amount': instance.totalAmount,
|
|
'item_count': instance.itemCount,
|
|
'is_void': instance.isVoid,
|
|
'is_refund': instance.isRefund,
|
|
'points_earned': instance.pointsEarned,
|
|
'coins_earned': instance.coinsEarned,
|
|
'created_at': instance.createdAt,
|
|
'table_number': instance.tableNumber,
|
|
'subtotal': instance.subtotal,
|
|
'discount_amount': instance.discountAmount,
|
|
'tax_amount': instance.taxAmount,
|
|
'refund_amount': instance.refundAmount,
|
|
'items': instance.items,
|
|
'payments': instance.payments,
|
|
};
|
|
|
|
_CustomerOrderItemDto _$CustomerOrderItemDtoFromJson(
|
|
Map<String, dynamic> json,
|
|
) => _CustomerOrderItemDto(
|
|
id: json['id'] as String?,
|
|
productName: json['product_name'] as String?,
|
|
variantName: json['variant_name'] as String?,
|
|
quantity: (json['quantity'] as num?)?.toInt(),
|
|
weight: (json['weight'] as num?)?.toDouble(),
|
|
unitName: json['unit_name'] as String?,
|
|
unitPrice: (json['unit_price'] as num?)?.toInt(),
|
|
totalPrice: (json['total_price'] as num?)?.toInt(),
|
|
refundQuantity: (json['refund_quantity'] as num?)?.toInt(),
|
|
);
|
|
|
|
Map<String, dynamic> _$CustomerOrderItemDtoToJson(
|
|
_CustomerOrderItemDto instance,
|
|
) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'product_name': instance.productName,
|
|
'variant_name': instance.variantName,
|
|
'quantity': instance.quantity,
|
|
'weight': instance.weight,
|
|
'unit_name': instance.unitName,
|
|
'unit_price': instance.unitPrice,
|
|
'total_price': instance.totalPrice,
|
|
'refund_quantity': instance.refundQuantity,
|
|
};
|
|
|
|
_CustomerOrderPaymentDto _$CustomerOrderPaymentDtoFromJson(
|
|
Map<String, dynamic> json,
|
|
) => _CustomerOrderPaymentDto(
|
|
id: json['id'] as String?,
|
|
methodName: json['method_name'] as String?,
|
|
methodType: json['method_type'] as String?,
|
|
amount: (json['amount'] as num?)?.toInt(),
|
|
refundAmount: (json['refund_amount'] as num?)?.toInt(),
|
|
);
|
|
|
|
Map<String, dynamic> _$CustomerOrderPaymentDtoToJson(
|
|
_CustomerOrderPaymentDto instance,
|
|
) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'method_name': instance.methodName,
|
|
'method_type': instance.methodType,
|
|
'amount': instance.amount,
|
|
'refund_amount': instance.refundAmount,
|
|
};
|
|
|
|
_VoucherDto _$VoucherDtoFromJson(Map<String, dynamic> json) => _VoucherDto(
|
|
id: json['id'] as String?,
|
|
name: json['name'] as String?,
|
|
description: json['description'] as String?,
|
|
imageUrl: json['image_url'] as String?,
|
|
voucherType: json['voucher_type'] as String?,
|
|
faceValue: (json['face_value'] as num?)?.toInt(),
|
|
pointCost: (json['point_cost'] as num?)?.toInt(),
|
|
maxPerCustomer: (json['max_per_customer'] as num?)?.toInt(),
|
|
validUntil: json['valid_until'] as String?,
|
|
available: (json['available'] as num?)?.toInt(),
|
|
);
|
|
|
|
Map<String, dynamic> _$VoucherDtoToJson(_VoucherDto instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'name': instance.name,
|
|
'description': instance.description,
|
|
'image_url': instance.imageUrl,
|
|
'voucher_type': instance.voucherType,
|
|
'face_value': instance.faceValue,
|
|
'point_cost': instance.pointCost,
|
|
'max_per_customer': instance.maxPerCustomer,
|
|
'valid_until': instance.validUntil,
|
|
'available': instance.available,
|
|
};
|
|
|
|
_VoucherRedemptionDto _$VoucherRedemptionDtoFromJson(
|
|
Map<String, dynamic> json,
|
|
) => _VoucherRedemptionDto(
|
|
id: json['id'] as String?,
|
|
voucherId: json['voucher_id'] as String?,
|
|
voucherName: json['voucher_name'] as String?,
|
|
voucherImageUrl: json['voucher_image_url'] as String?,
|
|
voucherType: json['voucher_type'] as String?,
|
|
status: json['status'] as String?,
|
|
faceValue: (json['face_value'] as num?)?.toInt(),
|
|
pointCost: (json['point_cost'] as num?)?.toInt(),
|
|
code: json['code'] as String?,
|
|
codeExpiresAt: json['code_expires_at'] as String?,
|
|
completedAt: json['completed_at'] as String?,
|
|
createdAt: json['created_at'] as String?,
|
|
pointBalance: (json['point_balance'] as num?)?.toInt(),
|
|
replayed: json['replayed'] as bool?,
|
|
);
|
|
|
|
Map<String, dynamic> _$VoucherRedemptionDtoToJson(
|
|
_VoucherRedemptionDto instance,
|
|
) => <String, dynamic>{
|
|
'id': instance.id,
|
|
'voucher_id': instance.voucherId,
|
|
'voucher_name': instance.voucherName,
|
|
'voucher_image_url': instance.voucherImageUrl,
|
|
'voucher_type': instance.voucherType,
|
|
'status': instance.status,
|
|
'face_value': instance.faceValue,
|
|
'point_cost': instance.pointCost,
|
|
'code': instance.code,
|
|
'code_expires_at': instance.codeExpiresAt,
|
|
'completed_at': instance.completedAt,
|
|
'created_at': instance.createdAt,
|
|
'point_balance': instance.pointBalance,
|
|
'replayed': instance.replayed,
|
|
};
|