42 lines
1.6 KiB
Dart
42 lines
1.6 KiB
Dart
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||
|
|
||
|
part of 'transaction_model.dart';
|
||
|
|
||
|
// **************************************************************************
|
||
|
// JsonSerializableGenerator
|
||
|
// **************************************************************************
|
||
|
|
||
|
Transaction _$TransactionFromJson(Map<String, dynamic> json) => Transaction(
|
||
|
id: json['id'] as int?,
|
||
|
amount: (json['amount'] as num).toDouble(),
|
||
|
type: $enumDecode(_$TransactionTypeEnumMap, json['type']),
|
||
|
budgetId: json['budget_id'] as int,
|
||
|
budgetCategoryId: json['budget_category_id'] as int?,
|
||
|
createdByUserId: json['created_by_user_id'] as int,
|
||
|
date: dateFromJson(json['date'] as int),
|
||
|
memo: json['memo'] as String?,
|
||
|
createdAt: dateFromJson(json['created_at'] as int),
|
||
|
updatedAt: dateFromJson(json['updated_at'] as int),
|
||
|
hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int),
|
||
|
);
|
||
|
|
||
|
Map<String, dynamic> _$TransactionToJson(Transaction instance) =>
|
||
|
<String, dynamic>{
|
||
|
'id': instance.id,
|
||
|
'budget_category_id': instance.budgetCategoryId,
|
||
|
'budget_id': instance.budgetId,
|
||
|
'created_by_user_id': instance.createdByUserId,
|
||
|
'amount': instance.amount,
|
||
|
'memo': instance.memo,
|
||
|
'type': _$TransactionTypeEnumMap[instance.type]!,
|
||
|
'hide': boolToJson(instance.hide),
|
||
|
'date': dateToJson(instance.date),
|
||
|
'created_at': dateToJson(instance.createdAt),
|
||
|
'updated_at': dateToJson(instance.updatedAt),
|
||
|
};
|
||
|
|
||
|
const _$TransactionTypeEnumMap = {
|
||
|
TransactionType.income: 'income',
|
||
|
TransactionType.expense: 'expense',
|
||
|
};
|