diff --git a/src/backend/db/migrations/1_initial-migrations.sql b/src/backend/db/migrations/1_initial-migrations.sql index f267ffb4..8fd3c2bb 100644 --- a/src/backend/db/migrations/1_initial-migrations.sql +++ b/src/backend/db/migrations/1_initial-migrations.sql @@ -76,9 +76,8 @@ CREATE TABLE "goal" ( created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); --- aka benchmark -CREATE TABLE "subgoal" ( - subgoal_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), -- TODO: add index to allow reordering +CREATE TABLE "benchmark" ( + benchmark_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), -- TODO: add index to allow reordering goal_id UUID REFERENCES "goal" (goal_id), status TEXT NOT NULL DEFAULT 'In Progress' CHECK (status IN ('In Progress', 'Complete')), @@ -101,7 +100,7 @@ CREATE TABLE "subgoal" ( CREATE TABLE "task" ( task_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - subgoal_id UUID REFERENCES "subgoal" (subgoal_id), + benchmark_id UUID REFERENCES "benchmark" (benchmark_id), assignee_id UUID REFERENCES "user" (user_id), due_date TIMESTAMPTZ, trial_count INTEGER, @@ -129,5 +128,5 @@ CREATE TABLE "trial_data_file" ( ); -- Potential schema for different collection types: - -- type TEXT NOT NULL CHECK (type IN ('attempt', 'behavioral')) -- enum - type of subgoal + -- type TEXT NOT NULL CHECK (type IN ('attempt', 'behavioral')) -- enum - type of benchmark -- data jsonb -- actual data, e.g. attempt_counts etc diff --git a/src/backend/db/migrations/2_add-uniqueness-constraint-on-tasks.sql b/src/backend/db/migrations/2_add-uniqueness-constraint-on-tasks.sql index 5d5abe35..4a486ab6 100644 --- a/src/backend/db/migrations/2_add-uniqueness-constraint-on-tasks.sql +++ b/src/backend/db/migrations/2_add-uniqueness-constraint-on-tasks.sql @@ -1,7 +1,7 @@ --- Each task should have a unique subgoal_id - assignee_id combination +-- Each task should have a unique benchmark_id - assignee_id combination -- which corresponds to a unique benchmark / para combo ALTER TABLE task -ADD CONSTRAINT subgoal_assignee_unique UNIQUE (subgoal_id, assignee_id); +ADD CONSTRAINT benchmark_assignee_unique UNIQUE (benchmark_id, assignee_id); -- Add index to allow easy queries of tasks by assignee CREATE INDEX idx_task_assignee ON task(assignee_id); \ No newline at end of file diff --git a/src/backend/db/zapatos/schema.d.ts b/src/backend/db/zapatos/schema.d.ts index 01d8f9cd..d3bbac37 100644 --- a/src/backend/db/zapatos/schema.d.ts +++ b/src/backend/db/zapatos/schema.d.ts @@ -376,375 +376,472 @@ declare module 'zapatos/schema' { } /** - * **file** + * **benchmark** * - Table in database */ - export namespace file { - export type Table = 'file'; + export namespace benchmark { + export type Table = 'benchmark'; export interface Selectable { /** - * **file.file_id** + * **benchmark.benchmark_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - file_id: string; + benchmark_id: string; /** - * **file.name** + * **benchmark.goal_id** + * - `uuid` in database + * - Nullable, no default + */ + goal_id: string | null; + /** + * **benchmark.status** * - `text` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `'In Progress'::text` */ - name: string; + status: string; /** - * **file.content_type** + * **benchmark.description** * - `text` in database * - `NOT NULL`, no default */ - content_type: string; + description: string; /** - * **file.ext_s3_path** + * **benchmark.setup** * - `text` in database * - `NOT NULL`, no default */ - ext_s3_path: string; + setup: string; /** - * **file.uploaded_by_user_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.instructions** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - uploaded_by_user_id: string | null; + instructions: string; /** - * **file.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **benchmark.materials** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - created_at: Date; - } - export interface JSONSelectable { + materials: string; /** - * **file.file_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * **benchmark.frequency** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - file_id: string; + frequency: string; /** - * **file.name** - * - `text` in database + * **benchmark.target_level** + * - `int2` in database * - `NOT NULL`, no default */ - name: string; + target_level: number; /** - * **file.content_type** - * - `text` in database + * **benchmark.baseline_level** + * - `int2` in database * - `NOT NULL`, no default */ - content_type: string; + baseline_level: number; /** - * **file.ext_s3_path** + * **benchmark.current_level** + * - `int2` in database + * - Nullable, no default + */ + current_level: number | null; + /** + * **benchmark.metric_name** * - `text` in database * - `NOT NULL`, no default */ - ext_s3_path: string; + metric_name: string; /** - * **file.uploaded_by_user_id** - * - `uuid` in database + * **benchmark.attempts_per_trial** + * - `int2` in database * - Nullable, no default */ - uploaded_by_user_id: string | null; + attempts_per_trial: number | null; /** - * **file.created_at** + * **benchmark.number_of_trials** + * - `int2` in database + * - Nullable, no default + */ + number_of_trials: number | null; + /** + * **benchmark.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ - created_at: db.TimestampTzString; + created_at: Date; } - export interface Whereable { + export interface JSONSelectable { /** - * **file.file_id** + * **benchmark.benchmark_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - file_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + benchmark_id: string; /** - * **file.name** + * **benchmark.goal_id** + * - `uuid` in database + * - Nullable, no default + */ + goal_id: string | null; + /** + * **benchmark.status** * - `text` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `'In Progress'::text` */ - name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + status: string; /** - * **file.content_type** + * **benchmark.description** * - `text` in database * - `NOT NULL`, no default */ - content_type?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + description: string; /** - * **file.ext_s3_path** + * **benchmark.setup** * - `text` in database * - `NOT NULL`, no default */ - ext_s3_path?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + setup: string; /** - * **file.uploaded_by_user_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.instructions** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - uploaded_by_user_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + instructions: string; /** - * **file.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **benchmark.materials** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - } - export interface Insertable { + materials: string; /** - * **file.file_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * **benchmark.frequency** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - file_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; + frequency: string; /** - * **file.name** - * - `text` in database + * **benchmark.target_level** + * - `int2` in database * - `NOT NULL`, no default */ - name: string | db.Parameter | db.SQLFragment; + target_level: number; /** - * **file.content_type** - * - `text` in database + * **benchmark.baseline_level** + * - `int2` in database * - `NOT NULL`, no default */ - content_type: string | db.Parameter | db.SQLFragment; + baseline_level: number; /** - * **file.ext_s3_path** + * **benchmark.current_level** + * - `int2` in database + * - Nullable, no default + */ + current_level: number | null; + /** + * **benchmark.metric_name** * - `text` in database * - `NOT NULL`, no default */ - ext_s3_path: string | db.Parameter | db.SQLFragment; + metric_name: string; /** - * **file.uploaded_by_user_id** - * - `uuid` in database + * **benchmark.attempts_per_trial** + * - `int2` in database * - Nullable, no default */ - uploaded_by_user_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + attempts_per_trial: number | null; /** - * **file.created_at** + * **benchmark.number_of_trials** + * - `int2` in database + * - Nullable, no default + */ + number_of_trials: number | null; + /** + * **benchmark.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; + created_at: db.TimestampTzString; } - export interface Updatable { + export interface Whereable { /** - * **file.file_id** + * **benchmark.benchmark_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - file_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + benchmark_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **file.name** + * **benchmark.goal_id** + * - `uuid` in database + * - Nullable, no default + */ + goal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **benchmark.status** * - `text` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `'In Progress'::text` */ - name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + status?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **file.content_type** + * **benchmark.description** * - `text` in database * - `NOT NULL`, no default */ - content_type?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + description?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **file.ext_s3_path** + * **benchmark.setup** * - `text` in database * - `NOT NULL`, no default */ - ext_s3_path?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + setup?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **file.uploaded_by_user_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.instructions** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - uploaded_by_user_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + instructions?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **file.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **benchmark.materials** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; - } - export type UniqueIndex = 'file_ext_s3_path_key' | 'file_pkey'; - export type Column = keyof Selectable; - export type OnlyCols = Pick; - export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; - export type SQL = SQLExpression | SQLExpression[]; - } - - /** - * **goal** - * - Table in database - */ - export namespace goal { - export type Table = 'goal'; - export interface Selectable { + materials?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **goal.goal_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * **benchmark.frequency** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - goal_id: string; + frequency?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **goal.iep_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.target_level** + * - `int2` in database + * - `NOT NULL`, no default */ - iep_id: string | null; + target_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **goal.description** - * - `text` in database + * **benchmark.baseline_level** + * - `int2` in database * - `NOT NULL`, no default */ - description: string; + baseline_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **goal.category** + * **benchmark.current_level** + * - `int2` in database + * - Nullable, no default + */ + current_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **benchmark.metric_name** * - `text` in database * - `NOT NULL`, no default */ - category: string; + metric_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **goal.created_at** + * **benchmark.attempts_per_trial** + * - `int2` in database + * - Nullable, no default + */ + attempts_per_trial?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **benchmark.number_of_trials** + * - `int2` in database + * - Nullable, no default + */ + number_of_trials?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **benchmark.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ - created_at: Date; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } - export interface JSONSelectable { + export interface Insertable { /** - * **goal.goal_id** + * **benchmark.benchmark_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - goal_id: string; + benchmark_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **goal.iep_id** + * **benchmark.goal_id** * - `uuid` in database * - Nullable, no default */ - iep_id: string | null; + goal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; /** - * **goal.description** + * **benchmark.status** + * - `text` in database + * - `NOT NULL`, default: `'In Progress'::text` + */ + status?: string | db.Parameter | db.DefaultType | db.SQLFragment; + /** + * **benchmark.description** * - `text` in database * - `NOT NULL`, no default */ - description: string; + description: string | db.Parameter | db.SQLFragment; /** - * **goal.category** + * **benchmark.setup** * - `text` in database * - `NOT NULL`, no default */ - category: string; + setup: string | db.Parameter | db.SQLFragment; /** - * **goal.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **benchmark.instructions** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - created_at: db.TimestampTzString; - } - export interface Whereable { + instructions?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **goal.goal_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * **benchmark.materials** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - goal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + materials?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **goal.iep_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.frequency** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - iep_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + frequency?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **goal.description** - * - `text` in database + * **benchmark.target_level** + * - `int2` in database * - `NOT NULL`, no default */ - description?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + target_level: number | db.Parameter | db.SQLFragment; /** - * **goal.category** + * **benchmark.baseline_level** + * - `int2` in database + * - `NOT NULL`, no default + */ + baseline_level: number | db.Parameter | db.SQLFragment; + /** + * **benchmark.current_level** + * - `int2` in database + * - Nullable, no default + */ + current_level?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **benchmark.metric_name** * - `text` in database * - `NOT NULL`, no default */ - category?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + metric_name: string | db.Parameter | db.SQLFragment; /** - * **goal.created_at** + * **benchmark.attempts_per_trial** + * - `int2` in database + * - Nullable, no default + */ + attempts_per_trial?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **benchmark.number_of_trials** + * - `int2` in database + * - Nullable, no default + */ + number_of_trials?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **benchmark.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; } - export interface Insertable { + export interface Updatable { /** - * **goal.goal_id** + * **benchmark.benchmark_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - goal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; + benchmark_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **goal.iep_id** + * **benchmark.goal_id** * - `uuid` in database * - Nullable, no default */ - iep_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + goal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; /** - * **goal.description** + * **benchmark.status** * - `text` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `'In Progress'::text` */ - description: string | db.Parameter | db.SQLFragment; + status?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **goal.category** + * **benchmark.description** * - `text` in database * - `NOT NULL`, no default */ - category: string | db.Parameter | db.SQLFragment; + description?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **goal.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **benchmark.setup** + * - `text` in database + * - `NOT NULL`, no default */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; - } - export interface Updatable { + setup?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **goal.goal_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * **benchmark.instructions** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - goal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + instructions?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **goal.iep_id** - * - `uuid` in database - * - Nullable, no default + * **benchmark.materials** + * - `text` in database + * - `NOT NULL`, default: `''::text` */ - iep_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + materials?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **goal.description** + * **benchmark.frequency** * - `text` in database + * - `NOT NULL`, default: `''::text` + */ + frequency?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + /** + * **benchmark.target_level** + * - `int2` in database * - `NOT NULL`, no default */ - description?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + target_level?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **goal.category** + * **benchmark.baseline_level** + * - `int2` in database + * - `NOT NULL`, no default + */ + baseline_level?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + /** + * **benchmark.current_level** + * - `int2` in database + * - Nullable, no default + */ + current_level?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** + * **benchmark.metric_name** * - `text` in database * - `NOT NULL`, no default */ - category?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + metric_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **goal.created_at** + * **benchmark.attempts_per_trial** + * - `int2` in database + * - Nullable, no default + */ + attempts_per_trial?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** + * **benchmark.number_of_trials** + * - `int2` in database + * - Nullable, no default + */ + number_of_trials?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** + * **benchmark.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'goal_pkey'; + export type UniqueIndex = 'benchmark_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -752,44 +849,44 @@ declare module 'zapatos/schema' { } /** - * **iep** + * **file** * - Table in database */ - export namespace iep { - export type Table = 'iep'; + export namespace file { + export type Table = 'file'; export interface Selectable { /** - * **iep.iep_id** + * **file.file_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - iep_id: string; + file_id: string; /** - * **iep.student_id** - * - `uuid` in database - * - Nullable, no default + * **file.name** + * - `text` in database + * - `NOT NULL`, no default */ - student_id: string | null; + name: string; /** - * **iep.case_manager_id** - * - `uuid` in database - * - Nullable, no default + * **file.content_type** + * - `text` in database + * - `NOT NULL`, no default */ - case_manager_id: string | null; + content_type: string; /** - * **iep.start_date** - * - `date` in database + * **file.ext_s3_path** + * - `text` in database * - `NOT NULL`, no default */ - start_date: Date; + ext_s3_path: string; /** - * **iep.end_date** - * - `date` in database - * - `NOT NULL`, no default + * **file.uploaded_by_user_id** + * - `uuid` in database + * - Nullable, no default */ - end_date: Date; + uploaded_by_user_id: string | null; /** - * **iep.created_at** + * **file.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ @@ -797,37 +894,37 @@ declare module 'zapatos/schema' { } export interface JSONSelectable { /** - * **iep.iep_id** + * **file.file_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - iep_id: string; + file_id: string; /** - * **iep.student_id** - * - `uuid` in database - * - Nullable, no default + * **file.name** + * - `text` in database + * - `NOT NULL`, no default */ - student_id: string | null; + name: string; /** - * **iep.case_manager_id** - * - `uuid` in database - * - Nullable, no default + * **file.content_type** + * - `text` in database + * - `NOT NULL`, no default */ - case_manager_id: string | null; + content_type: string; /** - * **iep.start_date** - * - `date` in database + * **file.ext_s3_path** + * - `text` in database * - `NOT NULL`, no default */ - start_date: db.DateString; + ext_s3_path: string; /** - * **iep.end_date** - * - `date` in database - * - `NOT NULL`, no default + * **file.uploaded_by_user_id** + * - `uuid` in database + * - Nullable, no default */ - end_date: db.DateString; + uploaded_by_user_id: string | null; /** - * **iep.created_at** + * **file.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ @@ -835,37 +932,37 @@ declare module 'zapatos/schema' { } export interface Whereable { /** - * **iep.iep_id** + * **file.file_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - iep_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + file_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **iep.student_id** - * - `uuid` in database - * - Nullable, no default + * **file.name** + * - `text` in database + * - `NOT NULL`, no default */ - student_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **iep.case_manager_id** - * - `uuid` in database - * - Nullable, no default + * **file.content_type** + * - `text` in database + * - `NOT NULL`, no default */ - case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + content_type?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **iep.start_date** - * - `date` in database + * **file.ext_s3_path** + * - `text` in database * - `NOT NULL`, no default */ - start_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + ext_s3_path?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **iep.end_date** - * - `date` in database - * - `NOT NULL`, no default + * **file.uploaded_by_user_id** + * - `uuid` in database + * - Nullable, no default */ - end_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + uploaded_by_user_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **iep.created_at** + * **file.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ @@ -873,37 +970,37 @@ declare module 'zapatos/schema' { } export interface Insertable { /** - * **iep.iep_id** + * **file.file_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - iep_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; + file_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **iep.student_id** - * - `uuid` in database - * - Nullable, no default + * **file.name** + * - `text` in database + * - `NOT NULL`, no default */ - student_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + name: string | db.Parameter | db.SQLFragment; /** - * **iep.case_manager_id** - * - `uuid` in database - * - Nullable, no default - */ - case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; - /** - * **iep.start_date** - * - `date` in database + * **file.content_type** + * - `text` in database * - `NOT NULL`, no default */ - start_date: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment; + content_type: string | db.Parameter | db.SQLFragment; /** - * **iep.end_date** - * - `date` in database + * **file.ext_s3_path** + * - `text` in database * - `NOT NULL`, no default */ - end_date: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment; + ext_s3_path: string | db.Parameter | db.SQLFragment; /** - * **iep.created_at** + * **file.uploaded_by_user_id** + * - `uuid` in database + * - Nullable, no default + */ + uploaded_by_user_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **file.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ @@ -911,43 +1008,43 @@ declare module 'zapatos/schema' { } export interface Updatable { /** - * **iep.iep_id** + * **file.file_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - iep_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + file_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **iep.student_id** - * - `uuid` in database - * - Nullable, no default + * **file.name** + * - `text` in database + * - `NOT NULL`, no default */ - student_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **iep.case_manager_id** - * - `uuid` in database - * - Nullable, no default + * **file.content_type** + * - `text` in database + * - `NOT NULL`, no default */ - case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + content_type?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **iep.start_date** - * - `date` in database + * **file.ext_s3_path** + * - `text` in database * - `NOT NULL`, no default */ - start_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + ext_s3_path?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **iep.end_date** - * - `date` in database - * - `NOT NULL`, no default + * **file.uploaded_by_user_id** + * - `uuid` in database + * - Nullable, no default */ - end_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + uploaded_by_user_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; /** - * **iep.created_at** + * **file.created_at** * - `timestamptz` in database * - `NOT NULL`, default: `now()` */ created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'iep_pkey'; + export type UniqueIndex = 'file_ext_s3_path_key' | 'file_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -955,142 +1052,172 @@ declare module 'zapatos/schema' { } /** - * **migrations** + * **goal** * - Table in database */ - export namespace migrations { - export type Table = 'migrations'; + export namespace goal { + export type Table = 'goal'; export interface Selectable { /** - * **migrations.id** - * - `int4` in database - * - `NOT NULL`, no default + * **goal.goal_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - id: number; + goal_id: string; /** - * **migrations.name** - * - `varchar` in database + * **goal.iep_id** + * - `uuid` in database + * - Nullable, no default + */ + iep_id: string | null; + /** + * **goal.description** + * - `text` in database * - `NOT NULL`, no default */ - name: string; + description: string; /** - * **migrations.hash** - * - `varchar` in database + * **goal.category** + * - `text` in database * - `NOT NULL`, no default */ - hash: string; + category: string; /** - * **migrations.executed_at** - * - `timestamp` in database - * - Nullable, default: `CURRENT_TIMESTAMP` + * **goal.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - executed_at: Date | null; + created_at: Date; } export interface JSONSelectable { /** - * **migrations.id** - * - `int4` in database - * - `NOT NULL`, no default + * **goal.goal_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - id: number; + goal_id: string; /** - * **migrations.name** - * - `varchar` in database + * **goal.iep_id** + * - `uuid` in database + * - Nullable, no default + */ + iep_id: string | null; + /** + * **goal.description** + * - `text` in database * - `NOT NULL`, no default */ - name: string; + description: string; /** - * **migrations.hash** - * - `varchar` in database + * **goal.category** + * - `text` in database * - `NOT NULL`, no default */ - hash: string; + category: string; /** - * **migrations.executed_at** - * - `timestamp` in database - * - Nullable, default: `CURRENT_TIMESTAMP` + * **goal.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - executed_at: db.TimestampString | null; + created_at: db.TimestampTzString; } export interface Whereable { /** - * **migrations.id** - * - `int4` in database - * - `NOT NULL`, no default + * **goal.goal_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - id?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + goal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **migrations.name** - * - `varchar` in database + * **goal.iep_id** + * - `uuid` in database + * - Nullable, no default + */ + iep_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + /** + * **goal.description** + * - `text` in database * - `NOT NULL`, no default */ - name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + description?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **migrations.hash** - * - `varchar` in database + * **goal.category** + * - `text` in database * - `NOT NULL`, no default */ - hash?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + category?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **migrations.executed_at** - * - `timestamp` in database - * - Nullable, default: `CURRENT_TIMESTAMP` + * **goal.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { /** - * **migrations.id** - * - `int4` in database - * - `NOT NULL`, no default + * **goal.goal_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - id: number | db.Parameter | db.SQLFragment; + goal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **migrations.name** - * - `varchar` in database + * **goal.iep_id** + * - `uuid` in database + * - Nullable, no default + */ + iep_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **goal.description** + * - `text` in database * - `NOT NULL`, no default */ - name: string | db.Parameter | db.SQLFragment; + description: string | db.Parameter | db.SQLFragment; /** - * **migrations.hash** - * - `varchar` in database + * **goal.category** + * - `text` in database * - `NOT NULL`, no default */ - hash: string | db.Parameter | db.SQLFragment; + category: string | db.Parameter | db.SQLFragment; /** - * **migrations.executed_at** - * - `timestamp` in database - * - Nullable, default: `CURRENT_TIMESTAMP` + * **goal.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | null | db.DefaultType | db.SQLFragment; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; } export interface Updatable { /** - * **migrations.id** - * - `int4` in database - * - `NOT NULL`, no default + * **goal.goal_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - id?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + goal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **migrations.name** - * - `varchar` in database + * **goal.iep_id** + * - `uuid` in database + * - Nullable, no default + */ + iep_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** + * **goal.description** + * - `text` in database * - `NOT NULL`, no default */ - name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + description?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **migrations.hash** - * - `varchar` in database + * **goal.category** + * - `text` in database * - `NOT NULL`, no default */ - hash?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + category?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **migrations.executed_at** - * - `timestamp` in database - * - Nullable, default: `CURRENT_TIMESTAMP` + * **goal.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'migrations_name_key' | 'migrations_pkey'; + export type UniqueIndex = 'goal_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -1098,225 +1225,202 @@ declare module 'zapatos/schema' { } /** - * **paras_assigned_to_case_manager** + * **iep** * - Table in database */ - export namespace paras_assigned_to_case_manager { - export type Table = 'paras_assigned_to_case_manager'; + export namespace iep { + export type Table = 'iep'; export interface Selectable { /** - * **paras_assigned_to_case_manager.case_manager_id** + * **iep.iep_id** * - `uuid` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `uuid_generate_v4()` */ - case_manager_id: string; + iep_id: string; /** - * **paras_assigned_to_case_manager.para_id** + * **iep.student_id** * - `uuid` in database - * - `NOT NULL`, no default + * - Nullable, no default */ - para_id: string; - } - export interface JSONSelectable { - /** - * **paras_assigned_to_case_manager.case_manager_id** - * - `uuid` in database - * - `NOT NULL`, no default - */ - case_manager_id: string; - /** - * **paras_assigned_to_case_manager.para_id** - * - `uuid` in database - * - `NOT NULL`, no default - */ - para_id: string; - } - export interface Whereable { + student_id: string | null; /** - * **paras_assigned_to_case_manager.case_manager_id** + * **iep.case_manager_id** * - `uuid` in database - * - `NOT NULL`, no default + * - Nullable, no default */ - case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + case_manager_id: string | null; /** - * **paras_assigned_to_case_manager.para_id** - * - `uuid` in database + * **iep.start_date** + * - `date` in database * - `NOT NULL`, no default */ - para_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - } - export interface Insertable { + start_date: Date; /** - * **paras_assigned_to_case_manager.case_manager_id** - * - `uuid` in database + * **iep.end_date** + * - `date` in database * - `NOT NULL`, no default */ - case_manager_id: string | db.Parameter | db.SQLFragment; + end_date: Date; /** - * **paras_assigned_to_case_manager.para_id** - * - `uuid` in database - * - `NOT NULL`, no default + * **iep.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` */ - para_id: string | db.Parameter | db.SQLFragment; + created_at: Date; } - export interface Updatable { + export interface JSONSelectable { /** - * **paras_assigned_to_case_manager.case_manager_id** + * **iep.iep_id** * - `uuid` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `uuid_generate_v4()` */ - case_manager_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + iep_id: string; /** - * **paras_assigned_to_case_manager.para_id** + * **iep.student_id** * - `uuid` in database - * - `NOT NULL`, no default + * - Nullable, no default */ - para_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; - } - export type UniqueIndex = 'paras_assigned_to_case_manager_pkey'; - export type Column = keyof Selectable; - export type OnlyCols = Pick; - export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; - export type SQL = SQLExpression | SQLExpression[]; - } - - /** - * **session** - * - Table in database - */ - export namespace session { - export type Table = 'session'; - export interface Selectable { + student_id: string | null; /** - * **session.session_id** + * **iep.case_manager_id** * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * - Nullable, no default */ - session_id: string; + case_manager_id: string | null; /** - * **session.session_token** - * - `text` in database + * **iep.start_date** + * - `date` in database * - `NOT NULL`, no default */ - session_token: string; + start_date: db.DateString; /** - * **session.user_id** - * - `uuid` in database + * **iep.end_date** + * - `date` in database * - `NOT NULL`, no default */ - user_id: string; + end_date: db.DateString; /** - * **session.expires_at** + * **iep.created_at** * - `timestamptz` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `now()` */ - expires_at: Date; + created_at: db.TimestampTzString; } - export interface JSONSelectable { + export interface Whereable { /** - * **session.session_id** + * **iep.iep_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - session_id: string; - /** - * **session.session_token** - * - `text` in database - * - `NOT NULL`, no default - */ - session_token: string; + iep_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **session.user_id** + * **iep.student_id** * - `uuid` in database - * - `NOT NULL`, no default - */ - user_id: string; - /** - * **session.expires_at** - * - `timestamptz` in database - * - `NOT NULL`, no default + * - Nullable, no default */ - expires_at: db.TimestampTzString; - } - export interface Whereable { + student_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **session.session_id** + * **iep.case_manager_id** * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * - Nullable, no default */ - session_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **session.session_token** - * - `text` in database + * **iep.start_date** + * - `date` in database * - `NOT NULL`, no default */ - session_token?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + start_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **session.user_id** - * - `uuid` in database + * **iep.end_date** + * - `date` in database * - `NOT NULL`, no default */ - user_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + end_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **session.expires_at** + * **iep.created_at** * - `timestamptz` in database - * - `NOT NULL`, no default + * - `NOT NULL`, default: `now()` */ - expires_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { /** - * **session.session_id** + * **iep.iep_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - session_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; + iep_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **session.session_token** - * - `text` in database - * - `NOT NULL`, no default + * **iep.student_id** + * - `uuid` in database + * - Nullable, no default */ - session_token: string | db.Parameter | db.SQLFragment; + student_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; /** - * **session.user_id** + * **iep.case_manager_id** * - `uuid` in database + * - Nullable, no default + */ + case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + /** + * **iep.start_date** + * - `date` in database * - `NOT NULL`, no default */ - user_id: string | db.Parameter | db.SQLFragment; + start_date: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment; /** - * **session.expires_at** - * - `timestamptz` in database + * **iep.end_date** + * - `date` in database * - `NOT NULL`, no default */ - expires_at: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment; + end_date: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment; + /** + * **iep.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` + */ + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; } export interface Updatable { /** - * **session.session_id** + * **iep.iep_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - session_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + iep_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **session.session_token** - * - `text` in database - * - `NOT NULL`, no default + * **iep.student_id** + * - `uuid` in database + * - Nullable, no default */ - session_token?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + student_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; /** - * **session.user_id** + * **iep.case_manager_id** * - `uuid` in database + * - Nullable, no default + */ + case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + /** + * **iep.start_date** + * - `date` in database * - `NOT NULL`, no default */ - user_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + start_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **session.expires_at** - * - `timestamptz` in database + * **iep.end_date** + * - `date` in database * - `NOT NULL`, no default */ - expires_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + end_date?: (db.DateString | Date) | db.Parameter<(db.DateString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + /** + * **iep.created_at** + * - `timestamptz` in database + * - `NOT NULL`, default: `now()` + */ + created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'session_pkey' | 'session_session_token_key'; + export type UniqueIndex = 'iep_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -1324,202 +1428,142 @@ declare module 'zapatos/schema' { } /** - * **student** + * **migrations** * - Table in database */ - export namespace student { - export type Table = 'student'; + export namespace migrations { + export type Table = 'migrations'; export interface Selectable { /** - * **student.student_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` - */ - student_id: string; - /** - * **student.first_name** - * - `text` in database + * **migrations.id** + * - `int4` in database * - `NOT NULL`, no default */ - first_name: string; + id: number; /** - * **student.last_name** - * - `text` in database + * **migrations.name** + * - `varchar` in database * - `NOT NULL`, no default */ - last_name: string; + name: string; /** - * **student.email** - * - `text` in database + * **migrations.hash** + * - `varchar` in database * - `NOT NULL`, no default */ - email: string; + hash: string; /** - * **student.assigned_case_manager_id** - * - `uuid` in database - * - Nullable, no default + * **migrations.executed_at** + * - `timestamp` in database + * - Nullable, default: `CURRENT_TIMESTAMP` */ - assigned_case_manager_id: string | null; + executed_at: Date | null; + } + export interface JSONSelectable { /** - * **student.grade** - * - `int2` in database - * - `NOT NULL`, no default - */ - grade: number; - } - export interface JSONSelectable { - /** - * **student.student_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` - */ - student_id: string; - /** - * **student.first_name** - * - `text` in database + * **migrations.id** + * - `int4` in database * - `NOT NULL`, no default */ - first_name: string; + id: number; /** - * **student.last_name** - * - `text` in database + * **migrations.name** + * - `varchar` in database * - `NOT NULL`, no default */ - last_name: string; + name: string; /** - * **student.email** - * - `text` in database + * **migrations.hash** + * - `varchar` in database * - `NOT NULL`, no default */ - email: string; - /** - * **student.assigned_case_manager_id** - * - `uuid` in database - * - Nullable, no default - */ - assigned_case_manager_id: string | null; + hash: string; /** - * **student.grade** - * - `int2` in database - * - `NOT NULL`, no default + * **migrations.executed_at** + * - `timestamp` in database + * - Nullable, default: `CURRENT_TIMESTAMP` */ - grade: number; + executed_at: db.TimestampString | null; } export interface Whereable { /** - * **student.student_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` - */ - student_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** - * **student.first_name** - * - `text` in database + * **migrations.id** + * - `int4` in database * - `NOT NULL`, no default */ - first_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + id?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **student.last_name** - * - `text` in database + * **migrations.name** + * - `varchar` in database * - `NOT NULL`, no default */ - last_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **student.email** - * - `text` in database + * **migrations.hash** + * - `varchar` in database * - `NOT NULL`, no default */ - email?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** - * **student.assigned_case_manager_id** - * - `uuid` in database - * - Nullable, no default - */ - assigned_case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + hash?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **student.grade** - * - `int2` in database - * - `NOT NULL`, no default + * **migrations.executed_at** + * - `timestamp` in database + * - Nullable, default: `CURRENT_TIMESTAMP` */ - grade?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } export interface Insertable { /** - * **student.student_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` - */ - student_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; - /** - * **student.first_name** - * - `text` in database + * **migrations.id** + * - `int4` in database * - `NOT NULL`, no default */ - first_name: string | db.Parameter | db.SQLFragment; + id: number | db.Parameter | db.SQLFragment; /** - * **student.last_name** - * - `text` in database + * **migrations.name** + * - `varchar` in database * - `NOT NULL`, no default */ - last_name: string | db.Parameter | db.SQLFragment; + name: string | db.Parameter | db.SQLFragment; /** - * **student.email** - * - `text` in database + * **migrations.hash** + * - `varchar` in database * - `NOT NULL`, no default */ - email: string | db.Parameter | db.SQLFragment; - /** - * **student.assigned_case_manager_id** - * - `uuid` in database - * - Nullable, no default - */ - assigned_case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + hash: string | db.Parameter | db.SQLFragment; /** - * **student.grade** - * - `int2` in database - * - `NOT NULL`, no default + * **migrations.executed_at** + * - `timestamp` in database + * - Nullable, default: `CURRENT_TIMESTAMP` */ - grade: number | db.Parameter | db.SQLFragment; + executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | null | db.DefaultType | db.SQLFragment; } export interface Updatable { /** - * **student.student_id** - * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` - */ - student_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; - /** - * **student.first_name** - * - `text` in database + * **migrations.id** + * - `int4` in database * - `NOT NULL`, no default */ - first_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + id?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **student.last_name** - * - `text` in database + * **migrations.name** + * - `varchar` in database * - `NOT NULL`, no default */ - last_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **student.email** - * - `text` in database + * **migrations.hash** + * - `varchar` in database * - `NOT NULL`, no default */ - email?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; - /** - * **student.assigned_case_manager_id** - * - `uuid` in database - * - Nullable, no default - */ - assigned_case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + hash?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **student.grade** - * - `int2` in database - * - `NOT NULL`, no default + * **migrations.executed_at** + * - `timestamp` in database + * - Nullable, default: `CURRENT_TIMESTAMP` */ - grade?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + executed_at?: (db.TimestampString | Date) | db.Parameter<(db.TimestampString | Date)> | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'student_email_key' | 'student_pkey'; + export type UniqueIndex = 'migrations_name_key' | 'migrations_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -1527,472 +1571,428 @@ declare module 'zapatos/schema' { } /** - * **subgoal** + * **paras_assigned_to_case_manager** * - Table in database */ - export namespace subgoal { - export type Table = 'subgoal'; + export namespace paras_assigned_to_case_manager { + export type Table = 'paras_assigned_to_case_manager'; export interface Selectable { /** - * **subgoal.subgoal_id** + * **paras_assigned_to_case_manager.case_manager_id** * - `uuid` in database - * - `NOT NULL`, default: `uuid_generate_v4()` + * - `NOT NULL`, no default */ - subgoal_id: string; + case_manager_id: string; /** - * **subgoal.goal_id** + * **paras_assigned_to_case_manager.para_id** * - `uuid` in database - * - Nullable, no default + * - `NOT NULL`, no default */ - goal_id: string | null; + para_id: string; + } + export interface JSONSelectable { /** - * **subgoal.status** - * - `text` in database - * - `NOT NULL`, default: `'In Progress'::text` + * **paras_assigned_to_case_manager.case_manager_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - status: string; + case_manager_id: string; /** - * **subgoal.description** - * - `text` in database + * **paras_assigned_to_case_manager.para_id** + * - `uuid` in database * - `NOT NULL`, no default */ - description: string; + para_id: string; + } + export interface Whereable { /** - * **subgoal.setup** - * - `text` in database + * **paras_assigned_to_case_manager.case_manager_id** + * - `uuid` in database * - `NOT NULL`, no default */ - setup: string; + case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.instructions** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **paras_assigned_to_case_manager.para_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - instructions: string; + para_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + } + export interface Insertable { /** - * **subgoal.materials** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **paras_assigned_to_case_manager.case_manager_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - materials: string; + case_manager_id: string | db.Parameter | db.SQLFragment; /** - * **subgoal.frequency** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **paras_assigned_to_case_manager.para_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - frequency: string; + para_id: string | db.Parameter | db.SQLFragment; + } + export interface Updatable { /** - * **subgoal.target_level** - * - `int2` in database + * **paras_assigned_to_case_manager.case_manager_id** + * - `uuid` in database * - `NOT NULL`, no default */ - target_level: number; + case_manager_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.baseline_level** - * - `int2` in database + * **paras_assigned_to_case_manager.para_id** + * - `uuid` in database * - `NOT NULL`, no default */ - baseline_level: number; + para_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + } + export type UniqueIndex = 'paras_assigned_to_case_manager_pkey'; + export type Column = keyof Selectable; + export type OnlyCols = Pick; + export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; + export type SQL = SQLExpression | SQLExpression[]; + } + + /** + * **session** + * - Table in database + */ + export namespace session { + export type Table = 'session'; + export interface Selectable { /** - * **subgoal.current_level** - * - `int2` in database - * - Nullable, no default + * **session.session_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - current_level: number | null; + session_id: string; /** - * **subgoal.metric_name** + * **session.session_token** * - `text` in database * - `NOT NULL`, no default */ - metric_name: string; - /** - * **subgoal.attempts_per_trial** - * - `int2` in database - * - Nullable, no default - */ - attempts_per_trial: number | null; + session_token: string; /** - * **subgoal.number_of_trials** - * - `int2` in database - * - Nullable, no default + * **session.user_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - number_of_trials: number | null; + user_id: string; /** - * **subgoal.created_at** + * **session.expires_at** * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * - `NOT NULL`, no default */ - created_at: Date; + expires_at: Date; } export interface JSONSelectable { /** - * **subgoal.subgoal_id** + * **session.session_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - subgoal_id: string; - /** - * **subgoal.goal_id** - * - `uuid` in database - * - Nullable, no default - */ - goal_id: string | null; - /** - * **subgoal.status** - * - `text` in database - * - `NOT NULL`, default: `'In Progress'::text` - */ - status: string; - /** - * **subgoal.description** - * - `text` in database - * - `NOT NULL`, no default - */ - description: string; + session_id: string; /** - * **subgoal.setup** + * **session.session_token** * - `text` in database * - `NOT NULL`, no default */ - setup: string; - /** - * **subgoal.instructions** - * - `text` in database - * - `NOT NULL`, default: `''::text` - */ - instructions: string; - /** - * **subgoal.materials** - * - `text` in database - * - `NOT NULL`, default: `''::text` - */ - materials: string; - /** - * **subgoal.frequency** - * - `text` in database - * - `NOT NULL`, default: `''::text` - */ - frequency: string; + session_token: string; /** - * **subgoal.target_level** - * - `int2` in database + * **session.user_id** + * - `uuid` in database * - `NOT NULL`, no default */ - target_level: number; + user_id: string; /** - * **subgoal.baseline_level** - * - `int2` in database + * **session.expires_at** + * - `timestamptz` in database * - `NOT NULL`, no default */ - baseline_level: number; + expires_at: db.TimestampTzString; + } + export interface Whereable { /** - * **subgoal.current_level** - * - `int2` in database - * - Nullable, no default + * **session.session_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - current_level: number | null; + session_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.metric_name** + * **session.session_token** * - `text` in database * - `NOT NULL`, no default */ - metric_name: string; - /** - * **subgoal.attempts_per_trial** - * - `int2` in database - * - Nullable, no default - */ - attempts_per_trial: number | null; + session_token?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.number_of_trials** - * - `int2` in database - * - Nullable, no default + * **session.user_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - number_of_trials: number | null; + user_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.created_at** + * **session.expires_at** * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * - `NOT NULL`, no default */ - created_at: db.TimestampTzString; + expires_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } - export interface Whereable { + export interface Insertable { /** - * **subgoal.subgoal_id** + * **session.session_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - subgoal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; - /** - * **subgoal.goal_id** - * - `uuid` in database - * - Nullable, no default - */ - goal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + session_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **subgoal.status** + * **session.session_token** * - `text` in database - * - `NOT NULL`, default: `'In Progress'::text` + * - `NOT NULL`, no default */ - status?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + session_token: string | db.Parameter | db.SQLFragment; /** - * **subgoal.description** - * - `text` in database + * **session.user_id** + * - `uuid` in database * - `NOT NULL`, no default */ - description?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + user_id: string | db.Parameter | db.SQLFragment; /** - * **subgoal.setup** - * - `text` in database + * **session.expires_at** + * - `timestamptz` in database * - `NOT NULL`, no default */ - setup?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + expires_at: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment; + } + export interface Updatable { /** - * **subgoal.instructions** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **session.session_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - instructions?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + session_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **subgoal.materials** + * **session.session_token** * - `text` in database - * - `NOT NULL`, default: `''::text` + * - `NOT NULL`, no default */ - materials?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + session_token?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.frequency** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **session.user_id** + * - `uuid` in database + * - `NOT NULL`, no default */ - frequency?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + user_id?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.target_level** - * - `int2` in database + * **session.expires_at** + * - `timestamptz` in database * - `NOT NULL`, no default */ - target_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + expires_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + } + export type UniqueIndex = 'session_pkey' | 'session_session_token_key'; + export type Column = keyof Selectable; + export type OnlyCols = Pick; + export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; + export type SQL = SQLExpression | SQLExpression[]; + } + + /** + * **student** + * - Table in database + */ + export namespace student { + export type Table = 'student'; + export interface Selectable { /** - * **subgoal.baseline_level** - * - `int2` in database - * - `NOT NULL`, no default + * **student.student_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - baseline_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + student_id: string; /** - * **subgoal.current_level** - * - `int2` in database - * - Nullable, no default + * **student.first_name** + * - `text` in database + * - `NOT NULL`, no default */ - current_level?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + first_name: string; /** - * **subgoal.metric_name** + * **student.last_name** * - `text` in database * - `NOT NULL`, no default */ - metric_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + last_name: string; /** - * **subgoal.attempts_per_trial** - * - `int2` in database - * - Nullable, no default + * **student.email** + * - `text` in database + * - `NOT NULL`, no default */ - attempts_per_trial?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + email: string; /** - * **subgoal.number_of_trials** - * - `int2` in database + * **student.assigned_case_manager_id** + * - `uuid` in database * - Nullable, no default */ - number_of_trials?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + assigned_case_manager_id: string | null; /** - * **subgoal.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * **student.grade** + * - `int2` in database + * - `NOT NULL`, no default */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + grade: number; } - export interface Insertable { + export interface JSONSelectable { /** - * **subgoal.subgoal_id** + * **student.student_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - subgoal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; - /** - * **subgoal.goal_id** - * - `uuid` in database - * - Nullable, no default - */ - goal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + student_id: string; /** - * **subgoal.status** + * **student.first_name** * - `text` in database - * - `NOT NULL`, default: `'In Progress'::text` + * - `NOT NULL`, no default */ - status?: string | db.Parameter | db.DefaultType | db.SQLFragment; + first_name: string; /** - * **subgoal.description** + * **student.last_name** * - `text` in database * - `NOT NULL`, no default */ - description: string | db.Parameter | db.SQLFragment; + last_name: string; /** - * **subgoal.setup** + * **student.email** * - `text` in database * - `NOT NULL`, no default */ - setup: string | db.Parameter | db.SQLFragment; + email: string; /** - * **subgoal.instructions** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.assigned_case_manager_id** + * - `uuid` in database + * - Nullable, no default */ - instructions?: string | db.Parameter | db.DefaultType | db.SQLFragment; + assigned_case_manager_id: string | null; /** - * **subgoal.materials** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.grade** + * - `int2` in database + * - `NOT NULL`, no default */ - materials?: string | db.Parameter | db.DefaultType | db.SQLFragment; + grade: number; + } + export interface Whereable { /** - * **subgoal.frequency** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.student_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - frequency?: string | db.Parameter | db.DefaultType | db.SQLFragment; + student_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.target_level** - * - `int2` in database + * **student.first_name** + * - `text` in database * - `NOT NULL`, no default */ - target_level: number | db.Parameter | db.SQLFragment; + first_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.baseline_level** - * - `int2` in database + * **student.last_name** + * - `text` in database * - `NOT NULL`, no default */ - baseline_level: number | db.Parameter | db.SQLFragment; - /** - * **subgoal.current_level** - * - `int2` in database - * - Nullable, no default - */ - current_level?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; + last_name?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.metric_name** + * **student.email** * - `text` in database * - `NOT NULL`, no default */ - metric_name: string | db.Parameter | db.SQLFragment; + email?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.attempts_per_trial** - * - `int2` in database + * **student.assigned_case_manager_id** + * - `uuid` in database * - Nullable, no default */ - attempts_per_trial?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; + assigned_case_manager_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **subgoal.number_of_trials** + * **student.grade** * - `int2` in database - * - Nullable, no default - */ - number_of_trials?: number | db.Parameter | null | db.DefaultType | db.SQLFragment; - /** - * **subgoal.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * - `NOT NULL`, no default */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment; + grade?: number | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; } - export interface Updatable { + export interface Insertable { /** - * **subgoal.subgoal_id** + * **student.student_id** * - `uuid` in database * - `NOT NULL`, default: `uuid_generate_v4()` */ - subgoal_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; - /** - * **subgoal.goal_id** - * - `uuid` in database - * - Nullable, no default - */ - goal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + student_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **subgoal.status** + * **student.first_name** * - `text` in database - * - `NOT NULL`, default: `'In Progress'::text` + * - `NOT NULL`, no default */ - status?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + first_name: string | db.Parameter | db.SQLFragment; /** - * **subgoal.description** + * **student.last_name** * - `text` in database * - `NOT NULL`, no default */ - description?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + last_name: string | db.Parameter | db.SQLFragment; /** - * **subgoal.setup** + * **student.email** * - `text` in database * - `NOT NULL`, no default */ - setup?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + email: string | db.Parameter | db.SQLFragment; /** - * **subgoal.instructions** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.assigned_case_manager_id** + * - `uuid` in database + * - Nullable, no default */ - instructions?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + assigned_case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; /** - * **subgoal.materials** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.grade** + * - `int2` in database + * - `NOT NULL`, no default */ - materials?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + grade: number | db.Parameter | db.SQLFragment; + } + export interface Updatable { /** - * **subgoal.frequency** - * - `text` in database - * - `NOT NULL`, default: `''::text` + * **student.student_id** + * - `uuid` in database + * - `NOT NULL`, default: `uuid_generate_v4()` */ - frequency?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + student_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **subgoal.target_level** - * - `int2` in database + * **student.first_name** + * - `text` in database * - `NOT NULL`, no default */ - target_level?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + first_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.baseline_level** - * - `int2` in database + * **student.last_name** + * - `text` in database * - `NOT NULL`, no default */ - baseline_level?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; - /** - * **subgoal.current_level** - * - `int2` in database - * - Nullable, no default - */ - current_level?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + last_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.metric_name** + * **student.email** * - `text` in database * - `NOT NULL`, no default */ - metric_name?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; + email?: string | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; /** - * **subgoal.attempts_per_trial** - * - `int2` in database + * **student.assigned_case_manager_id** + * - `uuid` in database * - Nullable, no default */ - attempts_per_trial?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + assigned_case_manager_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; /** - * **subgoal.number_of_trials** + * **student.grade** * - `int2` in database - * - Nullable, no default - */ - number_of_trials?: number | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; - /** - * **subgoal.created_at** - * - `timestamptz` in database - * - `NOT NULL`, default: `now()` + * - `NOT NULL`, no default */ - created_at?: (db.TimestampTzString | Date) | db.Parameter<(db.TimestampTzString | Date)> | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; + grade?: number | db.Parameter | db.SQLFragment | db.SQLFragment | db.SQLFragment>; } - export type UniqueIndex = 'subgoal_pkey'; + export type UniqueIndex = 'student_email_key' | 'student_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -2013,11 +2013,11 @@ declare module 'zapatos/schema' { */ task_id: string; /** - * **task.subgoal_id** + * **task.benchmark_id** * - `uuid` in database * - Nullable, no default */ - subgoal_id: string | null; + benchmark_id: string | null; /** * **task.assignee_id** * - `uuid` in database @@ -2051,11 +2051,11 @@ declare module 'zapatos/schema' { */ task_id: string; /** - * **task.subgoal_id** + * **task.benchmark_id** * - `uuid` in database * - Nullable, no default */ - subgoal_id: string | null; + benchmark_id: string | null; /** * **task.assignee_id** * - `uuid` in database @@ -2089,11 +2089,11 @@ declare module 'zapatos/schema' { */ task_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** - * **task.subgoal_id** + * **task.benchmark_id** * - `uuid` in database * - Nullable, no default */ - subgoal_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; + benchmark_id?: string | db.Parameter | db.SQLFragment | db.ParentColumn | db.SQLFragment | db.SQLFragment | db.ParentColumn>; /** * **task.assignee_id** * - `uuid` in database @@ -2127,11 +2127,11 @@ declare module 'zapatos/schema' { */ task_id?: string | db.Parameter | db.DefaultType | db.SQLFragment; /** - * **task.subgoal_id** + * **task.benchmark_id** * - `uuid` in database * - Nullable, no default */ - subgoal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; + benchmark_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment; /** * **task.assignee_id** * - `uuid` in database @@ -2165,11 +2165,11 @@ declare module 'zapatos/schema' { */ task_id?: string | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; /** - * **task.subgoal_id** + * **task.benchmark_id** * - `uuid` in database * - Nullable, no default */ - subgoal_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; + benchmark_id?: string | db.Parameter | null | db.DefaultType | db.SQLFragment | db.SQLFragment | null | db.DefaultType | db.SQLFragment>; /** * **task.assignee_id** * - `uuid` in database @@ -2195,7 +2195,7 @@ declare module 'zapatos/schema' { */ seen?: boolean | db.Parameter | db.DefaultType | db.SQLFragment | db.SQLFragment | db.DefaultType | db.SQLFragment>; } - export type UniqueIndex = 'subgoal_assignee_unique' | 'task_pkey'; + export type UniqueIndex = 'benchmark_assignee_unique' | 'task_pkey'; export type Column = keyof Selectable; export type OnlyCols = Pick; export type SQLExpression = Table | db.ColumnNames | db.ColumnValues | Whereable | Column | db.ParentColumn | db.GenericSQLExpression; @@ -2854,20 +2854,20 @@ declare module 'zapatos/schema' { /* --- aggregate types --- */ export namespace public { - export type Table = account.Table | file.Table | goal.Table | iep.Table | migrations.Table | paras_assigned_to_case_manager.Table | session.Table | student.Table | subgoal.Table | task.Table | trial_data.Table | trial_data_file.Table | user.Table; - export type Selectable = account.Selectable | file.Selectable | goal.Selectable | iep.Selectable | migrations.Selectable | paras_assigned_to_case_manager.Selectable | session.Selectable | student.Selectable | subgoal.Selectable | task.Selectable | trial_data.Selectable | trial_data_file.Selectable | user.Selectable; - export type JSONSelectable = account.JSONSelectable | file.JSONSelectable | goal.JSONSelectable | iep.JSONSelectable | migrations.JSONSelectable | paras_assigned_to_case_manager.JSONSelectable | session.JSONSelectable | student.JSONSelectable | subgoal.JSONSelectable | task.JSONSelectable | trial_data.JSONSelectable | trial_data_file.JSONSelectable | user.JSONSelectable; - export type Whereable = account.Whereable | file.Whereable | goal.Whereable | iep.Whereable | migrations.Whereable | paras_assigned_to_case_manager.Whereable | session.Whereable | student.Whereable | subgoal.Whereable | task.Whereable | trial_data.Whereable | trial_data_file.Whereable | user.Whereable; - export type Insertable = account.Insertable | file.Insertable | goal.Insertable | iep.Insertable | migrations.Insertable | paras_assigned_to_case_manager.Insertable | session.Insertable | student.Insertable | subgoal.Insertable | task.Insertable | trial_data.Insertable | trial_data_file.Insertable | user.Insertable; - export type Updatable = account.Updatable | file.Updatable | goal.Updatable | iep.Updatable | migrations.Updatable | paras_assigned_to_case_manager.Updatable | session.Updatable | student.Updatable | subgoal.Updatable | task.Updatable | trial_data.Updatable | trial_data_file.Updatable | user.Updatable; - export type UniqueIndex = account.UniqueIndex | file.UniqueIndex | goal.UniqueIndex | iep.UniqueIndex | migrations.UniqueIndex | paras_assigned_to_case_manager.UniqueIndex | session.UniqueIndex | student.UniqueIndex | subgoal.UniqueIndex | task.UniqueIndex | trial_data.UniqueIndex | trial_data_file.UniqueIndex | user.UniqueIndex; - export type Column = account.Column | file.Column | goal.Column | iep.Column | migrations.Column | paras_assigned_to_case_manager.Column | session.Column | student.Column | subgoal.Column | task.Column | trial_data.Column | trial_data_file.Column | user.Column; + export type Table = account.Table | benchmark.Table | file.Table | goal.Table | iep.Table | migrations.Table | paras_assigned_to_case_manager.Table | session.Table | student.Table | task.Table | trial_data.Table | trial_data_file.Table | user.Table; + export type Selectable = account.Selectable | benchmark.Selectable | file.Selectable | goal.Selectable | iep.Selectable | migrations.Selectable | paras_assigned_to_case_manager.Selectable | session.Selectable | student.Selectable | task.Selectable | trial_data.Selectable | trial_data_file.Selectable | user.Selectable; + export type JSONSelectable = account.JSONSelectable | benchmark.JSONSelectable | file.JSONSelectable | goal.JSONSelectable | iep.JSONSelectable | migrations.JSONSelectable | paras_assigned_to_case_manager.JSONSelectable | session.JSONSelectable | student.JSONSelectable | task.JSONSelectable | trial_data.JSONSelectable | trial_data_file.JSONSelectable | user.JSONSelectable; + export type Whereable = account.Whereable | benchmark.Whereable | file.Whereable | goal.Whereable | iep.Whereable | migrations.Whereable | paras_assigned_to_case_manager.Whereable | session.Whereable | student.Whereable | task.Whereable | trial_data.Whereable | trial_data_file.Whereable | user.Whereable; + export type Insertable = account.Insertable | benchmark.Insertable | file.Insertable | goal.Insertable | iep.Insertable | migrations.Insertable | paras_assigned_to_case_manager.Insertable | session.Insertable | student.Insertable | task.Insertable | trial_data.Insertable | trial_data_file.Insertable | user.Insertable; + export type Updatable = account.Updatable | benchmark.Updatable | file.Updatable | goal.Updatable | iep.Updatable | migrations.Updatable | paras_assigned_to_case_manager.Updatable | session.Updatable | student.Updatable | task.Updatable | trial_data.Updatable | trial_data_file.Updatable | user.Updatable; + export type UniqueIndex = account.UniqueIndex | benchmark.UniqueIndex | file.UniqueIndex | goal.UniqueIndex | iep.UniqueIndex | migrations.UniqueIndex | paras_assigned_to_case_manager.UniqueIndex | session.UniqueIndex | student.UniqueIndex | task.UniqueIndex | trial_data.UniqueIndex | trial_data_file.UniqueIndex | user.UniqueIndex; + export type Column = account.Column | benchmark.Column | file.Column | goal.Column | iep.Column | migrations.Column | paras_assigned_to_case_manager.Column | session.Column | student.Column | task.Column | trial_data.Column | trial_data_file.Column | user.Column; - export type AllBaseTables = [account.Table, file.Table, goal.Table, iep.Table, migrations.Table, paras_assigned_to_case_manager.Table, session.Table, student.Table, subgoal.Table, task.Table, trial_data.Table, trial_data_file.Table, user.Table]; + export type AllBaseTables = [account.Table, benchmark.Table, file.Table, goal.Table, iep.Table, migrations.Table, paras_assigned_to_case_manager.Table, session.Table, student.Table, task.Table, trial_data.Table, trial_data_file.Table, user.Table]; export type AllForeignTables = []; export type AllViews = []; export type AllMaterializedViews = []; - export type AllTablesAndViews = [account.Table, file.Table, goal.Table, iep.Table, migrations.Table, paras_assigned_to_case_manager.Table, session.Table, student.Table, subgoal.Table, task.Table, trial_data.Table, trial_data_file.Table, user.Table]; + export type AllTablesAndViews = [account.Table, benchmark.Table, file.Table, goal.Table, iep.Table, migrations.Table, paras_assigned_to_case_manager.Table, session.Table, student.Table, task.Table, trial_data.Table, trial_data_file.Table, user.Table]; } @@ -2896,6 +2896,7 @@ declare module 'zapatos/schema' { export type SelectableForTable = { "account": account.Selectable; + "benchmark": benchmark.Selectable; "file": file.Selectable; "goal": goal.Selectable; "iep": iep.Selectable; @@ -2903,7 +2904,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.Selectable; "session": session.Selectable; "student": student.Selectable; - "subgoal": subgoal.Selectable; "task": task.Selectable; "trial_data": trial_data.Selectable; "trial_data_file": trial_data_file.Selectable; @@ -2912,6 +2912,7 @@ declare module 'zapatos/schema' { export type JSONSelectableForTable = { "account": account.JSONSelectable; + "benchmark": benchmark.JSONSelectable; "file": file.JSONSelectable; "goal": goal.JSONSelectable; "iep": iep.JSONSelectable; @@ -2919,7 +2920,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.JSONSelectable; "session": session.JSONSelectable; "student": student.JSONSelectable; - "subgoal": subgoal.JSONSelectable; "task": task.JSONSelectable; "trial_data": trial_data.JSONSelectable; "trial_data_file": trial_data_file.JSONSelectable; @@ -2928,6 +2928,7 @@ declare module 'zapatos/schema' { export type WhereableForTable = { "account": account.Whereable; + "benchmark": benchmark.Whereable; "file": file.Whereable; "goal": goal.Whereable; "iep": iep.Whereable; @@ -2935,7 +2936,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.Whereable; "session": session.Whereable; "student": student.Whereable; - "subgoal": subgoal.Whereable; "task": task.Whereable; "trial_data": trial_data.Whereable; "trial_data_file": trial_data_file.Whereable; @@ -2944,6 +2944,7 @@ declare module 'zapatos/schema' { export type InsertableForTable = { "account": account.Insertable; + "benchmark": benchmark.Insertable; "file": file.Insertable; "goal": goal.Insertable; "iep": iep.Insertable; @@ -2951,7 +2952,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.Insertable; "session": session.Insertable; "student": student.Insertable; - "subgoal": subgoal.Insertable; "task": task.Insertable; "trial_data": trial_data.Insertable; "trial_data_file": trial_data_file.Insertable; @@ -2960,6 +2960,7 @@ declare module 'zapatos/schema' { export type UpdatableForTable = { "account": account.Updatable; + "benchmark": benchmark.Updatable; "file": file.Updatable; "goal": goal.Updatable; "iep": iep.Updatable; @@ -2967,7 +2968,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.Updatable; "session": session.Updatable; "student": student.Updatable; - "subgoal": subgoal.Updatable; "task": task.Updatable; "trial_data": trial_data.Updatable; "trial_data_file": trial_data_file.Updatable; @@ -2976,6 +2976,7 @@ declare module 'zapatos/schema' { export type UniqueIndexForTable = { "account": account.UniqueIndex; + "benchmark": benchmark.UniqueIndex; "file": file.UniqueIndex; "goal": goal.UniqueIndex; "iep": iep.UniqueIndex; @@ -2983,7 +2984,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.UniqueIndex; "session": session.UniqueIndex; "student": student.UniqueIndex; - "subgoal": subgoal.UniqueIndex; "task": task.UniqueIndex; "trial_data": trial_data.UniqueIndex; "trial_data_file": trial_data_file.UniqueIndex; @@ -2992,6 +2992,7 @@ declare module 'zapatos/schema' { export type ColumnForTable = { "account": account.Column; + "benchmark": benchmark.Column; "file": file.Column; "goal": goal.Column; "iep": iep.Column; @@ -2999,7 +3000,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.Column; "session": session.Column; "student": student.Column; - "subgoal": subgoal.Column; "task": task.Column; "trial_data": trial_data.Column; "trial_data_file": trial_data_file.Column; @@ -3008,6 +3008,7 @@ declare module 'zapatos/schema' { export type SQLForTable = { "account": account.SQL; + "benchmark": benchmark.SQL; "file": file.SQL; "goal": goal.SQL; "iep": iep.SQL; @@ -3015,7 +3016,6 @@ declare module 'zapatos/schema' { "paras_assigned_to_case_manager": paras_assigned_to_case_manager.SQL; "session": session.SQL; "student": student.SQL; - "subgoal": subgoal.SQL; "task": task.SQL; "trial_data": trial_data.SQL; "trial_data_file": trial_data_file.SQL; diff --git a/src/backend/routers/iep.test.ts b/src/backend/routers/iep.test.ts index d82a1289..f37b97b3 100644 --- a/src/backend/routers/iep.test.ts +++ b/src/backend/routers/iep.test.ts @@ -3,7 +3,7 @@ import { getTestServer } from "@/backend/tests"; import { UserType } from "@/types/auth"; // TODO: Write more tests -test("basic flow - add/get goals, subgoals, tasks", async (t) => { +test("basic flow - add/get goals, benchmarks, tasks", async (t) => { const { trpc, db, seed } = await getTestServer(t, { authenticateAs: UserType.CaseManager, }); @@ -22,10 +22,10 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => { category: "writing", }); - await trpc.iep.addSubgoal.mutate({ + await trpc.iep.addBenchmark.mutate({ goal_id: goal1!.goal_id, status: "In Progress", - description: "subgoal 1", + description: "benchmark 1", setup: "Setup here", instructions: "instructions here", materials: "materials", @@ -37,10 +37,10 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => { number_of_trials: 15, }); - const subgoal1 = await trpc.iep.addSubgoal.mutate({ + const benchmark1 = await trpc.iep.addBenchmark.mutate({ goal_id: goal1!.goal_id, status: "Complete", - description: "subgoal 1", + description: "benchmark 1", setup: "", instructions: "", materials: "materials", @@ -51,12 +51,12 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => { attempts_per_trial: 10, number_of_trials: 30, }); - const subgoal1Id = subgoal1!.subgoal_id; + const benchmark1Id = benchmark1!.benchmark_id; - const subgoal2 = await trpc.iep.addSubgoal.mutate({ + const benchmark2 = await trpc.iep.addBenchmark.mutate({ goal_id: goal1!.goal_id, status: "Complete", - description: "subgoal 2", + description: "benchmark 2", setup: "", instructions: "", materials: "materials", @@ -67,47 +67,47 @@ test("basic flow - add/get goals, subgoals, tasks", async (t) => { attempts_per_trial: 10, number_of_trials: 30, }); - const subgoal2Id = subgoal2!.subgoal_id; + const benchmark2Id = benchmark2!.benchmark_id; await trpc.iep.addTask.mutate({ - subgoal_id: subgoal1Id, + benchmark_id: benchmark1Id, assignee_id: para_id, due_date: new Date("2023-12-31"), trial_count: 5, }); const assignTask = await trpc.iep.assignTaskToParas.mutate({ - subgoal_id: subgoal2Id, + benchmark_id: benchmark2Id, para_ids: [para_id], }); - t.is(assignTask?.subgoal_id, subgoal2Id); + t.is(assignTask?.benchmark_id, benchmark2Id); t.is(assignTask?.assignee_id, para_id); const gotGoals = await trpc.iep.getGoals.query({ iep_id: iep.iep_id }); t.is(gotGoals.length, 1); - const gotSubgoals = await trpc.iep.getSubgoals.query({ + const gotBenchmarks = await trpc.iep.getBenchmarks.query({ goal_id: goal1!.goal_id, }); - t.is(gotSubgoals.length, 3); + t.is(gotBenchmarks.length, 3); - const gotSubgoal = await trpc.iep.getSubgoal.query({ - subgoal_id: subgoal2Id, + const gotBenchmark = await trpc.iep.getBenchmark.query({ + benchmark_id: benchmark2Id, }); - t.is(gotSubgoal[0].description, "subgoal 2"); + t.is(gotBenchmark[0].description, "benchmark 2"); // TODO: Don't query db directly and use an API method instead. Possibly create a getTasks method later t.truthy( await db .selectFrom("task") - .where("subgoal_id", "=", subgoal2Id) + .where("benchmark_id", "=", benchmark2Id) .where("assignee_id", "=", para_id) .selectAll() .executeTakeFirstOrThrow() ); }); -test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => { +test("addTask - no duplicate benchmark_id + assigned_id combo", async (t) => { const { trpc, seed } = await getTestServer(t, { authenticateAs: UserType.CaseManager, }); @@ -126,10 +126,10 @@ test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => { category: "writing", }); - const subgoal1 = await trpc.iep.addSubgoal.mutate({ + const benchmark1 = await trpc.iep.addBenchmark.mutate({ goal_id: goal1!.goal_id, status: "Complete", - description: "subgoal 1", + description: "benchmark 1", setup: "", instructions: "", materials: "materials", @@ -140,10 +140,10 @@ test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => { attempts_per_trial: 10, number_of_trials: 30, }); - const subgoal1Id = subgoal1!.subgoal_id; + const benchmark1Id = benchmark1!.benchmark_id; await trpc.iep.addTask.mutate({ - subgoal_id: subgoal1Id, + benchmark_id: benchmark1Id, assignee_id: para_id, due_date: new Date("2023-12-31"), trial_count: 5, @@ -151,7 +151,7 @@ test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => { const error = await t.throwsAsync(async () => { await trpc.iep.addTask.mutate({ - subgoal_id: subgoal1Id, + benchmark_id: benchmark1Id, assignee_id: para_id, due_date: new Date("2024-03-31"), trial_count: 1, @@ -160,11 +160,11 @@ test("addTask - no duplicate subgoal_id + assigned_id combo", async (t) => { t.is( error?.message, - "Task already exists: This subgoal has already been assigned to the same para" + "Task already exists: This benchmark has already been assigned to the same para" ); }); -test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) => { +test("assignTaskToParas - no duplicate benchmark_id + para_id combo", async (t) => { const { trpc, seed } = await getTestServer(t, { authenticateAs: UserType.CaseManager, }); @@ -189,10 +189,10 @@ test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) => category: "writing", }); - const subgoal1 = await trpc.iep.addSubgoal.mutate({ + const benchmark1 = await trpc.iep.addBenchmark.mutate({ goal_id: goal1!.goal_id, status: "Complete", - description: "subgoal 1", + description: "benchmark 1", setup: "", instructions: "", materials: "materials", @@ -203,10 +203,10 @@ test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) => attempts_per_trial: 10, number_of_trials: 30, }); - const subgoal1Id = subgoal1!.subgoal_id; + const benchmark1Id = benchmark1!.benchmark_id; await trpc.iep.assignTaskToParas.mutate({ - subgoal_id: subgoal1Id, + benchmark_id: benchmark1Id, para_ids: [para_1.user_id], due_date: new Date("2023-12-31"), trial_count: 5, @@ -214,7 +214,7 @@ test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) => const error = await t.throwsAsync(async () => { await trpc.iep.assignTaskToParas.mutate({ - subgoal_id: subgoal1Id, + benchmark_id: benchmark1Id, para_ids: [para_1.user_id, para_2.user_id], due_date: new Date("2024-03-31"), trial_count: 1, @@ -223,7 +223,7 @@ test("assignTaskToParas - no duplicate subgoal_id + para_id combo", async (t) => t.is( error?.message, - "Task already exists: This subgoal has already been assigned to one or more of these paras" + "Task already exists: This benchmark has already been assigned to one or more of these paras" ); }); @@ -244,10 +244,10 @@ test("add benchmark - check full schema", async (t) => { category: "writing", }); - const subgoal_data = { + const benchmark_data = { goal_id: goal1!.goal_id, status: "In Progress", - description: "subgoal 1", + description: "benchmark 1", setup: "Setup here", instructions: "instructions here", materials: "materials", @@ -259,21 +259,21 @@ test("add benchmark - check full schema", async (t) => { number_of_trials: 15, }; - const created_subgoal = await trpc.iep.addSubgoal.mutate(subgoal_data); + const created_benchmark = await trpc.iep.addBenchmark.mutate(benchmark_data); // create explicitly string-indexable versions of these objects - const indexable_subgoal_data = subgoal_data as { + const indexable_benchmark_data = benchmark_data as { [index: string]: string | number | Date | null; }; - const indexable_subgoal = created_subgoal as { + const indexable_benchmark = created_benchmark as { [index: string]: string | number | Date | null; }; - for (const [key, val] of Object.entries(indexable_subgoal_data)) { - t.is(val, indexable_subgoal[key]); + for (const [key, val] of Object.entries(indexable_benchmark_data)) { + t.is(val, indexable_benchmark[key]); } - t.is(created_subgoal?.current_level, null); - t.truthy(created_subgoal?.created_at); + t.is(created_benchmark?.current_level, null); + t.truthy(created_benchmark?.created_at); }); test("edit goal", async (t) => { diff --git a/src/backend/routers/iep.ts b/src/backend/routers/iep.ts index 7657a10c..5db3a2d3 100644 --- a/src/backend/routers/iep.ts +++ b/src/backend/routers/iep.ts @@ -70,7 +70,7 @@ export const iep = router({ return result; }), - addSubgoal: hasCaseManager + addBenchmark: hasCaseManager .input( z.object({ // current_level not included, should be calculated as trial data is collected @@ -105,7 +105,7 @@ export const iep = router({ } = req.input; const result = await req.ctx.db - .insertInto("subgoal") + .insertInto("benchmark") .values({ goal_id, status, @@ -129,32 +129,32 @@ export const iep = router({ addTask: hasCaseManager .input( z.object({ - subgoal_id: z.string(), + benchmark_id: z.string(), assignee_id: z.string(), due_date: z.date(), trial_count: z.number(), }) ) .mutation(async (req) => { - const { subgoal_id, assignee_id, due_date, trial_count } = req.input; + const { benchmark_id, assignee_id, due_date, trial_count } = req.input; const existingTask = await req.ctx.db .selectFrom("task") - .where("subgoal_id", "=", subgoal_id) + .where("benchmark_id", "=", benchmark_id) .where("assignee_id", "=", assignee_id) .selectAll() .executeTakeFirst(); if (existingTask) { throw new Error( - "Task already exists: This subgoal has already been assigned to the same para" + "Task already exists: This benchmark has already been assigned to the same para" ); } const result = await req.ctx.db .insertInto("task") .values({ - subgoal_id, + benchmark_id, assignee_id, due_date, trial_count, @@ -167,25 +167,25 @@ export const iep = router({ assignTaskToParas: hasCaseManager .input( z.object({ - subgoal_id: z.string().uuid(), + benchmark_id: z.string().uuid(), para_ids: z.string().uuid().array(), due_date: z.date().optional(), trial_count: z.number().optional(), }) ) .mutation(async (req) => { - const { subgoal_id, para_ids, due_date, trial_count } = req.input; + const { benchmark_id, para_ids, due_date, trial_count } = req.input; const existingTasks = await req.ctx.db .selectFrom("task") - .where("subgoal_id", "=", subgoal_id) + .where("benchmark_id", "=", benchmark_id) .where("assignee_id", "in", para_ids) .selectAll() .execute(); if (existingTasks.length > 0) { throw new Error( - "Task already exists: This subgoal has already been assigned to one or more of these paras" + "Task already exists: This benchmark has already been assigned to one or more of these paras" ); } @@ -193,7 +193,7 @@ export const iep = router({ .insertInto("task") .values( para_ids.map((para_id) => ({ - subgoal_id, + benchmark_id, assignee_id: para_id, due_date, trial_count, @@ -207,13 +207,13 @@ export const iep = router({ tempAddTaskToSelf: hasCaseManager .input( z.object({ - subgoal_id: z.string(), + benchmark_id: z.string(), due_date: z.date(), trial_count: z.number(), }) ) .mutation(async (req) => { - const { subgoal_id, due_date, trial_count } = req.input; + const { benchmark_id, due_date, trial_count } = req.input; const { userId } = req.ctx.auth; const shouldAdd = await req.ctx.db @@ -221,7 +221,7 @@ export const iep = router({ .selectAll() .where((eb) => eb.and([ - eb("subgoal_id", "=", subgoal_id), + eb("benchmark_id", "=", benchmark_id), eb("assignee_id", "=", userId), ]) ) @@ -235,7 +235,7 @@ export const iep = router({ const result = await req.ctx.db .insertInto("task") .values({ - subgoal_id, + benchmark_id, assignee_id: userId, due_date, trial_count, @@ -336,7 +336,7 @@ export const iep = router({ return result; }), - getSubgoals: hasCaseManager + getBenchmarks: hasCaseManager .input( z.object({ goal_id: z.string(), @@ -346,7 +346,7 @@ export const iep = router({ const { goal_id } = req.input; const result = await req.ctx.db - .selectFrom("subgoal") + .selectFrom("benchmark") .where("goal_id", "=", goal_id) .selectAll() .execute(); @@ -354,24 +354,24 @@ export const iep = router({ return result; }), - getSubgoal: hasCaseManager + getBenchmark: hasCaseManager .input( z.object({ - subgoal_id: z.string(), + benchmark_id: z.string(), }) ) .query(async (req) => { - const { subgoal_id } = req.input; + const { benchmark_id } = req.input; const result = await req.ctx.db - .selectFrom("subgoal") - .where("subgoal.subgoal_id", "=", subgoal_id) + .selectFrom("benchmark") + .where("benchmark.benchmark_id", "=", benchmark_id) .selectAll() .execute(); return result; }), - getSubgoalsByAssignee: hasCaseManager + getBenchmarkByAssignee: hasCaseManager .input( z.object({ assignee_id: z.string(), @@ -381,8 +381,8 @@ export const iep = router({ const { assignee_id } = req.input; const result = await req.ctx.db - .selectFrom("subgoal") - .innerJoin("task", "subgoal.subgoal_id", "task.subgoal_id") + .selectFrom("benchmark") + .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") .where("task.assignee_id", "=", assignee_id) .selectAll() .execute(); @@ -390,7 +390,7 @@ export const iep = router({ return result; }), - getSubgoalAndTrialData: hasPara + getBenchmarkAndTrialData: hasPara .input( z.object({ task_id: z.string(), @@ -400,9 +400,9 @@ export const iep = router({ const { task_id } = req.input; const result = await req.ctx.db - .selectFrom("subgoal") - .innerJoin("task", "subgoal.subgoal_id", "task.subgoal_id") - .innerJoin("goal", "subgoal.goal_id", "goal.goal_id") + .selectFrom("benchmark") + .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") + .innerJoin("goal", "benchmark.goal_id", "goal.goal_id") .innerJoin("iep", "goal.iep_id", "iep.iep_id") .innerJoin("student", "iep.student_id", "student.student_id") .where("task.task_id", "=", task_id) @@ -411,11 +411,11 @@ export const iep = router({ "student.first_name", "student.last_name", "goal.category", - "subgoal.description", - "subgoal.instructions", - "subgoal.frequency", - "subgoal.number_of_trials", - "subgoal.subgoal_id", + "benchmark.description", + "benchmark.instructions", + "benchmark.frequency", + "benchmark.number_of_trials", + "benchmark.benchmark_id", "task.due_date", "task.seen", "task.trial_count", diff --git a/src/backend/routers/para.test.ts b/src/backend/routers/para.test.ts index cc7ed39c..d99bfdae 100644 --- a/src/backend/routers/para.test.ts +++ b/src/backend/routers/para.test.ts @@ -168,9 +168,9 @@ test("getMyTasks", async (t) => { const FIRST_NAME = "Foo"; const LAST_NAME = "Bar"; const STATUS = "In Progress"; - const DESCRIPTION = "Subgoal description"; + const DESCRIPTION = "Benchmark description"; const SETUP = "Setup"; - const INSTRUCTIONS = "subgoal instructions foobar"; + const INSTRUCTIONS = "benchmark instructions foobar"; const CATEGORY = "writing"; const DUE_DATE = new Date(); const ATTEMPTS_PER_TRIAL = 15; @@ -210,8 +210,8 @@ test("getMyTasks", async (t) => { .returningAll() .executeTakeFirstOrThrow(); - const { subgoal_id } = await db - .insertInto("subgoal") + const { benchmark_id } = await db + .insertInto("benchmark") .values({ goal_id: goal_id, status: STATUS, @@ -232,7 +232,7 @@ test("getMyTasks", async (t) => { const { task_id } = await db .insertInto("task") .values({ - subgoal_id: subgoal_id, + benchmark_id: benchmark_id, assignee_id: seed.case_manager.user_id, due_date: DUE_DATE, trial_count: TRIAL_COUNT, diff --git a/src/backend/routers/para.ts b/src/backend/routers/para.ts index 2800b402..09ad48fe 100644 --- a/src/backend/routers/para.ts +++ b/src/backend/routers/para.ts @@ -64,9 +64,9 @@ export const para = router({ const { userId } = req.ctx.auth; const result = await req.ctx.db - .selectFrom("subgoal") - .innerJoin("task", "subgoal.subgoal_id", "task.subgoal_id") - .innerJoin("goal", "subgoal.goal_id", "goal.goal_id") + .selectFrom("benchmark") + .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") + .innerJoin("goal", "benchmark.goal_id", "goal.goal_id") .innerJoin("iep", "goal.iep_id", "iep.iep_id") .innerJoin("student", "iep.student_id", "student.student_id") .where("task.assignee_id", "=", userId) @@ -75,10 +75,10 @@ export const para = router({ "student.first_name", "student.last_name", "goal.category", - "subgoal.description", - "subgoal.instructions", - "subgoal.attempts_per_trial", - "subgoal.number_of_trials", + "benchmark.description", + "benchmark.instructions", + "benchmark.attempts_per_trial", + "benchmark.number_of_trials", "task.due_date", "task.seen", "task.trial_count", diff --git a/src/backend/routers/student.ts b/src/backend/routers/student.ts index e21dfa09..23956056 100644 --- a/src/backend/routers/student.ts +++ b/src/backend/routers/student.ts @@ -24,8 +24,8 @@ export const student = router({ const result = await req.ctx.db .selectFrom("task") - .innerJoin("subgoal", "subgoal.subgoal_id", "task.subgoal_id") - .innerJoin("goal", "goal.goal_id", "subgoal.goal_id") + .innerJoin("benchmark", "benchmark.benchmark_id", "task.benchmark_id") + .innerJoin("goal", "goal.goal_id", "benchmark.goal_id") .innerJoin("iep", "iep.iep_id", "goal.iep_id") .innerJoin("student", "student.student_id", "iep.student_id") .where("task.task_id", "=", task_id) diff --git a/src/components/benchmarks/BenchmarkAssignmentModal.tsx b/src/components/benchmarks/BenchmarkAssignmentModal.tsx index 654463fc..2d52868d 100644 --- a/src/components/benchmarks/BenchmarkAssignmentModal.tsx +++ b/src/components/benchmarks/BenchmarkAssignmentModal.tsx @@ -50,8 +50,8 @@ export const BenchmarkAssignmentModal = ( const [currentModalSelection, setCurrentModalSelection] = useState("PARA_SELECTION"); const { data: myParas } = trpc.case_manager.getMyParas.useQuery(); - const { data: benchmark } = trpc.iep.getSubgoal.useQuery({ - subgoal_id: props.benchmark_id, + const { data: benchmark } = trpc.iep.getBenchmark.useQuery({ + benchmark_id: props.benchmark_id, }); const [errorMessage, setErrorMessage] = useState(""); @@ -96,7 +96,7 @@ export const BenchmarkAssignmentModal = ( // Reached end, save try { await assignTaskToPara.mutateAsync({ - subgoal_id: props.benchmark_id, + benchmark_id: props.benchmark_id, para_ids: selectedParaIds, due_date: assignmentDuration.type === "until_date" diff --git a/src/components/benchmarks/BenchmarkListElement.tsx b/src/components/benchmarks/BenchmarkListElement.tsx index 7dc8f2ea..24d22297 100644 --- a/src/components/benchmarks/BenchmarkListElement.tsx +++ b/src/components/benchmarks/BenchmarkListElement.tsx @@ -1,4 +1,4 @@ -import { type Subgoal as Benchmark } from "@/types/global"; +import { Benchmark } from "@/types/global"; import Box from "@mui/material/Box"; import Button from "@mui/material/Button"; import Divider from "@mui/material/Divider"; @@ -176,7 +176,7 @@ const BenchmarkListElement = ({ benchmark, index }: BenchmarkProps) => { setIsAssignmentModalOpen(false)} - benchmark_id={benchmark.subgoal_id} + benchmark_id={benchmark.benchmark_id} /> ); diff --git a/src/components/benchmarks/BenchmarksContainer.tsx b/src/components/benchmarks/BenchmarksContainer.tsx index 5c9c1320..7f16765c 100644 --- a/src/components/benchmarks/BenchmarksContainer.tsx +++ b/src/components/benchmarks/BenchmarksContainer.tsx @@ -7,7 +7,7 @@ import Button from "@mui/material/Button"; import $GoalPage from "@/styles/GoalPage.module.css"; import $button from "@/components/design_system/button/Button.module.css"; import Link from "next/link"; -import { type Subgoal as Benchmark } from "@/types/global"; +import { type Benchmark } from "@/types/global"; import BenchmarkListElement from "./BenchmarkListElement"; import NoBenchmarksGraphic from "./NoBenchmarksGraphic"; @@ -119,7 +119,7 @@ export default function BenchmarksContainer({ ) : ( filteredBenchmarks.map((benchmark, index) => ( diff --git a/src/components/goal/Goal.module.css b/src/components/goal/Goal.module.css index 60a2b460..2cc4a104 100644 --- a/src/components/goal/Goal.module.css +++ b/src/components/goal/Goal.module.css @@ -53,7 +53,7 @@ flex: 1 0 0; } -.subgoalCountBadge { +.benchmarkCountBadge { width: fit-content; display: flex; padding: 2px 8px; @@ -64,7 +64,7 @@ background: var(--grey-80); } -.subgoalCount { +.benchmarkCount { color: var(--grey-30); /* Body 2 */ diff --git a/src/components/goal/Goal.tsx b/src/components/goal/Goal.tsx index 40c9dbda..19f64112 100644 --- a/src/components/goal/Goal.tsx +++ b/src/components/goal/Goal.tsx @@ -13,10 +13,10 @@ interface GoalProps { const Goals = ({ goal }: GoalProps) => { const router = useRouter(); - // per current design, subgoals not currently showing in this component. - // trpc method, state for subgoals are here should that change, can be moved + // per current design, benchmarks not currently showing in this component. + // trpc method, state for benchmarks are here should that change, can be moved // to different page/component as needed - const { data: subgoals, isLoading } = trpc.iep.getSubgoals.useQuery({ + const { data: benchmarks, isLoading } = trpc.iep.getBenchmarks.useQuery({ goal_id: goal.goal_id, }); @@ -36,10 +36,10 @@ const Goals = ({ goal }: GoalProps) => { gap: "16px", }} > -
-
- {subgoals?.length} active benchmark - {subgoals?.length !== 1 && "s"} +
+
+ {benchmarks?.length} active benchmark + {benchmarks?.length !== 1 && "s"}
{ data: task, isLoading: taskIsLoading, isError, - } = trpc.iep.getSubgoalAndTrialData.useQuery( + } = trpc.iep.getBenchmarkAndTrialData.useQuery( { task_id: benchmark_id as string, }, @@ -42,23 +42,26 @@ const BenchmarkPage = () => { } ); const seenMutation = trpc.iep.markAsSeen.useMutation({ - onSuccess: async () => await utils.iep.getSubgoalAndTrialData.invalidate(), + onSuccess: async () => + await utils.iep.getBenchmarkAndTrialData.invalidate(), }); const addTrialMutation = trpc.iep.addTrialData.useMutation({ - onSuccess: async () => await utils.iep.getSubgoalAndTrialData.invalidate(), + onSuccess: async () => + await utils.iep.getBenchmarkAndTrialData.invalidate(), }); const updateTrialMutation = trpc.iep.updateTrialData.useMutation({ - onSuccess: async () => await utils.iep.getSubgoalAndTrialData.invalidate(), + onSuccess: async () => + await utils.iep.getBenchmarkAndTrialData.invalidate(), }); const attachFileToTrialDataMutation = trpc.iep.attachFileToTrialData.useMutation({ onSuccess: async () => - await utils.iep.getSubgoalAndTrialData.invalidate(), + await utils.iep.getBenchmarkAndTrialData.invalidate(), }); const removeFileFromTrialDataAndDeleteMutation = trpc.iep.removeFileFromTrialDataAndDelete.useMutation({ onSuccess: async () => - await utils.iep.getSubgoalAndTrialData.invalidate(), + await utils.iep.getBenchmarkAndTrialData.invalidate(), }); const [notesInputValue, setNotesInputValue] = useState(""); diff --git a/src/pages/benchmarks/[benchmark_id]/instructions.tsx b/src/pages/benchmarks/[benchmark_id]/instructions.tsx index 43f6311a..4a606cfb 100644 --- a/src/pages/benchmarks/[benchmark_id]/instructions.tsx +++ b/src/pages/benchmarks/[benchmark_id]/instructions.tsx @@ -10,12 +10,13 @@ import { trpc } from "@/client/lib/trpc"; const InstructionsPage = () => { const router = useRouter(); const { benchmark_id } = router.query; - const { data: subgoal, isLoading } = trpc.iep.getSubgoalAndTrialData.useQuery( - { task_id: benchmark_id as string }, - { enabled: Boolean(benchmark_id) } - ); + const { data: benchmark, isLoading } = + trpc.iep.getBenchmarkAndTrialData.useQuery( + { task_id: benchmark_id as string }, + { enabled: Boolean(benchmark_id) } + ); - if (isLoading || !subgoal) { + if (isLoading || !benchmark) { return
Loading...
; } return ( @@ -23,11 +24,11 @@ const InstructionsPage = () => {

Goal:

-

{subgoal.description}

+

{benchmark.description}

Frequency:

-

{subgoal.frequency}

+

{benchmark.frequency}

Materials:

@@ -39,7 +40,7 @@ const InstructionsPage = () => {

Set-up:

-

{subgoal.instructions}

+

{benchmark.instructions}

{ const router = useRouter(); const { benchmark_id } = router.query; - const { data: task, isLoading } = trpc.iep.getSubgoalAndTrialData.useQuery( + const { data: task, isLoading } = trpc.iep.getBenchmarkAndTrialData.useQuery( { task_id: benchmark_id as string, }, diff --git a/src/pages/students/[student_id]/goals/[goal_id].tsx b/src/pages/students/[student_id]/goals/[goal_id].tsx index 6dd78f3b..9b951a23 100644 --- a/src/pages/students/[student_id]/goals/[goal_id].tsx +++ b/src/pages/students/[student_id]/goals/[goal_id].tsx @@ -23,7 +23,7 @@ const GoalPage = () => { { enabled: Boolean(goal_id) } ); - const { data: benchmarks } = trpc.iep.getSubgoals.useQuery( + const { data: benchmarks } = trpc.iep.getBenchmarks.useQuery( { goal_id: goal_id }, { enabled: Boolean(goal_id) } ); diff --git a/src/pages/students/[student_id]/goals/[goal_id]/create.tsx b/src/pages/students/[student_id]/goals/[goal_id]/create.tsx index 4ec591d8..93d6180c 100644 --- a/src/pages/students/[student_id]/goals/[goal_id]/create.tsx +++ b/src/pages/students/[student_id]/goals/[goal_id]/create.tsx @@ -50,7 +50,7 @@ const CreateBenchmarkPage = () => { { enabled: Boolean(router.query.goal_id) } ); - const addSubgoalMutation = trpc.iep.addSubgoal.useMutation(); + const addBenchmarkMutation = trpc.iep.addBenchmark.useMutation(); const VIEW_STATES = { BENCHMARK_PG_1: 0, @@ -169,7 +169,7 @@ const CreateBenchmarkPage = () => { console.log("benchmarkFormState", benchmarkFormState); // TO DO: metric_name is not used in the mutation (removed from design) and should be removed from the schema try { - await addSubgoalMutation.mutateAsync({ + await addBenchmarkMutation.mutateAsync({ goal_id: router.query.goal_id as string, status: "In Progress", description: benchmarkFormState["description"].value as string, @@ -308,7 +308,7 @@ const CreateBenchmarkPage = () => { -
+
{viewState === VIEW_STATES.BENCHMARK_PG_1 && ( diff --git a/src/types/global.ts b/src/types/global.ts index 155eaf34..ed7f1091 100644 --- a/src/types/global.ts +++ b/src/types/global.ts @@ -1,6 +1,6 @@ import { SelectableForTable } from "zapatos/schema"; export type Goal = SelectableForTable<"goal">; -export type Subgoal = SelectableForTable<"subgoal">; +export type Benchmark = SelectableForTable<"benchmark">; export type ChangeEvent = React.ChangeEvent; export type FormEvent = React.FormEvent;