Fakultas Ilmu Komputer UI

donation.g.dart 3.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'donation.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

Donation _$DonationFromJson(Map<String, dynamic> json) {
  return Donation(
    id: json['id'] as String,
    donationNumber: json['donation_number'] as String,
13
14
    bankAccountTransferDestination:
        json['bank_account_transfer_destination'] as String,
15
16
17
    user: json['user'] as String,
    userUsername: json['user_username'] as String,
    program: json['program'] as String,
18
19
20
21
22
23
24
    userBankName: json['user_bank_name'] as String,
    transferDestinationBankName:
        json['transfer_destination_bank_name'] as String,
    transferDestinationBankAccountName:
        json['transfer_destination_bank_account_name'] as String,
    transferDestinationBankAccountNumber:
        json['transfer_destination_bank_account_number'] as String,
25
26
27
28
29
30
31
32
33
34
35
    programCode: json['program_code'] as String,
    userFullName: json['user_full_name'] as String,
    userPhoneNumber: json['user_phone_number'] as String,
    programName: json['program_name'] as String,
    amount: json['amount'] as String,
    donationStatus: stringToStatusDonation(json['donation_status'] as String),
    readableDonationStatus: json['readable_donation_status'] as String,
    proofOfBankTransfer: json['proof_of_bank_transfer'] as String,
    userBankAccountName: json['user_bank_account_name'] as String,
    createdAt: DateTime.parse(json['created_at'] as String),
    updatedAt: DateTime.parse(json['updated_at'] as String),
36
37
38
39
40
    donationType: json['donation_type'] as String,
    goodsQuantity: json['goods_quantity'] as String,
    goodsDescription: json['goods_description'] as String,
    deliveryMethod: json['delivery_method'] as String,
    deliveryAddress: json['delivery_address'] as String,
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  );
}

Map<String, dynamic> _$DonationToJson(Donation instance) => <String, dynamic>{
      'id': instance.id,
      'donation_number': instance.donationNumber,
      'user': instance.user,
      'user_username': instance.userUsername,
      'program': instance.program,
      'program_code': instance.programCode,
      'user_full_name': instance.userFullName,
      'user_phone_number': instance.userPhoneNumber,
      'program_name': instance.programName,
      'amount': instance.amount,
      'donation_status': _$StatusDonationEnumMap[instance.donationStatus],
      'readable_donation_status': instance.readableDonationStatus,
      'proof_of_bank_transfer': instance.proofOfBankTransfer,
      'user_bank_account_name': instance.userBankAccountName,
59
      'user_bank_name': instance.userBankName,
60
61
      'bank_account_transfer_destination':
          instance.bankAccountTransferDestination,
62
63
64
65
66
      'transfer_destination_bank_name': instance.transferDestinationBankName,
      'transfer_destination_bank_account_name':
          instance.transferDestinationBankAccountName,
      'transfer_destination_bank_account_number':
          instance.transferDestinationBankAccountNumber,
67
68
      'created_at': instance.createdAt.toIso8601String(),
      'updated_at': instance.updatedAt.toIso8601String(),
69
70
71
72
      'donation_type': instance.donationType,
      'goods_quantity': instance.goodsQuantity,
      'goods_description': instance.goodsDescription,
      'delivery_method': instance.deliveryMethod,
73
      'delivery_address': instance.deliveryAddress,
74
75
76
77
78
79
80
81
    };

const _$StatusDonationEnumMap = {
  StatusDonation.waitAdminConfirmation: 'waitAdminConfirmation',
  StatusDonation.waitProofAgain: 'waitProofAgain',
  StatusDonation.completed: 'completed',
  StatusDonation.canceled: 'canceled',
};