mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-02 23:38:54 +00:00
61 lines
1.3 KiB
Dart
61 lines
1.3 KiB
Dart
import 'model.dart';
|
|
|
|
|
|
/*
|
|
* The InvenTreeCompany class repreents the Company model in the InvenTree database.
|
|
*/
|
|
class InvenTreeCompany extends InvenTreeModel {
|
|
|
|
@override
|
|
String NAME = "Company";
|
|
|
|
@override
|
|
String URL = "company/";
|
|
|
|
InvenTreeCompany() : super();
|
|
|
|
String get image => jsondata['image'] ?? '';
|
|
|
|
String get website => jsondata['website'] ?? '';
|
|
|
|
String get phone => jsondata['phone'] ?? '';
|
|
|
|
String get email => jsondata['email'] ?? '';
|
|
|
|
bool get isSupplier => jsondata['is_supplier'] ?? false;
|
|
|
|
bool get isCustomer => jsondata['is_customer'] ?? false;
|
|
|
|
InvenTreeCompany.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
|
// TODO
|
|
}
|
|
|
|
@override
|
|
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
|
var company = InvenTreeCompany.fromJson(json);
|
|
|
|
return company;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
* The InvenTreeSupplierPart class represents the SupplierPart model in the InvenTree database
|
|
*/
|
|
class InvenTreeSupplierPart extends InvenTreeModel {
|
|
@override
|
|
String url = "company/part/";
|
|
|
|
InvenTreeSupplierPart() : super();
|
|
|
|
InvenTreeSupplierPart.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
|
// TODO
|
|
}
|
|
|
|
@override
|
|
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
|
var part = InvenTreeSupplierPart.fromJson(json);
|
|
|
|
return part;
|
|
}
|
|
} |