salix/modules/ticket/back/models/sale.json

81 lines
1.8 KiB
JSON

{
"name": "Sale",
"base": "Loggable",
"log": {
"model": "TicketLog",
"relation": "ticket",
"showField": "concept"
},
"options": {
"mysql": {
"table": "sale"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
},
"concept": {
"type": "string",
"required": true
},
"quantity": {
"type": "number"
},
"price": {
"type": "number"
},
"discount": {
"type": "number"
},
"reserved": {
"type": "boolean"
},
"isPicked": {
"type": "number"
},
"created": {
"type": "date"
},
"originalQuantity":{
"type": "number"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk",
"required": true
},
"ticket": {
"type": "belongsTo",
"model": "Ticket",
"foreignKey": "ticketFk",
"required": true
},
"components": {
"type": "hasMany",
"model": "SaleComponent",
"foreignKey": "saleFk"
},
"claimBeginning": {
"type": "hasOne",
"model": "ClaimBeginning",
"foreignKey": "saleFk"
},
"saleTracking": {
"type": "hasOne",
"model": "SaleTracking",
"foreignKey": "saleFk"
},
"itemShelvingSale": {
"type": "hasOne",
"model": "ItemShelvingSale",
"foreignKey": "saleFk"
}
}
}