This repository was archived by the owner on Mar 24, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.ts
More file actions
67 lines (47 loc) · 1.97 KB
/
index.ts
File metadata and controls
67 lines (47 loc) · 1.97 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
// types/index.ts
// Defines the individual question structure used throughout the application forms.
export type FormQuestion = {
/** Unique identifier for the question used by react-hook-form and Zod */
name: string;
/** Displayed question or prompt label in the form */
question: string;
/** Question input type (determines rendered UI) */
type: 'short' | 'paragraph' | 'select' | 'number' | 'digits-only';
/** Additional description or help text shown below the label */
description?: string;
/** Placeholder text to show in the empty input */
placeholder?: string;
/** Dropdown select options (only used if type is `select`) */
options?: string[];
/** Marks the question as optional or required */
optional?: boolean;
/** Number of rows for textarea (only used if type is `paragraph`) */
rows?: number;
/** Input type for short text fields (only used if type is `short`) */
inputType?: 'text' | 'email' | 'tel' | 'url' | 'password';
/** Min value for number fields (only used if type is `number`) */
min?: number;
/** Max value for number fields (only used if type is `number`) */
max?: number;
/** Step value for number fields (only used if type is `number`) */
step?: number;
/** Minimum length for digits-only fields */
minLength?: number;
/** Maximum length for digits-only fields */
maxLength?: number;
/** Object defining conditions for when this question should be shown */
showIf?: Record<string, string | string[]>;
};
/** Represents a single volunteer role available to applicants */
export type Role = {
/** URL-friendly role identifier (slug) */
slug: string;
/** Display name shown for the role */
name: string;
/** Department to which this role belongs */
department: string;
/** Brief description of the role's purpose */
description: string;
/** List of questions specific to this role (including departmental & role-specific questions, excluding general questions) */
questions: FormQuestion[];
};