salix/modules/item/back/models/item.json

209 lines
4.7 KiB
JSON

{
"name": "Item",
"base": "Loggable",
"log": {
"model": "ItemLog",
"showField": "id"
},
"options": {
"mysql": {
"table": "item"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Id"
},
"name": {
"type": "string",
"description": "Name"
},
"size": {
"type": "number",
"description": "Size"
},
"category": {
"type": "string",
"description": "Category"
},
"typeFk": {
"type": "number",
"description": "Type",
"required": true
},
"stems": {
"type": "number",
"description": "Stems"
},
"description": {
"type": "string",
"description": "Description"
},
"isActive": {
"type": "boolean",
"description": "Active"
},
"comment": {
"type": "string",
"description": "Comment"
},
"relevancy": {
"type": "number",
"description": "Relevancy"
},
"density": {
"type": "number",
"description": "Density"
},
"stemMultiplier": {
"type": "number",
"description": "Multiplier"
},
"image": {
"type": "string",
"description": "Image"
},
"longName": {
"type": "string",
"description": "Long name"
},
"subName": {
"type": "string",
"description": "Subname"
},
"tag5": {
"type": "string"
},
"value5": {
"type": "string"
},
"tag6": {
"type": "string"
},
"value6": {
"type": "string"
},
"tag7": {
"type": "string"
},
"value7": {
"type": "string"
},
"tag8": {
"type": "string"
},
"value8": {
"type": "string"
},
"tag9": {
"type": "string"
},
"value9": {
"type": "string"
},
"tag10": {
"type": "string"
},
"value10": {
"type": "string"
},
"itemPackingTypeFk": {
"type": "string"
},
"compression": {
"type": "number"
},
"hasKgPrice": {
"type": "boolean",
"description": "Price per Kg"
},
"family": {
"type": "string",
"description": "The item family"
},
"expenseFk": {
"type": "number",
"mysql": {
"columnName": "expenceFk"
}
},
"minPrice": {
"type": "number"
},
"packingOut": {
"type": "number"
},
"hasMinPrice": {
"type": "boolean"
},
"isFragile": {
"type": "boolean"
},
"isFloramondo": {
"type": "boolean"
}
},
"relations": {
"itemType": {
"type": "belongsTo",
"model": "ItemType",
"foreignKey": "typeFk"
},
"ink": {
"type": "belongsTo",
"model": "Ink",
"foreignKey": "inkFk"
},
"origin": {
"type": "belongsTo",
"model": "Origin",
"foreignKey": "originFk"
},
"producer": {
"type": "belongsTo",
"model": "Producer",
"foreignKey": "producerFk"
},
"intrastat": {
"type": "belongsTo",
"model": "Intrastat",
"foreignKey": "intrastatFk"
},
"expense": {
"type": "belongsTo",
"model": "Expense",
"foreignKey": "expenseFk"
},
"tags": {
"type": "hasMany",
"model": "ItemTag",
"foreignKey": "itemFk"
},
"itemBarcode": {
"type": "hasMany",
"model": "ItemBarcode",
"foreignKey": "itemFk"
},
"taxes": {
"type": "hasMany",
"model": "ItemTaxCountry",
"foreignKey": "itemFk"
},
"packaging": {
"type": "hasOne",
"model": "Packaging",
"foreignKey": "itemFk"
}
},
"scopes": {
"withName": {
"where": {
"name": {
"neq": ""
}
}
}
}
}