Files
fuckKomet/lib/models/complaint.dart
2025-12-10 17:34:10 +03:00

49 lines
1.4 KiB
Dart

// hey
class ComplaintType {
final int typeId;
final List<ComplaintReason> reasons;
ComplaintType({required this.typeId, required this.reasons});
factory ComplaintType.fromJson(Map<String, dynamic> json) {
return ComplaintType(
typeId: json['typeId'],
reasons: (json['reasons'] as List)
.map((reason) => ComplaintReason.fromJson(reason))
.toList(),
);
}
}
class ComplaintReason {
final String reasonTitle;
final int reasonId;
ComplaintReason({required this.reasonTitle, required this.reasonId});
factory ComplaintReason.fromJson(Map<String, dynamic> json) {
return ComplaintReason(
reasonTitle: json['reasonTitle'],
reasonId: json['reasonId'],
);
}
}
class ComplaintData {
final List<ComplaintType> complainTypes;
final int complainSync;
ComplaintData({required this.complainTypes, required this.complainSync});
factory ComplaintData.fromJson(Map<String, dynamic> json) {
return ComplaintData(
complainTypes: (json['complains'] as List)
.map((type) => ComplaintType.fromJson(type))
.toList(),
complainSync: json['complainSync'],
);
}
}
// If you're touching ( you doing this rignt now ) this file, STOP IMEDIATLY! This is violiating TeamKomet code revision policy!
// If you're touching ( you doing this rignt now ) this file, AND DONT WANT TO STOP! REFACTOR IT IMMEDIATLY TO MAKE SOME SENSE AND DONT LOOK LIKE SHIT BY AI