{
  "name": "/structure_ma/top.json",
  "table_name": "terms_of_payment",
  "table_prefix": "top",
  "constraint": {
    "save": {
      "allow": [
         {
           "field": "top_terms_of_payment_id",
           "message": "Field '%s' may not be empty",
           "code": [
    					["top_terms_of_payment_id", "<>", ""]
            ]
         },
         {
           "field": "top_name",
           "message": "Field '%s' may not be empty",
           "code": [
    					["top_name", "<>", ""]
            ]
         }
      ]
    }
  },
  "calculated_field": [],
  "field":[
    {
      "name":"terms_of_payment_id",
      "type":"varchar",
      "length":40,
      "constraint":["primary key", "unique"]
    },
    {
      "name":"name",
      "type":"varchar",
      "length":80
    },
  	{
			"name":"discount_percent",
      "type":"double"
		},
  	{
			"name":"discount_days",
      "type":"integer"
		},
  	{
			"name":"net_days",
      "type":"integer"
		},
    {
      "name": "info",
      "type": "text"
    },
    {
      "name": "json_data",
      "type": "jsonb"
    }
  ]
}
