{
  "modelspec": "1.0-draft",
  "module": {
    "id": "github.com/demo-db/northwind/northwind",
    "name": "northwind",
    "version": "0.1.0"
  },
  "entities": {
    "Categories": {
      "key": [
        "CategoryID"
      ],
      "properties": {
        "CategoryID": {
          "required": true,
          "type": "int"
        },
        "CategoryName": {
          "type": "string"
        },
        "Description": {
          "type": "string"
        },
        "Picture": {
          "type": "document"
        }
      }
    },
    "CustomerCustomerDemo": {
      "key": [
        "CustomerID",
        "CustomerTypeID"
      ],
      "properties": {
        "CustomerID": {
          "required": true,
          "entity": "Customers"
        },
        "CustomerTypeID": {
          "required": true,
          "entity": "CustomerDemographics"
        }
      }
    },
    "CustomerDemographics": {
      "key": [
        "CustomerTypeID"
      ],
      "properties": {
        "CustomerTypeID": {
          "required": true,
          "type": "string"
        },
        "CustomerDesc": {
          "type": "string"
        }
      }
    },
    "Customers": {
      "key": [
        "CustomerID"
      ],
      "properties": {
        "CustomerID": {
          "required": true,
          "type": "string"
        },
        "CompanyName": {
          "type": "string"
        },
        "ContactName": {
          "type": "string"
        },
        "ContactTitle": {
          "type": "string"
        },
        "Address": {
          "type": "string"
        },
        "City": {
          "type": "string"
        },
        "Region": {
          "type": "string"
        },
        "PostalCode": {
          "type": "string"
        },
        "Country": {
          "type": "string"
        },
        "Phone": {
          "type": "string"
        },
        "Fax": {
          "type": "string"
        }
      }
    },
    "EmployeeTerritories": {
      "key": [
        "EmployeeID",
        "TerritoryID"
      ],
      "properties": {
        "EmployeeID": {
          "required": true,
          "entity": "Employees"
        },
        "TerritoryID": {
          "required": true,
          "entity": "Territories"
        }
      }
    },
    "Employees": {
      "key": [
        "EmployeeID"
      ],
      "properties": {
        "EmployeeID": {
          "required": true,
          "type": "int"
        },
        "LastName": {
          "type": "string"
        },
        "FirstName": {
          "type": "string"
        },
        "Title": {
          "type": "string"
        },
        "TitleOfCourtesy": {
          "type": "string"
        },
        "BirthDate": {
          "type": "date"
        },
        "HireDate": {
          "type": "date"
        },
        "Address": {
          "type": "string"
        },
        "City": {
          "type": "string"
        },
        "Region": {
          "type": "string"
        },
        "PostalCode": {
          "type": "string"
        },
        "Country": {
          "type": "string"
        },
        "HomePhone": {
          "type": "string"
        },
        "Extension": {
          "type": "string"
        },
        "Photo": {
          "type": "document"
        },
        "Notes": {
          "type": "string"
        },
        "ReportsTo": {
          "entity": "Employees"
        },
        "PhotoPath": {
          "type": "string"
        }
      }
    },
    "OrderDetails": {
      "key": [
        "OrderID",
        "ProductID"
      ],
      "properties": {
        "OrderID": {
          "required": true,
          "entity": "Orders"
        },
        "ProductID": {
          "required": true,
          "entity": "Products"
        },
        "UnitPrice": {
          "required": true,
          "type": "decimal"
        },
        "Quantity": {
          "required": true,
          "type": "int"
        },
        "Discount": {
          "required": true,
          "type": "decimal"
        }
      }
    },
    "Orders": {
      "key": [
        "OrderID"
      ],
      "properties": {
        "OrderID": {
          "required": true,
          "type": "int"
        },
        "CustomerID": {
          "entity": "Customers"
        },
        "EmployeeID": {
          "entity": "Employees"
        },
        "OrderDate": {
          "type": "datetime"
        },
        "RequiredDate": {
          "type": "datetime"
        },
        "ShippedDate": {
          "type": "datetime"
        },
        "ShipVia": {
          "entity": "Shippers"
        },
        "Freight": {
          "type": "decimal"
        },
        "ShipName": {
          "type": "string"
        },
        "ShipAddress": {
          "type": "string"
        },
        "ShipCity": {
          "type": "string"
        },
        "ShipRegion": {
          "type": "string"
        },
        "ShipPostalCode": {
          "type": "string"
        },
        "ShipCountry": {
          "type": "string"
        }
      }
    },
    "Products": {
      "key": [
        "ProductID"
      ],
      "properties": {
        "ProductID": {
          "required": true,
          "type": "int"
        },
        "ProductName": {
          "required": true,
          "type": "string"
        },
        "SupplierID": {
          "entity": "Suppliers"
        },
        "CategoryID": {
          "entity": "Categories"
        },
        "QuantityPerUnit": {
          "type": "string"
        },
        "UnitPrice": {
          "type": "decimal"
        },
        "UnitsInStock": {
          "type": "int"
        },
        "UnitsOnOrder": {
          "type": "int"
        },
        "ReorderLevel": {
          "type": "int"
        },
        "Discontinued": {
          "required": true,
          "type": "string"
        }
      }
    },
    "Regions": {
      "key": [
        "RegionID"
      ],
      "properties": {
        "RegionID": {
          "required": true,
          "type": "int"
        },
        "RegionDescription": {
          "required": true,
          "type": "string"
        }
      }
    },
    "Shippers": {
      "key": [
        "ShipperID"
      ],
      "properties": {
        "ShipperID": {
          "required": true,
          "type": "int"
        },
        "CompanyName": {
          "required": true,
          "type": "string"
        },
        "Phone": {
          "type": "string"
        }
      }
    },
    "Suppliers": {
      "key": [
        "SupplierID"
      ],
      "properties": {
        "SupplierID": {
          "required": true,
          "type": "int"
        },
        "CompanyName": {
          "required": true,
          "type": "string"
        },
        "ContactName": {
          "type": "string"
        },
        "ContactTitle": {
          "type": "string"
        },
        "Address": {
          "type": "string"
        },
        "City": {
          "type": "string"
        },
        "Region": {
          "type": "string"
        },
        "PostalCode": {
          "type": "string"
        },
        "Country": {
          "type": "string"
        },
        "Phone": {
          "type": "string"
        },
        "Fax": {
          "type": "string"
        },
        "HomePage": {
          "type": "string"
        }
      }
    },
    "Territories": {
      "key": [
        "TerritoryID"
      ],
      "properties": {
        "TerritoryID": {
          "required": true,
          "type": "string"
        },
        "TerritoryDescription": {
          "required": true,
          "type": "string"
        },
        "RegionID": {
          "required": true,
          "entity": "Regions"
        }
      }
    }
  }
}
