rluv_client/lib/models/budget.dart

35 lines
824 B
Dart
Raw Normal View History

2023-07-19 02:16:13 -06:00
import 'package:json_annotation/json_annotation.dart';
import '../global/utils.dart';
part 'budget.g.dart';
@JsonSerializable()
class Budget {
const Budget({
this.id,
2023-07-27 01:40:26 -06:00
required this.familyId,
2023-07-19 02:16:13 -06:00
required this.name,
2023-08-17 13:34:30 -06:00
required this.expectedIncome,
2023-07-19 02:16:13 -06:00
required this.createdAt,
required this.updatedAt,
2023-07-22 21:29:32 -06:00
this.hide = false,
2023-07-19 02:16:13 -06:00
});
final int? id;
2023-07-27 01:40:26 -06:00
final int familyId;
2023-08-17 13:34:30 -06:00
final double? expectedIncome;
2023-07-19 02:16:13 -06:00
final String name;
2023-07-22 21:29:32 -06:00
@JsonKey(fromJson: boolFromJson, toJson: boolToJson)
final bool hide;
2023-07-19 02:16:13 -06:00
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime createdAt;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime updatedAt;
factory Budget.fromJson(Map<String, dynamic> json) => _$BudgetFromJson(json);
Map<String, dynamic> toJson() => _$BudgetToJson(this);
}