ts-tat/lib/data/models/plan.dart
2025-04-19 17:40:19 +05:30

54 lines
1.6 KiB
Dart

class Plan {
final String planId;
final String tripTitle;
final String tripType;
final String status;
final String costCenter;
final String functionalDepartment;
final String purposeOfTravel;
final String soNumber;
final String description;
final String isBillable;
final String userName;
final String travellerName;
final String statusValue;
final String createdOn;
Plan({
required this.planId,
required this.tripTitle,
required this.tripType,
required this.status,
required this.costCenter,
required this.functionalDepartment,
required this.purposeOfTravel,
required this.soNumber,
required this.description,
required this.isBillable,
required this.userName,
required this.travellerName,
required this.statusValue,
required this.createdOn,
});
factory Plan.fromJson(Map<String, dynamic> json) {
return Plan(
planId: json['plan_id'],
tripTitle: json['trip_title'],
tripType: json['trip_type_value'],
status: json['status'] == "0" ? "Inactive" : "Active",
costCenter: json['cost_center_value'] ?? '',
functionalDepartment: json['functional_department_value'] ?? '',
purposeOfTravel: json['purpose_of_travel_value'] ?? '',
soNumber: json['so_number'] ?? '',
description: json['description'] ?? '',
isBillable: json['is_billable_value'] ?? '',
userName: json["user_name"] ?? '',
travellerName: json["traveller_name"] ?? '',
statusValue: json["status_value"] ?? '',
createdOn: json["created_on"] ?? '',
);
}
}