diff --git a/bldg_server/Dockerfile b/bldg_server/Dockerfile index a7e0e4d..a9b098e 100644 --- a/bldg_server/Dockerfile +++ b/bldg_server/Dockerfile @@ -1,8 +1,8 @@ # ---- Build Stage ---- -FROM elixir:1.11-alpine AS app_builder +FROM elixir:1.15-alpine AS app_builder # Set environment variables for building the application -ENV MIX_ENV=prod \ +ENV MIX_ENV=dev \ TEST=1 \ LANG=C.UTF-8 @@ -36,7 +36,7 @@ FROM alpine AS app ENV LANG=C.UTF-8 # Install openssl -RUN apk add --update openssl ncurses-libs postgresql-client && \ +RUN apk add --update bash openssl libgcc ncurses-libs postgresql-client libstdc++ && \ rm -rf /var/cache/apk/* @@ -44,7 +44,7 @@ RUN apk add --update openssl ncurses-libs postgresql-client && \ RUN adduser -D -h /home/app app WORKDIR /home/app COPY --from=app_builder /app/_build . -RUN chown -R app: ./prod +RUN chown -R app: ./dev USER app diff --git a/bldg_server/Dockerfile.local-dev b/bldg_server/Dockerfile.local-dev new file mode 100644 index 0000000..44a6324 --- /dev/null +++ b/bldg_server/Dockerfile.local-dev @@ -0,0 +1,23 @@ +# Elixir + Phoenix +ARG EX_VERSION=1.15 + +FROM elixir:$EX_VERSION + +# Install debian packages +RUN apt-get update +RUN apt-get install --yes build-essential inotify-tools postgresql-client + +# Install Phoenix packages +ARG PHX_VERSION=1.5.6 +RUN mix local.hex --force +RUN mix local.rebar --force +RUN mix archive.install hex phx_new $PHX_VERSION + +# Install node +# RUN curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh +# RUN bash nodesource_setup.sh +# RUN apt-get install --yes nodejs npm + +WORKDIR /app +EXPOSE 4000 +EXPOSE 4443 \ No newline at end of file diff --git a/bldg_server/config/dev.exs b/bldg_server/config/dev.exs index c502596..5bedfec 100644 --- a/bldg_server/config/dev.exs +++ b/bldg_server/config/dev.exs @@ -2,10 +2,10 @@ use Mix.Config # Configure your database config :bldg_server, BldgServer.Repo, - username: "udi", - password: "", + username: System.get_env("DB_USER", "postgres"), + password: System.get_env("DB_PASSWORD", ""), database: "bldg_server_dev", - hostname: "localhost", + hostname: System.get_env("DB_HOST", "db"), show_sensitive_data_on_connection_error: true, pool_size: 10 @@ -19,6 +19,7 @@ config :bldg_server, BldgServerWeb.Endpoint, http: [port: 4000], https: [port: 4443, otp_app: :bldg_server, + cipher_suite: :strong, keyfile: "priv/cert/localhost.key", certfile: "priv/cert/localhost.cert"], debug_errors: true, diff --git a/bldg_server/config/test.exs b/bldg_server/config/test.exs index 7fc0090..ce0cde9 100644 --- a/bldg_server/config/test.exs +++ b/bldg_server/config/test.exs @@ -3,9 +3,9 @@ use Mix.Config # Configure your database config :bldg_server, BldgServer.Repo, username: "postgres", - password: "postgres", + password: System.get_env("DB_PASSWORD", "postgres"), database: "bldg_server_test", - hostname: "localhost", + hostname: System.get_env("DB_HOST", "localhost"), pool: Ecto.Adapters.SQL.Sandbox # We don't run a server during test. If one is required, diff --git a/bldg_server/devops/db/initial_db_data.sql b/bldg_server/devops/db/initial_db_data.sql new file mode 100644 index 0000000..a678a0e --- /dev/null +++ b/bldg_server/devops/db/initial_db_data.sql @@ -0,0 +1,199 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 14.10 (Homebrew) +-- Dumped by pg_dump version 14.10 (Homebrew) + +-- Started on 2024-01-03 08:46:32 PST + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + + +-- +-- TOC entry 3617 (class 0 OID 16861) +-- Dependencies: 218 +-- Data for Name: batteries; Type: TABLE DATA; Schema: public; Owner: udi +-- + +INSERT INTO public.batteries VALUES (54, 'g/fromTeal/l0/test-decision', 'g/b(16,92)/l0', 'http://localhost:8000/v1/on_message', true, false, 'sample-clock', '0.0.1', 'w2m', '2022-10-28 14:25:39', '2022-10-28 14:25:39'); +INSERT INTO public.batteries VALUES (76, 'g/fromTeal/l0/test1/l0/dataset-assistant', 'g/b(16,92)/l0/b(-10,12)/l0', 'http://localhost:8000/v1/on_message', true, false, 'dataset-assistant', '0.0.1', 'alice.in', '2023-09-15 16:02:54', '2023-09-15 16:02:54'); + + +-- +-- TOC entry 3611 (class 0 OID 16391) +-- Dependencies: 211 +-- Data for Name: bldgs; Type: TABLE DATA; Schema: public; Owner: udi +-- + +INSERT INTO public.bldgs VALUES (1102, 'g/b(13,5)', 'g', 13, -5, false, 'action1', NULL, 'action', 'approved', NULL, NULL, 'some action', NULL, NULL, '2023-10-17 14:57:08', '2023-10-17 14:57:08', '{dibaunaumh@gmail.com}', 'g/action1', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (9, 'g/b(16,92)/l0/b(34,16)', 'g/b(16,92)/l0', 34, 16, false, 'test7', 'test7.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-21 03:19:03', '2022-05-21 03:19:03', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test7', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (10, 'g/b(16,92)/l0/b(-10,12)/l0/b(19,23)', 'g/b(16,92)/l0/b(-10,12)/l0', 19, 23, false, 't4p', 'https://fromteal.app/g/b(16,92)/l0/b(-10,12)/l0/b(19,23)/purpose/t4p', 'purpose', 'approved', NULL, NULL, 'To be the test building every team needs', NULL, NULL, '2022-05-21 21:26:01', '2022-05-21 21:26:01', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test1/l0/t4p', 'g/fromTeal/l0/test1/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (31, 'g/b(236,191)', 'g', 236, 181, false, 'the-orb', 'http://orb.org', 'purpose', 'approved', NULL, NULL, 'interstaller travel made easy', NULL, NULL, '2022-08-10 21:09:20', '2022-08-10 21:09:20', '{dibaunaumh@gmail.com}', 'g/the-orb', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (7, 'g/b(16,92)/l0/b(0,12)', 'g/b(16,92)/l0', 0, 12, false, 'Cantata1', 'cantata1.org', 'cantata', 'approved', NULL, NULL, NULL, 'https://dibau.files.wordpress.com/2022/02/img_1067.jpg', NULL, '2022-05-09 04:14:10', '2022-05-09 04:14:10', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/Cantata1', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (13, 'g/b(-10,230)', 'g', -10, 235, false, 't10', 't10.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-22 01:31:18', '2022-05-22 01:31:18', '{dibaunaumh@gmail.com}', 'g/t10', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (35, 'g/b(-10,230)/l0/b(14,33)/l0/b(24,14)', 'g/b(-10,230)/l0/b(14,33)/l0', 24, 4, false, 'blueroadmap', 'https://blueroadmap.co', 'blue-lot', 'approved', NULL, NULL, 'roadmap to blue', NULL, NULL, '2022-08-19 20:08:33', '2022-08-19 20:08:33', '{dibaunaumh@gmail.com}', 'g/t11/l0/blueroadmap', 'g/t11/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (15, 'g/b(-45,142)/l0/b(-8,23)', 'g/b(-45,142)/l0', -8, 13, false, 't200', 't200.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-27 16:42:09', '2022-05-27 16:42:09', '{dibaunaumh@gmail.com}', 'g/t8/l0/t200', 'g/t8/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (18, 'g/b(-132,157)', 'g', -132, 147, false, 'ok-bldg', 'okbldg.org', 'team', 'approved', NULL, NULL, NULL, NULL, '{"a": "1", "b": "2"}', '2022-05-27 18:03:50', '2022-05-27 18:03:50', '{dibaunaumh@gmail.com}', 'g/ok-bldg', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (14, 'g/b(-10,230)/l0/b(14,33)', 'g/b(-10,230)/l0', 14, 23, false, 't11', 't11.org', 'team', 'approved', NULL, NULL, NULL, NULL, '{"promoted-inside-2-picture-url":"https://i.imgur.com/tKAxfBs.jpg"}', '2022-05-22 01:32:48', '2022-10-09 22:01:07', '{dibaunaumh@gmail.com}', 'g/t11', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (20, 'g/b(36,122)', 'g', 36, 122, false, 'quickactionsdialog', 'https://fromteal.app/entities/quickactionsdialog', 'task', 'approved', NULL, NULL, 'create quick actions dialog', NULL, NULL, '2022-07-26 19:29:02', '2022-09-16 03:55:21', '{dibaunaumh@gmail.com}', 'g/quickactionsdialog', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (12, 'g/b(-70,202)', 'g', -70, 202, false, 't9', 't9.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-22 01:28:47', '2022-05-22 01:28:47', '{dibaunaumh@gmail.com}', 'g/t9', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (6, 'g/b(-82,101)', 'g', -82, 101, false, 'test4', 'test4.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-05 13:54:33', '2022-05-07 19:01:32', '{inna.bauman@gmail.com}', 'g/test4', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (22, 'g/b(117,143)', 'g', 117, 143, false, 'gitcoin', 'https://gitcoin.co', 'cantata', 'approved', NULL, NULL, NULL, 'https://s.gitcoin.co/static/landingpage/sponsors.e07ea4881856.png', NULL, '2022-07-26 20:58:41', '2022-07-28 19:58:09', '{dibaunaumh@gmail.com}', 'g/gitcoin', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (32, 'g/b(16,92)/l0/b(13,10)', 'g/b(16,92)/l0', 13, 10, false, 'validate-form-input', 'http://fromteal.app/task/validate', 'task', 'approved', NULL, NULL, 'validate form input', NULL, NULL, '2022-08-11 17:14:34', '2022-09-18 11:58:25', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/validate-form-input', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (33, 'g/b(66,120)', 'g', 66, 120, false, 'dima', 'http://dime.org', 'task', 'approved', NULL, NULL, 'do something', NULL, NULL, '2022-08-15 21:00:34', '2022-09-14 04:23:49', '{dibaunaumh@gmail.com}', 'g/dima', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (1, 'g/b(15,-1)', 'g', 15, -1, false, 'Ikigai', 'ikigai.org', 'neighborhood', 'approved', NULL, NULL, 'Ikigai', NULL, NULL, '2022-03-31 20:38:49', '2022-03-31 20:38:49', '{dibaunaumh@gmail.com}', 'g/Ikigai', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (62, 'g/b(16,92)/l0/b(11,22)/l1/b(7,28)', 'g/b(16,92)/l0/b(11,22)/l1', 7, 28, false, 'ocean-love', NULL, 'solution', 'approved', NULL, NULL, 'ocean love apples', NULL, NULL, '2022-09-23 09:44:37', '2022-09-23 09:45:01', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/apple-a-day/l1/ocean-love', 'g/fromTeal/l0/apple-a-day/l1', 1, 3, NULL); +INSERT INTO public.bldgs VALUES (19, 'g/b(16,92)/l0/b(18,19)', 'g/b(16,92)/l0', 18, 9, false, 'task-1', 'task-1.org', 'task', 'approved', '3xl', NULL, '[Manage equity p1] Add task, meeting, cost & member entities.', NULL, '{"assignee1": "dibaunaumh@gmail.com", "assignee1_picture": "https://avatars.githubusercontent.com/u/45039?v=4", "task_external_url": "https://trello.com/c/dLZEJZUz/135-manage-equity-p1-add-task-entity"}', '2022-06-01 13:48:24', '2022-06-01 13:48:24', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/task-1', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (23, 'g/b(162,177)', 'g', 162, 177, false, 'gould', 'https://gould.xyz', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-07-28 13:31:41', '2022-08-03 19:52:04', '{dibaunaumh@gmail.com}', 'g/gould', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (24, 'g/b(193,244)', 'g', 193, 234, false, 'cooperation', 'http://coop.xyz', 'purpose', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-08-05 18:06:53', '2022-08-05 18:06:53', '{dibaunaumh@gmail.com}', 'g/cooperation', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (21, 'g/b(21,113)', 'g', 21, 103, false, 'ft-purpose', 'https://fromteal.app/entities/purpose', 'purpose', 'approved', NULL, NULL, 'connect people with shared purpose and help them work together towards it', NULL, NULL, '2022-07-26 20:54:55', '2022-07-26 20:54:55', '{dibaunaumh@gmail.com}', 'g/ft-purpose', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (27, 'g/b(216,228)', 'g', 216, 218, false, 'cc', 'https://cc.xyz', 'purpose', 'approved', NULL, NULL, 'capture carbon to mitigate global warming', NULL, NULL, '2022-08-05 18:17:40', '2022-08-05 18:17:40', '{dibaunaumh@gmail.com}', 'g/cc', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (26, 'g/b(226,230)', 'g', 226, 220, false, 'coop-purpose', 'https://coop.co/purpose', 'purpose', 'approved', NULL, NULL, 'increase cooperation between people & teams with shared purpose', NULL, NULL, '2022-08-05 18:12:44', '2022-08-05 18:12:44', '{dibaunaumh@gmail.com}', 'g/coop-purpose', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (28, 'g/b(235,197)', 'g', 235, 197, false, 'my-purpose', 'https://fromteal.com/purpose2', 'purpose', 'approved', NULL, NULL, 'purpose text bla bla', NULL, NULL, '2022-08-05 21:14:49', '2022-08-05 21:15:39', '{dibaunaumh@gmail.com}', 'g/my-purpose', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (29, 'g/b(235,199)', 'g', 235, 189, false, 'sometask', 'https://trello.com/card123', 'task', 'approved', NULL, NULL, 'build xyz', NULL, '{"assignee1": "dibaunaumh@gmail.com", "assignee1_picture": "https://avatars.githubusercontent.com/u/45039?v=4", "task_external_url": "https://trello.com/c/dLZEJZUz/135-manage-equity-p1-add-task-entity"}', '2022-08-05 21:17:16', '2022-08-05 21:22:04', '{eddiefidler12@gmail.com,dibaunaumh@gmail.com}', 'g/sometask', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (30, 'g/b(249,174)', 'g', 249, 174, false, '2nstask', 'https://trello.com/card456', 'task', 'approved', 'xl', NULL, 'then build abc', NULL, NULL, '2022-08-05 21:19:58', '2022-08-10 21:11:18', '{dibaunaumh@gmail.com}', 'g/2nstask', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (2, 'g/b(25,53)', 'g', 25, 53, false, 'Teal', 'teal.org', 'street', 'approved', NULL, NULL, 'Teal', NULL, NULL, '2022-04-01 14:33:37', '2022-05-07 18:56:13', '{eduard.fidler12@gmail.com,dibaunaumh@gmail.com}', 'g/Teal', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (34, 'g/b(42,136)', 'g', 42, 126, false, 'fight-maleria', 'https://maleria.xyz', 'yellow-lot', 'approved', NULL, NULL, 'fight maleria', NULL, NULL, '2022-08-16 22:09:11', '2022-08-16 22:09:11', '{dibaunaumh@gmail.com}', 'g/fight-maleria', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (17, 'g', NULL, NULL, NULL, true, 'g', 'w2m.site', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2022-05-27 00:00:00', '2022-05-27 00:00:00', '{dibaunaumh@gmail.com}', 'g', NULL, 0, 0, NULL); +INSERT INTO public.bldgs VALUES (3, 'g/b(16,92)', 'g', 16, 92, true, 'fromTeal', 'fromteal.com', 'team', 'approved', NULL, NULL, 'fromTeal', NULL, '{"promoted-inside-3-picture-url":"https://i.imgur.com/TA2SARD.jpg","promoted-inside-4-picture-url":"https://i.imgur.com/s0p6oyp.jpg"}', '2022-05-04 14:22:51', '2022-10-09 21:51:36', '{dibaunaumh@gmail.com}', 'g/fromTeal', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (36, 'g/b(38,136)', 'g', 38, 136, false, 'yellow-purpose', NULL, 'purpose', 'approved', NULL, NULL, 'for yellow lot to be less yellowish', NULL, NULL, '2022-09-14 05:40:12', '2022-09-14 05:41:49', '{dibaunaumh@gmail.com}', 'g/yellow-purpose', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (37, 'g/b(-83,119)', 'g', -83, 119, false, 'purpose-of-life', NULL, 'purpose', 'approved', NULL, NULL, 'to appreciate beauty, whatever that is', NULL, NULL, '2022-09-15 03:51:43', '2022-09-15 03:52:15', '{dibaunaumh@gmail.com}', 'g/purpose-of-life', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (39, 'g/b(16,92)/l0/b(16,17)', 'g/b(16,92)/l0', 16, 7, false, 'go-outside', NULL, 'action', 'approved', NULL, NULL, 'just go outside', NULL, NULL, '2022-09-17 06:07:01', '2022-09-17 06:07:01', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/go-outside', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (40, 'g/b(16,92)/l0/b(23,4)', 'g/b(16,92)/l0', 23, 4, false, 'bit-project-montage', NULL, 'milestone', 'approved', NULL, NULL, 'quickly montage the bit work on the project with a nice music', NULL, NULL, '2022-09-17 07:00:58', '2022-09-17 07:03:46', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/bit-project-montage', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (41, 'g/b(16,92)/l0/b(14,27)', 'g/b(16,92)/l0', 14, 17, false, 'artificial-hierarchy', NULL, 'problem', 'approved', NULL, NULL, 'people shouldn''t own other people', NULL, NULL, '2022-09-17 07:12:45', '2022-09-17 07:12:45', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/artificial-hierarchy', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (42, 'g/b(16,92)/l0/b(12,18)', 'g/b(16,92)/l0', 12, 18, false, 'some-solution', NULL, 'solution', 'approved', NULL, NULL, 'a clever solution to the problem', NULL, NULL, '2022-09-17 08:28:50', '2022-09-17 08:36:04', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/some-solution', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (43, 'g/b(16,92)/l0/b(21,20)', 'g/b(16,92)/l0', 21, 20, false, 'alifib', NULL, 'product', 'approved', NULL, NULL, 'the alifib product', NULL, NULL, '2022-09-17 09:07:03', '2022-09-17 09:10:19', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/alifib', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (44, 'g/b(16,92)/l0/b(16,18)', 'g/b(16,92)/l0', 16, 18, false, 'coaching', NULL, 'service', 'approved', NULL, NULL, 'coaching service for teal teams', NULL, NULL, '2022-09-17 09:43:38', '2022-09-17 09:46:28', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/coaching', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (45, 'g/b(16,92)/l0/b(18,22)', 'g/b(16,92)/l0', 18, 12, false, 'convert-data-to-organized-space', NULL, 'capability', 'approved', NULL, NULL, 'convert data into organized space', NULL, NULL, '2022-09-17 09:51:42', '2022-09-17 09:51:42', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/convert-data-to-organized-space', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (48, 'g/b(16,92)/l0/b(23,15)', 'g/b(16,92)/l0', 23, 15, false, 'the-el-dorado-project', NULL, 'project', 'approved', NULL, NULL, 'el dorado 306', NULL, NULL, '2022-09-17 10:42:34', '2022-09-17 10:46:55', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/the-el-dorado-project', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (49, 'g/b(16,92)/l0/b(9,21)', 'g/b(16,92)/l0', 9, 21, false, 'team-equity', NULL, 'equity', 'approved', NULL, NULL, 'fromteal equity distribution', NULL, NULL, '2022-09-17 10:54:48', '2022-09-17 10:56:43', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/team-equity', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (50, 'g/b(16,92)/l0/b(7,21)', 'g/b(16,92)/l0', 7, 21, false, 'decide-on-equity-model', NULL, 'action', 'approved', NULL, NULL, 'decide on equity model', NULL, NULL, '2022-09-17 10:57:38', '2022-09-17 10:58:33', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/decide-on-equity-model', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (46, 'g/b(16,92)/l0/b(15,17)', 'g/b(16,92)/l0', 15, 17, false, 'ef', NULL, 'member', 'approved', NULL, NULL, 'eddie fidler', NULL, NULL, '2022-09-17 10:17:43', '2022-09-17 10:59:15', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/ef', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (47, 'g/b(16,92)/l0/b(1,-5)', 'g/b(16,92)/l0', 1, -5, false, 'fromteal-community', NULL, 'community', 'approved', NULL, NULL, 'fromteal community', NULL, NULL, '2022-09-17 10:31:32', '2022-09-17 11:07:46', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/fromteal-community', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (51, 'g/b(16,92)/l0/b(11,7)', 'g/b(16,92)/l0', 11, 7, false, 'team-costs', NULL, 'costs', 'approved', NULL, NULL, 'fromteal costs', NULL, NULL, '2022-09-17 11:09:07', '2022-09-17 11:09:41', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/team-costs', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (52, 'g/b(4,97)', 'g', 4, 87, false, 'ro', NULL, 'project', 'approved', NULL, NULL, 'reinventing work advocacy', NULL, NULL, '2022-09-17 11:10:46', '2022-09-17 11:10:46', '{dibaunaumh@gmail.com}', 'g/ro', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (53, 'g/b(16,92)/l0/b(7,7)', 'g/b(16,92)/l0', 7, 7, false, 'fromteal-sales', NULL, 'sales', 'approved', NULL, NULL, 'sales archive', NULL, NULL, '2022-09-17 11:35:54', '2022-09-17 11:36:39', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/fromteal-sales', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (54, 'g/b(16,92)/l0/b(8,6)', 'g/b(16,92)/l0', 8, 6, false, 'advice-asking-agreement', NULL, 'agreement', 'approved', NULL, NULL, 'advice asking prior to decisions', NULL, NULL, '2022-09-17 12:07:58', '2022-09-17 12:08:57', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/advice-asking-agreement', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (56, 'g/b(16,92)/l0/b(10,23)', 'g/b(16,92)/l0', 10, 13, false, 'ambience-mall', NULL, 'customer', 'approved', NULL, NULL, 'ambience mall in delhi', NULL, NULL, '2022-09-17 12:58:43', '2022-09-17 12:58:43', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/ambience-mall', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (57, 'g/b(16,92)/l0/b(2,14)', 'g/b(16,92)/l0', 2, 14, false, 'some-project', NULL, 'project', 'approved', NULL, NULL, 'a large project', NULL, NULL, '2022-09-17 16:37:29', '2022-09-18 09:58:37', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/some-project', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (8, 'g/b(16,92)/l0/b(5,19)', 'g/b(16,92)/l0', 5, 19, false, 'ftpurpose', 'https://fromteal.app/g/b(19,100)/purpose/ftpurpose', 'purpose', 'approved', NULL, NULL, 'Connect people with shared purpose to create great things', 'https://i.imgur.com/TA2SARD.jpg', NULL, '2022-05-10 05:50:10', '2022-09-18 12:56:15', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/ftpurpose', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (59, 'g/b(16,92)/l0/b(13,6)', 'g/b(16,92)/l0', 13, -4, false, 'miami-look-and-feel', NULL, 'milestone', 'approved', NULL, NULL, 'miami look & feel', 'https://i.imgur.com/s0p6oyp.jpg', NULL, '2022-09-19 14:06:51', '2022-09-19 14:06:51', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/miami-look-and-feel', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (58, 'g/b(16,92)/l0/b(69,12)', 'g/b(16,92)/l0', 69, 2, false, 'graffiti-goal', NULL, 'goal', 'approved', NULL, NULL, 'find a good graffiti', 'https://i.imgur.com/eCzdqJW.jpg', NULL, '2022-09-18 17:53:49', '2022-09-18 17:53:49', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/graffiti-goal', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (60, 'g/b(16,92)/l0/b(11,22)/l1/b(9,38)', 'g/b(16,92)/l0/b(11,22)/l1', 9, 28, false, 'apples-are-boring', NULL, 'problem', 'approved', NULL, NULL, 'apples are too boring', NULL, NULL, '2022-09-23 09:41:08', '2022-09-23 09:41:08', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/apple-a-day/l1/apples-are-boring', 'g/fromTeal/l0/apple-a-day/l1', 1, 3, NULL); +INSERT INTO public.bldgs VALUES (61, 'g/b(16,92)/l0/b(11,22)/l0/b(7,37)', 'g/b(16,92)/l0/b(11,22)/l0', 7, 27, false, 'another-goal', NULL, 'goal', 'approved', NULL, NULL, 'another sub-goal', NULL, NULL, '2022-09-23 09:42:43', '2022-09-23 09:42:43', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/apple-a-day/l0/another-goal', 'g/fromTeal/l0/apple-a-day/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (55, 'g/b(16,92)/l0/b(9,19)', 'g/b(16,92)/l0', 9, 19, false, 'launch-decision', NULL, 'decision', 'approved', NULL, NULL, 'fromteal alpha launch: oct 1st, 2022', NULL, NULL, '2022-09-17 12:31:43', '2022-10-04 13:24:54', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/launch-decision', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (67, 'g/b(50,21)/l1/b(-9,5)', 'g/b(50,21)/l1', -9, 5, false, 'neil', NULL, 'action', 'approved', NULL, NULL, 'huggle', NULL, NULL, '2022-10-09 22:23:13', '2022-10-09 22:23:54', '{dibaunaumh@gmail.com}', 'g/cabinet/l1/neil', 'g/cabinet/l1', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (63, 'g/b(16,92)/l0/b(11,22)/l0/b(9,28)', 'g/b(16,92)/l0/b(11,22)/l0', 9, 28, false, 'eat-more-apples', NULL, 'action', 'approved', NULL, NULL, 'eat more apples', NULL, NULL, '2022-09-23 09:46:09', '2022-09-23 09:46:47', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/apple-a-day/l0/eat-more-apples', 'g/fromTeal/l0/apple-a-day/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (11, 'g/b(-45,142)', 'g', -45, 142, false, 't8', 'team8.org', 'team', 'approved', NULL, NULL, NULL, NULL, '{"promoted-inside-3-picture-url":"https://i.imgur.com/eczdqjw.jpg"}', '2022-05-22 01:12:58', '2022-09-30 18:45:41', '{dibaunaumh@gmail.com}', 'g/t8', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (66, 'g/b(-10,230)/l0/b(14,33)/l0/b(24,10)', 'g/b(-10,230)/l0/b(14,33)/l0', 24, 0, false, 'lutz', NULL, 'cantata', 'approved', NULL, NULL, 'lutz', 'https://i.imgur.com/tKAxfBs.jpg', NULL, '2022-10-09 21:57:26', '2022-10-09 21:57:26', '{dibaunaumh@gmail.com}', 'g/t11/l0/lutz', 'g/t11/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (64, 'g/b(50,21)/l1/b(-12,5)', 'g/b(50,21)/l1', -12, 5, false, 'graffiti', NULL, 'action', 'approved', NULL, NULL, 'graffiti for the team hq', 'https://i.imgur.com/eczdqjw.jpg', NULL, '2022-09-30 18:45:26', '2022-09-30 18:45:26', '{dibaunaumh@gmail.com}', 'g/cabinet/l1/graffiti', 'g/cabinet/l1', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (65, 'g/b(16,92)/l0/b(18,18)', 'g/b(16,92)/l0', 18, 18, false, 'test-decision', NULL, 'decision', 'approved', NULL, NULL, 'decide on something', NULL, NULL, '2022-10-04 13:34:29', '2022-10-14 17:11:02', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test-decision', 'g/fromTeal/l0', 0, 2, '{"{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 10:11\",\"say_time\":1665767462740}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 15:51\",\"say_time\":1665528669977}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 14:44\",\"say_time\":1665524693491}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 12:23\",\"say_time\":1665516196021}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 12:08\",\"say_time\":1665515304669}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 11:37\",\"say_time\":1665513471115}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 11:34\",\"say_time\":1665513247327}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 10:59\",\"say_time\":1665511165541}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 10:51\",\"say_time\":1665510707154}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 00:13\",\"say_time\":1665472389974}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 23:23\",\"say_time\":1665469436252}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/test-decision\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test-decision\",\"say_location\":\"g/b(16,92)/l0/b(18,18)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 23:23\",\"say_time\":1665469431895}"}'); +INSERT INTO public.bldgs VALUES (69, 'g/b(16,92)/l0/b(34,16)/l0/b(13,27)', 'g/b(16,92)/l0/b(34,16)/l0', 13, 17, false, 'databases', NULL, 'blue-lot', 'approved', NULL, NULL, 'databases', NULL, NULL, '2022-10-14 17:38:46', '2022-10-14 17:38:46', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test7/l0/databases', 'g/fromTeal/l0/test7/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (70, 'g/b(16,92)/l0/b(34,16)/l0/b(28,21)', 'g/b(16,92)/l0/b(34,16)/l0', 28, 11, false, 'mongodb', 'https://mongodb.com', 'project', 'approved', NULL, NULL, 'mongodb driver', NULL, NULL, '2022-10-14 17:40:57', '2022-10-14 17:40:57', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test7/l0/mongodb', 'g/fromTeal/l0/test7/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (68, 'g/b(16,92)/l0/b(18,16)', 'g/b(16,92)/l0', 18, 16, false, 'a-solution', NULL, 'solution', 'approved', NULL, NULL, 'another solution', NULL, NULL, '2022-10-11 19:18:45', '2022-10-11 19:19:28', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/a-solution', 'g/fromTeal/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (71, 'g/b(16,92)/l0/b(34,16)/l0/b(26,12)', 'g/b(16,92)/l0/b(34,16)/l0', 26, 12, false, 'postgres', NULL, 'goal', 'approved', NULL, NULL, 'posgtres', NULL, NULL, '2022-10-14 17:42:29', '2022-10-14 17:42:54', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test7/l0/postgres', 'g/fromTeal/l0/test7/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (38, 'g/b(16,92)/l0/b(11,22)', 'g/b(16,92)/l0', 11, 22, false, 'apple-a-day', NULL, 'goal', 'approved', NULL, NULL, 'eat one apple a day', NULL, NULL, '2022-09-17 05:24:35', '2023-05-31 14:22:37', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/apple-a-day', 'g/fromTeal/l0', 0, 2, '{"{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/apple-a-day\",\"resident_email\":\"arvind.dotiyal@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/apple-a-day\",\"say_location\":\"g/b(16,92)/l0/b(11,22)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 07:22\",\"say_time\":1685542957974}","{\"action_type\":\"SAY\",\"bldg_url\":\"g/fromTeal/l0/apple-a-day\",\"resident_email\":\"arvind.dotiyal@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0/apple-a-day\",\"say_location\":\"g/b(16,92)/l0/b(11,22)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"dibau\",\"say_speaker\":\"sample-clock\",\"say_text\":\"The time is 07:22\",\"say_time\":1685542957854}"}'); +INSERT INTO public.bldgs VALUES (1093, 'g/b(50,21)/l0/b(0,-3)', 'g/b(50,21)/l0', 0, -3, false, 'chahir', NULL, 'purpose', 'approved', NULL, NULL, 'da chahir', NULL, NULL, '2023-09-21 15:45:46', '2023-09-21 15:45:46', '{dibaunaumh@gmail.com}', 'g/cabinet/l0/chahir', 'g/cabinet/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1082, 'g/b(16,92)/l0/b(-10,12)/l0/b(2,-16)', 'g/b(16,92)/l0/b(-10,12)/l0', 2, -26, false, 'My-Dataset', 'https://my-dataset.org', 'team', 'approved', NULL, NULL, 'A dataset', NULL, NULL, '2023-09-14 15:49:24', '2023-09-14 15:49:24', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test1/l0/dataset-assistant/My-Dataset', 'g/fromTeal/l0/test1/l0/dataset-assistant', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (4, 'g/b(16,92)/l0/b(-10,12)', 'g/b(16,92)/l0', -10, 12, false, 'test1', 'test1.org', 'team', 'approved', NULL, NULL, NULL, NULL, NULL, '2022-05-05 13:36:13', '2023-09-27 02:12:43', '{inna.bauman@gmail.com,dibaunaumh@gmail.com}', 'g/fromTeal/l0/test1', 'g', 0, 1, '{"{\"say_speaker\":\"bldg_server\",\"say_text\":\"create bldg a-stage done\",\"say_time\":1695341403333}","{\"say_speaker\":\"bldg_server\",\"say_text\":\"create bldg chahir done\",\"say_time\":1695311146637}"}'); +INSERT INTO public.bldgs VALUES (1094, 'g/b(16,92)/l0/b(-10,12)/l0/b(27,11)', 'g/b(16,92)/l0/b(-10,12)/l0', 27, 1, true, 'a-stage', NULL, 'problem', 'approved', NULL, NULL, 'a stage with objects on top of', NULL, NULL, '2023-09-27 02:12:43', '2023-09-27 02:12:43', '{dibaunaumh@gmail.com}', 'g/fromTeal/l0/test1/l0/a-stage', 'g/fromTeal/l0/test1/l0', 0, 3, NULL); +INSERT INTO public.bldgs VALUES (1092, 'g/b(50,21)/l0/b(10,5)', 'g/b(50,21)/l0', 10, 5, false, 'boan', NULL, 'purpose', 'approved', NULL, NULL, 'da boan', NULL, NULL, '2023-09-21 15:42:44', '2023-09-21 15:42:44', '{dibaunaumh@gmail.com}', 'g/cabinet/l0/boan', 'g/cabinet/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1095, 'g/b(126,27)', 'g', 126, 27, false, 'da-prob', NULL, 'problem', 'approved', NULL, NULL, 'da problem container', NULL, NULL, '2023-10-10 01:52:57', '2023-10-10 01:52:57', '{dibaunaumh@gmail.com}', 'g/da-prob', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (1086, 'g/b(60,11)/l1/b(-15,0)', 'g/b(60,11)/l1', 15, 0, false, 'da-test', NULL, 'purpose', 'approved', NULL, NULL, 'da test purpose!!!', NULL, NULL, '2023-09-20 03:31:41', '2023-09-20 03:31:41', '{dibaunaumh@gmail.com}', 'g/da-2nd-prob/l1/da-test', 'g/da-2nd-prob/l1', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1087, 'g/b(60,11)/l1/b(-5,0)', 'g/b(60,11)/l1', -5, 0, false, 'north-star', NULL, 'purpose', 'approved', NULL, NULL, 'da north star', NULL, NULL, '2023-09-21 15:11:05', '2023-09-21 15:11:05', '{dibaunaumh@gmail.com}', 'g/da-2nd-prob/l1/north-star', 'g/da-2nd-prob/l1', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1088, 'g/b(60,11)/l0/b(2,0)', 'g/b(60,11)/l0', 2, 0, false, 'dawg', NULL, 'purpose', 'approved', NULL, NULL, 'da dawg', NULL, NULL, '2023-09-21 15:12:59', '2023-09-21 15:12:59', '{dibaunaumh@gmail.com}', 'g/da-2nd-prob/l0/dawg', 'g/da-2nd-prob/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1089, 'g/b(60,11)/l0/b(10,0)', 'g/b(60,11)/l0', 10, 0, false, 'raos', NULL, 'purpose', 'approved', NULL, NULL, 'da roas', NULL, NULL, '2023-09-21 15:15:41', '2023-09-21 15:15:41', '{dibaunaumh@gmail.com}', 'g/da-2nd-prob/l0/raos', 'g/da-2nd-prob/l0', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1100, 'g/b(60,11)', 'g', 60, 11, true, 'da-2nd-prob', NULL, 'problem', 'approved', NULL, NULL, 'another secondary problem', NULL, '{"flr_height": 0.7, "flr0_height": 0}', '2023-10-11 00:42:26', '2023-10-11 00:42:26', '{dibaunaumh@gmail.com}', 'g/da-2nd-prob', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (1101, 'g/b(50,21)', 'g', 50, 11, true, 'cabinet', NULL, 'sales', 'approved', NULL, NULL, 'a cabinet with shelves', NULL, '{"flr_height": 0.35, "flr0_height": 0.05}', '2023-10-16 04:21:24', '2023-10-16 04:21:24', '{dibaunaumh@gmail.com}', 'g/cabinet', 'g', 0, 1, NULL); +INSERT INTO public.bldgs VALUES (1090, 'g/b(50,21)/l2/b(-13,-4)', 'g/b(50,21)/l2', -13, -4, false, 'flip', NULL, 'purpose', 'approved', NULL, NULL, 'flop', NULL, NULL, '2023-09-21 15:19:21', '2023-09-21 15:19:21', '{dibaunaumh@gmail.com}', 'g/cabinet/l2/flip', 'g/cabinet/l2', 0, 2, NULL); +INSERT INTO public.bldgs VALUES (1091, 'g/b(50,21)/l1/b(0,-4)', 'g/b(50,21)/l1', 0, -4, false, 'wall', NULL, 'purpose', 'approved', NULL, NULL, 'the wall', NULL, NULL, '2023-09-21 15:22:46', '2023-09-21 15:22:46', '{dibaunaumh@gmail.com}', 'g/cabinet/l1/wall', 'g/cabinet/l1', 0, 2, NULL); + + +-- +-- TOC entry 3613 (class 0 OID 16404) +-- Dependencies: 213 +-- Data for Name: residents; Type: TABLE DATA; Schema: public; Owner: udi +-- + +INSERT INTO public.residents VALUES (2, 'inna.bauman@gmail.com', 'inna', 'Inna Bauman', 'g/b(28,46)/l0/b(2,5)', false, 'g/b(28,46)', 'g', 28, 46, 0, NULL, NULL, NULL, NULL, '2022-03-29 20:09:08', '2022-03-29 20:09:08', 'g', 0, 0); +INSERT INTO public.residents VALUES (3, 'neilbauman.123@gmail.com', 'neil', 'Neil Bauman', 'g/b(12,42)/l0/b(2,5)', false, 'g/b(16,92)/l0/b(10,10)', 'g/b(16,92)/l0', 10, 10, 0, NULL, NULL, NULL, NULL, '2022-05-12 00:30:23', '2022-05-12 00:30:23', 'g/fromTeal/l0', 0, 0); +INSERT INTO public.residents VALUES (1, 'dibaunaumh@gmail.com', 'dibau', 'Udi Bauman', 'g/b(17,24)/l0/b(4,5)', true, 'g', 'g', 8, 40, 200, '{"{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name ffff and summary ffff\",\"say_time\":1699647584224}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/connect between fromteal and gould\",\"say_time\":1699647475576}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name serhii and summary some purpose bldg\",\"say_time\":1699646592655}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(13,5)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create action bldg with name action1 and summary some action\",\"say_time\":1697006432584}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(50,21)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create sales bldg with name cabinet and summary a cabinet with shelves\",\"say_time\":1696996319913}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(42,12)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create product bldg with name da-2nd-prob and summary another secondary problem\",\"say_time\":1696932791124}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(43,84)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create goal bldg with name goaly1 and summary goaly !!!\",\"say_time\":1696904033509}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(32,82)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create problem bldg with name your-problem and summary this is your problem\",\"say_time\":1696903962075}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(76,84)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create problem bldg with name da-1st-problem and summary a 1st problem\",\"say_time\":1695656657960}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(70,79)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create problem bldg with name da-prob and summary a problem!\",\"say_time\":1695656324695}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g\",\"say_flr_url\":\"g\",\"say_location\":\"g/b(70,79)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create problem bldg with name da-prob and summary da problem container\",\"say_time\":1695656295454}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(27,11)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create problem bldg with name a-stage and summary a stage with objects on top of\",\"say_time\":1695341403325}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(19,-23)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name chahir and summary da chahir\",\"say_time\":1695311146621}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(6,3)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name boan and summary da boan\",\"say_time\":1695310964135}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-3,0)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name wall and summary the wall\",\"say_time\":1695309766588}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-13,6)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name flip and summary flop\",\"say_time\":1695309561575}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-21,-20)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name raos and summary da roas\",\"say_time\":1695309341760}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-39,-23)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name dawg and summary da dawg\",\"say_time\":1695309179248}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-45,-26)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name north-star and summary da north star\",\"say_time\":1695309065238}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-52,-22)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name da-test and summary da test purpose!!!\",\"say_time\":1695180701730}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-2,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694231579019}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-2,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694230074177}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-2,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"\",\"say_time\":1694229744241}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-2,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694229743257}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-37,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694227636929}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-37,1)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694227134922}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-38,-7)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694225855850}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-24,-12)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create team bldg with name titanic-passangers and website https://titanic.io and summary visualization of titanic passengers\",\"say_time\":1694188340387}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-18,19)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694186444204}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-21,11)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694102354649}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-37,-7)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694102201401}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-38,-9)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1694101151943}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-35,-15)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686071167653}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-34,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create purpose bldg with name john-doe and summary john doe\",\"say_time\":1686070585063}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-34,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686070394115}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-34,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686069142137}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-34,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686063527340}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-34,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/what time is it\",\"say_time\":1686063512625}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-35,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686012560801}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-35,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686011767653}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-35,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/visualize dataset\",\"say_time\":1686011603002}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-36,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/what time is it?\",\"say_time\":1685544973732}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-36,-8)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/what time is it?\",\"say_time\":1685544768360}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-38,0)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create decision bldg with name dataset-assistant and summary an assistant for visualiing datasets\",\"say_time\":1685544750064}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0/b(-10,12)/l0\",\"say_flr_url\":\"g/fromTeal/l0/test1/l0\",\"say_location\":\"g/b(16,92)/l0/b(-10,12)/l0/b(-40,32)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/create decision bldg with name dataset-assistant and summary a poc assistant for visualizing datasets\",\"say_time\":1685544447858}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0\",\"say_location\":\"g/b(16,92)/l0/b(18,25)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"/what time is it?\",\"say_time\":1685542957698}","{\"action_type\":\"SAY\",\"bldg_url\":\"\",\"resident_email\":\"dibaunaumh@gmail.com\",\"say_flr\":\"g/b(16,92)/l0\",\"say_flr_url\":\"g/fromTeal/l0\",\"say_location\":\"g/b(16,92)/l0/b(18,25)\",\"say_mimetype\":\"text/plain\",\"say_recipient\":\"\",\"say_speaker\":\"dibau\",\"say_text\":\"what time is it?\",\"say_time\":1685542909840}"}', NULL, '48d77bb2-1097-4215-aa01-8b00cbd61ba0', '2023-12-16 17:07:04', '2022-03-28 19:42:16', '2023-12-16 17:07:14', 'g', 0, 0); + + +-- +-- TOC entry 3615 (class 0 OID 16423) +-- Dependencies: 216 +-- Data for Name: roads; Type: TABLE DATA; Schema: public; Owner: udi +-- + +INSERT INTO public.roads VALUES (1, 'g', 'g/b(16,92)', 'g/b(-44,133)', 16, 92, -44, 133, '2022-05-05 14:01:26', '2022-05-05 14:01:26', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (2, 'g/b(16,92)/l0', 'g/b(16,92)/l0/b(-10,12)', 'g/b(16,92)/l0/b(34,16)', -10, 12, 34, 16, '2022-05-21 03:21:32', '2022-05-21 03:21:32', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (3, 'g', 'g/b(-10,230)', 'g/b(-70,202)', -10, 230, -70, 202, '2022-05-22 01:35:58', '2022-05-22 01:35:58', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (4, 'g', 'g/b(-82,101)', 'g/b(-70,202)', -82, 101, -70, 202, '2022-05-22 01:36:48', '2022-05-22 01:36:48', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (5, 'g', 'g/b(-45,142)/l0/b(-8,23)', 'g/b(-132,157)', -8, 23, -132, 157, '2022-05-27 18:08:39', '2022-05-27 18:08:39', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (6, 'g', 'g/b(16,92)', 'g/b(117,143)', 16, 92, 117, 143, '2022-07-29 20:21:05', '2022-07-29 20:21:05', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (7, 'g', 'g/b(162,177)', 'g/b(16,92)', 162, 177, 16, 92, '2022-08-03 20:12:32', '2022-08-03 20:12:32', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (8, 'g', 'g/b(226,230)', 'g/b(216,228)', 226, 230, 216, 228, '2022-08-05 18:18:14', '2022-08-05 18:18:14', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (9, 'g', 'g/b(235,199)', 'g/b(245,183)', 235, 199, 245, 183, '2022-08-05 21:20:49', '2022-08-05 21:20:49', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (10, 'g', 'g/b(-45,142)', 'g/b(-10,230)', -45, 142, -10, 230, '2022-09-14 05:46:01', '2022-09-14 05:46:01', '{dibaunaumh@gmail.com}'); +INSERT INTO public.roads VALUES (11, 'g', 'g/b(-45,142)', 'g/b(42,136)', -45, 142, 42, 136, '2022-09-16 03:54:21', '2022-09-16 03:54:21', '{dibaunaumh@gmail.com}'); + + +-- +-- TOC entry 3627 (class 0 OID 0) +-- Dependencies: 217 +-- Name: batteries_id_seq; Type: SEQUENCE SET; Schema: public; Owner: udi +-- + +SELECT pg_catalog.setval('public.batteries_id_seq', 76, true); + + +-- +-- TOC entry 3628 (class 0 OID 0) +-- Dependencies: 210 +-- Name: bldgs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: udi +-- + +SELECT pg_catalog.setval('public.bldgs_id_seq', 1102, true); + + +-- +-- TOC entry 3629 (class 0 OID 0) +-- Dependencies: 212 +-- Name: residents_id_seq; Type: SEQUENCE SET; Schema: public; Owner: udi +-- + +SELECT pg_catalog.setval('public.residents_id_seq', 3, true); + + +-- +-- TOC entry 3630 (class 0 OID 0) +-- Dependencies: 215 +-- Name: roads_id_seq; Type: SEQUENCE SET; Schema: public; Owner: udi +-- + +SELECT pg_catalog.setval('public.roads_id_seq', 11, true); + + + + +-- Completed on 2024-01-03 08:46:32 PST + +-- +-- PostgreSQL database dump complete +-- + diff --git a/bldg_server/docker-compose.yml b/bldg_server/docker-compose.yml index 64cfd4b..17161e1 100644 --- a/bldg_server/docker-compose.yml +++ b/bldg_server/docker-compose.yml @@ -1,32 +1,45 @@ -version: '3.1' +version: "3.2" services: - - database: + db: image: postgres restart: always environment: - POSTGRES_USER: ${DB_USER} - POSTGRES_PASSWORD: ${DB_PASSWORD} - POSTGRES_DB: bldg_server_prod - PGDATA: /var/lib/postgresql/data/pgdata - volumes: - - db_data:/var/lib/postgresql/data + POSTGRES_USER: postgres + POSTGRES_PASSWORD: + POSTGRES_HOST_AUTH_METHOD: trust + ports: + - "5432:5432" + volumes: + - ./devops/db/initial_db_data.sql:/docker-entrypoint-initdb.d/initial_db_data.sql + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 web: - image: bldg-server - restart: always + image: dibaunaumh/bldg-server:v063 + volumes: + - type: bind + source: . + target: /app ports: - - ${APP_PORT}:${APP_PORT} - environment: - APP_HOSTNAME: ${APP_HOSTNAME} - APP_PORT: ${APP_PORT} - DB_USER: ${DB_USER} - DB_PASSWORD: ${DB_PASSWORD} - DB_HOST: ${DB_HOST} - SECRET_KEY_BASE: ${SECRET_KEY_BASE} + - "4000:4000" + - "4443:4443" + env_file: docker.env depends_on: - - database + db: + condition: service_healthy + # command: + # - ./run.sh + redis: + image: redis + container_name: redis-server + ports: + - "6379:6379" + volumes: + - redis-data:/data volumes: - db_data: \ No newline at end of file + redis-data: \ No newline at end of file diff --git a/bldg_server/docker.env b/bldg_server/docker.env new file mode 100644 index 0000000..92157f7 --- /dev/null +++ b/bldg_server/docker.env @@ -0,0 +1,10 @@ +APP_HOSTNAME=localhost +APP_PORT=4443 +DB_USER=postgres +DB_PASSWORD= +DB_HOST=db +DB_PORT=5432 +DB_NAME=bldg_server_dev +DB_SSL=false +SECRET_KEY_BASE=notsecret +SENDGRID_API_KEY=notapikey \ No newline at end of file diff --git a/bldg_server/entrypoint.sh b/bldg_server/entrypoint.sh index fcfc7e3..09a8d22 100755 --- a/bldg_server/entrypoint.sh +++ b/bldg_server/entrypoint.sh @@ -10,6 +10,6 @@ do done -./prod/rel/bldg_server/bin/bldg_server eval BldgServer.Release.migrate +./dev/rel/bldg_server/bin/bldg_server eval BldgServer.Release.migrate -./prod/rel/bldg_server/bin/bldg_server start +./dev/rel/bldg_server/bin/bldg_server start diff --git a/bldg_server/lib/bldg_server/buildings.ex b/bldg_server/lib/bldg_server/buildings.ex index 0ae2a91..a5f7478 100644 --- a/bldg_server/lib/bldg_server/buildings.ex +++ b/bldg_server/lib/bldg_server/buildings.ex @@ -63,6 +63,57 @@ defmodule BldgServer.Buildings do Repo.all(q) end + def notify_bldg_change({:error, created_bldg}, action, subject) do + # notification parameters + # %BldgServer.Buildings.Bldg{name: name, flr: container_flr, flr_url: container_flr_url} = created_bldg + IO.puts("~~~~~ at notify_bldg_change - FAILURE: #{subject}") + # container_addr = get_container(container_flr) + # IO.puts("~~~~ container_addr: #{inspect(container_addr)}") + # container = get_bldg!(container_addr) + # msg = %{ + # "say_speaker" => "bldg_server", + # "say_text" => "/notify #{action} failed: #{subject}", + # "action_type" => "SAY", + # "bldg_url" => "", + # "say_flr" => container_flr, + # "say_flr_url" => container_flr_url, + # "say_mimetype" => "text/plain", + # "say_recipient" => "", + # "say_time" => 0, + # "resident_email" => "bldg_server", + # "say_location" => "" + # } + # say(container, msg) + end + + def notify_bldg_change({:ok, created_bldg}, action, subject) do + # notification parameters + %BldgServer.Buildings.Bldg{name: name, flr: container_flr, flr_url: container_flr_url} = created_bldg + IO.puts("~~~~~ at notify_bldg_change - SUCCESS: #{name}") + container_addr = get_container(container_flr) + IO.puts("~~~~ container_addr: #{inspect(container_addr)}") + if container_addr != "" do + # TODO handle the case where the container is g + container = get_bldg!(container_addr) + msg = %{ + "say_speaker" => "bldg_server", + "say_text" => "/notify #{action} done: #{subject}", + "action_type" => "SAY", + "bldg_url" => "", + "say_flr" => container_flr, + "say_flr_url" => container_flr_url, + "say_mimetype" => "text/plain", + "say_recipient" => "", + "say_time" => 0, + "resident_email" => "bldg_server", + "say_location" => "" + } + say(container, msg) + # recurse to parent container + notify_bldg_change({:ok, container}, action, subject) + end + end + @doc """ Creates a bldg. @@ -78,8 +129,13 @@ defmodule BldgServer.Buildings do def create_bldg(attrs \\ %{}) do cs = %Bldg{} |> Bldg.changeset(attrs) + # TODO figure out better way to notify bldg_url & address + created_bldg_url = attrs["bldg_url"] + created_bldg_address = attrs["address"] + created_bldg_ids = "#{created_bldg_url}|#{created_bldg_address}" case cs.errors do [] -> Repo.insert(cs) + |> notify_bldg_change("bldg_created", created_bldg_ids) _ -> IO.inspect(cs.errors) raise "Failed to prepare bldg for writing to database" @@ -99,9 +155,11 @@ defmodule BldgServer.Buildings do """ def update_bldg(%Bldg{} = bldg, attrs) do + # IO.puts("~~~~ updating bldg #{bldg.name} with attrs: #{inspect(attrs)}") bldg |> Bldg.changeset(attrs) |> Repo.update() + # TODO invoke notify_bldg_change but avoid recursion end @doc """ @@ -133,13 +191,27 @@ defmodule BldgServer.Buildings do Bldg.changeset(bldg, %{}) end + # This didn't work - update wasn't really applied + # def update_containers({:ok, %Bldg{} = bldg}) do + # # Update the updated_at field of all containers of + # # the given bldg + # IO.puts("~~~~ updating containers called for bldg: #{bldg.name}") + # container_addr = get_container(bldg.flr) + # IO.puts("~~~~ the container_addr of #{bldg.name} is: #{inspect(container_addr)}") + # if container_addr != "" do + # get_bldg!(container_addr) + # |> update_bldg(%{"updated_at" => DateTime.utc_now()}) + # |> update_containers() # continue recursively to next container + # end + # end + # UTILS def extract_coords(addr) do # get the coords from the last part of the address: "g/b(17,24)/l0/b(-11,6)" -> ["-11","6] [x_s, y_s] = addr - |> String.split(address_delimiter) + |> String.split(address_delimiter()) |> List.last() |> String.slice(2..-2) |> String.split(",") @@ -150,7 +222,7 @@ defmodule BldgServer.Buildings do def extract_flr_level(flr) do l_s = case flr do "g" -> "0" - _ -> flr |> String.split(address_delimiter) |> List.last() |> String.slice(1..-1) + _ -> flr |> String.split(address_delimiter()) |> List.last() |> String.slice(1..-1) end {level, ""} = Integer.parse(l_s) level @@ -163,11 +235,11 @@ defmodule BldgServer.Buildings do def get_container(addr) do addr - |> String.split(address_delimiter) + |> String.split(address_delimiter()) |> Enum.reverse() |> tl() |> Enum.reverse() - |> Enum.join(address_delimiter) + |> Enum.join(address_delimiter()) end def get_container_flr(addr) do @@ -218,11 +290,11 @@ defmodule BldgServer.Buildings do %{"container_web_url" => container} = entity entity_bldg = Buildings.get_by_web_url(container) # TODO handle the case the container bldg doesn't exist - {"#{entity_bldg.address}#{Buildings.address_delimiter}l0", "#{entity_bldg.bldg_url}#{Buildings.address_delimiter}l0", 0} + {"#{entity_bldg.address}#{address_delimiter()}l0", "#{entity_bldg.bldg_url}#{address_delimiter()}l0", 0} Map.has_key?(entity, "container_bldg_url") -> %{"container_bldg_url" => container} = entity entity_bldg = Buildings.get_by_bldg_url(container) - {"#{entity_bldg.address}#{Buildings.address_delimiter}l0", "#{entity_bldg.bldg_url}#{Buildings.address_delimiter}l0", 0} + {"#{entity_bldg.address}#{address_delimiter()}l0", "#{entity_bldg.bldg_url}#{address_delimiter()}l0", 0} Map.has_key?(entity, "flr") and Map.has_key?(entity, "flr_url") -> level = extract_flr_level(Map.get(entity, "flr")) {Map.get(entity, "flr"), Map.get(entity, "flr_url"), level} @@ -238,7 +310,7 @@ defmodule BldgServer.Buildings do Map.has_key?(entity, "bldg_url") -> Map.get(entity, "bldg_url") Map.has_key?(entity, "flr_url") and Map.has_key?(entity, "name") -> - "#{Map.get(entity, "flr_url")}#{address_delimiter}#{Map.get(entity, "name")}" + "#{Map.get(entity, "flr_url")}#{address_delimiter()}#{Map.get(entity, "name")}" true -> "g" end @@ -319,15 +391,45 @@ Given an entity: def calculate_nesting_depth(entity) do num_slashes = Map.get(entity, "address") - |> String.split(address_delimiter) + |> String.split(address_delimiter()) |> Enum.drop(1) |> length() depth = case num_slashes do 0 -> 0 - _ -> trunc((num_slashes + 1) / 2) + _ -> trunc(num_slashes / 2) end Map.put(entity, "nesting_depth", depth) end + # TODO get this from config + + def add_composite_bldg_metadata(%{"entity_type" => "problem"} = entity) do + entity + |> Map.put("is_composite", true) + |> Map.put("data", "{\"flr_height\": \"1.08\", \"flr0_height\": \"0.03\"}") + end + + def add_composite_bldg_metadata(%{"entity_type" => "milestone"} = entity) do + entity + |> Map.put("is_composite", true) + |> Map.put("data", "{\"flr_height\": \"0.63\", \"flr0_height\": \"0.0\"}") + end + + def add_composite_bldg_metadata(%{"entity_type" => "sales"} = entity) do + entity + |> Map.put("is_composite", true) + |> Map.put("data", "{\"flr_height\": 0.356, \"flr0_height\": \"0.05\"}") + end + + def add_composite_bldg_metadata(%{"entity_type" => "team"} = entity) do + entity + |> Map.put("is_composite", true) + |> Map.put("data", "{\"flr_height\": \"0.9\", \"flr0_height\": \"0.05\"}") + end + + def add_composite_bldg_metadata(entity) do + Map.put(entity, "is_composite", false) + end + def remove_build_params(entity) do Map.delete(entity, "container_web_url") @@ -365,6 +467,7 @@ Given an entity: |> figure_out_bldg_url() |> decide_on_location() |> calculate_nesting_depth() + |> add_composite_bldg_metadata() |> remove_build_params() end @@ -388,7 +491,10 @@ Given an entity: |> Map.merge(%{"say_time" => System.system_time(:millisecond)}) |> JSON.encode() - new_prev_messages = append_message_to_list(bldg.previous_messages, text) + prev_messages = Utils.limit_list_to(bldg.previous_messages, 100) + IO.puts("~~~~~ reduced list size to: #{Enum.count(prev_messages)}") + + new_prev_messages = append_message_to_list(prev_messages, text) changes = %{previous_messages: new_prev_messages} result = update_bldg(bldg, changes) diff --git a/bldg_server/lib/bldg_server/residents.ex b/bldg_server/lib/bldg_server/residents.ex index 1183075..0b4abb6 100644 --- a/bldg_server/lib/bldg_server/residents.ex +++ b/bldg_server/lib/bldg_server/residents.ex @@ -186,12 +186,27 @@ defmodule BldgServer.Residents do update_resident(resident, changes) end - def enter_bldg(%Resident{} = resident, address, bldg_url) do + def calculate_nesting_depth_from_address(address) do + num_slashes = address + |> String.split(Buildings.address_delimiter) + |> Enum.drop(1) |> length() + case num_slashes do + 0 -> 0 + _ -> trunc((num_slashes + 1) / 2) + end + end + + def enter_bldg_flr(%Resident{} = resident, address, bldg_url, flr_level) do {initial_x, initial_y} = {8, 40} # TODO read from config, per bldg type - changes = %{flr: "#{address}/l0", flr_url: "#{bldg_url}/l0", location: "#{address}/l0/b(#{initial_x},#{initial_y})", x: initial_x, y: initial_y} + nesting_depth = calculate_nesting_depth_from_address(address) + changes = %{flr: "#{address}/l#{flr_level}", flr_url: "#{bldg_url}/l#{flr_level}", location: "#{address}/l#{flr_level}/b(#{initial_x},#{initial_y})", x: initial_x, y: initial_y, nesting_depth: nesting_depth} update_resident(resident, changes) end + def enter_bldg(%Resident{} = resident, address, bldg_url) do + enter_bldg_flr(resident, address, bldg_url, 0) + end + def exit_bldg(%Resident{} = resident, address, bldg_url) do # get the container flr container_flr = Buildings.get_container_flr(address) @@ -200,9 +215,10 @@ defmodule BldgServer.Residents do # determine the location next to the door of the bldg exited {x, y} = Buildings.extract_coords(address) new_x = x - new_y = y + 6 + new_y = y + 2 + nesting_depth = calculate_nesting_depth_from_address(container_flr) - changes = %{flr: container_flr, flr_url: container_flr_url, location: "#{container_flr}/b(#{new_x},#{new_y})", x: new_x, y: new_y} + changes = %{flr: container_flr, flr_url: container_flr_url, location: "#{container_flr}/b(#{new_x},#{new_y})", x: new_x, y: new_y, nesting_depth: nesting_depth} update_resident(resident, changes) end @@ -221,13 +237,15 @@ defmodule BldgServer.Residents do def is_command(msg_text), do: String.at(msg_text, 0) == "/" - def say(%Resident{} = resident, msg) do {_, text} = msg |> Map.merge(%{"say_time" => System.system_time(:millisecond)}) |> JSON.encode() - new_prev_messages = append_message_to_list(resident.previous_messages, text) + prev_messages = Utils.limit_list_to(resident.previous_messages, 100) + IO.puts("~~~~~ reduced list size to: #{Enum.count(prev_messages)}") + + new_prev_messages = append_message_to_list(prev_messages, text) changes = %{previous_messages: new_prev_messages} result = update_resident(resident, changes) diff --git a/bldg_server/lib/bldg_server/residents/resident.ex b/bldg_server/lib/bldg_server/residents/resident.ex index 50f3eaf..8f278ad 100644 --- a/bldg_server/lib/bldg_server/residents/resident.ex +++ b/bldg_server/lib/bldg_server/residents/resident.ex @@ -18,6 +18,7 @@ defmodule BldgServer.Residents.Resident do field :x, :integer field :y, :integer field :flr_url, :string + field :nesting_depth, :integer timestamps() end @@ -25,7 +26,7 @@ defmodule BldgServer.Residents.Resident do @doc false def changeset(resident, attrs) do resident - |> cast(attrs, [:email, :alias, :name, :home_bldg, :is_online, :location, :direction, :previous_messages, :other_attributes, :session_id, :last_login_at, :flr, :flr_url, :x, :y]) + |> cast(attrs, [:email, :alias, :name, :home_bldg, :is_online, :location, :direction, :previous_messages, :other_attributes, :session_id, :last_login_at, :flr, :flr_url, :x, :y, :nesting_depth]) |> validate_required([:email, :alias, :name, :home_bldg]) |> unique_constraint(:email) end diff --git a/bldg_server/lib/bldg_server_web.ex b/bldg_server/lib/bldg_server_web.ex index 267e8dd..2b42b1f 100644 --- a/bldg_server/lib/bldg_server_web.ex +++ b/bldg_server/lib/bldg_server_web.ex @@ -22,7 +22,6 @@ defmodule BldgServerWeb do use Phoenix.Controller, namespace: BldgServerWeb import Plug.Conn - import BldgServerWeb.Gettext alias BldgServerWeb.Router.Helpers, as: Routes end end @@ -37,7 +36,6 @@ defmodule BldgServerWeb do import Phoenix.Controller, only: [get_flash: 1, get_flash: 2, view_module: 1] import BldgServerWeb.ErrorHelpers - import BldgServerWeb.Gettext alias BldgServerWeb.Router.Helpers, as: Routes end end @@ -53,7 +51,6 @@ defmodule BldgServerWeb do def channel do quote do use Phoenix.Channel - import BldgServerWeb.Gettext end end diff --git a/bldg_server/lib/bldg_server_web/battery_chat_dispatcher.ex b/bldg_server/lib/bldg_server_web/battery_chat_dispatcher.ex index f6d3b36..2500b62 100644 --- a/bldg_server/lib/bldg_server_web/battery_chat_dispatcher.ex +++ b/bldg_server/lib/bldg_server_web/battery_chat_dispatcher.ex @@ -22,11 +22,11 @@ defmodule BldgServerWeb.BatteryChatDispatcher do def send_message_to_battery(callback_url, msg) do - Logger.info("~~~~~ About to invoke battery callback URL at: #{callback_url}") - header_key = "content-type" - header_val = "application/json" {_, msg_json} = Jason.encode(msg) + IO.puts("~~~~~ About to invoke battery callback URL at: #{callback_url}") IO.inspect(msg_json) + header_key = "content-type" + header_val = "application/json" Finch.build(:post, callback_url, [{header_key, header_val}], msg_json) |> Finch.request(FinchClient) |> IO.inspect() @@ -36,7 +36,8 @@ defmodule BldgServerWeb.BatteryChatDispatcher do #def handle_info({sender, message, flr}, state) do def handle_info(%{event: "new_message", payload: new_message}, state) do #Logger.info("chat message received at #{flr} from #{sender}: #{message}") - Logger.info("~~~~~~~~~~~ [battery chat dispatcher] chat message received: #{new_message["message"]}") + IO.puts("~~~~~~~~~~~ [battery chat dispatcher] chat message received:") + IO.inspect(new_message) # query for all batteries inside that message flr # & invoke the callback url per each battery, with the message details in the body diff --git a/bldg_server/lib/bldg_server_web/bldg_command_executor.ex b/bldg_server/lib/bldg_server_web/bldg_command_executor.ex index caebff0..08917b4 100644 --- a/bldg_server/lib/bldg_server_web/bldg_command_executor.ex +++ b/bldg_server/lib/bldg_server_web/bldg_command_executor.ex @@ -114,11 +114,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "name" => name, @@ -143,11 +145,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "web_url" => website, @@ -173,11 +177,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "name" => name, @@ -202,11 +208,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "web_url" => website, @@ -233,11 +241,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "name" => name, @@ -263,11 +273,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "name" => name, @@ -292,11 +304,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "web_url" => website, @@ -322,11 +336,13 @@ defmodule BldgServerWeb.BldgCommandExecutor do else # TODO if creating under a given bldg, send its container_web_url instead of flr - {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-10) + {x, y} = Buildings.extract_coords(msg["say_location"]) |> Buildings.move_from_speaker(-4) + flr = msg["say_flr"] + updated_location = "#{flr}#{Buildings.address_delimiter}b(#{x},#{y})" entity = %{ - "flr" => msg["say_flr"], + "flr" => flr, "flr_url" => msg["say_flr_url"], - "address" => msg["say_location"], + "address" => updated_location, "x" => x, "y" => y, "web_url" => website, @@ -411,6 +427,10 @@ defmodule BldgServerWeb.BldgCommandExecutor do end end + def execute_command(msg_parts, _msg) do + Logger.info("Ignoring unknown command:") + IO.inspect(msg_parts) + end #def handle_info({sender, message, flr}, state) do def handle_info(%{event: "new_message", payload: new_message}, state) do diff --git a/bldg_server/lib/bldg_server_web/controllers/bldg_controller.ex b/bldg_server/lib/bldg_server_web/controllers/bldg_controller.ex index 7dba322..04323a4 100644 --- a/bldg_server/lib/bldg_server_web/controllers/bldg_controller.ex +++ b/bldg_server/lib/bldg_server_web/controllers/bldg_controller.ex @@ -46,8 +46,10 @@ defmodule BldgServerWeb.BldgController do def look(conn, %{"flr" => flr}) do # unescape the flr parameter decoded_flr = URI.decode(flr) + container_bldg_addr = Buildings.get_flr_bldg(decoded_flr) + container = Buildings.get_bldg!(container_bldg_addr) bldgs = Buildings.list_bldgs_in_flr(decoded_flr) - render(conn, "look.json", bldgs: bldgs) + render(conn, "look.json", bldgs: [container | bldgs]) end diff --git a/bldg_server/lib/bldg_server_web/controllers/resident_controller.ex b/bldg_server/lib/bldg_server_web/controllers/resident_controller.ex index 1d00ac9..acc5d5b 100644 --- a/bldg_server/lib/bldg_server_web/controllers/resident_controller.ex +++ b/bldg_server/lib/bldg_server_web/controllers/resident_controller.ex @@ -169,6 +169,21 @@ defmodule BldgServerWeb.ResidentController do end end + # ENTER_BLDG_FLR action + def act(conn, %{"resident_email" => email, "action_type" => "ENTER_BLDG_FLR", "bldg_address" => address, "bldg_url" => bldg_url, "flr_level" => flr_level}) do + resident = Residents.get_resident_by_email!(email) + # TODO validate that the resident is authorized to enter the given bldg + + with {:ok, %Resident{} = upd_rsdt} <- Residents.enter_bldg_flr(resident, address, bldg_url, flr_level) do + IO.puts("enter_bldg_flr action") + IO.inspect(upd_rsdt) + conn + |> put_status(:ok) + |> put_resp_header("location", Routes.resident_path(conn, :show, upd_rsdt)) + |> render("show.json", resident: upd_rsdt) + end + end + # EXIT_BLDG action def act(conn, %{"resident_email" => email, "action_type" => "EXIT_BLDG", "bldg_address" => address, "bldg_url" => bldg_url}) do resident = Residents.get_resident_by_email!(email) diff --git a/bldg_server/lib/bldg_server_web/gettext.ex b/bldg_server/lib/bldg_server_web/gettext.ex deleted file mode 100644 index 9f425ea..0000000 --- a/bldg_server/lib/bldg_server_web/gettext.ex +++ /dev/null @@ -1,24 +0,0 @@ -defmodule BldgServerWeb.Gettext do - @moduledoc """ - A module providing Internationalization with a gettext-based API. - - By using [Gettext](https://hexdocs.pm/gettext), - your module gains a set of macros for translations, for example: - - import BldgServerWeb.Gettext - - # Simple translation - gettext("Here is the string to translate") - - # Plural translation - ngettext("Here is the string to translate", - "Here are the strings to translate", - 3) - - # Domain-based translation - dgettext("errors", "Here is the error message to translate") - - See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. - """ - use Gettext, otp_app: :bldg_server -end diff --git a/bldg_server/lib/bldg_server_web/views/error_helpers.ex b/bldg_server/lib/bldg_server_web/views/error_helpers.ex index 99ca20c..6d2ced1 100644 --- a/bldg_server/lib/bldg_server_web/views/error_helpers.ex +++ b/bldg_server/lib/bldg_server_web/views/error_helpers.ex @@ -6,7 +6,7 @@ defmodule BldgServerWeb.ErrorHelpers do @doc """ Translates an error message using gettext. """ - def translate_error({msg, opts}) do + def translate_error({msg, _}) do # When using gettext, we typically pass the strings we want # to translate as a static argument: # @@ -24,10 +24,11 @@ defmodule BldgServerWeb.ErrorHelpers do # Note we use the "errors" domain, which means translations # should be written to the errors.po file. The :count option is # set by Ecto and indicates we should also apply plural rules. - if count = opts[:count] do - Gettext.dngettext(BldgServerWeb.Gettext, "errors", msg, msg, count, opts) - else - Gettext.dgettext(BldgServerWeb.Gettext, "errors", msg, opts) - end + #if count = opts[:count] do + # Gettext.dngettext(BldgServerWeb.Gettext, "errors", msg, msg, count, opts) + #else + # Gettext.dgettext(BldgServerWeb.Gettext, "errors", msg, opts) + #end + msg end end diff --git a/bldg_server/lib/bldg_server_web/views/resident_view.ex b/bldg_server/lib/bldg_server_web/views/resident_view.ex index b5462ad..8719b75 100644 --- a/bldg_server/lib/bldg_server_web/views/resident_view.ex +++ b/bldg_server/lib/bldg_server_web/views/resident_view.ex @@ -29,6 +29,7 @@ defmodule BldgServerWeb.ResidentView do direction: resident.direction, previous_messages: resident.previous_messages, other_attributes: resident.other_attributes, + nesting_depth: resident.nesting_depth, session_id: resident.session_id, last_login_at: resident.last_login_at, updated_at: resident.updated_at diff --git a/bldg_server/lib/utils.ex b/bldg_server/lib/utils.ex index 2714b8d..43bc888 100644 --- a/bldg_server/lib/utils.ex +++ b/bldg_server/lib/utils.ex @@ -4,4 +4,11 @@ defmodule Utils do def is_newer_than_x_minutes_ago(dt, x), do: NaiveDateTime.diff(NaiveDateTime.utc_now(), dt) < (x * 60) + def limit_list_to(list, limit) do + case list do + nil -> [] + _ -> Enum.take(list, limit) + end + end + end diff --git a/bldg_server/mix.exs b/bldg_server/mix.exs index be5c116..a45f75c 100644 --- a/bldg_server/mix.exs +++ b/bldg_server/mix.exs @@ -4,10 +4,10 @@ defmodule BldgServer.MixProject do def project do [ app: :bldg_server, - version: "0.5.6", + version: "0.6.3", elixir: "~> 1.5", elixirc_paths: elixirc_paths(Mix.env()), - compilers: [:phoenix, :gettext] ++ Mix.compilers(), + compilers: [:phoenix] ++ Mix.compilers(), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps() @@ -33,12 +33,12 @@ defmodule BldgServer.MixProject do # Type `mix help deps` for examples and options. defp deps do [ - {:phoenix, "~> 1.5.9"}, + {:phoenix, "~> 1.7.2"}, {:phoenix_pubsub, "~> 2.0"}, {:phoenix_ecto, "~> 4.0"}, - {:ecto_sql, "~> 3.1"}, + {:phoenix_view, "~> 2.0"}, + {:ecto_sql, "~> 3.8"}, {:postgrex, ">= 0.0.0"}, - {:gettext, "~> 0.11"}, {:jason, "~> 1.0"}, {:plug_cowboy, "~> 2.0"}, {:cors_plug, "~> 2.0"}, diff --git a/bldg_server/mix.lock b/bldg_server/mix.lock index 3670202..6e2ed91 100644 --- a/bldg_server/mix.lock +++ b/bldg_server/mix.lock @@ -1,45 +1,46 @@ %{ "bamboo": {:hex, :bamboo, "1.7.1", "7f0946e8c9081ce10d347cdba33c247c7c1c4f7dddc194ab0633603ef879bbdf", [:mix], [{:hackney, ">= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.4", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.1", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "5fb34c3ab638fc409deec47c1e91f9d78ad95bf22ccb153588b434e1ff1aa730"}, "bamboo_smtp": {:hex, :bamboo_smtp, "3.1.3", "215edc205fe3148fd633d45914a525969cceca4b2d2cc50f165d5360951859d7", [:mix], [{:bamboo, "~> 1.7.0", [hex: :bamboo, repo: "hexpm", optional: false]}, {:gen_smtp, "~> 1.1.0", [hex: :gen_smtp, repo: "hexpm", optional: false]}], "hexpm", "b63eff97205a5bb889931f32356eaa9c5504c3495bf1211a608ab9431cfc5877"}, - "castore": {:hex, :castore, "0.1.16", "2675f717adc700475345c5512c381ef9273eb5df26bdd3f8c13e2636cf4cc175", [:mix], [], "hexpm", "28ed2c43d83b5c25d35c51bc0abf229ac51359c170cba76171a462ced2e4b651"}, - "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, - "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, + "castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"}, + "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, "cors_plug": {:hex, :cors_plug, "2.0.3", "316f806d10316e6d10f09473f19052d20ba0a0ce2a1d910ddf57d663dac402ae", [:mix], [{:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ee4ae1418e6ce117fc42c2ba3e6cbdca4e95ecd2fe59a05ec6884ca16d469aea"}, - "cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"}, + "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, - "cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"}, - "db_connection": {:hex, :db_connection, "2.4.2", "f92e79aff2375299a16bcb069a14ee8615c3414863a6fef93156aee8e86c2ff3", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4fe53ca91b99f55ea249693a0229356a08f4d1a7931d8ffa79289b145fe83668"}, - "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, - "ecto": {:hex, :ecto, "3.8.0", "69cb6c9d58f28efd7990982a170c7f3b502933c4cafd16878d1a944b788d659c", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5393e6cdc3c47b5e8fa51554ae091509ae7e339b2dfe4cd00874cd62af35723a"}, - "ecto_sql": {:hex, :ecto_sql, "3.8.0", "b00d2080e523f2aff6100f22305c1c748016570b9cebf5b29cc61d4924b038c2", [:mix], [{:db_connection, "~> 2.5 or ~> 2.4.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.8.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0 or ~> 0.16.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8a273619e05c4924b225d526810641e0bae8b0aa114b9cbe3cc5c70cf9e5d607"}, - "finch": {:hex, :finch, "0.11.0", "622d31c224c801444c6003544fa1964a29551895b45c3543f6e4d8b0dab80f71", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "047550448148d828ddea1fb76fa3f0d2d0742eca6919e548fdd8357630cae449"}, + "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, + "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, + "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, + "ecto": {:hex, :ecto, "3.11.1", "4b4972b717e7ca83d30121b12998f5fcdc62ba0ed4f20fd390f16f3270d85c3e", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebd3d3772cd0dfcd8d772659e41ed527c28b2a8bde4b00fe03e0463da0f1983b"}, + "ecto_sql": {:hex, :ecto_sql, "3.11.1", "e9abf28ae27ef3916b43545f9578b4750956ccea444853606472089e7d169470", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ce14063ab3514424276e7e360108ad6c2308f6d88164a076aac8a387e1fea634"}, + "expo": {:hex, :expo, "0.5.1", "249e826a897cac48f591deba863b26c16682b43711dd15ee86b92f25eafd96d9", [:mix], [], "hexpm", "68a4233b0658a3d12ee00d27d37d856b1ba48607e7ce20fd376958d0ba6ce92b"}, + "finch": {:hex, :finch, "0.16.0", "40733f02c89f94a112518071c0a91fe86069560f5dbdb39f9150042f44dcfb1a", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f660174c4d519e5fec629016054d60edd822cdfe2b7270836739ac2f97735ec5"}, "gen_smtp": {:hex, :gen_smtp, "1.1.1", "bf9303c31735100631b1d708d629e4c65944319d1143b5c9952054f4a1311d85", [:rebar3], [{:hut, "1.3.0", [hex: :hut, repo: "hexpm", optional: false]}, {:ranch, ">= 1.7.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "51bc50cc017efd4a4248cbc39ea30fb60efa7d4a49688986fafad84434ff9ab7"}, - "gettext": {:hex, :gettext, "0.19.1", "564953fd21f29358e68b91634799d9d26989f8d039d7512622efb3c3b1c97892", [:mix], [], "hexpm", "10c656c0912b8299adba9b061c06947511e3f109ab0d18b44a866a4498e77222"}, - "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, - "hpax": {:hex, :hpax, "0.1.1", "2396c313683ada39e98c20a75a82911592b47e5c24391363343bde74f82396ca", [:mix], [], "hexpm", "0ae7d5a0b04a8a60caf7a39fcf3ec476f35cc2cc16c05abea730d3ce6ac6c826"}, - "httpoison": {:hex, :httpoison, "0.13.0", "bfaf44d9f133a6599886720f3937a7699466d23bb0cd7a88b6ba011f53c6f562", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "4846958172d6401c4f34ecc5c2c4607b5b0d90b8eec8f6df137ca4907942ed0f"}, + "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, + "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, "hut": {:hex, :hut, "1.3.0", "71f2f054e657c03f959cf1acc43f436ea87580696528ca2a55c8afb1b06c85e7", [:"erlang.mk", :rebar, :rebar3], [], "hexpm", "7e15d28555d8a1f2b5a3a931ec120af0753e4853a4c66053db354f35bf9ab563"}, - "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, - "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, + "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, + "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "json": {:hex, :json, "1.4.1", "8648f04a9439765ad449bc56a3ff7d8b11dd44ff08ffcdefc4329f7c93843dfa", [:mix], [], "hexpm", "9abf218dbe4ea4fcb875e087d5f904ef263d012ee5ed21d46e9dbca63f053d16"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "mint": {:hex, :mint, "1.4.1", "49b3b6ea35a9a38836d2ad745251b01ca9ec062f7cb66f546bf22e6699137126", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "cd261766e61011a9079cccf8fa9d826e7a397c24fbedf0e11b49312bea629b58"}, - "nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"}, - "nimble_pool": {:hex, :nimble_pool, "0.2.6", "91f2f4c357da4c4a0a548286c84a3a28004f68f05609b4534526871a22053cde", [:mix], [], "hexpm", "1c715055095d3f2705c4e236c18b618420a35490da94149ff8b580a2144f653f"}, - "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, - "phoenix": {:hex, :phoenix, "1.5.13", "d4e0805ec0973bed80d67302631130fb47d75b1a0b7335a0b23c4432b6ce55ee", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1a7c4f1900e6e60bb60ae6680e48418e3f7c360d58bcb9f812487b6d0d281a0f"}, - "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"}, - "plug": {:hex, :plug, "1.13.6", "187beb6b67c6cec50503e940f0434ea4692b19384d47e5fdfd701e93cadb4cc2", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02b9c6b9955bce92c829f31d6284bf53c591ca63c4fb9ff81dfd0418667a34ff"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"}, - "plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"}, - "poison": {:hex, :poison, "4.0.1", "bcb755a16fac91cad79bfe9fc3585bb07b9331e50cfe3420a24bcc2d735709ae", [:mix], [], "hexpm", "ba8836feea4b394bb718a161fc59a288fe0109b5006d6bdf97b6badfcf6f0f25"}, - "postgrex": {:hex, :postgrex, "0.16.2", "0f83198d0e73a36e8d716b90f45f3bde75b5eebf4ade4f43fa1f88c90a812f74", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "a9ea589754d9d4d076121090662b7afe155b374897a6550eb288f11d755acfa0"}, + "mint": {:hex, :mint, "1.5.2", "4805e059f96028948870d23d7783613b7e6b0e2fb4e98d720383852a760067fd", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "d77d9e9ce4eb35941907f1d3df38d8f750c357865353e21d335bdcdf6d892a02"}, + "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_pool": {:hex, :nimble_pool, "1.0.0", "5eb82705d138f4dd4423f69ceb19ac667b3b492ae570c9f5c900bb3d2f50a847", [:mix], [], "hexpm", "80be3b882d2d351882256087078e1b1952a28bf98d0a287be87e4a24a710b67a"}, + "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, + "phoenix": {:hex, :phoenix, "1.7.10", "02189140a61b2ce85bb633a9b6fd02dff705a5f1596869547aeb2b2b95edd729", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "cf784932e010fd736d656d7fead6a584a4498efefe5b8227e9f383bf15bb79d0"}, + "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.3", "86e9878f833829c3f66da03d75254c155d91d72a201eb56ae83482328dc7ca93", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d36c401206f3011fefd63d04e8ef626ec8791975d9d107f9a0817d426f61ac07"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, + "phoenix_template": {:hex, :phoenix_template, "1.0.3", "32de561eefcefa951aead30a1f94f1b5f0379bc9e340bb5c667f65f1edfa4326", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "16f4b6588a4152f3cc057b9d0c0ba7e82ee23afa65543da535313ad8d25d8e2c"}, + "phoenix_view": {:hex, :phoenix_view, "2.0.3", "4d32c4817fce933693741deeb99ef1392619f942633dde834a5163124813aad3", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "cd34049af41be2c627df99cd4eaa71fc52a328c0c3d8e7d4aa28f880c30e7f64"}, + "plug": {:hex, :plug, "1.15.2", "94cf1fa375526f30ff8770837cb804798e0045fd97185f0bb9e5fcd858c792a3", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "02731fa0c2dcb03d8d21a1d941bdbbe99c2946c0db098eee31008e04c6283615"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, + "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, + "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, - "telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, + "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, "uuid": {:hex, :uuid, "1.1.8", "e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9", [:mix], [], "hexpm", "c790593b4c3b601f5dc2378baae7efaf5b3d73c4c6456ba85759905be792f2ac"}, + "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, + "websock_adapter": {:hex, :websock_adapter, "0.5.5", "9dfeee8269b27e958a65b3e235b7e447769f66b5b5925385f5a569269164a210", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "4b977ba4a01918acbf77045ff88de7f6972c2a009213c515a445c48f224ffce9"}, } diff --git a/bldg_server/priv/repo/migrations/20231220154358_add_nesting_depth_to_residents.exs b/bldg_server/priv/repo/migrations/20231220154358_add_nesting_depth_to_residents.exs new file mode 100644 index 0000000..a3f1f80 --- /dev/null +++ b/bldg_server/priv/repo/migrations/20231220154358_add_nesting_depth_to_residents.exs @@ -0,0 +1,14 @@ +defmodule BldgServer.Repo.Migrations.AddNestingDepthToResidents do + use Ecto.Migration + + def change do + alter table("residents") do + add :flr_level, :integer + end + + alter table("residents") do + add :nesting_depth, :integer + end + end + +end diff --git a/bldg_server/rel/env.bat.eex b/bldg_server/rel/env.bat.eex index 60beb80..0d82afd 100644 --- a/bldg_server/rel/env.bat.eex +++ b/bldg_server/rel/env.bat.eex @@ -1,4 +1,7 @@ @echo off +rem Set the release to load code on demand (interactive) instead of preloading (embedded). +rem set RELEASE_MODE=interactive + rem Set the release to work across nodes. rem RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none". rem set RELEASE_DISTRIBUTION=name diff --git a/bldg_server/rel/env.sh.eex b/bldg_server/rel/env.sh.eex index 70cfce3..ab7b76a 100644 --- a/bldg_server/rel/env.sh.eex +++ b/bldg_server/rel/env.sh.eex @@ -1,6 +1,6 @@ #!/bin/sh -# Sets and enables heart (recommended only in daemon mode) +# # Sets and enables heart (recommended only in daemon mode) # case $RELEASE_COMMAND in # daemon*) # HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND" @@ -11,7 +11,10 @@ # ;; # esac -# Set the release to work across nodes. -# RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none". +# # Set the release to load code on demand (interactive) instead of preloading (embedded). +# export RELEASE_MODE=interactive + +# # Set the release to work across nodes. +# # RELEASE_DISTRIBUTION must be "sname" (local), "name" (distributed) or "none". # export RELEASE_DISTRIBUTION=name # export RELEASE_NODE=<%= @release.name %> diff --git a/bldg_server/rel/remote.vm.args.eex b/bldg_server/rel/remote.vm.args.eex new file mode 100644 index 0000000..983397a --- /dev/null +++ b/bldg_server/rel/remote.vm.args.eex @@ -0,0 +1,8 @@ +## Customize flags given to the VM: https://www.erlang.org/doc/man/erl.html +## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here + +## Increase number of concurrent ports/sockets +##+Q 65536 + +## Tweak GC to run more often +##-env ERL_FULLSWEEP_AFTER 10 diff --git a/bldg_server/rel/vm.args.eex b/bldg_server/rel/vm.args.eex index 5886aa8..983397a 100644 --- a/bldg_server/rel/vm.args.eex +++ b/bldg_server/rel/vm.args.eex @@ -1,9 +1,6 @@ -## Customize flags given to the VM: https://erlang.org/doc/man/erl.html +## Customize flags given to the VM: https://www.erlang.org/doc/man/erl.html ## -mode/-name/-sname/-setcookie are configured via env vars, do not set them here -## Number of dirty schedulers doing IO work (file, sockets, and others) -##+SDio 5 - ## Increase number of concurrent ports/sockets ##+Q 65536 diff --git a/bldg_server/run.sh b/bldg_server/run.sh new file mode 100755 index 0000000..2b9a1d8 --- /dev/null +++ b/bldg_server/run.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Adapted from Alex Kleissner's post, Running a Phoenix 1.3 project with docker-compose +# https://medium.com/@hex337/running-a-phoenix-1-3-project-with-docker-compose-d82ab55e43cf + +set -e + + +# Ensure the app's dependencies are installed +mix deps.get + +# Prepare Dialyzer if the project has Dialyxer set up +if mix help dialyzer >/dev/null 2>&1 +then + echo "\nFound Dialyxer: Setting up PLT..." + mix do deps.compile, dialyzer --plt +else + echo "\nNo Dialyxer config: Skipping setup..." +fi + +# Install JS libraries +#echo "\nInstalling JS..." +#cd assets && npm install +#cd .. + +# Wait for Postgres to become available. +until psql -h db -U "postgres" -c '\q' 2>/dev/null; do + >&2 echo "Postgres is unavailable - sleeping" + sleep 1 +done + +echo "\nPostgres is available: continuing with database setup..." + +#Analysis style code +# Prepare Credo if the project has Credo start code analyze +if mix help credo >/dev/null 2>&1 +then + echo "\nFound Credo: analyzing..." + mix credo || true +else + echo "\nNo Credo config: Skipping code analyze..." +fi + +# Potentially Set up the database +mix ecto.create +mix ecto.migrate + +echo "\nTesting the installation..." +# "Prove" that install was successful by running the tests +# TODO: Uncomment this line when tests are passing +# mix test + +echo "\n Launching Bldg-Server..." +# Start the phoenix web server +mix phx.server \ No newline at end of file diff --git a/bldg_server/test/bldg_server_web/controllers/session_controller_test.exs b/bldg_server/test/bldg_server_web/controllers/session_controller_test.exs deleted file mode 100644 index bf444f0..0000000 --- a/bldg_server/test/bldg_server_web/controllers/session_controller_test.exs +++ /dev/null @@ -1,108 +0,0 @@ -defmodule BldgServerWeb.SessionControllerTest do - use BldgServerWeb.ConnCase - - alias BldgServer.ResidentsAuth - alias BldgServer.ResidentsAuth.Session - - @create_attrs %{ - email: "some email", - ip_address: "some ip_address", - last_activity_time: ~N[2010-04-17 14:00:00], - resident_id: 42, - session_id: "7488a646-e31f-11e4-aace-600308960662", - status: "some status" - } - @update_attrs %{ - email: "some updated email", - ip_address: "some updated ip_address", - last_activity_time: ~N[2011-05-18 15:01:01], - resident_id: 43, - session_id: "7488a646-e31f-11e4-aace-600308960668", - status: "some updated status" - } - @invalid_attrs %{email: nil, ip_address: nil, last_activity_time: nil, resident_id: nil, session_id: nil, status: nil} - - def fixture(:session) do - {:ok, session} = ResidentsAuth.create_session(@create_attrs) - session - end - - setup %{conn: conn} do - {:ok, conn: put_req_header(conn, "accept", "application/json")} - end - - describe "index" do - test "lists all sessions", %{conn: conn} do - conn = get(conn, Routes.session_path(conn, :index)) - assert json_response(conn, 200)["data"] == [] - end - end - - describe "create session" do - test "renders session when data is valid", %{conn: conn} do - conn = post(conn, Routes.session_path(conn, :create), session: @create_attrs) - assert %{"id" => id} = json_response(conn, 201)["data"] - - conn = get(conn, Routes.session_path(conn, :show, id)) - - assert %{ - "id" => id, - "email" => "some email", - "ip_address" => "some ip_address", - "last_activity_time" => "2010-04-17T14:00:00", - "resident_id" => 42, - "session_id" => "7488a646-e31f-11e4-aace-600308960662", - "status" => "some status" - } = json_response(conn, 200)["data"] - end - - test "renders errors when data is invalid", %{conn: conn} do - conn = post(conn, Routes.session_path(conn, :create), session: @invalid_attrs) - assert json_response(conn, 422)["errors"] != %{} - end - end - - describe "update session" do - setup [:create_session] - - test "renders session when data is valid", %{conn: conn, session: %Session{id: id} = session} do - conn = put(conn, Routes.session_path(conn, :update, session), session: @update_attrs) - assert %{"id" => ^id} = json_response(conn, 200)["data"] - - conn = get(conn, Routes.session_path(conn, :show, id)) - - assert %{ - "id" => id, - "email" => "some updated email", - "ip_address" => "some updated ip_address", - "last_activity_time" => "2011-05-18T15:01:01", - "resident_id" => 43, - "session_id" => "7488a646-e31f-11e4-aace-600308960668", - "status" => "some updated status" - } = json_response(conn, 200)["data"] - end - - test "renders errors when data is invalid", %{conn: conn, session: session} do - conn = put(conn, Routes.session_path(conn, :update, session), session: @invalid_attrs) - assert json_response(conn, 422)["errors"] != %{} - end - end - - describe "delete session" do - setup [:create_session] - - test "deletes chosen session", %{conn: conn, session: session} do - conn = delete(conn, Routes.session_path(conn, :delete, session)) - assert response(conn, 204) - - assert_error_sent 404, fn -> - get(conn, Routes.session_path(conn, :show, session)) - end - end - end - - defp create_session(_) do - session = fixture(:session) - %{session: session} - end -end