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
5 changes: 4 additions & 1 deletion csfunctions/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .base import BaseObject
from .briefcase import Briefcase
from .classification import ObjectPropertyValue
from .common_role import CommonRole
from .document import CADDocument, Document
from .engineering_change import Change, ChangeOrder, ChangeRequest, EngineeringChange
from .file import File
Expand All @@ -26,7 +27,8 @@
| Briefcase
| Workflow
| Person
| MaturityLevel,
| MaturityLevel
| CommonRole,
Field(discriminator="object_type"),
]

Expand All @@ -48,4 +50,5 @@
"BaseObject",
"Person",
"MaturityLevel",
"CommonRole",
]
1 change: 1 addition & 0 deletions csfunctions/objects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ObjectType(str, Enum):
BRIEFCASE = "briefcase"
PERSON = "person"
MATURITY_LEVEL = "maturity_level"
COMMON_ROLE = "common_role"


class BaseObject(BaseModel):
Expand Down
20 changes: 20 additions & 0 deletions csfunctions/objects/common_role.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Literal

from pydantic import Field

from csfunctions.objects.base import BaseObject, ObjectType


class CommonRole(BaseObject):
"""
A Common (global) Role that can be assigned to a Person.
"""

object_type: Literal[ObjectType.COMMON_ROLE] = ObjectType.COMMON_ROLE

role_id: str = Field(..., description="Role ID")
name_de: str | None = Field(None, description="Name DE")
name_en: str | None = Field(None, description="Name EN")
name_ja: str | None = Field(None, description="Name JA")
name_zh: str | None = Field(None, description="Name ZH")
cdb_object_id: str | None = Field(None, description="Object ID")
14 changes: 14 additions & 0 deletions docs/reference/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ A change request of the ECM module. Shares all attributes of its base class `csf
|cdb_mpersno|str|Last Modified by|
|cdb_mdate|datetime \| None|Last Modified on|

## CommonRole
`csfunctions.objects.CommonRole`

A Common (global) Role that can be assigned to a Person.

|Attribute|Type|Description|
|-|-|-|
|role_id|str|Role ID|
|name_de|str \| None|Name DE|
|name_en|str \| None|Name EN|
|name_ja|str \| None|Name JA|
|name_zh|str \| None|Name ZH|
|cdb_object_id|str \| None|Object ID|

## Document
`csfunctions.objects.Document`

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 next
- Feat: Add CommonRole object

### Version 0.27.0
- Feat: Add part_blocked and document_blocked events
- Feat: Add reviewers field to PartReleaseCheckEvent and DocumentReleaseCheckEvent, populated for express releases
Expand Down
Loading