aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-12-26 14:43:19 +0000
committerAkshay <[email protected]>2020-12-26 14:43:19 +0000
commita7881f40ccaa623d757e762d1215d5e9bc9d1a7a (patch)
tree010712299e6b0735c162edb8a73f1be612c4d7f1
parent8014def1a8da3397d78d1162f9e1b8c3f22d0322 (diff)
add AR integration
-rw-r--r--backend/migrations/2020-12-26-051845_ar_integration/down.sql6
-rw-r--r--backend/migrations/2020-12-26-051845_ar_integration/up.sql6
-rw-r--r--backend/src/schema.rs2
-rw-r--r--backend/tests/product/chair.json6
-rw-r--r--backend/tests/product/dumb_sofa.json4
-rw-r--r--backend/tests/product/recliner.json8
-rw-r--r--backend/tests/product/single_chair.json10
-rw-r--r--backend/tests/product/smart_sofa.json6
-rw-r--r--backend/tests/requests.txt2
9 files changed, 38 insertions, 12 deletions
diff --git a/backend/migrations/2020-12-26-051845_ar_integration/down.sql b/backend/migrations/2020-12-26-051845_ar_integration/down.sql
new file mode 100644
index 0000000..f61b527
--- /dev/null
+++ b/backend/migrations/2020-12-26-051845_ar_integration/down.sql
@@ -0,0 +1,6 @@
1-- This file should undo anything in `up.sql`
2alter table product
3drop column src;
4
5alter table product
6drop column ios_src;
diff --git a/backend/migrations/2020-12-26-051845_ar_integration/up.sql b/backend/migrations/2020-12-26-051845_ar_integration/up.sql
new file mode 100644
index 0000000..16aa805
--- /dev/null
+++ b/backend/migrations/2020-12-26-051845_ar_integration/up.sql
@@ -0,0 +1,6 @@
1-- Your SQL goes here
2alter table product
3add src text(500);
4
5alter table product
6add ios_src text(500);
diff --git a/backend/src/schema.rs b/backend/src/schema.rs
index 1419bc0..5cd3a73 100644
--- a/backend/src/schema.rs
+++ b/backend/src/schema.rs
@@ -24,6 +24,8 @@ table! {
24 kind -> Nullable<Varchar>, 24 kind -> Nullable<Varchar>,
25 price -> Float, 25 price -> Float,
26 description -> Nullable<Varchar>, 26 description -> Nullable<Varchar>,
27 src -> Nullable<Text>,
28 ios_src -> Nullable<Text>,
27 } 29 }
28} 30}
29 31
diff --git a/backend/tests/product/chair.json b/backend/tests/product/chair.json
index bb13c8b..0564d01 100644
--- a/backend/tests/product/chair.json
+++ b/backend/tests/product/chair.json
@@ -1,6 +1,8 @@
1{ 1{
2 "name": "Urban Ladder Teak Chair", 2 "name": "Teak Chair",
3 "kind": "Chair", 3 "kind": "Chair",
4 "price": 3500, 4 "price": 3500,
5 "description": "Sleek, modern chair for offices and workplaces" 5 "description": "High quality teak chair ideal for casual use.",
6 "src": "https://poly.googleusercontent.com/downloads/c/fp/1607083617515204/7Jl72KgiRl-/2lfpoCUD7hi/WoodChair_01(1).gltf",
7 "ios_src": "https://poly.googleusercontent.com/downloads/c/fp/1607083617515204/7Jl72KgiRl-/40_ivv2I3M2/WoodChair_01(1).usdz"
6} 8}
diff --git a/backend/tests/product/dumb_sofa.json b/backend/tests/product/dumb_sofa.json
deleted file mode 100644
index 2b09a58..0000000
--- a/backend/tests/product/dumb_sofa.json
+++ /dev/null
@@ -1,4 +0,0 @@
1{
2 "name": "Home Town Leather Sofa",
3 "price": 5400
4}
diff --git a/backend/tests/product/recliner.json b/backend/tests/product/recliner.json
new file mode 100644
index 0000000..f390351
--- /dev/null
+++ b/backend/tests/product/recliner.json
@@ -0,0 +1,8 @@
1{
2 "name": "Leather Recliner",
3 "kind": "Sofa",
4 "price": 12500,
5 "description": "Fully mechanical recliner, with leg rest and 120 degree recline angle.",
6 "src": "https://poly.googleusercontent.com/downloads/c/fp/1605210857124678/eBafYyUfz60/5UrSr1r5w8r/model.gltf",
7 "ios_src": "https://poly.googleusercontent.com/downloads/c/fp/1605210857124678/eBafYyUfz60/1WxZLhYggZm/model.usdz"
8}
diff --git a/backend/tests/product/single_chair.json b/backend/tests/product/single_chair.json
new file mode 100644
index 0000000..5990985
--- /dev/null
+++ b/backend/tests/product/single_chair.json
@@ -0,0 +1,10 @@
1{
2 "name": "Single Cushioned Chair",
3 "kind": "Chair",
4 "price": 8200,
5 "description": "Casual single chair with cushioned bottom and back. Contains strudy steel frame and rubber bottom legs.",
6 "src": "https://poly.googleusercontent.com/downloads/c/fp/1606863385683627/4-etwKK4ifB/c29G_sc6wH8/KEYSHOT9PRO_UV6D_single%20chair-DIM.gltf",
7 "ios_src": "https://poly.googleusercontent.com/downloads/c/fp/1606863385683627/4-etwKK4ifB/7QDBFnQJcRu/KEYSHOT9PRO_UV6D_single%20chair-DIM.usdz"
8}
9
10
diff --git a/backend/tests/product/smart_sofa.json b/backend/tests/product/smart_sofa.json
deleted file mode 100644
index 5d7f7d4..0000000
--- a/backend/tests/product/smart_sofa.json
+++ /dev/null
@@ -1,6 +0,0 @@
1{
2 "name": "Home Town Leather Sofa",
3 "kind": "Sofa",
4 "description": "Comfortable, authentic leather, wooden frame sofa, for living rooms",
5 "price": 5400
6}
diff --git a/backend/tests/requests.txt b/backend/tests/requests.txt
index 7e2ca5c..0ce1cb9 100644
--- a/backend/tests/requests.txt
+++ b/backend/tests/requests.txt
@@ -19,3 +19,5 @@ http POST :7878/cart/remove Cookie: product_id:=1
19http POST :7878/rating/add Cookie: product_id:=1 stars:=3 comment_text=Very good functional chair 19http POST :7878/rating/add Cookie: product_id:=1 stars:=3 comment_text=Very good functional chair
20 20
21http :7878/product/reviews/1 21http :7878/product/reviews/1
22
23http :7878/transaction/list Cookie: