Skip to content
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

Novas regras de apuração do subsídio #300

Merged
merged 24 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
adc8d47
add DATA_SUBSIDIO_V10_INICIO
akaBotelho Nov 5, 2024
969c003
add regras resolucao 3777/2024
akaBotelho Nov 5, 2024
3073114
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 5, 2024
ba38095
registra flow
akaBotelho Nov 5, 2024
8393f7e
add changelog
akaBotelho Nov 5, 2024
60b11fa
Merge branch 'staging/novas-regras-apuracao' of https://github.com/pr…
akaBotelho Nov 5, 2024
8426414
Update queries/models/dashboard_subsidio_sppo/CHANGELOG.md
eng-rodrigocunha Nov 5, 2024
2426e7c
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 6, 2024
17f32db
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 6, 2024
98533fb
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 7, 2024
cb3d119
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 7, 2024
2722038
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 11, 2024
b831052
ajuste nas regras
akaBotelho Nov 25, 2024
9312ee7
Merge branch 'main' into staging/novas-regras-apuracao
akaBotelho Nov 25, 2024
6150231
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 25, 2024
22204a9
corrige regras, add indicador_circular, versao e datetime_ultima_atua…
akaBotelho Nov 25, 2024
5abee4f
Merge branch 'staging/novas-regras-apuracao' of https://github.com/pr…
akaBotelho Nov 25, 2024
b8c6fd8
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 25, 2024
fabad29
altera changelog e corrige logica circular
akaBotelho Nov 25, 2024
6ee39dd
Merge branch 'staging/novas-regras-apuracao' of https://github.com/pr…
akaBotelho Nov 25, 2024
4fdbf20
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 25, 2024
8c67439
Merge branch 'main' into staging/novas-regras-apuracao
mergify[bot] Nov 26, 2024
1352f9f
remove coluna indicador_circular
akaBotelho Nov 26, 2024
0d19e6c
Merge branch 'staging/novas-regras-apuracao' of https://github.com/pr…
akaBotelho Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipelines/migration/projeto_subsidio_sppo/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Flows for projeto_subsidio_sppo

DBT: 2024-10-24
DBT: 2024-11-05
"""

from prefect import Parameter, case, task
Expand Down
2 changes: 2 additions & 0 deletions queries/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ vars:
DATA_SUBSIDIO_V8_INICIO: "2024-07-20"
# Feature Apuração por faixa horária
DATA_SUBSIDIO_V9_INICIO: "2024-08-16"
# Feature Apuração por novas faixas horárias (RESOLUÇÃO SMTR 3777/2024)
DATA_SUBSIDIO_V10_INICIO: "2024-11-01"
# valor_subsidio: "`rj-smtr-dev.projeto_subsidio_sppo.valor_subsidio`"
DATA_SUBSIDIO_V11_INICIO: "2024-11-06"

Expand Down
6 changes: 6 additions & 0 deletions queries/models/dashboard_subsidio_sppo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog - dashboard_subsidio_sppo

## [7.0.6] - 2024-11-05

### Alterado

- Altera regras do modelo `viagens_remuneradas` conforme Resolução SMTR N° 3777/2024 (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/300)

## [7.0.5] - 2024-10-16

### Corrigido
Expand Down
17 changes: 17 additions & 0 deletions queries/models/dashboard_subsidio_sppo/viagens_remuneradas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ WITH
SELECT
v.* EXCEPT(rn, datetime_partida, viagens_planejadas, viagens_planejadas_ida_volta, km_planejada, tipo_dia, consorcio, faixa_horaria_inicio, faixa_horaria_fim),
CASE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas > 5
AND pof > 110
AND rn > viagens_planejadas_ida_volta*1.1
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas <= 5
AND pof > 200
AND rn > viagens_planejadas_ida_volta*2
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V10_INICIO") }}")
AND v.tipo_dia != "Dia Útil"
AND pof > 120
AND rn > viagens_planejadas_ida_volta*1.2
THEN FALSE
WHEN v.data >= DATE("{{ var("DATA_SUBSIDIO_V3A_INICIO") }}")
AND v.tipo_dia = "Dia Útil"
AND viagens_planejadas > 10
Expand Down
Loading