@company-semantics/contracts 0.98.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.98.0",
3
+ "version": "0.100.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -246,10 +246,13 @@ export type {
246
246
  // Goals domain types (PRD-00173)
247
247
  GoalVisibility,
248
248
  GoalDocLevel,
249
+ GoalNodeType,
249
250
  GoalSource,
250
251
  GoalDependency,
251
252
  GoalTreeNode,
252
253
  GoalDoc,
254
+ TeamDepartmentRole,
255
+ TeamDepartmentMembership,
253
256
  // Team types (PRD-00306)
254
257
  TeamMembershipRole,
255
258
  TeamSyncMode,
@@ -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
@@ -10,6 +10,16 @@ export type GoalVisibility = 'public' | 'private';
10
10
 
11
11
  export type GoalDocLevel = 'root' | 'department' | 'team';
12
12
 
13
+ export type GoalNodeType = 'company' | 'department' | 'team' | 'cross_team' | 'doc' | 'goal' | 'source' | 'map';
14
+
15
+ export type TeamDepartmentRole = 'owner' | 'participant' | 'supporting';
16
+
17
+ export interface TeamDepartmentMembership {
18
+ readonly teamId: string;
19
+ readonly departmentId: string;
20
+ readonly role: TeamDepartmentRole;
21
+ }
22
+
13
23
  export interface GoalSource {
14
24
  readonly label: string;
15
25
  readonly sourceType: 'meeting' | 'document' | 'conversation' | 'manual';
@@ -21,30 +31,32 @@ export interface GoalDependency {
21
31
  readonly description: string;
22
32
  }
23
33
 
24
- export interface GoalTreeNode {
34
+ export interface GoalNodeIdentity {
25
35
  readonly id: string;
26
36
  readonly slug: string;
27
37
  readonly title: string;
28
38
  readonly level: GoalDocLevel;
39
+ readonly parentId: string | null;
40
+ /** Department name (backwards-compat) */
29
41
  readonly department: string | null;
42
+ /** Structured department reference */
43
+ readonly departmentId: string | null;
30
44
  readonly visibility: GoalVisibility;
31
- readonly canEdit: boolean;
32
- readonly memberCount: number;
33
45
  /** Owning team. Null for root docs or when the owning team has been deleted. */
34
46
  readonly owningTeam: { readonly id: string; readonly name: string } | null;
35
47
  }
36
48
 
37
- export interface GoalDocCore {
38
- readonly id: string;
39
- readonly slug: string;
40
- readonly title: string;
41
- readonly level: GoalDocLevel;
42
- readonly department: string | null;
49
+ export interface GoalTreeNode extends GoalNodeIdentity {
50
+ readonly type: GoalNodeType;
51
+ readonly canEdit: boolean;
52
+ readonly memberCount: number;
53
+ readonly description?: string;
54
+ /** Department IDs this node is associated with (for cross-team projections). */
55
+ readonly departmentIds?: readonly string[];
56
+ }
57
+
58
+ export interface GoalDocCore extends GoalNodeIdentity {
43
59
  readonly content: string;
44
- readonly visibility: GoalVisibility;
45
- readonly parentId: string | null;
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
60
  }
49
61
 
50
62
  export interface GoalDocCollaborators {
package/src/org/index.ts CHANGED
@@ -84,24 +84,39 @@ export { VIEW_SCOPE_MAP, getViewScope } from './view-scopes';
84
84
  export type {
85
85
  GoalVisibility,
86
86
  GoalDocLevel,
87
+ GoalNodeType,
87
88
  GoalSource,
88
89
  GoalDependency,
90
+ GoalNodeIdentity,
89
91
  GoalTreeNode,
90
92
  GoalDocCore,
91
93
  GoalDocCollaborators,
92
94
  GoalDocRelations,
93
95
  GoalDoc,
96
+ TeamDepartmentRole,
97
+ TeamDepartmentMembership,
94
98
  } from './goals';
95
99
 
96
100
  // Team types (PRD-00306)
97
101
  export type {
98
102
  TeamMembershipRole,
99
103
  TeamSyncMode,
104
+ TeamScope,
100
105
  Team,
101
106
  TeamMember,
102
107
  TeamDetail,
103
108
  } from './teams';
104
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
+
105
120
  // Sharing and ACL types (PRD-00306)
106
121
  export type {
107
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
  /**