Terminado sprint 2A

This commit is contained in:
markosbenitez
2026-06-02 10:27:52 -03:00
parent 418c91fb12
commit 0f376a8b75
81 changed files with 5379 additions and 46 deletions

52
lib/types.ts Normal file
View File

@@ -0,0 +1,52 @@
export type QuestionType =
| 'single_choice'
| 'multiple_choice'
| 'rating'
| 'text_long'
| 'text_short'
| 'section'
export interface QuestionOption {
value: string
label: string
}
export interface RatingOptions {
min: number
max: number
min_label: string
max_label: string
}
export interface ConditionalRule {
if_question: string
op: 'eq'
value: string
action: 'show'
}
export interface Question {
id: string
survey_id: string
code: string
type: QuestionType
prompt: string
position: number
is_sensitive: boolean
required: boolean
max_select: number | null
options: QuestionOption[] | RatingOptions | null
conditional_rules: ConditionalRule[] | null
}
export interface Survey {
id: string
title: string
status: string
is_anonymous: boolean
k_threshold: number
questions: Question[]
}
// Answers keyed by question code
export type FormAnswers = Record<string, string | string[] | number | null>