From 2ba6c7565f3f6c264c6bfa25d21a286b4a80474a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:30:10 +0100 Subject: [PATCH 01/14] feat: Add new events for document and part checks --- csfunctions/events/base.py | 4 ++++ csfunctions/events/document_create_check.py | 20 ++++++++++++++++++++ csfunctions/events/document_modify_check.py | 17 +++++++++++++++++ csfunctions/events/part_create_check.py | 17 +++++++++++++++++ csfunctions/events/part_modify_check.py | 16 ++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 csfunctions/events/document_create_check.py create mode 100644 csfunctions/events/document_modify_check.py create mode 100644 csfunctions/events/part_create_check.py create mode 100644 csfunctions/events/part_modify_check.py diff --git a/csfunctions/events/base.py b/csfunctions/events/base.py index 282c256..fbfe50c 100644 --- a/csfunctions/events/base.py +++ b/csfunctions/events/base.py @@ -13,6 +13,10 @@ class EventNames(str, Enum): ENGINEERING_CHANGE_RELEASE_CHECK = "engineering_change_release_check" FIELD_VALUE_CALCULATION = "field_value_calculation" WORKFLOW_TASK_TRIGGER = "workflow_task_trigger" + DOCUMENT_CREATE_CHECK = "document_create_check" + DOCUMENT_MODIFY_CHECK = "document_modify_check" + PART_CREATE_CHECK = "part_create_check" + PART_MODIFY_CHECK = "part_modify_check" class BaseEvent(BaseModel): diff --git a/csfunctions/events/document_create_check.py b/csfunctions/events/document_create_check.py new file mode 100644 index 0000000..1f2d9fd --- /dev/null +++ b/csfunctions/events/document_create_check.py @@ -0,0 +1,20 @@ +from typing import Literal + +from pydantic import BaseModel, Field + +from csfunctions.objects import Document, Part + +from .base import BaseEvent, EventNames + + +class DocumentCreateCheckData(BaseModel): + documents: list[Document] = Field(..., description="List of documents that are about to be created") + attached_parts: list[Part] = Field(..., description="List of parts that belong to the documents") + attached_documents: list[Document] = Field( + ..., description="Contains the original document(s) if a document is a copy" + ) + + +class DocumentCreateCheckEvent(BaseEvent): + name: Literal[EventNames.DOCUMENT_CREATE_CHECK] = EventNames.DOCUMENT_CREATE_CHECK + data: DocumentCreateCheckData diff --git a/csfunctions/events/document_modify_check.py b/csfunctions/events/document_modify_check.py new file mode 100644 index 0000000..d0cc0a8 --- /dev/null +++ b/csfunctions/events/document_modify_check.py @@ -0,0 +1,17 @@ +from typing import Literal + +from pydantic import BaseModel, Field + +from csfunctions.objects import Document, Part + +from .base import BaseEvent, EventNames + + +class DocumentModifyCheckData(BaseModel): + documents: list[Document] = Field(..., description="List of documents that are about to be modified") + attached_parts: list[Part] = Field(..., description="List of parts that belong to the documents") + + +class DocumentModifyCheckEvent(BaseEvent): + name: Literal[EventNames.DOCUMENT_MODIFY_CHECK] = EventNames.DOCUMENT_MODIFY_CHECK + data: DocumentModifyCheckData diff --git a/csfunctions/events/part_create_check.py b/csfunctions/events/part_create_check.py new file mode 100644 index 0000000..8ac7780 --- /dev/null +++ b/csfunctions/events/part_create_check.py @@ -0,0 +1,17 @@ +from typing import Literal + +from pydantic import BaseModel, Field + +from csfunctions.objects import Document, Part + +from .base import BaseEvent, EventNames + + +class PartCreateCheckData(BaseModel): + parts: list[Part] = Field(..., description="List of parts that are about to be created") + attached_documents: list[Document] = Field(..., description="Contains the original part(s) if a part is a copy") + + +class PartCreateCheckEvent(BaseEvent): + name: Literal[EventNames.PART_CREATE_CHECK] = EventNames.PART_CREATE_CHECK + data: PartCreateCheckData diff --git a/csfunctions/events/part_modify_check.py b/csfunctions/events/part_modify_check.py new file mode 100644 index 0000000..647aedc --- /dev/null +++ b/csfunctions/events/part_modify_check.py @@ -0,0 +1,16 @@ +from typing import Literal + +from pydantic import BaseModel, Field + +from csfunctions.objects import Part + +from .base import BaseEvent, EventNames + + +class PartModifyCheckData(BaseModel): + parts: list[Part] = Field(..., description="List of parts that are about to be modified") + + +class PartModifyCheckEvent(BaseEvent): + name: Literal[EventNames.PART_MODIFY_CHECK] = EventNames.PART_MODIFY_CHECK + data: PartModifyCheckData From 5706d840c40673f2cde222802428191e27eef978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:34:50 +0100 Subject: [PATCH 02/14] fix: register new events in module --- csfunctions/events/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/csfunctions/events/__init__.py b/csfunctions/events/__init__.py index a2f91b4..6a2e725 100644 --- a/csfunctions/events/__init__.py +++ b/csfunctions/events/__init__.py @@ -3,12 +3,16 @@ from pydantic import Field from .dialog_data import DocumentReleaseDialogData, PartReleaseDialogData +from .document_create_check import DocumentCreateCheckData, DocumentCreateCheckEvent +from .document_modify_check import DocumentModifyCheckData, DocumentModifyCheckEvent from .document_release import DocumentReleaseData, DocumentReleaseEvent from .document_release_check import DocumentReleaseCheckData, DocumentReleaseCheckEvent from .dummy import DummyEvent, DummyEventData from .engineering_change_release import EngineeringChangeRelease, EngineeringChangeReleaseData from .engineering_change_release_check import EngineeringChangeReleaseCheck, EngineeringChangeReleaseCheckData from .field_value_calculation import FieldValueCalculationData, FieldValueCalculationEvent +from .part_create_check import PartCreateCheckData, PartCreateCheckEvent +from .part_modify_check import PartModifyCheckData, PartModifyCheckEvent from .part_release import PartReleaseData, PartReleaseEvent from .part_release_check import PartReleaseCheckData, PartReleaseCheckEvent from .workflow_task_trigger import WorkflowTaskTriggerEvent, WorkflowTaskTriggerEventData @@ -24,6 +28,10 @@ EngineeringChangeRelease, EngineeringChangeReleaseCheck, WorkflowTaskTriggerEvent, + DocumentCreateCheckEvent, + DocumentModifyCheckEvent, + PartCreateCheckEvent, + PartModifyCheckEvent, ], Field(discriminator="name"), ] @@ -37,6 +45,10 @@ EngineeringChangeReleaseData, EngineeringChangeReleaseCheckData, WorkflowTaskTriggerEventData, + DocumentCreateCheckData, + DocumentModifyCheckData, + PartCreateCheckData, + PartModifyCheckData, ] __all__ = [ @@ -60,4 +72,12 @@ "WorkflowTaskTriggerEventData", "DocumentReleaseDialogData", "PartReleaseDialogData", + "DocumentCreateCheckData", + "DocumentCreateCheckEvent", + "DocumentModifyCheckData", + "DocumentModifyCheckEvent", + "PartCreateCheckData", + "PartCreateCheckEvent", + "PartModifyCheckData", + "PartModifyCheckEvent", ] From 86c329ff2a817d6e6890e0c4601af522bf75ff3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:35:04 +0100 Subject: [PATCH 03/14] update schema json with new events --- json_schemas/request.json | 228 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/json_schemas/request.json b/json_schemas/request.json index d892f1d..d073c55 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -737,6 +737,121 @@ "title": "Document", "type": "object" }, + "DocumentCreateCheckData": { + "properties": { + "documents": { + "description": "List of documents that are about to be created", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Documents", + "type": "array" + }, + "attached_parts": { + "description": "List of parts that belong to the documents", + "items": { + "$ref": "#/$defs/Part" + }, + "title": "Attached Parts", + "type": "array" + }, + "attached_documents": { + "description": "Contains the original document(s) if a document is a copy", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Attached Documents", + "type": "array" + } + }, + "required": [ + "documents", + "attached_parts", + "attached_documents" + ], + "title": "DocumentCreateCheckData", + "type": "object" + }, + "DocumentCreateCheckEvent": { + "properties": { + "name": { + "const": "document_create_check", + "default": "document_create_check", + "enum": [ + "document_create_check" + ], + "title": "Name", + "type": "string" + }, + "event_id": { + "description": "unique identifier", + "title": "Event Id", + "type": "string" + }, + "data": { + "$ref": "#/$defs/DocumentCreateCheckData" + } + }, + "required": [ + "event_id", + "data" + ], + "title": "DocumentCreateCheckEvent", + "type": "object" + }, + "DocumentModifyCheckData": { + "properties": { + "documents": { + "description": "List of documents that are about to be modified", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Documents", + "type": "array" + }, + "attached_parts": { + "description": "List of parts that belong to the documents", + "items": { + "$ref": "#/$defs/Part" + }, + "title": "Attached Parts", + "type": "array" + } + }, + "required": [ + "documents", + "attached_parts" + ], + "title": "DocumentModifyCheckData", + "type": "object" + }, + "DocumentModifyCheckEvent": { + "properties": { + "name": { + "const": "document_modify_check", + "default": "document_modify_check", + "enum": [ + "document_modify_check" + ], + "title": "Name", + "type": "string" + }, + "event_id": { + "description": "unique identifier", + "title": "Event Id", + "type": "string" + }, + "data": { + "$ref": "#/$defs/DocumentModifyCheckData" + } + }, + "required": [ + "event_id", + "data" + ], + "title": "DocumentModifyCheckEvent", + "type": "object" + }, "DocumentReleaseCheckData": { "properties": { "documents": { @@ -2462,6 +2577,103 @@ "title": "Part", "type": "object" }, + "PartCreateCheckData": { + "properties": { + "parts": { + "description": "List of parts that are about to be created", + "items": { + "$ref": "#/$defs/Part" + }, + "title": "Parts", + "type": "array" + }, + "attached_documents": { + "description": "Contains the original part(s) if a part is a copy", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Attached Documents", + "type": "array" + } + }, + "required": [ + "parts", + "attached_documents" + ], + "title": "PartCreateCheckData", + "type": "object" + }, + "PartCreateCheckEvent": { + "properties": { + "name": { + "const": "part_create_check", + "default": "part_create_check", + "enum": [ + "part_create_check" + ], + "title": "Name", + "type": "string" + }, + "event_id": { + "description": "unique identifier", + "title": "Event Id", + "type": "string" + }, + "data": { + "$ref": "#/$defs/PartCreateCheckData" + } + }, + "required": [ + "event_id", + "data" + ], + "title": "PartCreateCheckEvent", + "type": "object" + }, + "PartModifyCheckData": { + "properties": { + "parts": { + "description": "List of parts that are about to be modified", + "items": { + "$ref": "#/$defs/Part" + }, + "title": "Parts", + "type": "array" + } + }, + "required": [ + "parts" + ], + "title": "PartModifyCheckData", + "type": "object" + }, + "PartModifyCheckEvent": { + "properties": { + "name": { + "const": "part_modify_check", + "default": "part_modify_check", + "enum": [ + "part_modify_check" + ], + "title": "Name", + "type": "string" + }, + "event_id": { + "description": "unique identifier", + "title": "Event Id", + "type": "string" + }, + "data": { + "$ref": "#/$defs/PartModifyCheckData" + } + }, + "required": [ + "event_id", + "data" + ], + "title": "PartModifyCheckEvent", + "type": "object" + }, "PartReleaseCheckData": { "properties": { "parts": { @@ -2807,12 +3019,16 @@ "event": { "discriminator": { "mapping": { + "document_create_check": "#/$defs/DocumentCreateCheckEvent", + "document_modify_check": "#/$defs/DocumentModifyCheckEvent", "document_release": "#/$defs/DocumentReleaseEvent", "document_release_check": "#/$defs/DocumentReleaseCheckEvent", "dummy": "#/$defs/DummyEvent", "engineering_change_release": "#/$defs/EngineeringChangeRelease", "engineering_change_release_check": "#/$defs/EngineeringChangeReleaseCheck", "field_value_calculation": "#/$defs/FieldValueCalculationEvent", + "part_create_check": "#/$defs/PartCreateCheckEvent", + "part_modify_check": "#/$defs/PartModifyCheckEvent", "part_release": "#/$defs/PartReleaseEvent", "part_release_check": "#/$defs/PartReleaseCheckEvent", "workflow_task_trigger": "#/$defs/WorkflowTaskTriggerEvent" @@ -2846,6 +3062,18 @@ }, { "$ref": "#/$defs/WorkflowTaskTriggerEvent" + }, + { + "$ref": "#/$defs/DocumentCreateCheckEvent" + }, + { + "$ref": "#/$defs/DocumentModifyCheckEvent" + }, + { + "$ref": "#/$defs/PartCreateCheckEvent" + }, + { + "$ref": "#/$defs/PartModifyCheckEvent" } ], "title": "Event" From 0f9a16f2b841f54ba74012232fef3053ca0bbb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:42:28 +0100 Subject: [PATCH 04/14] add documentation --- docs/reference/events.md | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/docs/reference/events.md b/docs/reference/events.md index f7fba6a..3478f62 100644 --- a/docs/reference/events.md +++ b/docs/reference/events.md @@ -1,5 +1,46 @@ Events always have a `name` and a `data` attribute. The contents of those attributes depend on the type of the event. + +## DocumentCreateCheckEvent +`csfunctions.events.DocumentCreateCheckEvent` + +This event is fired when a user tries to create or copy a document. Raising an exception will prevent the creation. +The event is triggered before any field calculations are performed. + +**Supported actions:** + +- [AbortAndShowErrorAction](actions.md#AbortAndShowErrorAction) + +**DocumentCreateCheckEvent.name:** document_create_check + +**DocumentCreateCheckEvent.data:** + +|Attribute|Type|Description| +|-|-|-| +|documents| list[[Document](objects.md#document)]|List of documents that are about to be created.| +|attached_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| +|attached_documents| list[[Document](objects.md#document)]|Contains the original document(s) if a document is a copy.| + +## DocumentModifyCheckEvent +`csfunctions.events.DocumentModifyCheckEvent` + +This event is fired when a user tries to modify a document. Raising an exception will prevent the modification. +The event is triggered before any field calculations are performed. + +**Supported actions:** + +- [AbortAndShowErrorAction](actions.md#AbortAndShowErrorAction) + +**DocumentModifyCheckEvent.name:** document_modify_check + +**DocumentModifyCheckEvent.data:** + +|Attribute|Type|Description| +|-|-|-| +|documents| list[[Document](objects.md#document)]|List of documents that are about to be modified.| +|attached_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| + + ## DocumentReleaseCheckEvent `csfunctions.events.DocumentReleaseCheckEvent` @@ -86,6 +127,42 @@ This event is fired **after** an engineering change has been released. Raising a |documents| list[[Document](objects.md#document)]|List of included documents.| |parts| list[[Part](objects.md#part)]|List of included parts.| +## PartCreateCheckEvent +`csfunctions.events.PartCreateCheckEvent` + +This event is fired when a user tries to create or copy a part. Raising an exception will prevent the creation. +The event is triggered before any field calculations are performed. + +**Supported actions:** + +- [AbortAndShowErrorAction](actions.md#AbortAndShowErrorAction) + +**PartCreateCheckEvent.name:** part_create_check + +**PartCreateCheckEvent.data:** + +|Attribute|Type|Description| +|-|-|-| +|parts| list[[Part](objects.md#part)]|List of parts that are about to be created.| +|attached_documents| list[[Document](objects.md#document)]|Contains the original part(s) if a part is a copy.| + +## PartModifyCheckEvent +`csfunctions.events.PartModifyCheckEvent` + +This event is fired when a user tries to modify a part. Raising an exception will prevent the modification. +The event is triggered before any field calculations are performed. + +**Supported actions:** + +- [AbortAndShowErrorAction](actions.md#AbortAndShowErrorAction) + +**PartModifyCheckEvent.name:** part_modify_check + +**PartModifyCheckEvent.data:** + +|Attribute|Type|Description| +|-|-|-| +|parts| list[[Part](objects.md#part)]|List of parts that are about to be modified.| ## PartReleaseCheckEvent `csfunctions.events.PartReleaseCheckEvent` From f065e7ef7421b47981b4b317076ec869cc62bcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:50:02 +0100 Subject: [PATCH 05/14] fix: attached parts not documents --- csfunctions/events/part_create_check.py | 4 ++-- docs/reference/events.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/csfunctions/events/part_create_check.py b/csfunctions/events/part_create_check.py index 8ac7780..0442b5b 100644 --- a/csfunctions/events/part_create_check.py +++ b/csfunctions/events/part_create_check.py @@ -2,14 +2,14 @@ from pydantic import BaseModel, Field -from csfunctions.objects import Document, Part +from csfunctions.objects import Part from .base import BaseEvent, EventNames class PartCreateCheckData(BaseModel): parts: list[Part] = Field(..., description="List of parts that are about to be created") - attached_documents: list[Document] = Field(..., description="Contains the original part(s) if a part is a copy") + attached_parts: list[Part] = Field(..., description="Contains the original part(s) if a part is a copy") class PartCreateCheckEvent(BaseEvent): diff --git a/docs/reference/events.md b/docs/reference/events.md index 3478f62..ee7e9e4 100644 --- a/docs/reference/events.md +++ b/docs/reference/events.md @@ -144,7 +144,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |parts| list[[Part](objects.md#part)]|List of parts that are about to be created.| -|attached_documents| list[[Document](objects.md#document)]|Contains the original part(s) if a part is a copy.| +|attached_parts| list[[Part](objects.md#part)]|Contains the original part(s) if a part is a copy.| ## PartModifyCheckEvent `csfunctions.events.PartModifyCheckEvent` From c9592f94a7a5162f06b673329cb6b85e5bf67d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 21 Feb 2025 12:50:19 +0100 Subject: [PATCH 06/14] update schema --- json_schemas/request.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/json_schemas/request.json b/json_schemas/request.json index d073c55..639d032 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -2587,18 +2587,18 @@ "title": "Parts", "type": "array" }, - "attached_documents": { + "attached_parts": { "description": "Contains the original part(s) if a part is a copy", "items": { - "$ref": "#/$defs/Document" + "$ref": "#/$defs/Part" }, - "title": "Attached Documents", + "title": "Attached Parts", "type": "array" } }, "required": [ "parts", - "attached_documents" + "attached_parts" ], "title": "PartCreateCheckData", "type": "object" From 1a5343c3dbfd21118723a1fff2d88890525187f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Wed, 26 Feb 2025 10:09:38 +0100 Subject: [PATCH 07/14] remove attached_documents from DocumentCreateCheckEvent --- csfunctions/events/document_create_check.py | 3 --- docs/reference/events.md | 1 - 2 files changed, 4 deletions(-) diff --git a/csfunctions/events/document_create_check.py b/csfunctions/events/document_create_check.py index 1f2d9fd..4a43146 100644 --- a/csfunctions/events/document_create_check.py +++ b/csfunctions/events/document_create_check.py @@ -10,9 +10,6 @@ class DocumentCreateCheckData(BaseModel): documents: list[Document] = Field(..., description="List of documents that are about to be created") attached_parts: list[Part] = Field(..., description="List of parts that belong to the documents") - attached_documents: list[Document] = Field( - ..., description="Contains the original document(s) if a document is a copy" - ) class DocumentCreateCheckEvent(BaseEvent): diff --git a/docs/reference/events.md b/docs/reference/events.md index ee7e9e4..985e638 100644 --- a/docs/reference/events.md +++ b/docs/reference/events.md @@ -19,7 +19,6 @@ The event is triggered before any field calculations are performed. |-|-|-| |documents| list[[Document](objects.md#document)]|List of documents that are about to be created.| |attached_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| -|attached_documents| list[[Document](objects.md#document)]|Contains the original document(s) if a document is a copy.| ## DocumentModifyCheckEvent `csfunctions.events.DocumentModifyCheckEvent` From 8815b7f370d90269bd6be34186b4347c327ec605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Wed, 26 Feb 2025 10:29:30 +0100 Subject: [PATCH 08/14] fix: Update PartCreateCheck and PartModifyCheck events to use attached_documents --- csfunctions/events/part_create_check.py | 4 ++-- csfunctions/events/part_modify_check.py | 3 ++- docs/reference/events.md | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/csfunctions/events/part_create_check.py b/csfunctions/events/part_create_check.py index 0442b5b..7492792 100644 --- a/csfunctions/events/part_create_check.py +++ b/csfunctions/events/part_create_check.py @@ -2,14 +2,14 @@ from pydantic import BaseModel, Field -from csfunctions.objects import Part +from csfunctions.objects import Document, Part from .base import BaseEvent, EventNames class PartCreateCheckData(BaseModel): parts: list[Part] = Field(..., description="List of parts that are about to be created") - attached_parts: list[Part] = Field(..., description="Contains the original part(s) if a part is a copy") + attached_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") class PartCreateCheckEvent(BaseEvent): diff --git a/csfunctions/events/part_modify_check.py b/csfunctions/events/part_modify_check.py index 647aedc..a1203a5 100644 --- a/csfunctions/events/part_modify_check.py +++ b/csfunctions/events/part_modify_check.py @@ -2,13 +2,14 @@ from pydantic import BaseModel, Field -from csfunctions.objects import Part +from csfunctions.objects import Document, Part from .base import BaseEvent, EventNames class PartModifyCheckData(BaseModel): parts: list[Part] = Field(..., description="List of parts that are about to be modified") + attached_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") class PartModifyCheckEvent(BaseEvent): diff --git a/docs/reference/events.md b/docs/reference/events.md index 985e638..61cbe40 100644 --- a/docs/reference/events.md +++ b/docs/reference/events.md @@ -143,7 +143,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |parts| list[[Part](objects.md#part)]|List of parts that are about to be created.| -|attached_parts| list[[Part](objects.md#part)]|Contains the original part(s) if a part is a copy.| +|attached_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| ## PartModifyCheckEvent `csfunctions.events.PartModifyCheckEvent` @@ -162,7 +162,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |parts| list[[Part](objects.md#part)]|List of parts that are about to be modified.| - +|attached_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| ## PartReleaseCheckEvent `csfunctions.events.PartReleaseCheckEvent` From b65f6a448bbedf83b55a4b52381db4225a31e315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Wed, 26 Feb 2025 13:19:38 +0100 Subject: [PATCH 09/14] index default to empty string if None --- csfunctions/objects/document.py | 2 +- csfunctions/objects/part.py | 2 +- json_schemas/request.json | 36 ++++++++++++++++----------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/csfunctions/objects/document.py b/csfunctions/objects/document.py index c336b1c..3c0f9d4 100644 --- a/csfunctions/objects/document.py +++ b/csfunctions/objects/document.py @@ -24,7 +24,7 @@ class Document(BaseObject): object_type: Literal[ObjectType.DOCUMENT] = ObjectType.DOCUMENT z_nummer: str = Field(..., description="document number") - z_index: str = Field(..., description="index") + z_index: str = Field("", description="index") titel: str | None = Field(..., description="title") category1_name_en: str | None = Field(..., description="Main Category") category1_name_de: str | None = Field(..., description="Main Category") diff --git a/csfunctions/objects/part.py b/csfunctions/objects/part.py index a6c0c99..3b7c776 100644 --- a/csfunctions/objects/part.py +++ b/csfunctions/objects/part.py @@ -19,7 +19,7 @@ class Part(BaseObject): object_type: Literal[ObjectType.PART] = ObjectType.PART teilenummer: str = Field(..., description="part number") - t_index: str = Field(..., description="part index") + t_index: str = Field("", description="part index") status: int = Field(..., description="Status Number") materialnr_erp: str | None = Field(None, description="Material No. (ERP)") benennung: str | None = Field(None, description="Name") diff --git a/json_schemas/request.json b/json_schemas/request.json index 639d032..a76ac1d 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -106,6 +106,7 @@ "type": "string" }, "z_index": { + "default": "", "description": "index", "title": "Z Index", "type": "string" @@ -720,7 +721,6 @@ }, "required": [ "z_nummer", - "z_index", "titel", "category1_name_en", "category1_name_de", @@ -754,20 +754,11 @@ }, "title": "Attached Parts", "type": "array" - }, - "attached_documents": { - "description": "Contains the original document(s) if a document is a copy", - "items": { - "$ref": "#/$defs/Document" - }, - "title": "Attached Documents", - "type": "array" } }, "required": [ "documents", - "attached_parts", - "attached_documents" + "attached_parts" ], "title": "DocumentCreateCheckData", "type": "object" @@ -1813,6 +1804,7 @@ "type": "string" }, "t_index": { + "default": "", "description": "part index", "title": "T Index", "type": "string" @@ -2571,7 +2563,6 @@ }, "required": [ "teilenummer", - "t_index", "status" ], "title": "Part", @@ -2587,18 +2578,18 @@ "title": "Parts", "type": "array" }, - "attached_parts": { - "description": "Contains the original part(s) if a part is a copy", + "attached_documents": { + "description": "List of documents that are referenced by the parts.", "items": { - "$ref": "#/$defs/Part" + "$ref": "#/$defs/Document" }, - "title": "Attached Parts", + "title": "Attached Documents", "type": "array" } }, "required": [ "parts", - "attached_parts" + "attached_documents" ], "title": "PartCreateCheckData", "type": "object" @@ -2639,10 +2630,19 @@ }, "title": "Parts", "type": "array" + }, + "attached_documents": { + "description": "List of documents that are referenced by the parts.", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Attached Documents", + "type": "array" } }, "required": [ - "parts" + "parts", + "attached_documents" ], "title": "PartModifyCheckData", "type": "object" From 36d9b0f3f1b5af12a7452981f3fd90d8e13362bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Wed, 26 Feb 2025 13:27:18 +0100 Subject: [PATCH 10/14] Revert "index default to empty string if None" This reverts commit b65f6a448bbedf83b55a4b52381db4225a31e315. --- csfunctions/objects/document.py | 2 +- csfunctions/objects/part.py | 2 +- json_schemas/request.json | 36 ++++++++++++++++----------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/csfunctions/objects/document.py b/csfunctions/objects/document.py index 3c0f9d4..c336b1c 100644 --- a/csfunctions/objects/document.py +++ b/csfunctions/objects/document.py @@ -24,7 +24,7 @@ class Document(BaseObject): object_type: Literal[ObjectType.DOCUMENT] = ObjectType.DOCUMENT z_nummer: str = Field(..., description="document number") - z_index: str = Field("", description="index") + z_index: str = Field(..., description="index") titel: str | None = Field(..., description="title") category1_name_en: str | None = Field(..., description="Main Category") category1_name_de: str | None = Field(..., description="Main Category") diff --git a/csfunctions/objects/part.py b/csfunctions/objects/part.py index 3b7c776..a6c0c99 100644 --- a/csfunctions/objects/part.py +++ b/csfunctions/objects/part.py @@ -19,7 +19,7 @@ class Part(BaseObject): object_type: Literal[ObjectType.PART] = ObjectType.PART teilenummer: str = Field(..., description="part number") - t_index: str = Field("", description="part index") + t_index: str = Field(..., description="part index") status: int = Field(..., description="Status Number") materialnr_erp: str | None = Field(None, description="Material No. (ERP)") benennung: str | None = Field(None, description="Name") diff --git a/json_schemas/request.json b/json_schemas/request.json index a76ac1d..639d032 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -106,7 +106,6 @@ "type": "string" }, "z_index": { - "default": "", "description": "index", "title": "Z Index", "type": "string" @@ -721,6 +720,7 @@ }, "required": [ "z_nummer", + "z_index", "titel", "category1_name_en", "category1_name_de", @@ -754,11 +754,20 @@ }, "title": "Attached Parts", "type": "array" + }, + "attached_documents": { + "description": "Contains the original document(s) if a document is a copy", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Attached Documents", + "type": "array" } }, "required": [ "documents", - "attached_parts" + "attached_parts", + "attached_documents" ], "title": "DocumentCreateCheckData", "type": "object" @@ -1804,7 +1813,6 @@ "type": "string" }, "t_index": { - "default": "", "description": "part index", "title": "T Index", "type": "string" @@ -2563,6 +2571,7 @@ }, "required": [ "teilenummer", + "t_index", "status" ], "title": "Part", @@ -2578,18 +2587,18 @@ "title": "Parts", "type": "array" }, - "attached_documents": { - "description": "List of documents that are referenced by the parts.", + "attached_parts": { + "description": "Contains the original part(s) if a part is a copy", "items": { - "$ref": "#/$defs/Document" + "$ref": "#/$defs/Part" }, - "title": "Attached Documents", + "title": "Attached Parts", "type": "array" } }, "required": [ "parts", - "attached_documents" + "attached_parts" ], "title": "PartCreateCheckData", "type": "object" @@ -2630,19 +2639,10 @@ }, "title": "Parts", "type": "array" - }, - "attached_documents": { - "description": "List of documents that are referenced by the parts.", - "items": { - "$ref": "#/$defs/Document" - }, - "title": "Attached Documents", - "type": "array" } }, "required": [ - "parts", - "attached_documents" + "parts" ], "title": "PartModifyCheckData", "type": "object" From 923f06c34b4699d492d2b1f1bd5f5bce9891f004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 28 Feb 2025 13:29:33 +0100 Subject: [PATCH 11/14] update schema jspn --- json_schemas/request.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/json_schemas/request.json b/json_schemas/request.json index 639d032..ad6a1ca 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -754,20 +754,11 @@ }, "title": "Attached Parts", "type": "array" - }, - "attached_documents": { - "description": "Contains the original document(s) if a document is a copy", - "items": { - "$ref": "#/$defs/Document" - }, - "title": "Attached Documents", - "type": "array" } }, "required": [ "documents", - "attached_parts", - "attached_documents" + "attached_parts" ], "title": "DocumentCreateCheckData", "type": "object" @@ -2587,18 +2578,18 @@ "title": "Parts", "type": "array" }, - "attached_parts": { - "description": "Contains the original part(s) if a part is a copy", + "attached_documents": { + "description": "List of documents that are referenced by the parts.", "items": { - "$ref": "#/$defs/Part" + "$ref": "#/$defs/Document" }, - "title": "Attached Parts", + "title": "Attached Documents", "type": "array" } }, "required": [ "parts", - "attached_parts" + "attached_documents" ], "title": "PartCreateCheckData", "type": "object" @@ -2639,10 +2630,19 @@ }, "title": "Parts", "type": "array" + }, + "attached_documents": { + "description": "List of documents that are referenced by the parts.", + "items": { + "$ref": "#/$defs/Document" + }, + "title": "Attached Documents", + "type": "array" } }, "required": [ - "parts" + "parts", + "attached_documents" ], "title": "PartModifyCheckData", "type": "object" From 336b887a15dcad375a5da8ff3897daa7c0a9dab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 7 Mar 2025 09:54:31 +0100 Subject: [PATCH 12/14] refactor: Rename 'attached' to 'linked' in event data models and documentation --- csfunctions/events/document_create_check.py | 2 +- csfunctions/events/document_modify_check.py | 2 +- csfunctions/events/part_create_check.py | 2 +- csfunctions/events/part_modify_check.py | 2 +- docs/reference/events.md | 9 +- json_schemas/data_response.json | 3 - json_schemas/error_response.json | 3 - json_schemas/request.json | 99 +++------------------ json_schemas/workload_response.json | 9 -- 9 files changed, 23 insertions(+), 108 deletions(-) diff --git a/csfunctions/events/document_create_check.py b/csfunctions/events/document_create_check.py index 4a43146..4af0468 100644 --- a/csfunctions/events/document_create_check.py +++ b/csfunctions/events/document_create_check.py @@ -9,7 +9,7 @@ class DocumentCreateCheckData(BaseModel): documents: list[Document] = Field(..., description="List of documents that are about to be created") - attached_parts: list[Part] = Field(..., description="List of parts that belong to the documents") + linked_parts: list[Part] = Field(..., description="List of parts that belong to the documents") class DocumentCreateCheckEvent(BaseEvent): diff --git a/csfunctions/events/document_modify_check.py b/csfunctions/events/document_modify_check.py index d0cc0a8..1581869 100644 --- a/csfunctions/events/document_modify_check.py +++ b/csfunctions/events/document_modify_check.py @@ -9,7 +9,7 @@ class DocumentModifyCheckData(BaseModel): documents: list[Document] = Field(..., description="List of documents that are about to be modified") - attached_parts: list[Part] = Field(..., description="List of parts that belong to the documents") + linked_parts: list[Part] = Field(..., description="List of parts that belong to the documents") class DocumentModifyCheckEvent(BaseEvent): diff --git a/csfunctions/events/part_create_check.py b/csfunctions/events/part_create_check.py index 7492792..3cef96e 100644 --- a/csfunctions/events/part_create_check.py +++ b/csfunctions/events/part_create_check.py @@ -9,7 +9,7 @@ class PartCreateCheckData(BaseModel): parts: list[Part] = Field(..., description="List of parts that are about to be created") - attached_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") + linked_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") class PartCreateCheckEvent(BaseEvent): diff --git a/csfunctions/events/part_modify_check.py b/csfunctions/events/part_modify_check.py index a1203a5..a52ad4a 100644 --- a/csfunctions/events/part_modify_check.py +++ b/csfunctions/events/part_modify_check.py @@ -9,7 +9,7 @@ class PartModifyCheckData(BaseModel): parts: list[Part] = Field(..., description="List of parts that are about to be modified") - attached_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") + linked_documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.") class PartModifyCheckEvent(BaseEvent): diff --git a/docs/reference/events.md b/docs/reference/events.md index 61cbe40..f1351a0 100644 --- a/docs/reference/events.md +++ b/docs/reference/events.md @@ -18,7 +18,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |documents| list[[Document](objects.md#document)]|List of documents that are about to be created.| -|attached_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| +|linked_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| ## DocumentModifyCheckEvent `csfunctions.events.DocumentModifyCheckEvent` @@ -37,7 +37,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |documents| list[[Document](objects.md#document)]|List of documents that are about to be modified.| -|attached_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| +|linked_parts| list[[Part](objects.md#part)]|List of parts that belong to the documents.| ## DocumentReleaseCheckEvent @@ -143,7 +143,7 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |parts| list[[Part](objects.md#part)]|List of parts that are about to be created.| -|attached_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| +|linked_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| ## PartModifyCheckEvent `csfunctions.events.PartModifyCheckEvent` @@ -162,7 +162,8 @@ The event is triggered before any field calculations are performed. |Attribute|Type|Description| |-|-|-| |parts| list[[Part](objects.md#part)]|List of parts that are about to be modified.| -|attached_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| +|linked_documents| list[[Document](objects.md#document)]|List of documents that are referenced by the parts.| + ## PartReleaseCheckEvent `csfunctions.events.PartReleaseCheckEvent` diff --git a/json_schemas/data_response.json b/json_schemas/data_response.json index ea457c9..a2d0839 100644 --- a/json_schemas/data_response.json +++ b/json_schemas/data_response.json @@ -2,9 +2,6 @@ "properties": { "response_type": { "const": "data", - "enum": [ - "data" - ], "title": "Response Type", "type": "string" }, diff --git a/json_schemas/error_response.json b/json_schemas/error_response.json index 07e3ebd..c53efd4 100644 --- a/json_schemas/error_response.json +++ b/json_schemas/error_response.json @@ -2,9 +2,6 @@ "properties": { "response_type": { "const": "error", - "enum": [ - "error" - ], "title": "Response Type", "type": "string" }, diff --git a/json_schemas/request.json b/json_schemas/request.json index ad6a1ca..6b54c1b 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -6,9 +6,6 @@ "object_type": { "const": "briefcase", "default": "briefcase", - "enum": [ - "briefcase" - ], "title": "Object Type", "type": "string" }, @@ -94,9 +91,6 @@ "object_type": { "const": "document", "default": "document", - "enum": [ - "document" - ], "title": "Object Type", "type": "string" }, @@ -747,18 +741,18 @@ "title": "Documents", "type": "array" }, - "attached_parts": { + "linked_parts": { "description": "List of parts that belong to the documents", "items": { "$ref": "#/$defs/Part" }, - "title": "Attached Parts", + "title": "Linked Parts", "type": "array" } }, "required": [ "documents", - "attached_parts" + "linked_parts" ], "title": "DocumentCreateCheckData", "type": "object" @@ -768,9 +762,6 @@ "name": { "const": "document_create_check", "default": "document_create_check", - "enum": [ - "document_create_check" - ], "title": "Name", "type": "string" }, @@ -800,18 +791,18 @@ "title": "Documents", "type": "array" }, - "attached_parts": { + "linked_parts": { "description": "List of parts that belong to the documents", "items": { "$ref": "#/$defs/Part" }, - "title": "Attached Parts", + "title": "Linked Parts", "type": "array" } }, "required": [ "documents", - "attached_parts" + "linked_parts" ], "title": "DocumentModifyCheckData", "type": "object" @@ -821,9 +812,6 @@ "name": { "const": "document_modify_check", "default": "document_modify_check", - "enum": [ - "document_modify_check" - ], "title": "Name", "type": "string" }, @@ -878,9 +866,6 @@ "name": { "const": "document_release_check", "default": "document_release_check", - "enum": [ - "document_release_check" - ], "title": "Name", "type": "string" }, @@ -935,9 +920,6 @@ "dialog_type": { "const": "document_release", "default": "document_release", - "enum": [ - "document_release" - ], "title": "Dialog Type", "type": "string" }, @@ -976,9 +958,6 @@ "name": { "const": "document_release", "default": "document_release", - "enum": [ - "document_release" - ], "title": "Name", "type": "string" }, @@ -1003,9 +982,6 @@ "properties": { "name": { "const": "dummy", - "enum": [ - "dummy" - ], "title": "Name", "type": "string" }, @@ -1015,11 +991,7 @@ "type": "string" }, "data": { - "allOf": [ - { - "$ref": "#/$defs/DummyEventData" - } - ], + "$ref": "#/$defs/DummyEventData", "default": [] } }, @@ -1059,9 +1031,6 @@ "object_type": { "const": "engineering_change", "default": "engineering_change", - "enum": [ - "engineering_change" - ], "title": "Object Type", "type": "string" }, @@ -1370,9 +1339,6 @@ "name": { "const": "engineering_change_release", "default": "engineering_change_release", - "enum": [ - "engineering_change_release" - ], "title": "Name", "type": "string" }, @@ -1397,9 +1363,6 @@ "name": { "const": "engineering_change_release_check", "default": "engineering_change_release_check", - "enum": [ - "engineering_change_release_check" - ], "title": "Name", "type": "string" }, @@ -1532,9 +1495,6 @@ "properties": { "name": { "const": "field_value_calculation", - "enum": [ - "field_value_calculation" - ], "title": "Name", "type": "string" }, @@ -1560,9 +1520,6 @@ "object_type": { "const": "file", "default": "file", - "enum": [ - "file" - ], "title": "Object Type", "type": "string" }, @@ -1792,9 +1749,6 @@ "object_type": { "const": "part", "default": "part", - "enum": [ - "part" - ], "title": "Object Type", "type": "string" }, @@ -2578,18 +2532,18 @@ "title": "Parts", "type": "array" }, - "attached_documents": { + "linked_documents": { "description": "List of documents that are referenced by the parts.", "items": { "$ref": "#/$defs/Document" }, - "title": "Attached Documents", + "title": "Linked Documents", "type": "array" } }, "required": [ "parts", - "attached_documents" + "linked_documents" ], "title": "PartCreateCheckData", "type": "object" @@ -2599,9 +2553,6 @@ "name": { "const": "part_create_check", "default": "part_create_check", - "enum": [ - "part_create_check" - ], "title": "Name", "type": "string" }, @@ -2631,18 +2582,18 @@ "title": "Parts", "type": "array" }, - "attached_documents": { + "linked_documents": { "description": "List of documents that are referenced by the parts.", "items": { "$ref": "#/$defs/Document" }, - "title": "Attached Documents", + "title": "Linked Documents", "type": "array" } }, "required": [ "parts", - "attached_documents" + "linked_documents" ], "title": "PartModifyCheckData", "type": "object" @@ -2652,9 +2603,6 @@ "name": { "const": "part_modify_check", "default": "part_modify_check", - "enum": [ - "part_modify_check" - ], "title": "Name", "type": "string" }, @@ -2708,9 +2656,6 @@ "properties": { "name": { "const": "part_release_check", - "enum": [ - "part_release_check" - ], "title": "Name", "type": "string" }, @@ -2766,9 +2711,6 @@ "dialog_type": { "const": "part_release", "default": "part_release", - "enum": [ - "part_release" - ], "title": "Dialog Type", "type": "string" }, @@ -2807,9 +2749,6 @@ "name": { "const": "part_release", "default": "part_release", - "enum": [ - "part_release" - ], "title": "Name", "type": "string" }, @@ -2834,9 +2773,6 @@ "object_type": { "const": "workflow", "default": "workflow", - "enum": [ - "workflow" - ], "title": "Object Type", "type": "string" }, @@ -2930,9 +2866,6 @@ "properties": { "name": { "const": "workflow_task_trigger", - "enum": [ - "workflow_task_trigger" - ], "title": "Name", "type": "string" }, @@ -3009,11 +2942,7 @@ }, "properties": { "metadata": { - "allOf": [ - { - "$ref": "#/$defs/MetaData" - } - ], + "$ref": "#/$defs/MetaData", "description": "General information." }, "event": { diff --git a/json_schemas/workload_response.json b/json_schemas/workload_response.json index 9930872..38fd1d6 100644 --- a/json_schemas/workload_response.json +++ b/json_schemas/workload_response.json @@ -5,9 +5,6 @@ "name": { "const": "abort_and_show_error", "default": "abort_and_show_error", - "enum": [ - "abort_and_show_error" - ], "title": "Name", "type": "string" }, @@ -38,9 +35,6 @@ "properties": { "name": { "const": "dummy", - "enum": [ - "dummy" - ], "title": "Name", "type": "string" }, @@ -67,9 +61,6 @@ "properties": { "response_type": { "const": "workload", - "enum": [ - "workload" - ], "title": "Response Type", "type": "string" }, From 9c8c4c5f4b6b6aad3bc7e78839c6a6c97361cb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Fri, 7 Mar 2025 10:10:03 +0100 Subject: [PATCH 13/14] fix schemas --- json_schemas/data_response.json | 3 ++ json_schemas/error_response.json | 3 ++ json_schemas/request.json | 75 ++++++++++++++++++++++++++++- json_schemas/workload_response.json | 9 ++++ 4 files changed, 88 insertions(+), 2 deletions(-) diff --git a/json_schemas/data_response.json b/json_schemas/data_response.json index a2d0839..ea457c9 100644 --- a/json_schemas/data_response.json +++ b/json_schemas/data_response.json @@ -2,6 +2,9 @@ "properties": { "response_type": { "const": "data", + "enum": [ + "data" + ], "title": "Response Type", "type": "string" }, diff --git a/json_schemas/error_response.json b/json_schemas/error_response.json index c53efd4..07e3ebd 100644 --- a/json_schemas/error_response.json +++ b/json_schemas/error_response.json @@ -2,6 +2,9 @@ "properties": { "response_type": { "const": "error", + "enum": [ + "error" + ], "title": "Response Type", "type": "string" }, diff --git a/json_schemas/request.json b/json_schemas/request.json index 6b54c1b..334cfbb 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -6,6 +6,9 @@ "object_type": { "const": "briefcase", "default": "briefcase", + "enum": [ + "briefcase" + ], "title": "Object Type", "type": "string" }, @@ -91,6 +94,9 @@ "object_type": { "const": "document", "default": "document", + "enum": [ + "document" + ], "title": "Object Type", "type": "string" }, @@ -762,6 +768,9 @@ "name": { "const": "document_create_check", "default": "document_create_check", + "enum": [ + "document_create_check" + ], "title": "Name", "type": "string" }, @@ -812,6 +821,9 @@ "name": { "const": "document_modify_check", "default": "document_modify_check", + "enum": [ + "document_modify_check" + ], "title": "Name", "type": "string" }, @@ -866,6 +878,9 @@ "name": { "const": "document_release_check", "default": "document_release_check", + "enum": [ + "document_release_check" + ], "title": "Name", "type": "string" }, @@ -920,6 +935,9 @@ "dialog_type": { "const": "document_release", "default": "document_release", + "enum": [ + "document_release" + ], "title": "Dialog Type", "type": "string" }, @@ -958,6 +976,9 @@ "name": { "const": "document_release", "default": "document_release", + "enum": [ + "document_release" + ], "title": "Name", "type": "string" }, @@ -982,6 +1003,9 @@ "properties": { "name": { "const": "dummy", + "enum": [ + "dummy" + ], "title": "Name", "type": "string" }, @@ -991,7 +1015,11 @@ "type": "string" }, "data": { - "$ref": "#/$defs/DummyEventData", + "allOf": [ + { + "$ref": "#/$defs/DummyEventData" + } + ], "default": [] } }, @@ -1031,6 +1059,9 @@ "object_type": { "const": "engineering_change", "default": "engineering_change", + "enum": [ + "engineering_change" + ], "title": "Object Type", "type": "string" }, @@ -1339,6 +1370,9 @@ "name": { "const": "engineering_change_release", "default": "engineering_change_release", + "enum": [ + "engineering_change_release" + ], "title": "Name", "type": "string" }, @@ -1363,6 +1397,9 @@ "name": { "const": "engineering_change_release_check", "default": "engineering_change_release_check", + "enum": [ + "engineering_change_release_check" + ], "title": "Name", "type": "string" }, @@ -1495,6 +1532,9 @@ "properties": { "name": { "const": "field_value_calculation", + "enum": [ + "field_value_calculation" + ], "title": "Name", "type": "string" }, @@ -1520,6 +1560,9 @@ "object_type": { "const": "file", "default": "file", + "enum": [ + "file" + ], "title": "Object Type", "type": "string" }, @@ -1749,6 +1792,9 @@ "object_type": { "const": "part", "default": "part", + "enum": [ + "part" + ], "title": "Object Type", "type": "string" }, @@ -2553,6 +2599,9 @@ "name": { "const": "part_create_check", "default": "part_create_check", + "enum": [ + "part_create_check" + ], "title": "Name", "type": "string" }, @@ -2603,6 +2652,9 @@ "name": { "const": "part_modify_check", "default": "part_modify_check", + "enum": [ + "part_modify_check" + ], "title": "Name", "type": "string" }, @@ -2656,6 +2708,9 @@ "properties": { "name": { "const": "part_release_check", + "enum": [ + "part_release_check" + ], "title": "Name", "type": "string" }, @@ -2711,6 +2766,9 @@ "dialog_type": { "const": "part_release", "default": "part_release", + "enum": [ + "part_release" + ], "title": "Dialog Type", "type": "string" }, @@ -2749,6 +2807,9 @@ "name": { "const": "part_release", "default": "part_release", + "enum": [ + "part_release" + ], "title": "Name", "type": "string" }, @@ -2773,6 +2834,9 @@ "object_type": { "const": "workflow", "default": "workflow", + "enum": [ + "workflow" + ], "title": "Object Type", "type": "string" }, @@ -2866,6 +2930,9 @@ "properties": { "name": { "const": "workflow_task_trigger", + "enum": [ + "workflow_task_trigger" + ], "title": "Name", "type": "string" }, @@ -2942,7 +3009,11 @@ }, "properties": { "metadata": { - "$ref": "#/$defs/MetaData", + "allOf": [ + { + "$ref": "#/$defs/MetaData" + } + ], "description": "General information." }, "event": { diff --git a/json_schemas/workload_response.json b/json_schemas/workload_response.json index 38fd1d6..9930872 100644 --- a/json_schemas/workload_response.json +++ b/json_schemas/workload_response.json @@ -5,6 +5,9 @@ "name": { "const": "abort_and_show_error", "default": "abort_and_show_error", + "enum": [ + "abort_and_show_error" + ], "title": "Name", "type": "string" }, @@ -35,6 +38,9 @@ "properties": { "name": { "const": "dummy", + "enum": [ + "dummy" + ], "title": "Name", "type": "string" }, @@ -61,6 +67,9 @@ "properties": { "response_type": { "const": "workload", + "enum": [ + "workload" + ], "title": "Response Type", "type": "string" }, From 475f4fa6a2a85417955ea63d3a8daff6d0dd519f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20K=C3=BCrten?= Date: Thu, 13 Mar 2025 09:30:26 +0100 Subject: [PATCH 14/14] fix schema --- json_schemas/request.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/json_schemas/request.json b/json_schemas/request.json index 69dc025..d30b574 100644 --- a/json_schemas/request.json +++ b/json_schemas/request.json @@ -762,9 +762,6 @@ "name": { "const": "document_create_check", "default": "document_create_check", - "enum": [ - "document_create_check" - ], "title": "Name", "type": "string" }, @@ -815,9 +812,6 @@ "name": { "const": "document_modify_check", "default": "document_modify_check", - "enum": [ - "document_modify_check" - ], "title": "Name", "type": "string" }, @@ -2560,9 +2554,6 @@ "name": { "const": "part_create_check", "default": "part_create_check", - "enum": [ - "part_create_check" - ], "title": "Name", "type": "string" }, @@ -2613,9 +2604,6 @@ "name": { "const": "part_modify_check", "default": "part_modify_check", - "enum": [ - "part_modify_check" - ], "title": "Name", "type": "string" },