import 'package:json_annotation/json_annotation.dart'; import 'package:prasule/api/debt_entry.dart'; import 'package:prasule/api/debt_person.dart'; part 'debt_scenario.g.dart'; /// A folder for different entries and people @JsonSerializable() class DebtScenario { /// A folder for different entries and people DebtScenario({ required this.id, required this.name, required this.isArchived, this.entries = const [], this.people = const [], }); /// Generates a class instance from a Map factory DebtScenario.fromJson(Map json) => _$DebtScenarioFromJson(json); /// Converts the data in this instance into a Map Map toJson() => _$DebtScenarioToJson(this); /// Unique identified final int id; /// User-friendly identifier String name; /// Whether this scenario should be shown under archived ones bool isArchived; /// All entries List entries; /// All people List people; }