feat(templates): create schemas for categories, brands, products, customers, orders, order_items, reviews
This commit is contained in:
parent
6a4e6cb109
commit
aa1f151a00
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue