From 5a802eb5704aa76c497acbc944d9c0ea7da0d702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Sat, 9 Dec 2023 14:24:58 -0500 Subject: [PATCH] Actualiza --- Gemfile.lock | 32 ++-- app/javascript/controllers/index.js | 3 + db/structure.sql | 255 +++++++++++++++++++++++++++- test/puppeteer/yarn.lock | 14 +- 4 files changed, 278 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2a054a8..23f7e39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,7 +35,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/apo214.git - revision: a4c7a38b7ea9e7f23668745ec67071ff940641e4 + revision: 33a582b9293fb9cc69d2387fecdf6b3be9629345 branch: main specs: apo214 (2.2.0.beta4) @@ -44,7 +44,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/heb412_gen.git - revision: 7cd8b4b7de0898ab2a3b049217e4a0e9d3c2cc81 + revision: 41e1a1d290cf0b7fe85f107121524d6ca628d2d8 branch: main specs: heb412_gen (2.2.0.beta4) @@ -55,7 +55,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/mr519_gen.git - revision: 8ac5cf474570620c29569b5ddfe31327113063c8 + revision: a6f79b4748e6a6f0322b5fbf58ddf156f4a19bb3 branch: main specs: mr519_gen (2.2.0.beta4) @@ -64,7 +64,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/msip.git - revision: 932966920f125f0f47e37ace5574ec80ca7a8366 + revision: e54ff9f4a722a4a056e78c8b1414e1ec1de02263 branch: main specs: msip (2.2.0.beta4) @@ -84,7 +84,7 @@ GIT GIT remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git - revision: 9e0c2c69f7832aede185bfd0062530ff3f97b565 + revision: 66be0fd7383172f92c779c5544ed9cf67df2fb3d branch: main specs: sivel2_gen (2.2.0.beta4) @@ -162,7 +162,7 @@ GEM tzinfo (~> 2.0) acts_as_list (1.1.0) activerecord (>= 4.2) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) andand (1.3.3) babel-source (5.8.35) @@ -266,7 +266,7 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) io-console (0.6.0) - irb (1.9.1) + irb (1.10.1) rdoc reline (>= 0.3.8) jbuilder (2.11.5) @@ -289,12 +289,12 @@ GEM method_source (1.0.0) mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + mime-types-data (3.2023.1205) mini_mime (1.1.5) mini_portile2 (2.8.5) minitest (5.20.0) msgpack (1.7.2) - net-imap (0.4.6) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) @@ -303,7 +303,7 @@ GEM timeout net-smtp (0.4.0) net-protocol - nio4r (2.6.1) + nio4r (2.7.0) nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -371,15 +371,15 @@ GEM zeitwerk (~> 2.5) raindrops (0.20.1) rake (13.1.0) - rdoc (6.6.0) + rdoc (6.6.1) psych (>= 4.0.0) redcarpet (3.6.0) redis (5.0.8) redis-client (>= 0.17.0) - redis-client (0.18.0) + redis-client (0.19.0) connection_pool - regexp_parser (2.8.2) - reline (0.4.0) + regexp_parser (2.8.3) + reline (0.4.1) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) @@ -399,7 +399,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (4.15.0) + selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -423,7 +423,7 @@ GEM sprockets (>= 3.0.0) stimulus-rails (1.3.0) railties (>= 6.0.0) - stringio (3.0.9) + stringio (3.1.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) thor (1.3.0) diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 97dce38..25783c5 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -39,3 +39,6 @@ application.register("msip--sindocaut", Msip__SindocautController) import Sivel2Gen__EdadController from "./sivel2_gen/edad_controller" application.register("sivel2-gen--edad", Sivel2Gen__EdadController) + +import Sivel2Gen__EnviarFichaCasoController from "./sivel2_gen/enviar_ficha_caso_controller" +application.register("sivel2-gen--enviar-ficha-caso", Sivel2Gen__EnviarFichaCasoController) diff --git a/db/structure.sql b/db/structure.sql index 14150db..802ad10 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -258,6 +258,94 @@ CREATE FUNCTION public.msip_eliminar_familiar_inverso() RETURNS trigger $$; +-- +-- Name: msip_nombre_vereda(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_nombre_vereda() RETURNS character varying + LANGUAGE sql + AS $$ + SELECT 'Vereda ' + $$; + + +-- +-- Name: msip_ubicacionpre_dpa_nomenclatura(character varying, character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_ubicacionpre_dpa_nomenclatura(pais character varying, departamento character varying, municipio character varying, vereda character varying, centropoblado character varying) RETURNS text[] + LANGUAGE sql + AS $$ + SELECT CASE + WHEN pais IS NULL OR pais = '' THEN + array[NULL, NULL] + WHEN departamento IS NULL OR departamento = '' THEN + array[pais, NULL] + WHEN municipio IS NULL OR municipio = '' THEN + array[departamento || ' / ' || pais, departamento] + WHEN (vereda IS NULL OR vereda = '') AND + (centropoblado IS NULL OR centropoblado = '') THEN + array[ + municipio || ' / ' || departamento || ' / ' || pais, + municipio || ' / ' || departamento ] + WHEN vereda IS NOT NULL THEN + array[ + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || departamento || ' / ' || pais, + msip_nombre_vereda() || vereda || ' / ' || + municipio || ' / ' || departamento ] + ELSE + array[ + centropoblado || ' / ' || + municipio || ' / ' || departamento || ' / ' || pais, + centropoblado || ' / ' || + municipio || ' / ' || departamento ] + END + $$; + + +-- +-- Name: msip_ubicacionpre_id_rtablabasica(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_ubicacionpre_id_rtablabasica() RETURNS integer + LANGUAGE sql + AS $$ + SELECT max(id+1) FROM msip_ubicacionpre WHERE + (id+1) NOT IN (SELECT id FROM msip_ubicacionpre) AND + id<10000000 + $$; + + +-- +-- Name: msip_ubicacionpre_nomenclatura(character varying, character varying, character varying, character varying, character varying, character varying, character varying); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.msip_ubicacionpre_nomenclatura(pais character varying, departamento character varying, municipio character varying, vereda character varying, centropoblado character varying, lugar character varying, sitio character varying) RETURNS text[] + LANGUAGE sql + AS $$ + SELECT CASE + WHEN (lugar IS NULL OR lugar = '') THEN + msip_ubicacionpre_dpa_nomenclatura(pais, departamento, + municipio, vereda, centropoblado) + WHEN (sitio IS NULL OR sitio= '') THEN + array[lugar || ' / ' || + (msip_ubicacionpre_dpa_nomenclatura(pais, departamento, + municipio, vereda, centropoblado))[0], + lugar || ' / ' || + (msip_ubicacionpre_dpa_nomenclatura(pais, departamento, + municipio, vereda, centropoblado))[1] ] + ELSE + array[sitio || ' / ' || lugar || ' / ' || + (msip_ubicacionpre_dpa_nomenclatura(pais, departamento, + municipio, vereda, centropoblado))[0], + sitio || ' / ' || lugar || ' / ' || + (msip_ubicacionpre_dpa_nomenclatura(pais, departamento, + municipio, vereda, centropoblado))[1] ] + END + $$; + + -- -- Name: probapellido(text); Type: FUNCTION; Schema: public; Owner: - -- @@ -3198,7 +3286,7 @@ CREATE TABLE public.msip_tsitio ( CREATE TABLE public.msip_ubicacionpre ( id bigint NOT NULL, nombre character varying(2000) NOT NULL COLLATE public.es_co_utf_8, - pais_id integer, + pais_id integer NOT NULL, departamento_id integer, municipio_id integer, centropoblado_id integer, @@ -3209,7 +3297,11 @@ CREATE TABLE public.msip_ubicacionpre ( longitud double precision, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, - nombre_sin_pais character varying(500) + nombre_sin_pais character varying(500), + vereda_id integer, + observaciones character varying(5000), + fechacreacion date DEFAULT now() NOT NULL, + fechadeshabilitacion date ); @@ -5443,6 +5535,14 @@ ALTER TABLE ONLY public.msip_centropoblado ADD CONSTRAINT msip_centropoblado_id_uniqe UNIQUE (id); +-- +-- Name: msip_centropoblado msip_centropoblado_municipio_id_id_unico; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_centropoblado + ADD CONSTRAINT msip_centropoblado_municipio_id_id_unico UNIQUE (municipio_id, id); + + -- -- Name: msip_centropoblado msip_centropoblado_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5475,6 +5575,14 @@ ALTER TABLE ONLY public.msip_departamento ADD CONSTRAINT msip_departamento_id_pais_id_deplocal_unico UNIQUE (pais_id, deplocal_cod); +-- +-- Name: msip_departamento msip_departamento_pais_id_id_unico; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_departamento + ADD CONSTRAINT msip_departamento_pais_id_id_unico UNIQUE (pais_id, id); + + -- -- Name: msip_departamento msip_departamento_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5531,6 +5639,14 @@ ALTER TABLE ONLY public.msip_grupoper ADD CONSTRAINT msip_grupoper_pkey PRIMARY KEY (id); +-- +-- Name: msip_municipio msip_municipio_departamento_id_id_unico; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_municipio + ADD CONSTRAINT msip_municipio_departamento_id_id_unico UNIQUE (departamento_id, id); + + -- -- Name: msip_municipio_histvigencia msip_municipio_histvigencia_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -5731,6 +5847,14 @@ ALTER TABLE ONLY public.msip_ubicacionpre ADD CONSTRAINT msip_ubicacionpre_pkey PRIMARY KEY (id); +-- +-- Name: msip_vereda msip_vereda_municipio_id_id_unico; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_vereda + ADD CONSTRAINT msip_vereda_municipio_id_id_unico UNIQUE (municipio_id, id); + + -- -- Name: msip_vereda msip_vereda_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -6351,6 +6475,13 @@ CREATE INDEX index_msip_ubicacion_on_municipio_id ON public.msip_ubicacion USING CREATE INDEX index_msip_ubicacion_on_pais_id ON public.msip_ubicacion USING btree (pais_id); +-- +-- Name: index_msip_ubicacionpre_on_vereda_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_msip_ubicacionpre_on_vereda_id ON public.msip_ubicacionpre USING btree (vereda_id); + + -- -- Name: index_sivel2_gen_caso_solicitud_on_caso_id; Type: INDEX; Schema: public; Owner: - -- @@ -6554,6 +6685,76 @@ CREATE INDEX msip_persona_sexo ON public.msip_persona USING btree (sexo); CREATE INDEX msip_persona_sexo_ind ON public.msip_persona USING btree (sexo); +-- +-- Name: msip_ubicacionpre_centropoblado_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_centropoblado_id_idx ON public.msip_ubicacionpre USING btree (centropoblado_id); + + +-- +-- Name: msip_ubicacionpre_departamento_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_departamento_id_idx ON public.msip_ubicacionpre USING btree (departamento_id); + + +-- +-- Name: msip_ubicacionpre_departamento_id_municipio_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_departamento_id_municipio_id_idx ON public.msip_ubicacionpre USING btree (departamento_id, municipio_id); + + +-- +-- Name: msip_ubicacionpre_municipio_id_centropoblado_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_municipio_id_centropoblado_id_idx ON public.msip_ubicacionpre USING btree (municipio_id, centropoblado_id); + + +-- +-- Name: msip_ubicacionpre_municipio_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_municipio_id_idx ON public.msip_ubicacionpre USING btree (municipio_id); + + +-- +-- Name: msip_ubicacionpre_municipio_id_vereda_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_municipio_id_vereda_id_idx ON public.msip_ubicacionpre USING btree (municipio_id, vereda_id); + + +-- +-- Name: msip_ubicacionpre_pais_id_departamento_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_pais_id_departamento_id_idx ON public.msip_ubicacionpre USING btree (pais_id, departamento_id); + + +-- +-- Name: msip_ubicacionpre_pais_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_pais_id_idx ON public.msip_ubicacionpre USING btree (pais_id); + + +-- +-- Name: msip_ubicacionpre_tsitio_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_tsitio_id_idx ON public.msip_ubicacionpre USING btree (vereda_id); + + +-- +-- Name: msip_ubicacionpre_vereda_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msip_ubicacionpre_vereda_id_idx ON public.msip_ubicacionpre USING btree (vereda_id); + + -- -- Name: sivel2_gen_caso_anio_mes; Type: INDEX; Schema: public; Owner: - -- @@ -7424,6 +7625,14 @@ ALTER TABLE ONLY public.mr519_gen_encuestapersona ADD CONSTRAINT fk_rails_54b3e0ed5c FOREIGN KEY (persona_id) REFERENCES public.msip_persona(id); +-- +-- Name: msip_ubicacionpre fk_rails_558c98f353; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_rails_558c98f353 FOREIGN KEY (vereda_id) REFERENCES public.msip_vereda(id); + + -- -- Name: msip_etiqueta_municipio fk_rails_5672729520; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -7944,6 +8153,38 @@ ALTER TABLE ONLY public.msip_solicitud ADD CONSTRAINT fk_rails_ffa31a0de6 FOREIGN KEY (estadosol_id) REFERENCES public.msip_estadosol(id); +-- +-- Name: msip_ubicacionpre fk_ubicacionpre_departamento_municipio; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_ubicacionpre_departamento_municipio FOREIGN KEY (departamento_id, municipio_id) REFERENCES public.msip_municipio(departamento_id, id); + + +-- +-- Name: msip_ubicacionpre fk_ubicacionpre_municipio_centropoblado; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_ubicacionpre_municipio_centropoblado FOREIGN KEY (municipio_id, centropoblado_id) REFERENCES public.msip_centropoblado(municipio_id, id); + + +-- +-- Name: msip_ubicacionpre fk_ubicacionpre_municipio_vereda; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_ubicacionpre_municipio_vereda FOREIGN KEY (municipio_id, vereda_id) REFERENCES public.msip_vereda(municipio_id, id); + + +-- +-- Name: msip_ubicacionpre fk_ubicacionpre_pais_departamento; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msip_ubicacionpre + ADD CONSTRAINT fk_ubicacionpre_pais_departamento FOREIGN KEY (pais_id, departamento_id) REFERENCES public.msip_departamento(pais_id, id); + + -- -- Name: msip_centropoblado msip_centropoblado_municipio_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -8774,6 +9015,14 @@ INSERT INTO "schema_migrations" (version) VALUES ('20231120094041'), ('20231120175125'), ('20231121135551'), -('20231121203443'); +('20231121203443'), +('20231124200056'), +('20231125152802'), +('20231125152810'), +('20231125230000'), +('20231205202418'), +('20231205205549'), +('20231205205600'), +('20231208162022'); diff --git a/test/puppeteer/yarn.lock b/test/puppeteer/yarn.lock index 73d94bf..d0e390b 100644 --- a/test/puppeteer/yarn.lock +++ b/test/puppeteer/yarn.lock @@ -4,7 +4,7 @@ "@pasosdeJesus/pruebas_puppeteer@https://gitpkg.now.sh/pasosdeJesus/msip/pruebas_puppeteer?main": version "0.0.9-a7" - resolved "https://gitpkg.now.sh/pasosdeJesus/msip/pruebas_puppeteer?main#3e7ed5cf0a4ca20b88217a19e5a2a9f21dcd4e74" + resolved "https://gitpkg.now.sh/pasosdeJesus/msip/pruebas_puppeteer?main#b8c269dc67a9e1f30cdc06468149b9d162388234" "@puppeteer/browsers@1.4.6": version "1.4.6" @@ -25,9 +25,9 @@ integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== "@types/node@*": - version "20.9.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.5.tgz#bb441014bcb91c63742b0e1fe25b902f5d581faa" - integrity sha512-Uq2xbNq0chGg+/WQEU0LJTSs/1nKxz6u1iemLcGomkSnKokbW1fbLqc3HOqCf2JP7KjlL4QkS7oZZTrOQHQYgQ== + version "20.10.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.4.tgz#b246fd84d55d5b1b71bf51f964bd514409347198" + integrity sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg== dependencies: undici-types "~5.26.4" @@ -452,9 +452,9 @@ source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== streamx@^2.15.0: - version "2.15.5" - resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.15.5.tgz#87bcef4dc7f0b883f9359671203344a4e004c7f1" - integrity sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg== + version "2.15.6" + resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.15.6.tgz#28bf36997ebc7bf6c08f9eba958735231b833887" + integrity sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw== dependencies: fast-fifo "^1.1.0" queue-tick "^1.0.1"