@company-semantics/contracts 0.99.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/org/departments.ts +46 -0
- package/src/org/goals.ts +11 -14
- package/src/org/index.ts +12 -0
- package/src/org/teams.ts +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Department Domain Types
|
|
3
|
+
*
|
|
4
|
+
* Vocabulary types for the org hierarchy: Company > Departments > Teams > Members.
|
|
5
|
+
* Shared between backend (persistence/service) and app (UI rendering).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type DepartmentMembershipRole = 'member' | 'manager' | 'owner';
|
|
9
|
+
|
|
10
|
+
export type DepartmentSyncMode = 'manual_only' | 'scim' | 'hris';
|
|
11
|
+
|
|
12
|
+
export type TeamScope = 'department' | 'cross_department' | 'org';
|
|
13
|
+
|
|
14
|
+
export type UserScope = 'department' | 'org';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Department read model for list views.
|
|
18
|
+
*/
|
|
19
|
+
export interface Department {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly slug: string;
|
|
23
|
+
readonly description: string | null;
|
|
24
|
+
readonly memberCount: number;
|
|
25
|
+
readonly position: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Department member within a department detail view.
|
|
30
|
+
*/
|
|
31
|
+
export interface DepartmentMember {
|
|
32
|
+
readonly userId: string;
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly email: string;
|
|
35
|
+
readonly role: DepartmentMembershipRole;
|
|
36
|
+
readonly joinedAt: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Full department detail view including members.
|
|
41
|
+
* Returned by GET /api/departments/:id.
|
|
42
|
+
*/
|
|
43
|
+
export interface DepartmentDetail extends Department {
|
|
44
|
+
readonly members: ReadonlyArray<DepartmentMember>;
|
|
45
|
+
readonly syncMode: DepartmentSyncMode;
|
|
46
|
+
}
|
package/src/org/goals.ts
CHANGED
|
@@ -31,35 +31,32 @@ export interface GoalDependency {
|
|
|
31
31
|
readonly description: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export interface
|
|
34
|
+
export interface GoalNodeIdentity {
|
|
35
35
|
readonly id: string;
|
|
36
36
|
readonly slug: string;
|
|
37
37
|
readonly title: string;
|
|
38
|
-
readonly type: GoalNodeType;
|
|
39
38
|
readonly level: GoalDocLevel;
|
|
40
39
|
readonly parentId: string | null;
|
|
40
|
+
/** Department name (backwards-compat) */
|
|
41
41
|
readonly department: string | null;
|
|
42
|
+
/** Structured department reference */
|
|
43
|
+
readonly departmentId: string | null;
|
|
42
44
|
readonly visibility: GoalVisibility;
|
|
45
|
+
/** Owning team. Null for root docs or when the owning team has been deleted. */
|
|
46
|
+
readonly owningTeam: { readonly id: string; readonly name: string } | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GoalTreeNode extends GoalNodeIdentity {
|
|
50
|
+
readonly type: GoalNodeType;
|
|
43
51
|
readonly canEdit: boolean;
|
|
44
52
|
readonly memberCount: number;
|
|
45
53
|
readonly description?: string;
|
|
46
|
-
/** Owning team. Null for root docs or when the owning team has been deleted. */
|
|
47
|
-
readonly owningTeam: { readonly id: string; readonly name: string } | null;
|
|
48
54
|
/** Department IDs this node is associated with (for cross-team projections). */
|
|
49
55
|
readonly departmentIds?: readonly string[];
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
export interface GoalDocCore {
|
|
53
|
-
readonly id: string;
|
|
54
|
-
readonly slug: string;
|
|
55
|
-
readonly title: string;
|
|
56
|
-
readonly level: GoalDocLevel;
|
|
57
|
-
readonly department: string | null;
|
|
58
|
+
export interface GoalDocCore extends GoalNodeIdentity {
|
|
58
59
|
readonly content: string;
|
|
59
|
-
readonly visibility: GoalVisibility;
|
|
60
|
-
readonly parentId: string | null;
|
|
61
|
-
/** Owning team. Null for root docs or when the owning team has been deleted. */
|
|
62
|
-
readonly owningTeam: { readonly id: string; readonly name: string } | null;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
export interface GoalDocCollaborators {
|
package/src/org/index.ts
CHANGED
|
@@ -87,6 +87,7 @@ export type {
|
|
|
87
87
|
GoalNodeType,
|
|
88
88
|
GoalSource,
|
|
89
89
|
GoalDependency,
|
|
90
|
+
GoalNodeIdentity,
|
|
90
91
|
GoalTreeNode,
|
|
91
92
|
GoalDocCore,
|
|
92
93
|
GoalDocCollaborators,
|
|
@@ -100,11 +101,22 @@ export type {
|
|
|
100
101
|
export type {
|
|
101
102
|
TeamMembershipRole,
|
|
102
103
|
TeamSyncMode,
|
|
104
|
+
TeamScope,
|
|
103
105
|
Team,
|
|
104
106
|
TeamMember,
|
|
105
107
|
TeamDetail,
|
|
106
108
|
} from './teams';
|
|
107
109
|
|
|
110
|
+
// Department types (org hierarchy rationalization)
|
|
111
|
+
export type {
|
|
112
|
+
DepartmentMembershipRole,
|
|
113
|
+
DepartmentSyncMode,
|
|
114
|
+
UserScope,
|
|
115
|
+
Department,
|
|
116
|
+
DepartmentMember,
|
|
117
|
+
DepartmentDetail,
|
|
118
|
+
} from './departments';
|
|
119
|
+
|
|
108
120
|
// Sharing and ACL types (PRD-00306)
|
|
109
121
|
export type {
|
|
110
122
|
AccessLevel,
|
package/src/org/teams.ts
CHANGED
|
@@ -14,6 +14,11 @@ export type TeamMembershipRole = 'member' | 'manager' | 'owner';
|
|
|
14
14
|
*/
|
|
15
15
|
export type TeamSyncMode = 'manual_only' | 'synced_readonly' | 'synced_with_overrides';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Team scope — discriminates the organizational scope of a team.
|
|
19
|
+
*/
|
|
20
|
+
export type { TeamScope } from './departments';
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* Team read model for list views.
|
|
19
24
|
*/
|
|
@@ -23,6 +28,9 @@ export interface Team {
|
|
|
23
28
|
readonly slug: string;
|
|
24
29
|
readonly description: string | null;
|
|
25
30
|
readonly memberCount: number;
|
|
31
|
+
readonly scope: import('./departments').TeamScope;
|
|
32
|
+
readonly department: { readonly id: string; readonly name: string; readonly slug: string } | null;
|
|
33
|
+
readonly homeDepartment: { readonly id: string; readonly name: string; readonly slug: string } | null;
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
/**
|