You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_common_app/lib/models/shipping_models/shipping_status_model.dart

81 lines
2.1 KiB
Dart

import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/utils/enums.dart';
class ShippingRequestModel {
int? id;
int? requestID;
Request? request;
int? shippingStatus;
ShippingRequestStatusEnum? shippingStatusEnum;
String? deliveredOn;
String? comment;
String? createdOn;
int? customerID;
String? customerName;
int? vehicleTypeID;
String? vehicleType;
ShippingRequestModel({
this.id,
this.requestID,
this.request,
this.shippingStatus,
this.deliveredOn,
this.comment,
this.createdOn,
this.customerID,
this.customerName,
this.vehicleTypeID,
this.vehicleType,
});
ShippingRequestModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
requestID = json['requestID'];
request = json['request'] != null ? Request.fromJson(json['request']) : null;
shippingStatus = json['shippingStatus'];
shippingStatusEnum = json['shippingStatus'] != null ? (json['shippingStatus'] as int).toShippingStatusEnum() : ShippingRequestStatusEnum.initiated;
deliveredOn = json['deliveredOn'];
comment = json['comment'];
createdOn = json['createdOn'];
customerID = json['customerID'];
customerName = json['customerName'];
vehicleTypeID = json['vehicleTypeID'];
vehicleType = json['vehicleType'];
}
}
class Request {
int? requestType;
String? brand;
String? model;
int? year;
bool? isNew;
String? description;
double? price;
Request({this.requestType, this.brand, this.model, this.year, this.isNew, this.description, this.price});
Request.fromJson(Map<String, dynamic> json) {
requestType = json['requestType'];
brand = json['brand'];
model = json['model'];
year = json['year'];
isNew = json['isNew'];
description = json['description'];
price = json['price'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['requestType'] = requestType;
data['brand'] = brand;
data['model'] = model;
data['year'] = year;
data['isNew'] = isNew;
data['description'] = description;
data['price'] = price;
return data;
}
}