github.com/ravendb/ravendb-go-client@v0.0.0-20240229102137-4474ee7aa0fa/examples/northwind/definitions.go (about) 1 package northwind 2 3 import "github.com/ravendb/ravendb-go-client" 4 5 // definitions for Northwind test database as hosted at https://live-test.ravendb.net 6 // in database "Demo" 7 // see https://ravendb.net/docs/article-page/4.1/csharp/start/about-examples 8 9 // Category describes a product category 10 type Category struct { 11 ID string 12 Name string `json:"Name"` 13 Description string `json:"Description"` 14 } 15 16 // Contact describes a contact 17 type Contact struct { 18 Name string 19 Title string 20 } 21 22 // Company describes a company 23 type Company struct { 24 ID string 25 Name string `json:"Name"` 26 ExternalID string `json:"ExternalId"` 27 Phone string `json:"Phone,omitempty"` 28 Fax string `json:"Fax,omitempty"` 29 Contact *Contact `json:"Contact"` 30 Address *Address `json:"Address"` 31 } 32 33 // Employee describes an employee 34 type Employee struct { 35 ID string 36 LastName string `json:"LastName"` 37 FirstName string `json:"FirstName"` 38 Title string `json:"Title"` 39 Address *Address `json:"Address"` 40 HiredAt ravendb.Time `json:"HiredAt"` 41 Birthday ravendb.Time `json:"Birthday"` 42 HomePhone string `json:"HomePhone"` 43 Extension string `json:"Extension"` 44 ReportsTo string `json:"ReportsTo"` // id of Employee struct 45 Notes []string `json:"Notes"` 46 Territories []string `json:"Territories"` 47 } 48 49 // Order describes an order 50 type Order struct { 51 ID string 52 Company string `json:"Company"` // id of Company struct 53 Employee string `json:"Employee"` // id of Employee struct 54 OrderedAt ravendb.Time `json:"OrderedAt"` 55 RequireAt ravendb.Time `json:"RequireAt"` 56 ShippedAt *ravendb.Time `json:"ShippedAt"` 57 ShipTo *Address `json:"ShipTo"` 58 ShipVia string `json:"ShipVia"` // id of Shipper struct 59 Freight float64 `json:"Freight"` 60 Lines []*OrderLine `json:"Lines"` 61 } 62 63 // Product describes a product 64 type Product struct { 65 ID string 66 Name string `json:"Name"` 67 Supplier string `json:"Supplier"` // id of Supplier struct 68 Category string `json:"Category"` // id of Category struct 69 QuantityPerUnit string `json:"QuantityPerUnit"` 70 PricePerUnit float64 `json:"PricePerUnit"` 71 UnitsInStock int `json:"UnitsInStock"` 72 UnitsOnOrder int `json:"UnitsOnOrder"` 73 Discontinued bool `json:"Discontinued"` 74 ReorderLevel int `json:"ReorderLevel"` 75 } 76 77 // Region describes a region 78 type Region struct { 79 ID string 80 Name string `json:"Name"` 81 Territories []Territory `json:"Territories,omitempty"` 82 } 83 84 // Territory describes a territory 85 type Territory struct { 86 Code string `json:"Code"` 87 Name string `json:"Name"` 88 } 89 90 // Shipper describes a shipper 91 type Shipper struct { 92 ID string 93 Name string `json:"Name"` 94 Phoene string `json:"Phone"` 95 } 96 97 // Supplier describes a supplier 98 type Supplier struct { 99 ID string 100 Name string `json:"Name"` 101 Phone string `json:"Phone"` 102 Fax string `json:"Fax,omitempty"` 103 HomePage string `json:"HomePage,omitempty"` 104 Contact *Contact `json:"Contact"` 105 Address *Address `json:"Address"` 106 } 107 108 // Address describes an address 109 type Address struct { 110 Line1 string `json:"Line1"` 111 Line2 string `json:"Line2,omitempty"` 112 City string `json:"City"` 113 Region string `json:"Region,omitempty"` 114 PostalCode string `json:"PostalCode"` 115 Country string `json:"Country"` 116 Location *Location `json:"Location"` 117 } 118 119 // Location describes a location 120 type Location struct { 121 Latitude float64 122 Longitude float64 123 } 124 125 // OrderLine describes an order line 126 type OrderLine struct { 127 Product string `json:"Product"` // id of Product string 128 ProductName string `json:"ProductName"` 129 PricePerUnit float64 `json:"PricePerUnit"` 130 Quantity int `json:"Quantity"` 131 Discount float64 `json:"Discount"` 132 }