schema upd

This commit is contained in:
matthieu42morin 2024-03-31 05:34:15 +02:00
parent e9ab134ebd
commit ee9b7501e2
2 changed files with 106 additions and 107 deletions

View File

@ -1,49 +1,48 @@
{ {
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"title": "Service category schema", "title": "Service category schema",
"type": "object", "type": "object",
"required": [ "title", "description", "id", "image", "services"], "required": ["title", "description", "id", "image", "services"],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"title": { "title": {
"type": "string", "type": "string",
"description": "Name of the category of services", "description": "Name of the category of services",
"minLength": 4, "minLength": 4,
"default": "Permanentní makeup" "default": "Permanentní makeup"
}, },
"description": { "description": {
"title": "Description of the category", "title": "Description of the category",
"type": "string", "type": "string",
"description": "description :D", "description": "description :D",
"default": "A description of a description" "default": "A description of a description"
}, },
"id": { "id": {
"type": "string", "type": "string",
"description": "a short handle used in urls", "description": "a short handle used in urls",
"default": "pmu", "default": "pmu",
"minLength": 3 "minLength": 3
}, },
"image": { "image": {
"title": "Image", "title": "Image",
"description": "A featured image in previews and on top of page", "description": "A featured image in previews and on top of page",
"type": "string", "type": "string",
"format": "uri" "format": "uri"
}, },
"tags": { "tags": {
"title": "tags", "title": "tags",
"description": "Tags of the services, e.g. 'pmu'", "description": "Tags of the services, e.g. 'pmu'",
"type": "array", "type": "array",
"items": { "items": {
"type": "string"
"type": "string" }
} },
}, "services": {
"services": { "title": "services under the category",
"title": "services under the category", "type": "array",
"type": "array", "items": {
"items": { "$ref": "./schema-services.json"
"$ref": "./schema-services.json" }
} }
} }
}
} }

View File

@ -1,62 +1,62 @@
{ {
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"title": "Service schema", "title": "Service schema",
"type": "object", "type": "object",
"required": [ "title", "description", "id", "image", "duration", "price"], "required": ["title", "description", "id", "image", "duration", "price"],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"title": { "title": {
"type": "string", "type": "string",
"description": "Name of the service" "description": "Name of the service"
}, },
"description": { "description": {
"title": "Description", "title": "Description",
"type": "string", "type": "string",
"description": "description :D", "description": "description :D",
"default": "A description of a description" "default": "A description of a description"
}, },
"id": { "id": {
"type": "string", "type": "string",
"description": "a short handle used in urls and on cal.com", "description": "a short handle used in urls and on cal.com",
"default": "pmu", "default": "pmu",
"minLength": 3 "minLength": 3
}, },
"image": { "image": {
"title": "Image", "title": "Image",
"description": "A featured image in previews and on top of page", "description": "A featured image in previews and on top of page",
"type": "string", "type": "string",
"format": "uri" "format": "uri"
}, },
"price": { "price": {
"title": "Price", "title": "Price",
"description": "Price of the product", "description": "Price of the product",
"oneOf": [ "oneOf": [
{ {
"type": "number", "type": "number",
"description": "Price of the service as a number", "description": "Price of the service as a number",
"default": 300 "default": 300
}, },
{ {
"type": "string", "type": "string",
"description": "Price of the service as a text description (e.g., 'Free')", "description": "Price of the service as a text description (e.g., 'Free')",
"default": "na dohode" "default": "na dohode"
} }
] ]
}, },
"duration": { "duration": {
"title": "Duration", "title": "Duration",
"description": "How long will the procedure take? (can be on demand or specific amount)", "description": "How long will the procedure take? (can be on demand or specific amount)",
"oneOf": [ "oneOf": [
{ {
"type": "number", "type": "number",
"description": "Duration of the service in minutes (e.g., 60)", "description": "Duration of the service in minutes (e.g., 60)",
"minimum": 15 "minimum": 15
}, },
{ {
"type": "string", "type": "string",
"description": "Duration of the service as a text description (e.g., 'on demand')" "description": "Duration of the service as a text description (e.g., 'on demand')"
} }
] ]
} }
} }
} }