mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Project code support (#336)
* Determine if project codes are supported * Add helpers for boolean functions * Adds helper methods for generic "model" class - Will allow us to do some good refactoring * Refactor the refactor * Add debug support and getMap function * Major refactoring for model data accessors * Handle null values * Add sentry reporting if key is used incorrectly * Fix typo * Refactor createFromJson function * Add model for ProjectCode * Display and edit project code for purchase orders
This commit is contained in:
parent
95573a2784
commit
e23a8b4d5e
13 changed files with 383 additions and 299 deletions
28
lib/inventree/project_code.dart
Normal file
28
lib/inventree/project_code.dart
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import "package:inventree/inventree/model.dart";
|
||||
|
||||
|
||||
/*
|
||||
* Class representing the ProjectCode database model
|
||||
*/
|
||||
class InvenTreeProjectCode extends InvenTreeModel {
|
||||
|
||||
InvenTreeProjectCode() : super();
|
||||
|
||||
InvenTreeProjectCode.fromJson(Map<String, dynamic> json) : super.fromJson(json);
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) => InvenTreeProjectCode.fromJson(json);
|
||||
|
||||
@override
|
||||
String get URL => "project-code/";
|
||||
|
||||
@override
|
||||
Map<String, dynamic> formFields() {
|
||||
return {
|
||||
"code": {},
|
||||
"description": {},
|
||||
};
|
||||
}
|
||||
|
||||
String get code => getString("code");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue