rluv_client/lib/models/transaction_model.g.dart
2023-07-19 02:16:13 -06:00

37 lines
1.3 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(),
transactionType:
$enumDecode(_$TransactionTypeEnumMap, json['transaction_type']),
budgetId: json['budget_id'] as int,
budgetCategoryId: json['budget_category_id'] as int,
addedByUserId: json['added_by_user_id'] as int,
date: dateFromJson(json['date'] as int),
createdAt: dateFromJson(json['created_at'] as int),
);
Map<String, dynamic> _$TransactionToJson(Transaction instance) =>
<String, dynamic>{
'id': instance.id,
'budget_id': instance.budgetId,
'budget_category_id': instance.budgetCategoryId,
'added_by_user_id': instance.addedByUserId,
'amount': instance.amount,
'transaction_type': _$TransactionTypeEnumMap[instance.transactionType]!,
'date': dateToJson(instance.date),
'created_at': dateToJson(instance.createdAt),
};
const _$TransactionTypeEnumMap = {
TransactionType.income: 'income',
TransactionType.expense: 'expense',
};