rluv_client/lib/models/transaction_model.g.dart

42 lines
1.6 KiB
Dart
Raw Normal View History

2023-07-19 02:16:13 -06:00
// 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(),
2023-07-22 21:29:32 -06:00
type: $enumDecode(_$TransactionTypeEnumMap, json['type']),
2023-07-19 02:16:13 -06:00
budgetId: json['budget_id'] as int,
2023-07-22 21:29:32 -06:00
budgetCategoryId: json['budget_category_id'] as int?,
2023-08-17 13:34:30 -06:00
createdByUserId: json['created_by_user_id'] as int,
2023-07-19 02:16:13 -06:00
date: dateFromJson(json['date'] as int),
2023-07-22 21:29:32 -06:00
memo: json['memo'] as String?,
2023-07-19 02:16:13 -06:00
createdAt: dateFromJson(json['created_at'] as int),
2023-07-22 21:29:32 -06:00
updatedAt: dateFromJson(json['updated_at'] as int),
hide: json['hide'] == null ? false : boolFromJson(json['hide'] as int),
2023-07-19 02:16:13 -06:00
);
Map<String, dynamic> _$TransactionToJson(Transaction instance) =>
<String, dynamic>{
'id': instance.id,
'budget_category_id': instance.budgetCategoryId,
2023-07-22 21:29:32 -06:00
'budget_id': instance.budgetId,
2023-08-17 13:34:30 -06:00
'created_by_user_id': instance.createdByUserId,
2023-07-19 02:16:13 -06:00
'amount': instance.amount,
2023-07-22 21:29:32 -06:00
'memo': instance.memo,
'type': _$TransactionTypeEnumMap[instance.type]!,
'hide': boolToJson(instance.hide),
2023-07-19 02:16:13 -06:00
'date': dateToJson(instance.date),
'created_at': dateToJson(instance.createdAt),
2023-07-22 21:29:32 -06:00
'updated_at': dateToJson(instance.updatedAt),
2023-07-19 02:16:13 -06:00
};
const _$TransactionTypeEnumMap = {
TransactionType.income: 'income',
TransactionType.expense: 'expense',
};