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

78 lines
1.7 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"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk",
"required": true
},
"ticket": {
"type": "belongsTo",
"model": "Ticket",
"foreignKey": "ticketFk",
"required": true
},
"isChecked": {
"type": "hasOne",
"model": "SaleChecked",
"foreignKey": "saleFk"
},
"components": {
"type": "hasMany",
"model": "SaleComponent",
"foreignKey": "saleFk"
},
"claimBeginning": {
"type": "hasOne",
"model": "ClaimBeginning",
"foreignKey": "saleFk"
},
"saleTracking": {
"type": "hasOne",
"model": "SaleTracking",
"foreignKey": "saleFk"
}
}
}