{
	"name": "CreditInsurance",
	"description": "Credit insurance",
	"base": "VnModel",
	"options": {
    	"mysql": {
      		"table": "creditInsurance"
    	}
  	},
  	"properties": {
    	"id": {
			"id": true,
			"type": "number",
			"description": "Identifier"
		},
		"credit": {
			"type": "number"
		},
		"created": {
			"type": "date",
      		"mysql": {
        		"columnName": "creationDate"
      		}
		},
		"grade": {
			"type": "number"
		}
	},
	"relations": {	
		"classification": {
			"type": "belongsTo",
			"model": "CreditClassification",
      		"foreignKey": "creditClassificationFk"
		}
	},
	"scope": {
		"include": {
			"relation": "classification",
			"scope": {
				"fields": ["client"],
				"include": {
					"relation": "customer",
					"scope": {
						"fields": ["name", "salesPersonFk"],
						"include": {
							"relation": "salesPersonUser",
							"scope": {
								"fields": ["id", "name"]
							}
						}
					}
				}
			}
		}
	}
}