From 258758e0a1b8f3b04eaa26dcb15f6b5966242029 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Wed, 15 Feb 2023 23:51:57 +0100 Subject: [PATCH] Add playground env --- test/playground/env.go | 71 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 test/playground/env.go diff --git a/test/playground/env.go b/test/playground/env.go new file mode 100644 index 000000000..9b35c69b9 --- /dev/null +++ b/test/playground/env.go @@ -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 +}