-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package playground | ||
|
||
import "time" | ||
|
||
type Env struct { | ||
Products []Product `expr:"products"` | ||
Customers []Customer `expr:"customers"` | ||
Discounts []Discount `expr:"discounts"` | ||
Orders []Order `expr:"orders"` | ||
} | ||
|
||
type Product struct { | ||
Name string | ||
Description string | ||
Price float64 | ||
Stock int | ||
AddOn *AddOn | ||
Metadata map[string]interface{} | ||
Tags []string | ||
Rating float64 | ||
Reviews []Review | ||
} | ||
|
||
type Feature struct { | ||
Id string | ||
Description string | ||
} | ||
|
||
type Discount struct { | ||
Name string | ||
Percent int | ||
} | ||
|
||
type Customer struct { | ||
FirstName string | ||
LastName string | ||
Age int | ||
Addresses []Address | ||
} | ||
|
||
type Address struct { | ||
Country string | ||
City string | ||
Street string | ||
PostalCode string | ||
} | ||
|
||
type Order struct { | ||
Number int | ||
Customer Customer | ||
Items []*OrderItem | ||
Discounts []*Discount | ||
CreatedAt time.Time | ||
} | ||
|
||
type OrderItem struct { | ||
Product Product | ||
Quantity int | ||
} | ||
|
||
type Review struct { | ||
Product *Product | ||
Customer *Customer | ||
Comment string | ||
Rating float64 | ||
} | ||
|
||
type AddOn struct { | ||
Name string | ||
Price float64 | ||
} |