prasule/lib/api/walletentry.dart
2023-11-01 15:39:24 +01:00

30 lines
862 B
Dart

import 'package:prasule/api/category.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:prasule/api/entry_data.dart';
part 'walletentry.g.dart';
@JsonSerializable()
/// This is an entry containing a single item
class WalletSingleEntry {
EntryType type;
EntryData data;
DateTime date;
WalletCategory category;
int id;
WalletSingleEntry(
{required this.data,
required this.type,
required this.date,
required this.category,
required this.id});
/// Connect the generated [_$WalletEntry] function to the `fromJson`
/// factory.
factory WalletSingleEntry.fromJson(Map<String, dynamic> json) =>
_$WalletSingleEntryFromJson(json);
/// Connect the generated [_$WalletEntryToJson] function to the `toJson` method.
Map<String, dynamic> toJson() => _$WalletSingleEntryToJson(this);
}