From aa1f151a00f139ad1d09dda19af3b7020eb12c30 Mon Sep 17 00:00:00 2001 From: GitApp Date: Fri, 19 Dec 2025 15:50:37 +0000 Subject: [PATCH] feat(templates): create schemas for categories, brands, products, customers, orders, order_items, reviews --- .gitapp/.gitkeep | 0 .gitapp/manifest.json | 57 ++++++++++++++++++++++++++++++++ .gitapp/operations/.gitkeep | 0 .gitapp/schemas/.gitkeep | 0 .gitapp/schemas/brands.json | 24 ++++++++++++++ .gitapp/schemas/categories.json | 31 +++++++++++++++++ .gitapp/schemas/customers.json | 28 ++++++++++++++++ .gitapp/schemas/order_items.json | 33 ++++++++++++++++++ .gitapp/schemas/orders.json | 43 ++++++++++++++++++++++++ .gitapp/schemas/products.json | 50 ++++++++++++++++++++++++++++ .gitapp/schemas/reviews.json | 43 ++++++++++++++++++++++++ collections/brands/.gitkeep | 0 collections/categories/.gitkeep | 0 collections/customers/.gitkeep | 0 collections/order_items/.gitkeep | 0 collections/orders/.gitkeep | 0 collections/products/.gitkeep | 0 collections/reviews/.gitkeep | 0 18 files changed, 309 insertions(+) create mode 100644 .gitapp/.gitkeep create mode 100644 .gitapp/manifest.json create mode 100644 .gitapp/operations/.gitkeep create mode 100644 .gitapp/schemas/.gitkeep create mode 100644 .gitapp/schemas/brands.json create mode 100644 .gitapp/schemas/categories.json create mode 100644 .gitapp/schemas/customers.json create mode 100644 .gitapp/schemas/order_items.json create mode 100644 .gitapp/schemas/orders.json create mode 100644 .gitapp/schemas/products.json create mode 100644 .gitapp/schemas/reviews.json create mode 100644 collections/brands/.gitkeep create mode 100644 collections/categories/.gitkeep create mode 100644 collections/customers/.gitkeep create mode 100644 collections/order_items/.gitkeep create mode 100644 collections/orders/.gitkeep create mode 100644 collections/products/.gitkeep create mode 100644 collections/reviews/.gitkeep diff --git a/.gitapp/.gitkeep b/.gitapp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/manifest.json b/.gitapp/manifest.json new file mode 100644 index 0000000..fdc7375 --- /dev/null +++ b/.gitapp/manifest.json @@ -0,0 +1,57 @@ +{ + "name": "pocketbase-lite", + "version": "0.1.0", + "paths": { + "data": "collections/", + "media": "media/", + "indexes": ".gitapp/indexes/" + }, + "schemas": [ + { + "id": "categories", + "file": "schemas/categories.json", + "glob": "collections/categories/*.json" + }, + { + "id": "brands", + "file": "schemas/brands.json", + "glob": "collections/brands/*.json" + }, + { + "id": "products", + "file": "schemas/products.json", + "glob": "collections/products/*.json" + }, + { + "id": "customers", + "file": "schemas/customers.json", + "glob": "collections/customers/*.json" + }, + { + "id": "orders", + "file": "schemas/orders.json", + "glob": "collections/orders/*.json" + }, + { + "id": "order_items", + "file": "schemas/order_items.json", + "glob": "collections/order_items/*.json" + }, + { + "id": "reviews", + "file": "schemas/reviews.json", + "glob": "collections/reviews/*.json" + } + ], + "operations": [], + "policies": { + "roles": [ + "viewer", + "editor" + ], + "acl": null + }, + "lfs": { + "enabled": false + } +} \ No newline at end of file diff --git a/.gitapp/operations/.gitkeep b/.gitapp/operations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/schemas/.gitkeep b/.gitapp/schemas/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitapp/schemas/brands.json b/.gitapp/schemas/brands.json new file mode 100644 index 0000000..d96c09a --- /dev/null +++ b/.gitapp/schemas/brands.json @@ -0,0 +1,24 @@ +{ + "$id": "brands", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "logo": { + "type": "string" + }, + "description": { + "type": "string" + }, + "website": { + "type": "string", + "format": "uri" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/categories.json b/.gitapp/schemas/categories.json new file mode 100644 index 0000000..eb4b30b --- /dev/null +++ b/.gitapp/schemas/categories.json @@ -0,0 +1,31 @@ +{ + "$id": "categories", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "slug" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "slug": { + "type": "string" + }, + "description": { + "type": "string" + }, + "image": { + "type": "string" + }, + "parent": { + "type": "string", + "x-relation": { + "collection": "categories", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/customers.json b/.gitapp/schemas/customers.json new file mode 100644 index 0000000..64fe508 --- /dev/null +++ b/.gitapp/schemas/customers.json @@ -0,0 +1,28 @@ +{ + "$id": "customers", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "email" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "email": { + "type": "string", + "format": "email" + }, + "phone": { + "type": "string" + }, + "address": { + "type": "string" + }, + "avatar": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/order_items.json b/.gitapp/schemas/order_items.json new file mode 100644 index 0000000..a1c1f0c --- /dev/null +++ b/.gitapp/schemas/order_items.json @@ -0,0 +1,33 @@ +{ + "$id": "order_items", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "quantity", + "price" + ], + "properties": { + "quantity": { + "type": "integer", + "minimum": 1 + }, + "price": { + "type": "number", + "minimum": 0 + }, + "order": { + "type": "string", + "x-relation": { + "collection": "orders", + "type": "single" + } + }, + "product": { + "type": "string", + "x-relation": { + "collection": "products", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/orders.json b/.gitapp/schemas/orders.json new file mode 100644 index 0000000..14bf496 --- /dev/null +++ b/.gitapp/schemas/orders.json @@ -0,0 +1,43 @@ +{ + "$id": "orders", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "orderNumber", + "status", + "total" + ], + "properties": { + "orderNumber": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "processing", + "shipped", + "delivered", + "cancelled" + ] + }, + "total": { + "type": "number", + "minimum": 0 + }, + "date": { + "type": "string", + "format": "date-time" + }, + "shippingAddress": { + "type": "string" + }, + "customer": { + "type": "string", + "x-relation": { + "collection": "customers", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/products.json b/.gitapp/schemas/products.json new file mode 100644 index 0000000..f532ead --- /dev/null +++ b/.gitapp/schemas/products.json @@ -0,0 +1,50 @@ +{ + "$id": "products", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "name", + "price", + "sku" + ], + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "description": { + "type": "string" + }, + "price": { + "type": "number", + "minimum": 0 + }, + "sku": { + "type": "string" + }, + "stock": { + "type": "integer", + "minimum": 0 + }, + "image": { + "type": "string" + }, + "featured": { + "type": "boolean" + }, + "category": { + "type": "string", + "x-relation": { + "collection": "categories", + "type": "single" + } + }, + "brand": { + "type": "string", + "x-relation": { + "collection": "brands", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/.gitapp/schemas/reviews.json b/.gitapp/schemas/reviews.json new file mode 100644 index 0000000..bc87f3f --- /dev/null +++ b/.gitapp/schemas/reviews.json @@ -0,0 +1,43 @@ +{ + "$id": "reviews", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "rating", + "title" + ], + "properties": { + "rating": { + "type": "integer", + "minimum": 1, + "maximum": 5 + }, + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "verified": { + "type": "boolean" + }, + "product": { + "type": "string", + "x-relation": { + "collection": "products", + "type": "single" + } + }, + "customer": { + "type": "string", + "x-relation": { + "collection": "customers", + "type": "single" + } + } + } +} \ No newline at end of file diff --git a/collections/brands/.gitkeep b/collections/brands/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/categories/.gitkeep b/collections/categories/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/customers/.gitkeep b/collections/customers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/order_items/.gitkeep b/collections/order_items/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/orders/.gitkeep b/collections/orders/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/products/.gitkeep b/collections/products/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/collections/reviews/.gitkeep b/collections/reviews/.gitkeep new file mode 100644 index 0000000..e69de29