-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.interface.ts
More file actions
562 lines (509 loc) · 15.9 KB
/
events.interface.ts
File metadata and controls
562 lines (509 loc) · 15.9 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
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import { OffsetPaginatedResponse } from './api.interface';
/**
* The set of valid status filter values for foundation events.
* Raw EVENT_STATUS DB values ('Active', 'Planned', 'Pending', 'Completed') are passed
* directly as SQL bind parameters. 'coming-soon' is a synthetic sentinel that the server
* maps to `EVENT_STATUS IN ('Pending', 'Planned')`.
*/
export type EventStatusFilter = 'Active' | 'Planned' | 'Pending' | 'Completed' | 'coming-soon';
/**
* Event item for the My Events dashboard
*/
export interface MyEvent {
/** Unique event identifier */
id: string;
/** Event display name */
name: string;
/** External event URL */
url: string;
/** Event registration URL */
registrationUrl: string | null;
/** Foundation short name (e.g. "CNCF", "OpenSSF") */
foundation: string;
/** ISO 8601 event start date string (e.g. "2026-11-10T00:00:00.000Z") — used for date-range filtering */
startDate: string;
/** Human-readable date string (e.g. "Nov 10–13, 2026") */
date: string;
/** Human-readable location string (e.g. "Salt Lake City, UT") */
location: string;
/** User's role at the event (e.g. "Speaker", "Attendee", "Organizer"); empty string when not registered */
role: string;
/** Registration status (e.g. "Registered", "Not Registered", "Attended") */
status: string;
/** Whether the current user has registered for this event */
isRegistered: boolean;
}
/**
* Raw row returned from ANALYTICS.PLATINUM_LFX_ONE.EVENT_REGISTRATIONS
*/
export interface MyEventRow {
EVENT_ID: string;
EVENT_NAME: string;
EVENT_START_DATE: Date | string;
EVENT_END_DATE: Date | string | null;
EVENT_LOCATION: string | null;
EVENT_CITY: string | null;
EVENT_COUNTRY: string | null;
PROJECT_ID: string;
PROJECT_NAME: string;
PROJECT_SLUG: string;
ACCOUNT_NAME: string;
ACCOUNT_LOGO_URL: string | null;
/** Null when the user has not registered for this event */
USER_ROLE: string | null;
/** Null when the user has not registered for this event */
REGISTRATION_STATUS: string | null;
TF_REQUEST_STATUS: string | null;
VL_REQUEST_STATUS: string | null;
/** Null when the user has not registered for this event */
GROSS_REVENUE: number | null;
/** Null when the user has not registered for this event */
TAX_AMOUNT: number | null;
/** Null when the user has not registered for this event */
NET_REVENUE: number | null;
IS_PAST_EVENT: boolean;
EVENT_URL: string | null;
EVENT_REGISTRATION_URL: string | null;
/** Null when the user has not registered for this event */
USER_ATTENDED: number | null;
/** True when the user has registered for this event */
IS_REGISTERED: boolean;
TOTAL_RECORDS: number;
}
/**
* Paginated API response for my events
*/
export type MyEventsResponse = OffsetPaginatedResponse<MyEvent>;
/**
* Raw row returned from ANALYTICS.SILVER_DIM.EVENTS
*/
export interface EventRow {
EVENT_ID: string;
EVENT_NAME: string;
EVENT_CATEGORY: string | null;
EVENT_START_DATE: Date | string;
EVENT_END_DATE: Date | string | null;
EVENT_LOCATION: string | null;
EVENT_CITY: string | null;
EVENT_COUNTRY: string | null;
EVENT_STATUS: string | null;
IS_PAST_EVENT: boolean;
EVENT_URL: string | null;
EVENT_REGISTRATION_URL: string | null;
ATTENDEES: number | null;
TOTAL_RECORDS: number;
}
/**
* Event item for the Foundation Events dashboard
*/
export interface FoundationEvent {
/** Unique event identifier */
id: string;
/** Event display name */
name: string;
/** Event category (e.g. "Conference", "Summit") */
category: string | null;
/** External event URL */
url: string;
/** Event registration URL */
registrationUrl: string | null;
/** Human-readable date string (e.g. "Nov 10–13, 2026") */
date: string;
/** Human-readable location string (e.g. "Salt Lake City, UT") */
location: string;
/** Raw EVENT_STATUS value from the database (e.g. 'Active', 'Planned', 'Completed') */
status: string | null;
/** Whether the event is in the past */
isPast: boolean;
/** Number of attendees (only populated for past events) */
attendees: number | null;
}
/**
* Foundation event with computed action properties for the events table
*/
export interface FoundationEventWithActions extends FoundationEvent {
/** Display label derived from raw status (e.g. 'Active' → 'Registration Open') */
displayStatus: string | null;
actionLabel: string;
isOutlined: boolean;
}
/**
* Paginated API response for foundation events
*/
export type EventsResponse = OffsetPaginatedResponse<FoundationEvent>;
/**
* Response for distinct event organizations (ACCOUNT_NAME values)
*/
export interface MyEventOrganizationsResponse {
data: string[];
}
/**
* Sort change event emitted by the events table
*/
export interface SortChangeEvent {
field: string;
}
/**
* Page change event emitted by the events table
*/
export interface PageChangeEvent {
offset: number;
pageSize: number;
}
/**
* Tab identifier for the events list component
*/
export type EventTabId = 'upcoming' | 'past' | 'visa-letters' | 'travel-funding';
/**
* Tab definition for the events list component
*/
export interface EventTab {
id: EventTabId;
label: string;
countKey?: 'upcoming' | 'past';
}
/**
* Step identifiers for the visa letter application dialog
*/
export type VisaRequestStep = 'select-event' | 'terms' | 'apply';
/**
* Step identifiers for the travel fund application dialog
*/
export type TravelFundStep = 'select-event' | 'terms' | 'about-me' | 'expenses';
/**
* Represents the render state of a single step in a multi-step dialog's step indicator
*/
export interface DialogStepState {
id: string;
label: string;
number: number;
isActive: boolean;
isCompleted: boolean;
}
/**
* Parameters for fetching event requests (visa letters or travel fund) from the API
*/
export interface GetEventRequestsParams {
eventId?: string;
projectName?: string;
searchQuery?: string;
status?: string;
sortField?: string;
pageSize?: number;
offset?: number;
sortOrder?: 'ASC' | 'DESC';
}
/**
* Parameters for fetching my events from the API
*/
export interface GetMyEventsParams {
isPast?: boolean;
eventId?: string;
projectName?: string;
searchQuery?: string;
role?: string;
status?: string;
sortField?: string;
pageSize?: number;
offset?: number;
sortOrder?: 'ASC' | 'DESC';
/** When true, only events the user has registered for are returned */
registeredOnly?: boolean;
/** ISO 8601 date string — include only events starting on or after this date */
startDateFrom?: string;
/** ISO 8601 date string — include only events starting on or before this date */
startDateTo?: string;
/** Filter events by country (e.g. "United States") */
country?: string;
isVisaRequestAccepted?: boolean;
isTravelFundRequestAccepted?: boolean;
}
/**
* Parameters for fetching event organizations from the API
*/
export interface GetEventOrganizationsParams {
projectName?: string;
/** When true, returns only foundations from the user's registered past events */
isPast?: boolean;
}
/**
* Parameters for fetching foundation events from the API
*/
export interface GetEventsParams {
isPast?: boolean;
eventId?: string;
projectNames?: string[];
searchQuery?: string;
/** Filter by event status. See {@link EventStatusFilter} for supported values. */
status?: EventStatusFilter;
sortField?: string;
pageSize?: number;
offset?: number;
sortOrder?: 'ASC' | 'DESC';
}
/**
* Parameters for fetching certificate from the API
*/
export interface GetCertificateParams {
eventId: string;
}
export interface PDFTemplateDetails {
address: string;
link: string;
name: string;
desc: string;
onBehalf: string;
logo: string;
signature: string;
signatureText: string;
}
export interface CertificateEventRow {
EVENT_NAME: string;
EVENT_START_DATE: Date | string;
EVENT_END_DATE: Date | string | null;
EVENT_LOCATION: string | null;
EVENT_CITY: string | null;
EVENT_COUNTRY: string | null;
PROJECT_ID: string;
}
export interface CertificateData {
eventId: string;
userEmail: string;
userName: string;
}
/**
* Raw row returned from ANALYTICS.PLATINUM_LFX_ONE.EVENT_REGISTRATIONS for visa letter requests
*/
export interface VisaRequestRow {
EVENT_ID: string;
EVENT_NAME: string;
EVENT_URL: string | null;
EVENT_LOCATION: string | null;
EVENT_CITY: string | null;
EVENT_COUNTRY: string | null;
/** Date the visa letter was applied for */
APPLICATION_DATE: Date | string | null;
/** Visa letter request status. Actual Snowflake values: "Submitted", "Approved", "Denied", "Expired" */
REQUEST_STATUS: string;
TOTAL_RECORDS: number;
}
/**
* Visa letter request item for the My Events visa-letters tab
*/
export interface VisaRequest {
/** Unique event identifier */
id: string;
/** Event display name */
name: string;
/** External event URL */
url: string;
/** Human-readable location string (e.g. "Salt Lake City, UT") */
location: string;
/** Human-readable application date string (e.g. "Jan 15, 2026") */
applicationDate: string;
/** Visa letter request status (e.g. "Submitted", "Approved", "Denied", "Expired") */
status: string;
}
/**
* Paginated API response for visa letter requests
*/
export type VisaRequestsResponse = OffsetPaginatedResponse<VisaRequest>;
/**
* Travel fund request item — identical shape to VisaRequest (event name, location, application date, status)
*/
export type TravelFundRequest = VisaRequest;
/**
* Paginated API response for travel fund requests
*/
export type TravelFundRequestsResponse = OffsetPaginatedResponse<TravelFundRequest>;
/**
* Valid sort order values for event queries
*/
export type EventSortOrder = 'ASC' | 'DESC';
/**
* Server-side options for fetching event requests (visa letters or travel fund) — required pagination/sort fields
*/
export interface GetEventRequestsOptions {
eventId?: string;
projectName?: string;
searchQuery?: string;
status?: string;
sortField?: string;
pageSize: number;
offset: number;
sortOrder: EventSortOrder;
}
/**
* Server-side options for fetching user events (required pagination/sort fields)
*/
export interface GetMyEventsOptions {
isPast?: boolean;
eventId?: string;
projectName?: string;
searchQuery?: string;
role?: string;
status?: string;
sortField?: string;
pageSize: number;
offset: number;
sortOrder: EventSortOrder;
/** When true, only events the user has registered for are returned */
registeredOnly?: boolean;
/** ISO 8601 date string — include only events starting on or after this date */
startDateFrom?: string;
/** ISO 8601 date string — include only events starting on or before this date */
startDateTo?: string;
/** Filter events by country (e.g. "United States") */
country?: string;
/** Project slugs from persona detection — scopes upcoming events to affiliated projects */
affiliatedProjectSlugs?: string[];
/** When true, only events where the user's visa letter request was accepted are returned */
isVisaRequestAccepted?: boolean;
/** When true, only events where the user's travel fund request was accepted are returned */
isTravelFundRequestAccepted?: boolean;
}
/**
* Response for distinct event countries
*/
export interface GetUpcomingCountriesResponse {
data: string[];
}
/**
* Server-side options for fetching foundation events (required pagination/sort fields)
*/
export interface GetEventsOptions {
isPast?: boolean;
eventId?: string;
projectNames?: string[];
searchQuery?: string;
/** Filter by event status. See {@link EventStatusFilter} for supported values. */
status?: EventStatusFilter;
sortField?: string;
pageSize: number;
offset: number;
sortOrder: EventSortOrder;
}
/**
* Server-side options for fetching distinct event organizations
*/
export interface GetEventOrganizationsOptions {
projectName?: string;
/** When true, returns only foundations from the authenticated user's registered past events */
isPast?: boolean;
/** Project slugs from persona detection — scopes upcoming foundations to affiliated projects */
affiliatedProjectSlugs?: string[];
}
// ---------------------------------------------------------------------------
// Travel Fund Application
// ---------------------------------------------------------------------------
export interface TravelFundAboutMe {
firstName: string;
lastName: string;
email: string;
citizenshipCountry: string;
profileLink: string;
company: string;
organizationID: string;
canReceiveFunds: string;
travelFromCountry: string;
accommodationNumberOfNights: number;
openSourceInvolvement: string;
isLgbtqia: boolean;
isWoman: boolean;
isPersonWithDisability: boolean;
isDiversityOther: boolean;
preferNotToAnswer: boolean;
attendingForCompany: string;
willingToBlog: string;
}
export interface TravelFundExpenses {
airfareCost: number;
airfareNotes: string;
hotelCost: number;
hotelNotes: string;
groundTransportCost: number;
groundTransportNotes: string;
estimatedTotal: number;
}
export interface TravelFundApplication {
eventId: string;
eventName: string;
termsAccepted: boolean;
/** Salesforce user record ID — client-provided in the request shape; the server should ignore it and derive/validate the effective user from the session */
userId: string;
aboutMe: TravelFundAboutMe;
expenses: TravelFundExpenses;
}
export interface TravelFundApplicationResponse {
success: boolean;
message: string;
}
// ---------------------------------------------------------------------------
// Visa Request Application
// ---------------------------------------------------------------------------
/** Who pays for the attendee's accommodation — maps to attendeeAccommodationPaidBy in the user-service API */
export type AttendeeAccommodationPaidBy = 'delegate' | 'delegates_company' | 'the_linux_foundation' | 'cncf';
/** Attendee role at the event — maps to attendeeType in the user-service API */
export type AttendeeType = 'attendee' | 'speaker';
export interface VisaRequestApplicantInfo {
firstName: string;
lastName: string;
email: string;
passportNumber: string;
/** Country of citizenship — maps to birthCountry in the user-service API */
citizenshipCountry: string;
passportExpiryDate: Date | null;
embassyCity: string;
/** Organization ID — selected from the autocomplete component */
organizationID: string;
company: string;
mailingAddress: string;
/** Who pays for the attendee's accommodation */
attendeeAccommodationPaidBy: AttendeeAccommodationPaidBy;
/** Attendee role at the event */
attendeeType: AttendeeType;
/** Date of birth */
birthDate: Date | null;
}
export interface VisaRequestApplication {
eventId: string;
eventName: string;
termsAccepted: boolean;
/** Salesforce user record ID — ignored by the server; the server derives this from the authenticated session via the API Gateway profile */
userId: string;
applicantInfo: VisaRequestApplicantInfo;
}
export interface VisaRequestApplicationResponse {
success: boolean;
message: string;
}
export type RequestType = 'visa' | 'travel-fund';
export type TimeFilterValue = 'any' | 'this-month' | 'next-3-months';
// ---------------------------------------------------------------------------
// Organization Search
// ---------------------------------------------------------------------------
/**
* A single organization result from the API Gateway organization search endpoint.
* Only ID and Name are surfaced — the upstream response contains many additional fields.
*/
export interface OrgSearchResult {
id: string;
name: string;
}
/**
* Response for organization name search
*/
export interface OrgSearchResponse {
data: OrgSearchResult[];
}
// ---------------------------------------------------------------------------
// Salesforce ID
// ---------------------------------------------------------------------------
/**
* Response from the /api/user/salesforce-id endpoint.
*/
export interface SalesforceIdResponse {
id: string;
}