-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommittee.interface.ts
More file actions
670 lines (607 loc) · 22.1 KB
/
committee.interface.ts
File metadata and controls
670 lines (607 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import { CommitteeMemberVisibility } from '../enums/committee.enum';
import { CommitteeMemberRole, CommitteeMemberVotingStatus } from '../enums/committee-member.enum';
import { GroupsIOMailingList } from './mailing-list.interface';
import { MeetingAttachment } from './meeting-attachment.interface';
// ── v2.0 Taxonomy Types ─────────────────────────────────────────────────────
/**
* Sub-type for oversight committees to distinguish governance-track (TOC, TSC)
* from advisory-track (TAC, Legal, Finance) bodies.
* Drives subtle dashboard differences: governance sub-type shows binding vote UI,
* advisory sub-type shows recommendation/report UI.
*/
export type OversightSubType = 'governance' | 'advisory';
/**
* Behavioral class for group types — drives personalized dashboard layouts.
*
* @see LFX-One-Groups-Type-Taxonomy-Spec.docx (v1.1)
*
* - governing-board: Voting, budgets, resolutions, fiduciary oversight, delegation
* - oversight-committee: Technical governance + collaboration (TSC, TOC, TAC, Legal, Finance, CoC)
* - working-group: Task-oriented collaboration, deliverables, milestones
* - special-interest-group: Community discussions, events, knowledge sharing
* - ambassador-program: Outreach, evangelism, referral campaigns, ambassador engagement
* - other: Catch-all for uncategorized groups; minimal generic dashboard
*/
export type GroupBehavioralClass = 'governing-board' | 'oversight-committee' | 'working-group' | 'special-interest-group' | 'ambassador-program' | 'other';
// ── Join & Invite Types (Phase 1) ───────────────────────────────────────────
/**
* How users can join this group.
* - open: Anyone can self-join; no approval required.
* - invite_only: Members / admins send invite links; invitee clicks to accept.
* - application: User submits application; admin reviews and approves/rejects.
* - closed: Only admins can add members directly.
*/
export type JoinMode = 'open' | 'invite_only' | 'application' | 'closed';
/** Status of a member invite */
export type InviteStatus = 'pending' | 'accepted' | 'declined' | 'expired';
/**
* A colleague-to-colleague or admin-to-user invitation to join a group.
*/
export interface GroupInvite {
/** Unique invite ID */
uid: string;
/** Committee this invite is for */
committee_uid: string;
/** Email address of the invitee */
invitee_email: string;
/** Display name of the invitee (optional) */
invitee_name?: string;
/** UID of the user who sent the invite */
invited_by_uid: string;
/** Name of the person who sent the invite */
invited_by_name?: string;
/** Current status */
status: InviteStatus;
/** Optional personal message from inviter */
message?: string;
/** Role to assign on acceptance (default: 'Member') */
suggested_role?: string;
/** When the invite was created */
created_at: string;
/** When the invite expires (default: 14 days) */
expires_at: string;
/** When the invite was accepted / declined */
responded_at?: string;
}
/**
* Payload to create one or more invites.
*/
export interface CreateGroupInviteRequest {
/** Email addresses to invite */
emails: string[];
/** Optional personal message included in the invite email */
message?: string;
/** Role to assign on acceptance */
suggested_role?: string;
}
/**
* Membership-tier eligibility thresholds for group participation.
* Replaces the former "Membership Class" behavioral type — tier is now
* an attribute on any group rather than a top-level type.
*/
export interface GroupEligibility {
/** Minimum tier to join the group (default: 'any') */
join_tier?: 'platinum' | 'gold' | 'silver' | 'any';
/** Minimum tier to serve as chair */
chair_tier?: 'platinum' | 'gold';
/** Minimum tier to hold voting rights */
voting_tier?: 'platinum' | 'gold';
}
/**
* Lightweight committee reference for cross-module use
* @description Minimal committee data with voting status eligibility
*/
export interface CommitteeReference {
/** Committee UID */
uid: string;
/** Committee display name */
name?: string;
/** Allowed voting statuses: Voting Rep, Alternate Voting Rep, Observer, Emeritus, None */
allowed_voting_statuses?: CommitteeMemberVotingStatus[];
}
/**
* Committee entity with complete details
* @description Represents a committee/working group within a project with full metadata
*/
export interface Committee {
/** Unique identifier for the committee */
uid: string;
/** Committee name */
name: string;
/** Display name for UI presentation (optional override) */
display_name?: string;
/** Write access permission for current user (response only) */
writer?: boolean;
/** Committee category/type (e.g., "Technical", "Legal", "Board") */
category: string;
/** Optional description of the committee's purpose */
description?: string;
/** UID of parent committee for hierarchical structures */
parent_uid?: string;
/** Whether voting functionality is enabled for this committee */
enable_voting: boolean;
/** Whether the committee is publicly visible */
public: boolean;
/** Whether SSO group integration is enabled */
sso_group_enabled: boolean;
/** Associated SSO group name for membership sync */
sso_group_name?: string;
/** Committee website URL */
website?: string | null;
/** Whether committee membership requires review */
requires_review?: boolean;
/** Timestamp when committee was created */
created_at: string;
/** Timestamp when committee was last updated */
updated_at: string;
/** Total number of committee members */
total_members: number;
/** Total number of voting representatives (upstream field name is total_voting_repos) */
total_voting_repos: number;
/** Associated project UID */
project_uid: string;
/** Associated project name (populated from project data) */
project_name?: string;
/** Project URL slug (enriched for filtering) */
project_slug?: string;
/** Whether the project is a foundation (top-level entity) */
is_foundation?: boolean;
/** Parent project UID (for subprojects under a foundation) */
parent_project_uid?: string;
/** Foundation name this committee belongs to (populated from project hierarchy) */
foundation_name?: string;
/** Calendar visibility settings */
calendar?: {
/** Whether committee calendar is public */
public: boolean;
};
/** Whether business email is required for membership (from settings) */
business_email_required?: boolean;
/** Whether audit logging is enabled (from settings) */
is_audit_enabled?: boolean;
/** Member profile visibility setting */
member_visibility?: CommitteeMemberVisibility;
/** Whether to show meeting attendees by default */
show_meeting_attendees?: boolean;
// ── v2.0 Taxonomy fields ──
/** Sub-type for oversight committees: governance (binding) vs advisory */
oversight_sub_type?: OversightSubType;
/** Membership-tier eligibility thresholds for participation */
eligibility?: GroupEligibility;
// ── Join & Invite fields ──
/** How users can join this group (default: 'invite_only') */
join_mode?: JoinMode;
// ── Communication Channels ──
/** Whether the committee has any associated mailing lists (enriched by BFF via query-service association counts) */
has_mailing_list?: boolean;
/** Mailing list email address associated with the group (plain string from upstream). Set to null to clear. */
mailing_list?: string | null;
/** Chat channel URL or identifier associated with the group (plain string from upstream). Set to null to clear. */
chat_channel?: string | null;
// NOTE: chair/co_chair are NOT returned by GET /committees/{uid}.
// Leadership is derived from committee members with role.name === "Chair" / "Vice Chair".
// Server-side enrichment will be added in a follow-up PR.
/** Users with write (manage) access to this committee */
writers?: CommitteeUser[];
/** Users with audit (review) access to this committee */
auditors?: CommitteeUser[];
/**
* Caller's role in this committee, when they are a member. Absent for non-members.
* Falls back to the literal 'Member' when the upstream membership row exists but
* either carries no role or uses the placeholder `CommitteeMemberRole.NONE` value.
*/
my_role?: CommitteeMemberRole | 'Member';
/** Caller's member UID in this committee. Absent for non-members. */
my_member_uid?: string;
}
/**
* Committee with the current user's membership info.
*
* @description Extends {@link Committee}, narrowing `my_role` to required for endpoints
* that guarantee the caller is a member (e.g. `GET /committees/my-committees`). No new
* fields beyond the optional ones already declared on `Committee`.
*/
export interface MyCommittee extends Committee {
/** User's role in this committee (e.g., "Chair", "Member", "Observer") */
my_role: CommitteeMemberRole | 'Member';
/** User's member UID in this committee (needed for leave action) */
my_member_uid?: string;
}
/**
* Data required to create a new committee
* @description Input payload for committee creation API
*/
export interface CommitteeCreateData {
/** Committee name (required) */
name: string;
/** Committee category (required) */
category: string;
/** Optional committee description */
description?: string;
/** Parent committee UID for hierarchical structure */
parent_uid?: string;
/** Require business email for membership */
business_email_required?: boolean;
/** Enable voting functionality */
enable_voting?: boolean;
/** Enable audit logging */
is_audit_enabled?: boolean;
/** Make committee publicly visible */
public?: boolean;
/** Display name override */
display_name?: string;
/** Enable SSO group integration */
sso_group_enabled?: boolean;
/** SSO group name for membership sync */
sso_group_name?: string;
/** Committee website URL */
website?: string | null;
/** Associated project UID */
project_uid?: string;
/** How users can join this group */
join_mode?: JoinMode;
/** Member profile visibility setting */
member_visibility?: CommitteeMemberVisibility;
/** Whether to show meeting attendees by default */
show_meeting_attendees?: boolean;
}
/**
* Data for updating existing committee
* @description Partial update payload allowing any field from create data to be modified
*/
export interface CommitteeUpdateData extends Partial<CommitteeCreateData> {
/** Update or clear mailing list email */
mailing_list?: string | null;
/** Update or clear chat channel */
chat_channel?: string | null;
/** Update the list of users with manage (write) access */
writers?: CommitteeUser[];
/** Update the list of users with review (audit) access */
auditors?: CommitteeUser[];
}
/**
* Committee settings update data
* @description Specific settings that can be updated independently
*/
export interface CommitteeSettingsData {
/** Update business email requirement */
business_email_required?: boolean;
/** Update audit logging setting */
is_audit_enabled?: boolean;
/** Update member profile visibility setting */
member_visibility?: CommitteeMemberVisibility;
/** Update show meeting attendees setting */
show_meeting_attendees?: boolean;
/** Update the list of users with manage (write) access */
writers?: CommitteeUser[];
/** Update the list of users with review (audit) access */
auditors?: CommitteeUser[];
}
// ── Committee Dashboard Data Types ──────────────────────────────────────────
// These interfaces describe data shapes for per-group-type dashboard cards.
// Fields reflect the current mock data; will align to real API shapes when
// the corresponding V2 endpoints are available.
/** Status of an open vote */
export type CommitteeVoteStatus = 'open' | 'closed' | 'cancelled';
/**
* An open or recent vote in a governing board or oversight committee.
*/
export interface CommitteeVote {
uid: string;
title: string;
status: CommitteeVoteStatus;
/** ISO date string for when voting closes */
deadline: string;
votes_for: number;
votes_against: number;
votes_abstain: number;
total_eligible: number;
created_by: string;
}
/** A single budget category line item */
export interface CommitteeBudgetCategory {
name: string;
allocated: number;
spent: number;
}
/**
* Budget summary for a governing board's fiscal year.
*/
export interface CommitteeBudgetSummary {
fiscal_year: string;
total_budget: number;
spent: number;
committed: number;
remaining: number;
categories: CommitteeBudgetCategory[];
}
/**
* A passed/failed resolution from a governing or oversight committee.
*/
export interface CommitteeResolution {
uid: string;
title: string;
/** ISO date string */
date: string;
result: string;
votes_for: number;
votes_against: number;
}
/** Activity type for collaboration-class groups */
export type CommitteeActivityType = 'pr_merged' | 'issue_opened' | 'release' | 'discussion' | 'comment' | 'review';
/**
* A recent activity event shown in working-group / oversight-committee dashboards.
*/
export interface CommitteeActivity {
uid: string;
type: CommitteeActivityType;
title: string;
author: string;
repo: string;
/** ISO date string */
timestamp: string;
/** FontAwesome icon class e.g. "fa-light fa-code-pull-request" */
icon: string;
/** Tailwind text-color class e.g. "text-emerald-600" */
color: string;
}
/**
* A top contributor shown in working-group / oversight-committee dashboards.
*/
export interface CommitteeContributor {
name: string;
commits: number;
prs: number;
reviews: number;
org: string;
}
/** Status of a working-group deliverable */
export type CommitteeDeliverableStatus = 'not-started' | 'in-progress' | 'completed' | 'blocked';
/**
* A deliverable / milestone tracked by a working group.
*/
export interface CommitteeDeliverable {
uid: string;
title: string;
status: CommitteeDeliverableStatus;
/** Completion percentage 0–100 */
progress: number;
owner: string;
/** ISO date string */
due_date: string;
}
/**
* A discussion thread in a special-interest-group dashboard.
*/
export interface CommitteeDiscussionThread {
uid: string;
title: string;
author: string;
replies: number;
/** ISO date string of most recent reply */
last_activity: string;
tags: string[];
}
/** Format of a committee-hosted event */
export type CommitteeEventType = 'Webinar' | 'In-Person' | 'Virtual' | 'Hybrid';
/**
* An upcoming event shown in a special-interest-group dashboard.
*/
export interface CommitteeEvent {
uid: string;
title: string;
type: CommitteeEventType;
/** ISO date string */
date: string;
speaker: string;
attendees: number;
}
/** Status of an ambassador outreach campaign */
export type CommitteeCampaignStatus = 'active' | 'upcoming' | 'ended' | 'paused';
/**
* An outreach campaign shown in an ambassador-program dashboard.
*/
export interface CommitteeOutreachCampaign {
uid: string;
title: string;
status: CommitteeCampaignStatus;
reach: number;
conversions: number;
conversion_rate: number;
/** FontAwesome icon class */
icon: string;
/** Tailwind text-color class */
color: string;
}
/**
* Aggregate engagement metrics for an ambassador-program dashboard.
*/
export interface CommitteeEngagementMetrics {
total_reach: number;
new_members_30d: number;
event_attendance: number;
newsletter_open_rate: number;
social_impressions: number;
ambassador_count: number;
}
/** Type of a committee document entry */
export type CommitteeDocumentType = 'file' | 'link' | 'folder';
/** Subset of document types that can be created via the BFF (excludes 'file' — meeting attachments only) */
export type CreateCommitteeDocumentType = 'link' | 'folder';
/**
* A document or resource link associated with a committee.
*/
export interface CommitteeDocument {
uid: string;
type: CommitteeDocumentType;
name: string;
/** URL for links; download URL for files */
url?: string;
/** Optional description */
description?: string;
/** MIME type or file extension (files only) */
mime_type?: string;
/** File size in bytes (files only) */
file_size?: number;
/** ISO date string of creation */
created_at?: string;
/** ISO date string of last update */
updated_at?: string;
/** UID of the user who created the document */
created_by?: string;
uploaded_by?: string;
/** Parent folder UID (for nested documents) */
parent_uid?: string;
/** Committee UID this document belongs to */
committee_uid?: string;
}
/** Request body for creating a committee document */
export interface CreateCommitteeDocumentRequest {
type: CreateCommitteeDocumentType;
name: string;
/** Required for type 'link' */
url?: string;
description?: string;
/** Parent folder UID (to place a link inside a folder) */
parent_uid?: string;
/** Display name of the creator (populated by BFF from session) */
created_by_name?: string;
}
/** Attachment enriched with meeting context for display. */
export interface MeetingAttachmentWithContext {
attachment: MeetingAttachment;
meetingTitle: string;
meetingDate: string;
meetingId: string;
}
/** Unified display item that covers both meeting attachments and standalone documents. */
export interface DocumentDisplayItem {
uid: string;
name: string;
type: CommitteeDocumentType;
url?: string;
description?: string;
addedBy?: string;
date?: string;
fileSize?: number;
/** Source for filtering: 'meeting', 'link', 'folder', or 'file' */
source: CommitteeDocumentType | 'meeting';
/** Whether this is a standalone document (supports edit/delete) */
isStandalone: boolean;
/** Original meeting attachment data (for download) */
meetingAttachment?: MeetingAttachmentWithContext;
/** Original committee document data (for edit/delete) */
committeeDocument?: CommitteeDocument;
/** Parent folder UID (for hierarchy display) */
parentUid?: string;
/** Number of child links inside this folder */
childCount?: number;
/** Whether this item is a child inside a folder (indent in table) */
isChild?: boolean;
}
/**
* Source category for a committee document entry in the Documents tab.
* @description Distinguishes between attachments, recordings, transcripts, and AI summaries.
*/
export type CommitteeDocumentSource = 'link' | 'file' | 'recording' | 'transcript' | 'summary';
/**
* Unified document item for the committee Documents tab.
* @description Represents attachments, recording files, transcripts, and AI summaries
* in a single shape suitable for table display.
*/
export interface CommitteeDocumentItem {
/** Unique key for table dataKey (combination of source + id) */
id: string;
/** Display name shown in the Name column */
name: string;
/** Source type for filtering and icon selection */
source: CommitteeDocumentSource;
/** Person who created/added the item (display name or null) */
addedBy: string | null;
/** ISO date string for the Date column */
date: string;
/** File size in bytes (null for links and summaries) */
fileSize: number | null;
/** Meeting title for the "From: ..." subtitle */
meetingTitle: string;
/** Meeting date for the "From: ..." subtitle */
meetingDate: string;
/** Meeting UID — needed for attachment download APIs on upcoming meetings */
meetingId: string;
/** Past meeting UID — needed for past meeting APIs (null for upcoming meetings) */
pastMeetingId: string | null;
/** For source='link': the external URL */
linkUrl?: string;
/** For source='file': the attachment UID for download API */
attachmentUid?: string;
/** For source='recording': play URL from RecordingFile */
playUrl?: string;
/** For source='recording'|'transcript': download URL from RecordingFile */
downloadUrl?: string;
/** For source='recording': share URL from the largest RecordingSession */
shareUrl?: string;
/** For source='summary': data needed to open SummaryModal */
summaryData?: {
uid: string;
content: string;
approved: boolean;
};
}
export interface DocumentAction {
icon: string;
tooltip: string;
}
/** View mode for the committee meetings tab. */
export type ViewMode = 'list' | 'calendar';
/** Time filter for the committee meetings tab. */
export type TimeFilter = 'upcoming' | 'past';
/** Dialog step for the Add Member search-first flow. */
export type DialogMode = 'search' | 'configure';
/**
* A user with manage/audit access to a committee (writer or auditor).
* Mirrors the CommitteeUser type from the upstream committee service.
*/
export interface CommitteeUser {
username: string;
email: string;
name: string;
avatar?: string;
}
// ── Committee Dialog Data/Result Interfaces ────────────────────────────────
export interface JoinApplicationDialogData {
committeeName: string;
mode: 'application' | 'invite_only';
}
export interface JoinApplicationDialogResult {
message: string | undefined;
}
export interface MailingListPickerDialogData {
mailingLists: GroupsIOMailingList[];
associatedUids: Set<string>;
projectUid: string;
}
export interface MailingListPickerDialogResult {
selectedUids: Set<string>;
}
export interface DescriptionDialogData {
mode: 'view' | 'edit';
description: string;
}
export interface EditChairsDialogData {
members: { label: string; value: string }[];
currentChairUid: string | null;
currentViceChairUid: string | null;
}
export type CommitteeTab = 'overview' | 'members' | 'votes' | 'meetings' | 'surveys' | 'documents' | 'settings';
/** Configuration entry for a committee view tab. Visibility and badge are closures so each consumer can wire its own signals/state. */
export interface TabConfigEntry {
key: CommitteeTab;
label: string | (() => string);
icon: string;
visible: () => boolean;
badge?: () => number | null;
}
/** Permission level for a committee member. */
export type CommitteePermissionLevel = 'manage' | 'review' | 'member';