-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manual de fuga #16
Open
renatocron
wants to merge
156
commits into
master
Choose a base branch
from
homol
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41,845
−1,103
Open
Manual de fuga #16
Changes from 142 commits
Commits
Show all changes
156 commits
Select commit
Hold shift + click to select a range
987f0fc
PR pra filtrar 00
renatocron dc98f78
Fix pra só considerar quando ambos lat/long for perto do zero ao mesm…
renatocron c2b64a2
Retorno de texto em cliente_list_events_audio
renatocron df533cd
PR pra filtrar 00
renatocron cd1eec7
Fix pra só considerar quando ambos lat/long for perto do zero ao mesm…
renatocron d416096
Fix space
renatocron 2af23f9
Merge branch 'master' into homol
renatocron 16653f3
WIP
renatocron f6abc46
Fix teste t/api/058-anon-quiz.t (tirar o floor da query pra resolver …
renatocron 8a157dc
Fix mais um teste
renatocron 50c88fc
Marcar, Desmarcar e remover tarefas
renatocron 705f674
Adicionando endpoint para Nova tarefa
renatocron b256d1c
tidy
renatocron b7740d9
Endpoints para atualizar tarefa
renatocron 4890205
modulo mf
renatocron 550329b
Fix carregamento do modulo mf
renatocron 463680f
Add: Você ainda não tem nenhum áudio gravado.
renatocron dca2f89
PR pra filtrar 00
renatocron 9a51345
Fix pra só considerar quando ambos lat/long for perto do zero ao mesm…
renatocron 6f06592
Feat/task padrao atualizada (#8)
renatocron fcd2a4f
Fix syntax err
renatocron 22d7404
Feat/task padrao (#10)
renatocron 5ce4060
Fix 0028-mf-info.sql
renatocron 7ef7ffe
Update autocontinue nao existe
renatocron 03db579
More log
renatocron 99fb9e3
More logs
renatocron ea4eb6a
Change to get_column
renatocron 61488d1
Rm cover (should not exists at repo)
renatocron f6b6e59
Confess if user.id not found
renatocron 66c5920
Fix get_columns on user
renatocron 3a4d13a
Fix load_quiz_session on get /me/tarefas
renatocron d878bb9
Add tests / fix get /me/tarefas during quiz
renatocron f88a1df
Fix force end
renatocron 05b8943
Add lorem
renatocron 14cdeb1
Fix GET mf_assistant
renatocron cfb819c
cliente_mf_add_tag_by_code e fix migration
renatocron f88bb2a
Pular msg vazias pro frontend (mas marcar tarefas/tags)
renatocron a041826
Add _json on MC questions to easy detect the responses
renatocron 2c00963
Update parser.ts para montar o multiplechoice
renatocron af2d17a
Fix Anon quiz, mas o teste ainda ta quebrado
renatocron d3f1830
Fix display do resultados do CEP
renatocron d1e9a66
Não existe cep_results no app, logo, não faz sentido o teste no _skip…
renatocron 8d7d9ef
Add endpoint/column pra qtde_login_offline
renatocron 5b5025c
Fix encoding do 🗑
renatocron ea8f1a5
Add tag_user to parse.ts
renatocron 597bfcd
Patch https://ws.iwebservice.digital/CPF/
renatocron 43d5317
Atualizando .XLSX, .SQL e debug quando o render do relevance é undef
renatocron c5d2484
Mais logs
renatocron 2653f45
Skip empty messages on any_has_relevance
renatocron 922e27c
Adicionando PQ
renatocron 6584af6
Atualizando agrupador da tarefas
renatocron d860152
Fix P4ac
renatocron 0513f6d
Adicionar linkfy (e .prettierrc)
renatocron 910d5b3
Fix TS warnings
renatocron 471e6c4
Caso tenha links nas respostas
renatocron c3b9f28
Revisao parser (chars nao visiveis)
renatocron ae26265
Colocar exception se um dia faltar 2 opcoes pro yesno, 3 pro yesnomaybe
renatocron 6877723
Fix is_json_member when array is not initialized yet
renatocron 16f46fa
Adicionar suporte do PQ como pergunta (e não como opcoes)
renatocron 23df8eb
Tidy
renatocron 5642c12
Correção no local de insert do PQ (um por pergunta e nao por cada res…
renatocron 406323a
Add tests to cover json_array_to_string/is_json_member
renatocron e203014
new version parser
renatocron 559d083
Usando o código da resposta, no lugar do texto, por causa dos textos …
renatocron 4291cd0
Add debug do quiz
renatocron df3d95c
$q is not public
renatocron 472b9f6
use _code
renatocron 9c1d272
nova versao do quiz
renatocron 77f6a2e
atualizar texto descricao do MF
renatocron b0da28e
Parser: Adicionando pergunta sim/nao para limpeza de tarefas e tag (S…
renatocron 718c40b
Add cliente_mf_clear_tasks via tags
renatocron 091be66
Add column ja_completou_mf
renatocron 1d2d6ad
Adicionando versão em Batch para endpoint do sync
renatocron b7332de
Removendo DDP
renatocron e91be03
Add campo consultado_em
renatocron 870fbf2
Fix atualizado_em >= no lugar de >
renatocron a6851e8
Add ViaCep
renatocron f8c7da9
Atualizando textos
renatocron a491964
Update docker to FROM phusion/baseimage:focal-1.2.0
renatocron 1cda9a4
Adicionando logs em cliente_sync_lista_tarefas
renatocron 8c4d9f3
Resolvendo warning na linha 260 em lib/Penhas/Controller.pm
renatocron c9c995a
Patch na tarefa especial
renatocron ef93169
Atualizando parser do MF para detectar texto do checkbox_contato
renatocron 1a12cfb
Adicionando NAO_LIMPA_MF
renatocron 8eba29e
Update index
renatocron 4a8397c
Update textos
renatocron 22f1e91
Adicionando regra para limpar determinados codigos ao entrar no bloco
renatocron d93adce
Add codigo_tarefa
renatocron 5792166
Add sql code for tag NAO_LIMPA_MF
renatocron e74abb1
Adicionando render_botao_endereco para verficar se o app já quebra, rs
renatocron d62082a
Perl is hard
renatocron e07afb0
Adicionando codigo para iniciar o MF_REDO_ADDR_QUESTIONNAIRE_ID
renatocron e8265b4
Registrando process_redo_addr_mf_assistant
renatocron dc58d8c
Update rota para render_botao_endereco
renatocron 3814b13
Simplificando regra de carregamento do quiz
renatocron c7d75f3
Tratamento para always_new_session
renatocron 8b61656
Filtro por $opts{session_id} na busca da resposta
renatocron e3fd13d
auto_change_questionnaire não é iterativo
renatocron ed45e5f
Add more lo
renatocron 199cbc3
Print stash before mod
renatocron 519ad68
Set auto_change_questionnaire as input again
renatocron 5d64c18
Fix bug de 4 anos: mover msgs sem relevancia do current pro pending a…
renatocron 6e2a3bf
Movendo para pending antes do add_more_questions
renatocron 456ec3c
Update quiz
renatocron 8865f6c
Atualizando quiz
renatocron c083084
Atualizando label do botão
renatocron b998f32
Atualizar botao final para Concluir tambem
renatocron 17dd74c
Update texto lib/Penhas/Helpers/Cliente.pm
renatocron 0fd39c5
Movimentando campo_livre para tabela mf_cliente_tarefa
renatocron a190efe
Mudando tarefa de contato
renatocron 793ee8d
Update quiz
renatocron ca9ea6a
Fix revisar
renatocron 6fa61ac
update quiz
renatocron 5cef628
Fix _currently_has_relevance para items recem adicionados no loop
renatocron 5b5f127
Manter prev_msgs ao encaminhar questionario
renatocron 32519b2
Manter prev_msgs tbm na pergunta do tipo change_questionnaire
renatocron fb7626b
Fix mf_tag
renatocron 4460cb3
Add ENABLE_MANUAL_FUGA_IDS
renatocron 8be63fb
Better use of ENABLE_MANUAL_FUGA_IDS
renatocron e817562
Fix _build_access_modules
renatocron b22b6a1
Adicionar mf_control_id no processo de refazer o endereço
renatocron 3de2327
Update quiz
renatocron 5516be9
Fix created_on on ClienteTag
renatocron 9c793be
Add log of $mf_sc->status()
renatocron a5e9dda
Chamando discard_changes no ensure_cliente_mf_session_control_exists
renatocron 07a8974
Add texto ataulização pro legacy
renatocron 808608c
Fix of created_at legacy tweet
renatocron 6e53041
Change to unshfit
renatocron e47f18a
Msg de boas vindas automatica
renatocron dfbbb55
Ajuste texto legacy
renatocron 0a4161c
link para loja
renatocron c6a2f56
Titulo: atualização está disponível
renatocron a80c608
Criando versão maybe_linkfy
renatocron a5428d5
Fix maybe_linkfy para usar o $penhas_avatar que é do tweet e não vari…
renatocron e69de19
Fix tag deve entrar sempre ao passar por um $item->{type} eq tag_user…
renatocron dd75e67
Fix $tag que está sumindo da $item em algum momento
renatocron 058a9c3
add sql of metabase
renatocron c0ba4dd
Add workflow to build and publish image
renatocron 86993fe
Patch docker/Dockerfile to copy api code to /src
renatocron afbb60d
Fix Makefile.PL copy (no need more local copy)
renatocron 325e81a
Finish adjust for docker/
renatocron b0ee59c
Add RUN chown 1000:1000 /src/ -R to end of Dockerfile
renatocron f89dc0d
Add api/integracoes.md
renatocron 1d7fec3
Add favicon
renatocron 4029d29
Fix lib/Penhas/CEP/ViaCep.pm
renatocron 14f733e
Add pagina de exclusao
renatocron 324b356
fix(SignUp.pm, CepUpdater.pm): remove suporte ao backend Correios e P…
renatocron 52ce154
Update quiz for new tags
renatocron 5ad72c2
feat(metricas-de-uso-do-manual-de-fuga.sql): expande as tags no view …
renatocron d2f3ad7
Add DB_SSL__REJECT_UNAUTHORIZED=false
renatocron 559a6ec
feat(deploy_db): adiciona função e trigger para prevenir duplicatas e…
renatocron 58880c8
feat(Maintenance.pm): adiciona limpeza de sessões de cliente com mais…
renatocron f0a7a87
fix(Maintenance.pm): altera retorno de renderização JSON para valor b…
renatocron 2857077
Update docker-compose
renatocron 3657bcb
feat(ClienteTag.pm): adiciona restrição de unicidade para cliente_id …
renatocron 3c29538
Atualizando arquivo de sqitch
renatocron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
name: Create and publish the Docker image | ||
|
||
on: | ||
push: | ||
branches: ['homol'] | ||
|
||
env: | ||
IMAGE_NAME: ghcr.io/institutoazmina/penhas-backend | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./api/ | ||
file: ./api/docker/Dockerfile | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acho que vamos precisar de um step intermediário para definir a lista de tags, separando o que é |
||
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest | ||
cache-to: type=inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"endOfLine": "lf", | ||
"trailingComma": "es5", | ||
"insertPragma": false, | ||
"printWidth": 120, | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
"singleQuote": true, | ||
"quoteProps": "preserve", | ||
"semi": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# cpanm -n Devel::Cover | ||
HARNESS_PERL_SWITCHES=-MDevel::Cover prove -lvr t/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
-- Deploy penhas:0027-tarefa-padrao to pg | ||
-- requires: 0026-block-users | ||
|
||
BEGIN; | ||
|
||
|
||
-- alter table mf_tarefa drop column campo_livre_1, drop column campo_livre_2, drop column campo_livre_3; | ||
-- alter table mf_tarefa add column campo_livre json; | ||
|
||
create table mf_tarefa ( | ||
id serial primary key not null, | ||
|
||
titulo varchar not null, | ||
descricao varchar not null, | ||
|
||
tipo varchar not null default 'checkbox', | ||
codigo varchar, | ||
|
||
campo_livre json, | ||
|
||
agrupador varchar(120) not null default 'Outros', | ||
|
||
criado_em timestamp without time zone not null default now(), | ||
-- se é editável ou não pela usuária | ||
eh_customizada boolean not null default false | ||
); | ||
|
||
create table mf_cliente_tarefa ( | ||
id serial primary key not null, | ||
|
||
mf_tarefa_id int not null references mf_tarefa(id), | ||
cliente_id bigint not null references clientes(id), | ||
|
||
checkbox_feito boolean not null default false, | ||
|
||
checkbox_feito_checked_first_updated_at timestamp without time zone, | ||
checkbox_feito_checked_last_updated_at timestamp without time zone, | ||
|
||
checkbox_feito_unchecked_first_updated_at timestamp without time zone, | ||
checkbox_feito_unchecked_last_updated_at timestamp without time zone, | ||
|
||
criado_em timestamp without time zone not null default now(), | ||
removido_em timestamp without time zone, | ||
|
||
last_from_questionnaire int references questionnaires(id), | ||
|
||
atualizado_em timestamp without time zone not null default now() | ||
); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
-- Deploy penhas:0028-mf-info to pg | ||
-- requires: 0027-tarefa-padrao | ||
|
||
BEGIN; | ||
|
||
create unique index ix_mf_codigo_tarefa on mf_tarefa (codigo) where codigo != ''; | ||
|
||
alter table quiz_config alter column intro set default '[]', | ||
alter column yesnogroup set default '[]'; | ||
|
||
-- guarda a ordem preferencial dos blocos de questionarios do manual de fuga | ||
create table mf_questionnaire_order ( | ||
id serial not null primary key, | ||
|
||
sort int not null default 0, | ||
|
||
outstanding_order boolean not null default false, | ||
|
||
is_last boolean not null default false, | ||
|
||
published character varying(20) default 'testing', | ||
|
||
questionnaire_id int not null references questionnaires(id) | ||
); | ||
|
||
-- statuses: | ||
-- onboarding | ||
-- inProgress | ||
-- completed | ||
create table cliente_mf_session_control ( | ||
cliente_id int not null references clientes(id) ON DELETE CASCADE primary key, | ||
|
||
status varchar not null default 'onboarding', | ||
|
||
current_clientes_quiz_session int references clientes_quiz_session(id), | ||
completed_questionnaires_id int[] not null default '{}'::int[], | ||
|
||
started_at timestamp without time zone not null default now(), | ||
completed_at timestamp without time zone | ||
); | ||
|
||
-- novos tipo na quiz_config: | ||
-- next_mf_questionnaire | ||
-- next_mf_questionnaire_outstanding | ||
-- auto_change_questionnaire | ||
-- yesnomaybe | ||
-- multiplechoice | ||
-- tag_user | ||
-- text << já existia, mas não tem no app | ||
|
||
alter table quiz_config add column change_to_questionnaire_id int references questionnaires(id) default null; | ||
alter table quiz_config add column tarefas json not null default '[]'; | ||
|
||
-- not really mf, mas já tem uma table "tags" lá pro feed/noticias | ||
create table mf_tag ( | ||
id serial not null primary key, | ||
code varchar not null unique, | ||
description varchar, | ||
created_on timestamp without time zone not null default now() | ||
); | ||
|
||
create table cliente_tag ( | ||
id serial not null primary key, | ||
|
||
cliente_id int not null references clientes(id) ON DELETE CASCADE, | ||
mf_tag_id int not null references mf_tag(id) ON DELETE CASCADE , | ||
|
||
created_on timestamp without time zone not null default now() | ||
); | ||
|
||
alter table quiz_config add column tag json not null default '[]'; | ||
alter table quiz_config alter tag set not null; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Deploy penhas:0029-cliente_offline to pg | ||
-- requires: 0028-mf-info | ||
|
||
BEGIN; | ||
|
||
alter table clientes add column qtde_login_offline int not null default 0; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Deploy penhas:0030-ja_completou_mf to pg | ||
-- requires: 0029-cliente_offline | ||
|
||
BEGIN; | ||
|
||
alter table clientes add column ja_completou_mf boolean default false; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Deploy penhas:0031-mf_block_clear to pg | ||
-- requires: 0030-ja_completou_mf | ||
|
||
BEGIN; | ||
|
||
create table mf_questionnaire_remove_tarefa ( | ||
id serial not null primary key, | ||
questionnaire_id int not null references questionnaires(id), | ||
codigo_tarefa varchar not null | ||
); | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Deploy penhas:0032-fix-campo_livre to pg | ||
-- requires: 0031-mf_block_clear | ||
|
||
BEGIN; | ||
|
||
alter table mf_tarefa drop column campo_livre; | ||
alter table mf_cliente_tarefa add column campo_livre json; | ||
|
||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package Penhas::CEP::Postmon; | ||
|
||
use Moose::Role; | ||
use feature 'state'; | ||
|
||
use Furl; | ||
use JSON qw(decode_json); | ||
|
||
sub name {'Postmon'} | ||
|
||
sub _find { | ||
state $ua = Furl->new(timeout => 20); | ||
|
||
my $cep = pop; | ||
my $res = $ua->get('https://viacep.com.br/ws/' . $cep . '/json/'); | ||
|
||
return unless $res->is_success; | ||
|
||
my $r = eval { decode_json($res->content) } or return; | ||
|
||
my $street = $r->{logradouro} || ''; | ||
|
||
return {street => $street, city => $r->{localidade}, district => $r->{bairro}, state => $r->{uf}, | ||
ibge => $r->{ibge}}; | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisamos mudar isso aqui para permitir tanto
homol
quantomaster