refactor: added itemPackingType and temperature relations
gitea/salix/pipeline/head This commit is unstable Details

This commit is contained in:
Vicent Llopis 2022-05-23 12:40:11 +02:00
parent fd80fc58fc
commit 1b3f0ee026
4 changed files with 18 additions and 10 deletions

View File

@ -18,18 +18,12 @@
"name": {
"type": "string"
},
"temperatureFk": {
"type": "string"
},
"life": {
"type": "number"
},
"promo": {
"type": "number"
},
"itemPackingTypeFk": {
"type": "string"
},
"isUnconventionalSize": {
"type": "number"
}
@ -49,6 +43,16 @@
"type": "belongsTo",
"model": "ItemCategory",
"foreignKey": "categoryFk"
},
"itemPackingType": {
"type": "belongsTo",
"model": "ItemPackingType",
"foreignKey": "itemPackingTypeFk"
},
"temperature": {
"type": "belongsTo",
"model": "Temperature",
"foreignKey": "temperatureFk"
}
},
"acls": [

View File

@ -6,7 +6,9 @@ class Controller extends ModuleCard {
const filter = {
include: [
{relation: 'worker'},
{relation: 'category'}
{relation: 'category'},
{relation: 'itemPackingType'},
{relation: 'temperature'}
]
};

View File

@ -27,7 +27,7 @@
</vn-label-value>
<vn-label-value
label="Temperature"
value="{{summary.temperatureFk}}">
value="{{summary.temperature.name}}">
</vn-label-value>
<vn-label-value
label="Life"
@ -39,7 +39,7 @@
</vn-label-value>
<vn-label-value
label="Item packing type"
value="{{summary.itemPackingTypeFk}}">
value="{{summary.itemPackingType.description}}">
</vn-label-value>
<vn-label-value
label="Is unconventional size"

View File

@ -10,7 +10,9 @@ class Controller extends Component {
const filter = {
include: [
{relation: 'worker'},
{relation: 'category'}
{relation: 'category'},
{relation: 'itemPackingType'},
{relation: 'temperature'}
]
};
this.$http.get(`ItemTypes/${value.id}`, {filter})