type Category struct {
categoryID int unique,
categoryName string,
description string,
picture string
}
end

type Customer struct {
customerID string unique,
companyName string,
contactName string,
contactTitle string,
address string,
city string,
region string,
postalCode string optional,
country string,
phone string,
fax string
}
end

type Employee struct {
employeeID int unique,
lastName string,
firstName string,
title string,
titleOfCourtesy string,
birthDate string,
hireDate string,
address string,
city string,
region string,
postalCode string optional,
country string,
homePhone string,
extension int,
photo string,
notes string,
reportsTo string optional,
photoPath string
}
end

type Order struct {
orderID int unique,
customer Customer optional, //customerID string,
employee Employee optional, //employeeID int,
orderDate string,
requiredDate string,
shippedDate string,
shipVia int,
freight string,
shipName string,
shipAddress string,
shipCity string,
shipRegion string,
shipPostalCode string optional,
shipCountry string
}
end

type Order_Detail struct {
orderID int,
productID int,
unitPrice string,
quantity int,
discount number optional
}
end

type Region struct {
regionID int unique,
regionDescription string
}
end

type Shipper struct {
shipperID int unique,
companyName string,
phone string
}
end

type Supplier struct {
supplierID int unique,
companyName string,
contactName string,
contactTitle string,
address string,
city string,
region string,
postalCode string optional,
country string,
phone string,
fax string optional,
homePage string
}
end

type Territory struct {
territoryID int unique,
territoryDescription string,
region Region //regionID int
}
end

type Employee_Territory struct {
employeeID int,
territory Territory  //territoryID int
}
end

type Product struct {
productID int unique,
productName string,
supplier Supplier, //supplierID int,
category Category, //categoryID int,
quantityPerUnit string,
unitPrice string,
unitsInStock int,
unitsOnOrder int,
reorderLevel int,
discontinued int
}
end



type PlanInfo struct { typeName string, csvFile string } end

//lists 
let listCategory list<string> = [ 
'categoryID', 'categoryID', 'int',
'categoryName', 'categoryName', 'string',
'description', 'description', 'string',
'picture', 'picture', 'string']



let projectName string = 'Northwind'

let mainPlan PlanInfo = { 'Order', 'orders.csv' }

//topo-sort:Order_Detail,Supplier,Region,Product,Shipper,Customer,Employee,Category,Territory,PlanInfo,Order,Employee_Territory

let subPlans list<PlanInfo> = [
 { "Order_Detail", "order_details.csv" },
 { 'Supplier', 'suppliers.csv' },
 { 'Region', 'regions.csv' },
 { 'Product', 'products.csv' },
 { 'Shipper', 'shippers.csv' },
 { 'Customer', 'customers.csv' },
 { 'Employee', 'employees.csv' },
 { 'Category', 'categories.csv' },
 { 'Territory', 'territories.csv' },
 { 'Employee_Territory', 'employee_territories.csv' }
 
]
 
let listCustomer list<string> = [ 
'customerID', 'customerID', 'string',
'companyName', 'companyName', 'string',
'contactName', 'contactName', 'string',
'contactTitle', 'contactTitle', 'string',
'address', 'address', 'string',
'city', 'city', 'string',
'region', 'region', 'string',
'postalCode', 'postalCode', 'string',
'country', 'country', 'string',
'phone', 'phone', 'string',
'fax', 'fax', 'string']


 let listEmployee list<string> = [ 
'employeeID', 'employeeID', 'int',
'lastName', 'lastName', 'string',
'firstName', 'firstName', 'string',
'title', 'title', 'string',
'titleOfCourtesy', 'titleOfCourtesy', 'string',
'birthDate', 'birthDate', 'string',
'hireDate', 'hireDate', 'string',
'address', 'address', 'string',
'city', 'city', 'string',
'region', 'region', 'string',
'postalCode', 'postalCode', 'string',
'country', 'country', 'string',
'homePhone', 'homePhone', 'string',
'extension', 'extension', 'int',
'photo', 'photo', 'string',
'notes', 'notes', 'string',
'reportsTo', 'reportsTo', 'string',
'photoPath', 'photoPath', 'string']
 
 let listEmployee_Territory list<string> = [ 
'employeeID', 'employeeID', 'int',
'territoryID', 'territory', 'int']

let listOrder list<string> = [ 
'orderID', 'orderID', 'int',
'customerID', 'customer', 'string',
'employeeID', 'employee', 'int',
'orderDate', 'orderDate', 'string',
'requiredDate', 'requiredDate', 'string',
'shippedDate', 'shippedDate', 'string',
'shipVia', 'shipVia', 'int',
'freight', 'freight', 'string',
'shipName', 'shipName', 'string',
'shipAddress', 'shipAddress', 'string',
'shipCity', 'shipCity', 'string',
'shipRegion', 'shipRegion', 'string',
'shipPostalCode', 'shipPostalCode', 'string',
'shipCountry', 'shipCountry', 'string']

 let listOrder_Detail list<string> = [ 
'orderID', 'orderID', 'int',
'productID', 'productID', 'int',
'unitPrice', 'unitPrice', 'string',
'quantity', 'quantity', 'int',
'discount', 'discount', 'int']
 
let listProduct list<string> = [ 
'productID', 'productID', 'int',
'productName', 'productName', 'string',
'supplierID', 'supplier', 'int',
'categoryID', 'category', 'int',
'quantityPerUnit', 'quantityPerUnit', 'string',
'unitPrice', 'unitPrice', 'string',
'unitsInStock', 'unitsInStock', 'int',
'unitsOnOrder', 'unitsOnOrder', 'int',
'reorderLevel', 'reorderLevel', 'int',
'discontinued', 'discontinued', 'int']

 let listRegion list<string> = [ 
'regionID', 'regionID', 'int',
'regionDescription', 'regionDescription', 'string']

 let listSupplier list<string> = [ 
'supplierID', 'supplierID', 'int',
'companyName', 'companyName', 'string',
'contactName', 'contactName', 'string',
'contactTitle', 'contactTitle', 'string',
'address', 'address', 'string',
'city', 'city', 'string',
'region', 'region', 'string',
'postalCode', 'postalCode', 'string',
'country', 'country', 'string',
'phone', 'phone', 'string',
'fax', 'fax', 'string',
'homePage', 'homePage', 'string']

let tlang_Supplier_fax list<string> = [
 "if value == 'NULL' then ''"
]

let listTerritory list<string> = [ 
'territoryID', 'territoryID', 'int',
'territoryDescription', 'territoryDescription', 'string',
'regionID', 'region', 'int']

 let listShipper list<string> = [ 
'shipperID', 'shipperID', 'int',
'companyName', 'companyName', 'string',
'phone', 'phone', 'string']
 
 