mod input and routes
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
class InputModel {
|
||||
String szDocumentId;
|
||||
String szUserId;
|
||||
String szDate;
|
||||
int nOdometer;
|
||||
double mnLiters;
|
||||
double mnPricePerLiter;
|
||||
String szLocation;
|
||||
double? mnTotalPrice;
|
||||
InputModel({required this.szDocumentId, required this.szUserId, required this.szDate, required this.nOdometer, required this.mnLiters, required this.mnPricePerLiter, required this.szLocation, this.mnTotalPrice});
|
||||
|
||||
factory InputModel.fromJson(Map<String, dynamic> json) {
|
||||
return InputModel(
|
||||
szDocumentId: json['szDocumentId'] as String,
|
||||
szUserId: json['szUserId'] as String,
|
||||
szDate: json['szDate'] as String,
|
||||
nOdometer: json['nOdometer'] as int,
|
||||
mnLiters: json['mnLiters'] as double,
|
||||
mnPricePerLiter: json['mnPricePerLiter'] as double,
|
||||
szLocation: json['szLocation'] as String,
|
||||
mnTotalPrice: (json['mnLiters'] as double) * (json['mnPricePerLiter'] as double),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'szDocumentId': szDocumentId,
|
||||
'szUserId': szUserId,
|
||||
'szDate': szDate,
|
||||
'nOdometer': nOdometer,
|
||||
'mnLiters': mnLiters,
|
||||
'mnPricePerLiter': mnPricePerLiter,
|
||||
'szLocation': szLocation,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user