From 513a9b79a720374fd6251a2fe75c83e0d5b4c0f2 Mon Sep 17 00:00:00 2001 From: Pablo Gracia Gil Date: Mon, 11 Nov 2024 09:25:52 +0100 Subject: [PATCH] add new help types --- src/helpers/constants.ts | 7 ++++++- src/types/database.ts | 9 +++++++-- supabase/migrations/20241111081800_add_help_types.sql | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 supabase/migrations/20241111081800_add_help_types.sql diff --git a/src/helpers/constants.ts b/src/helpers/constants.ts index 17b7591..cfafebd 100644 --- a/src/helpers/constants.ts +++ b/src/helpers/constants.ts @@ -1,4 +1,6 @@ -export const tiposAyudaOptions = { +import { HelpRequestHelpType } from '@/types/Requests'; + +export const tiposAyudaOptions: Record = { limpieza: 'Labores de Limpieza', evacuacion: 'Peticion de desplazamiento', alojamiento: 'Alojamiento temporal', @@ -9,6 +11,9 @@ export const tiposAyudaOptions = { logistico: 'Apoyo logístico', reparto: 'Labores de reparto de alimentos a domicilio', donaciones: 'Labores de organización de donaciones', + maquinariaMovilidadReducida: 'Maquinaria para movilidad reducida', + maquinariaPesada: 'Maquinaria pesada (grúas, palas, ...)', + contenedoresEscombros: 'Contenedores de Escombros', otros: 'Ayuda general', } as const; diff --git a/src/types/database.ts b/src/types/database.ts index 0e8c342..10b717e 100644 --- a/src/types/database.ts +++ b/src/types/database.ts @@ -175,6 +175,7 @@ export type Database = { contact_info: string | null; coordinates: unknown | null; created_at: string | null; + crm_status: string | null; description: string | null; help_type: Database['public']['Enums']['help_type_enum'][] | null; id: number; @@ -190,7 +191,6 @@ export type Database = { town_id: number | null; type: string | null; urgency: string | null; - crm_status: string | null; user_id: string | null; }; Insert: { @@ -199,6 +199,7 @@ export type Database = { contact_info?: string | null; coordinates?: unknown | null; created_at?: string | null; + crm_status?: string | null; description?: string | null; help_type?: Database['public']['Enums']['help_type_enum'][] | null; id?: number; @@ -222,6 +223,7 @@ export type Database = { contact_info?: string | null; coordinates?: unknown | null; created_at?: string | null; + crm_status?: string | null; description?: string | null; help_type?: Database['public']['Enums']['help_type_enum'][] | null; id?: number; @@ -381,7 +383,10 @@ export type Database = { | 'logistico' | 'otros' | 'reparto' - | 'donaciones'; + | 'donaciones' + | 'maquinariaMovilidadReducida' + | 'maquinariaPesada' + | 'contenedoresEscombros'; roles: 'user' | 'moderator' | 'admin'; }; CompositeTypes: { diff --git a/supabase/migrations/20241111081800_add_help_types.sql b/supabase/migrations/20241111081800_add_help_types.sql new file mode 100644 index 0000000..9bbbbb1 --- /dev/null +++ b/supabase/migrations/20241111081800_add_help_types.sql @@ -0,0 +1,4 @@ +alter type "public"."help_type_enum" add value 'maquinariaMovilidadReducida'; +alter type "public"."help_type_enum" add value 'maquinariaPesada'; +alter type "public"."help_type_enum" add value 'contenedoresEscombros'; +