genaric models update
parent
6bdcf5fb81
commit
77d4291025
@ -1,61 +1,70 @@
|
||||
//TODO: this needs to match with ServiceProviderService from backend side
|
||||
class ServiceModel {
|
||||
final int? providerBranchServiceId;
|
||||
final int? serviceProviderServiceId;
|
||||
final dynamic providerServiceDescription;
|
||||
final int? serviceCategoryId;
|
||||
final int? categoryId;
|
||||
final String? categoryName;
|
||||
final int? serviceId;
|
||||
final String? serviceDescription;
|
||||
final String? serviceDescriptionN;
|
||||
final int? status;
|
||||
final int? serviceStatus;
|
||||
final dynamic statusText;
|
||||
final bool? isAllowAppointment;
|
||||
final bool? isAllowAppointmentHome;
|
||||
final int? customerLocationRange;
|
||||
final String? rangePricePerKm;
|
||||
final int? itemsCount;
|
||||
bool isExpanded;
|
||||
|
||||
ServiceModel({
|
||||
this.providerBranchServiceId,
|
||||
this.serviceProviderServiceId,
|
||||
this.providerServiceDescription,
|
||||
this.serviceCategoryId,
|
||||
this.categoryId,
|
||||
this.categoryName,
|
||||
this.serviceId,
|
||||
this.serviceDescription,
|
||||
this.serviceDescriptionN,
|
||||
this.status,
|
||||
this.serviceStatus,
|
||||
this.statusText,
|
||||
this.isAllowAppointment,
|
||||
this.isAllowAppointmentHome,
|
||||
this.customerLocationRange,
|
||||
this.rangePricePerKm,
|
||||
this.itemsCount,
|
||||
required this.isExpanded,
|
||||
});
|
||||
|
||||
factory ServiceModel.fromJson(Map<String, dynamic> json) =>
|
||||
ServiceModel(
|
||||
providerBranchServiceId: json["providerBranchServiceID"],
|
||||
factory ServiceModel.fromJson(Map<String, dynamic> json) => ServiceModel(
|
||||
serviceProviderServiceId: json["serviceProviderServiceID"],
|
||||
providerServiceDescription: json["providerServiceDescription"],
|
||||
serviceCategoryId: json["serviceCategoryID"],
|
||||
categoryId: json["categoryID"],
|
||||
categoryName: json["categoryName"],
|
||||
serviceId: json["serviceID"],
|
||||
serviceDescription: json["serviceDescription"],
|
||||
serviceDescriptionN: json["serviceDescriptionN"],
|
||||
status: json["status"],
|
||||
serviceDescription: json["serviceDescription"] ?? json["serviceName"],
|
||||
serviceDescriptionN: json["serviceDescriptionN"]?? json["serviceNameN"],
|
||||
serviceStatus: json["serviceStatus"],
|
||||
statusText: json["statusText"],
|
||||
isAllowAppointment: json["isAllowAppointment"],
|
||||
isAllowAppointmentHome: json["isAllowAppointmentHome"],
|
||||
customerLocationRange: json["customerLocationRange"],
|
||||
rangePricePerKm: json["rangePricePerKm"].toString(),
|
||||
itemsCount: json["itemsCount"],
|
||||
isExpanded: false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() =>
|
||||
{
|
||||
"providerBranchServiceID": providerBranchServiceId,
|
||||
Map<String, dynamic> toJson() => {
|
||||
"serviceProviderServiceID": serviceProviderServiceId,
|
||||
"providerServiceDescription": providerServiceDescription,
|
||||
"serviceCategoryID": serviceCategoryId,
|
||||
"categoryID": categoryId,
|
||||
"categoryName": categoryName,
|
||||
"serviceID": serviceId,
|
||||
"serviceDescription": serviceDescription,
|
||||
"serviceDescriptionN": serviceDescriptionN,
|
||||
"status": status,
|
||||
"serviceStatus": serviceStatus,
|
||||
"statusText": statusText,
|
||||
"isAllowAppointment": isAllowAppointment,
|
||||
"isAllowAppointmentHome": isAllowAppointmentHome,
|
||||
"customerLocationRange": customerLocationRange,
|
||||
"rangePricePerKm": rangePricePerKm,
|
||||
"itemsCount": itemsCount,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue