/** * Appropriateness question output DTO (matches backend) */ export interface AppropriatenessQuestionOutputDto { id: number; name: string; groupName: string; question: string; answers: string[]; /** * When true, the investor may select multiple options (rendered as checkboxes rather than radios). * The backend only sets this in WeightedScore tests; absent on older backends → single-select. */ allowMultiple?: boolean; } /** * Per-test completion mode (ADR-0039 D1). * - `PassRequired` — the investor must complete AND pass to continue (default; today's behaviour). * - `CompletionRequired` — the investor must complete the test but may continue after a failed * result, following a warning and an explicit acknowledgement. */ export type AppropriatenessCompletionMode = 'PassRequired' | 'CompletionRequired'; /** Canonical outcome of a taken appropriateness test (ADR-0039 D2). */ export type AppropriatenessResult = 'Passed' | 'FailedExhausted' | 'FailedContinued'; /** * Outcome object reported to the host when the appropriateness test concludes (ADR-0039 D3). * Additive to the frozen SDK contract — hosts that ignore it keep working. */ export interface AppropriatenessOutcome { testId: number; completionMode: AppropriatenessCompletionMode; result: AppropriatenessResult; /** Total attempts used, including previous sessions (server-counted failed tries). */ attempts: number; passed: boolean; /** True only for `FailedContinued` — the investor explicitly acknowledged the warning. */ warningAcknowledged: boolean; /** ISO-8601; set only when `warningAcknowledged` is true. */ acknowledgedAt?: string; /** ISO-8601; when the investor started the (last) test session in this SDK instance. */ startedAt?: string; /** ISO-8601; when the outcome became final. */ completedAt: string; } /** * Normalizes the backend's `completionMode` field (numeric enum or string, any casing) * into the SDK's string union. Absent/unknown values default to `PassRequired`, * so tests configured before AC-792 keep today's pass-gated behaviour. */ export declare function normalizeCompletionMode(value: unknown): AppropriatenessCompletionMode; /** * How a test's pass/fail is scored. * - `CorrectCount` — pass = correct answers ≥ `testCorrectAnswerPassLimit` (default; legacy behaviour). * - `WeightedScore` — each answer carries a score; pass = total score ≥ `passScore`. */ export type AppropriatenessScoringMode = 'CorrectCount' | 'WeightedScore'; /** Normalizes the backend's `scoringMode` (numeric enum or string). Absent/unknown ⇒ `CorrectCount`. */ export declare function normalizeScoringMode(value: unknown): AppropriatenessScoringMode; /** * Appropriateness test output DTO (matches backend) */ export interface AppropriatenessTestOutputDto { id: number; applicantId: number; name: string; displayName: string; subtitle: string; description: string; /** Optional time limit in seconds. `null`/absent = untimed (no countdown, no auto-submit). */ testDurationSec: number | null; testAllowedMaxTry: number; testCorrectAnswerPassLimit: number; totalFailedTries: number; totalQuestionCount: number; /** Server wait before next try — often `"hh:mm:ss"` or TimeSpan JSON with fractional seconds */ waitTimeSpanForNextTry: string; /** * Completion mode configured for this test (AC-792). Numeric enum or string depending on * backend serialization; absent on older backends. Use {@link normalizeCompletionMode}. */ completionMode?: AppropriatenessCompletionMode | number | string; /** How the test is scored (numeric enum or string; absent on older backends). Use {@link normalizeScoringMode}. */ scoringMode?: AppropriatenessScoringMode | number | string; /** WeightedScore mode: minimum total score to pass (shown as the pass requirement). */ passScore?: number; /** * Admin-configured low-score confirmation message (AC-910 / ADR-0039 D4). Shown at the * `CompletionRequired` fail gate — the investor must acknowledge it (they understand there is * insufficient information to assess appropriateness and accept responsibility) before continuing. * Absent on older backends → the SDK falls back to its built-in `appropriatenessTest.warningBody`. */ lowScoreConfirmationMessage?: string; /** * AO-604: when true, the start screen shows ONLY the description — no question count, no time * limit, no attempts-left counter (the fail screen's attempts counter hides with it). Configured * per test in the VeroCompliance admin; absent on older backends → details show, the legacy behaviour. */ hideTestDetails?: boolean; appropriatenessQuestions: AppropriatenessQuestionOutputDto[]; } /** * Appropriateness question result */ export interface AppropriatenessQuestionResult { appropriatenessQuestionId: number; /** Single-select answer text (empty string for a multi-select question — see {@link values}). */ value: string; /** Multi-select answer texts. Sent for checkbox questions; the backend prefers this when non-empty. */ values?: string[]; } /** * Fill appropriateness test input */ export interface FillAppropriatenessTestInput { applicantId: number; appropriatenessTestId: number; appropriatenessQuestionResults: AppropriatenessQuestionResult[]; } /** * Fill appropriateness test result */ export interface FillAppropriatenessTestResult { isSuccess: boolean; message: string; } /** * Records the continue-despite-fail acknowledgement on the backend (ADR-0039 D6). * Implemented server-side by AC-794; the SDK call is best-effort until it ships. */ export interface AcknowledgeAppropriatenessTestInput { applicantId: number; appropriatenessTestId: number; acknowledgedAt: string; } export declare enum AppropriatenessQuestionType { SingleChoice = 0, MultipleChoice = 1, Text = 2 } export interface AppropriatenessAnswerDto { id: number; text: string; value: string; order: number; score?: number; } export interface AppropriatenessQuestionDto { id: number; text: string; questionType: AppropriatenessQuestionType; order: number; isRequired: boolean; answers: AppropriatenessAnswerDto[]; } //# sourceMappingURL=appropriateness-test.d.ts.map