|
|
|
import 'package:siopas/models/m_asset_status_model.dart';
|
|
|
|
|
|
|
|
class WarehouseModel {
|
|
|
|
int? id;
|
|
|
|
String? name;
|
|
|
|
String? description;
|
|
|
|
String? address;
|
|
|
|
String? created_by;
|
|
|
|
String? updated_by;
|
|
|
|
|
|
|
|
DateTime? created_at;
|
|
|
|
DateTime? updated_at;
|
|
|
|
DateTime? deleted_at;
|
|
|
|
|
|
|
|
WarehouseModel({
|
|
|
|
this.id,
|
|
|
|
this.name,
|
|
|
|
this.description,
|
|
|
|
this.address,
|
|
|
|
this.created_by,
|
|
|
|
this.updated_by,
|
|
|
|
this.created_at,
|
|
|
|
this.updated_at,
|
|
|
|
this.deleted_at,
|
|
|
|
});
|
|
|
|
|
|
|
|
WarehouseModel.fromJson(Map<String, dynamic> json) {
|
|
|
|
id = json['id'] != null ? int.parse(json['id'].toString()) : 0;
|
|
|
|
name = json['name'];
|
|
|
|
description = json['description'];
|
|
|
|
address = json['address'];
|
|
|
|
created_by = json['created_by'];
|
|
|
|
updated_by = json['updated_by'];
|
|
|
|
created_at = DateTime.parse(json['created_at'] != null
|
|
|
|
? json['created_at'].toString()
|
|
|
|
: DateTime.now().toString());
|
|
|
|
updated_at = DateTime.parse(json['updated_at'] != null
|
|
|
|
? json['updated_at'].toString()
|
|
|
|
: DateTime.now().toString());
|
|
|
|
deleted_at = DateTime.parse(json['deleted_at'] != null
|
|
|
|
? json['deleted_at'].toString()
|
|
|
|
: DateTime.now().toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
'id': id.toString(),
|
|
|
|
'name': name,
|
|
|
|
'description': description,
|
|
|
|
'address': address,
|
|
|
|
'created_by': created_by,
|
|
|
|
'updated_by': updated_by,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
class WarehouseEnterModel {
|
|
|
|
String? id;
|
|
|
|
String? name;
|
|
|
|
String? description;
|
|
|
|
String? address;
|
|
|
|
|
|
|
|
WarehouseEnterModel({
|
|
|
|
this.id,
|
|
|
|
this.name,
|
|
|
|
this.description,
|
|
|
|
this.address,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory WarehouseEnterModel.fromJson(Map<String, dynamic> json) {
|
|
|
|
return WarehouseEnterModel(
|
|
|
|
id: json['id'].toString(),
|
|
|
|
name: json['name'],
|
|
|
|
description: json['description'],
|
|
|
|
address: json['address'],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
'id': id.toString(),
|
|
|
|
'name': name,
|
|
|
|
'description': description,
|
|
|
|
'address': address,
|
|
|
|
};
|
|
|
|
}
|