Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions csfunctions/actions/start_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

from pydantic import BaseModel, Field

from ..subject import Subject
from .base import ActionNames, BaseAction


class Subject(BaseModel):
subject_id: str = Field(..., description="ID of the subject, eg. a role name or personalnummer")
subject_type: Literal["Person", "PCS Role", "Common Role"] = Field(
..., description="Type of the subject: Person, PCS Role or Common Role"
)


class TaskConfiguration(BaseModel):
task_id: str = Field(..., description="Identifier for the task")
responsible: Subject | None = Field(default=None, description="Responsible subject for the task")
Expand Down
5 changes: 5 additions & 0 deletions csfunctions/events/document_release_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pydantic import BaseModel, Field

from csfunctions.objects import Document, Part
from csfunctions.subject import Subject

from .base import BaseEvent, EventNames
from .dialog_data import DocumentReleasedDialogData
Expand All @@ -12,6 +13,10 @@ class DocumentReleaseCheckData(BaseModel):
documents: list[Document] = Field(..., description="List of documents that will be released.")
parts: list[Part] = Field(..., description="List of parts that belong to the documents")
dialog_data: DocumentReleasedDialogData
reviewers: list[Subject] = Field(
default_factory=list,
description="List of reviewers assigned to the release. Only populated for express releases.",
)


class DocumentReleaseCheckEvent(BaseEvent):
Expand Down
5 changes: 5 additions & 0 deletions csfunctions/events/part_release_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pydantic import BaseModel, Field

from csfunctions.objects import Document, Part
from csfunctions.subject import Subject

from .base import BaseEvent, EventNames
from .dialog_data import PartReleasedDialogData
Expand All @@ -12,6 +13,10 @@ class PartReleaseCheckData(BaseModel):
parts: list[Part] = Field(..., description="List of parts that will be released.")
documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.")
dialog_data: PartReleasedDialogData
reviewers: list[Subject] = Field(
default_factory=list,
description="List of reviewers assigned to the release. Only populated for express releases.",
)


class PartReleaseCheckEvent(BaseEvent):
Expand Down
10 changes: 10 additions & 0 deletions csfunctions/subject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Literal

from pydantic import BaseModel, Field


class Subject(BaseModel):
subject_id: str = Field(..., description="ID of the subject, eg. a role name or personalnummer")
subject_type: Literal["Person", "PCS Role", "Common Role"] = Field(
..., description="Type of the subject: Person, PCS Role or Common Role"
)
36 changes: 26 additions & 10 deletions docs/reference/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ Be aware that the document is not released yet and the release might still be ab

**DocumentReleaseCheckEvent.data:**

| Attribute | Type | Description |
| ----------- | ------------------------------------- | ------------------------------------------- |
| documents | list[[Document](objects.md#document)] | List of documents that will be released. |
| parts | list[[Part](objects.md#part)] | List of parts that belong to the documents. |
| dialog_data | DocumentReleaseDialogData | Contents of the dialog. |
| Attribute | Type | Description |
| ----------- | ------------------------------------- | -------------------------------------------------------------------------------- |
| documents | list[[Document](objects.md#document)] | List of documents that will be released. |
| parts | list[[Part](objects.md#part)] | List of parts that belong to the documents. |
| dialog_data | DocumentReleaseDialogData | Contents of the dialog. |
| reviewers | list[Subject] | List of reviewers assigned to the release. Only populated for express releases. |

**DocumentReleaseCheckDialogData:**

Expand All @@ -67,6 +68,13 @@ Be aware that the document is not released yet and the release might still be ab
| cdbprot_remark | str \| None | Remark |
| cdb_ec_id | str \| None | Engineering Change ID |

**Subject:**

| Attribute | Type | Description |
| ------------ | ---- | ------------------------------------------------------------------ |
| subject_id | str | ID of the subject, e.g. a role name or "personalnummer" |
| subject_type | str | Type of the subject. Can be "Person", "PCS Role" or "Common Role" |

## DocumentReleasedEvent
`csfunctions.events.DocumentReleasedEvent`

Expand Down Expand Up @@ -364,11 +372,12 @@ Be aware that the part is not released yet and the release might still be aborte

**PartReleaseCheckEvent.data:**

| Attribute | Type | Description |
| ----------- | ------------------------------------- | ---------------------------------------------------- |
| parts | list[[Part](objects.md#part)] | List of parts that will released. |
| documents | list[[Document](objects.md#document)] | List of documents that belong to the released parts. |
| dialog_data | PartReleaseDialogData | Contents of the dialog. |
| Attribute | Type | Description |
| ----------- | ------------------------------------- | -------------------------------------------------------------------------------- |
| parts | list[[Part](objects.md#part)] | List of parts that will released. |
| documents | list[[Document](objects.md#document)] | List of documents that belong to the released parts. |
| dialog_data | PartReleaseDialogData | Contents of the dialog. |
| reviewers | list[Subject] | List of reviewers assigned to the release. Only populated for express releases. |

**PartReleaseCheckDialogData:**

Expand All @@ -377,6 +386,13 @@ Be aware that the part is not released yet and the release might still be aborte
| cdbprot_remark | str \| None | Remark |
| cdb_ec_id | str \| None | Engineering Change ID |

**Subject:**

| Attribute | Type | Description |
| ------------ | ---- | ------------------------------------------------------------------ |
| subject_id | str | ID of the subject, e.g. a role name or "personalnummer" |
| subject_type | str | Type of the subject. Can be "Person", "PCS Role" or "Common Role" |


## PartReleasedEvent
`csfunctions.events.PartReleasedEvent`
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ hide:
- toc
---

### Version 0.27.0
- Feat: Add reviewers field to PartReleaseCheckEvent and DocumentReleaseCheckEvent, populated for express releases

### Version 0.26.0
- Feat: Extend all multi-language object fields with Japanese (ja) and Chinese (zh) variants

Expand Down
41 changes: 41 additions & 0 deletions json_schemas/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -7413,6 +7413,14 @@
},
"dialog_data": {
"$ref": "#/$defs/DocumentReleasedDialogData"
},
"reviewers": {
"description": "List of reviewers assigned to the release. Only populated for express releases.",
"items": {
"$ref": "#/$defs/Subject"
},
"title": "Reviewers",
"type": "array"
}
},
"required": [
Expand Down Expand Up @@ -11137,6 +11145,14 @@
},
"dialog_data": {
"$ref": "#/$defs/PartReleasedDialogData"
},
"reviewers": {
"description": "List of reviewers assigned to the release. Only populated for express releases.",
"items": {
"$ref": "#/$defs/Subject"
},
"title": "Reviewers",
"type": "array"
}
},
"required": [
Expand Down Expand Up @@ -11263,6 +11279,31 @@
"title": "PartReleasedEvent",
"type": "object"
},
"Subject": {
"properties": {
"subject_id": {
"description": "ID of the subject, eg. a role name or personalnummer",
"title": "Subject Id",
"type": "string"
},
"subject_type": {
"description": "Type of the subject: Person, PCS Role or Common Role",
"enum": [
"Person",
"PCS Role",
"Common Role"
],
"title": "Subject Type",
"type": "string"
}
},
"required": [
"subject_id",
"subject_type"
],
"title": "Subject",
"type": "object"
},
"Workflow": {
"properties": {
"object_type": {
Expand Down
Loading