You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.2 KiB
77 lines
2.2 KiB
import 'm_asset_status_model.dart'; |
|
import 'warehouse_mode.dart'; |
|
|
|
class AssetStatusModel { |
|
int? id; |
|
int? asset_id; |
|
DateTime? exit_at; |
|
String? exit_pic; |
|
int? exit_warehouse; |
|
String? enter_at; |
|
String? enter_pic; |
|
int? enter_warehouse; |
|
int? created_by; |
|
int? updated_by; |
|
late M_assetStatusModel asset; |
|
late WarehouseModel warehouse; |
|
|
|
AssetStatusModel({ |
|
this.id, |
|
this.asset_id, |
|
this.exit_at, |
|
this.exit_pic, |
|
this.exit_warehouse, |
|
this.enter_at, |
|
this.enter_pic, |
|
this.enter_warehouse, |
|
this.created_by, |
|
this.updated_by, |
|
required this.asset, |
|
required this.warehouse, |
|
}); |
|
|
|
factory AssetStatusModel.fromJson(Map<String, dynamic> json) { |
|
return AssetStatusModel( |
|
id: json['id'], |
|
asset_id: json['asset_id'] != null |
|
? int.parse(json['asset_id'].toString()) |
|
: null, |
|
exit_at: json['exit_at'] != null ? DateTime.parse(json['exit_at']) : null, |
|
exit_pic: json['exit_pic'], |
|
exit_warehouse: json['exit_warehouse'] != null |
|
? int.parse(json['exit_warehouse'].toString()) |
|
: null, |
|
enter_at: json['enter_at'], |
|
enter_pic: json['enter_pic'], |
|
enter_warehouse: json['enter_warehouse'] != null |
|
? int.parse(json['enter_warehouse'].toString()) |
|
: null, |
|
created_by: json['created_by'] != null |
|
? int.parse(json['created_by'].toString()) |
|
: null, |
|
updated_by: json['updated_by'] != null |
|
? int.parse(json['updated_by'].toString()) |
|
: null, |
|
asset: M_assetStatusModel.fromJson( |
|
json['asset'] != null ? json['asset'] : {'id': 0, 'name': 'null'}), |
|
warehouse: WarehouseModel.fromJson(json['warehouse'] != null |
|
? json['warehouse'] |
|
: {'id': 0, 'name': 'null'}), |
|
); |
|
} |
|
|
|
Map<String, dynamic> toJson() => { |
|
'id': id, |
|
'asset_id': asset_id, |
|
'exit_at': exit_at, |
|
'exit_pic': exit_pic, |
|
'exit_warehouse': exit_warehouse, |
|
'enter_at': enter_at, |
|
'enter_pic': enter_pic, |
|
'enter_warehouse': enter_warehouse, |
|
'created_by': created_by, |
|
'updated_by': updated_by, |
|
'asset': asset.toJson(), |
|
'warehouse': warehouse.toJson(), |
|
}; |
|
}
|
|
|