Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9f971f5
feat: step 4 funcionando e checkin enviando payload
sarahdomingos May 19, 2026
a01fa26
Merge branch 'development' of https://github.com/PequiProject/pequi i…
sarahdomingos May 20, 2026
3504952
fix: ao fim do checkin, redirect para a tela home
sarahdomingos May 20, 2026
cf59178
test: teste unitário para a componente pai checkin
sarahdomingos May 20, 2026
805e3d1
feat: creating register appointment flow
lawtherea May 20, 2026
a6232a3
chore(ci): enhance CI/CD workflows and update dependencies
TETEURYAN May 21, 2026
d73636e
chore(ci): standardize workflows with backend directory setup
TETEURYAN May 21, 2026
93ee643
chore(ci): update environment variables for development in workflows
TETEURYAN May 21, 2026
ff8d6d4
fix: no more hidden steps
lawtherea May 21, 2026
8dd3800
fix: change sentence
lawtherea May 21, 2026
9eda09a
Merge branch 'main' of https://github.com/PequiProject/pequi into fea…
lawtherea May 21, 2026
8920513
Merge pull request #16 from PequiProject/feat/register-appointment-125
lawtherea May 21, 2026
f28c1f3
PEQ-78: Implement M3 treatments and doses backend (#17)
TETEURYAN May 22, 2026
7fb6a31
Merge branch 'development' of https://github.com/PequiProject/pequi i…
sarahdomingos May 22, 2026
886005f
PEQ-126: Corrige URL de teste PostgreSQL no CI (#20)
TETEURYAN May 24, 2026
ccf482c
PEQ-127: Aumentar a cobertura de testes unitários de backend para CI …
TETEURYAN May 24, 2026
90c3c6c
PEQ-79: Implement M4 check-ins and alerts backend (#19)
rafaellucian0 May 25, 2026
702040b
Merge branch 'development' of https://github.com/PequiProject/pequi i…
sarahdomingos May 25, 2026
e847389
fix: correções do comentário do PR aplicadas
sarahdomingos May 25, 2026
c531c53
Merge pull request #15 from PequiProject/feat/instensity-symptoms-41
sarahdomingos May 25, 2026
ea767e7
hotfix: sentimentos ordenados do melhor para pior em checkin
sarahdomingos May 25, 2026
7eebb08
Merge pull request #22 from PequiProject/hotfix/change-feeling-sort
sarahdomingos May 25, 2026
82f9817
chore: trigger preview deploy
TETEURYAN May 26, 2026
7dc3f06
chore: trigger preview another deploy
TETEURYAN May 26, 2026
15ba227
PEQ-129: Atualiza README com arquitetura e isntruções de setup (#26)
TETEURYAN May 26, 2026
436a1d9
PEQ-80: Build Body Map Evaluate (#24)
TETEURYAN May 26, 2026
a3b530e
PEQ-81: Implement Anonymous Community (#27)
rafaellucian0 May 27, 2026
538e7da
PEQ-49-51-124: Profile feature and fixing some stuff in appointment f…
lawtherea May 27, 2026
cdb872c
PEQ-82: Implement M7 educational articles library (#30)
TETEURYAN May 28, 2026
bbebc05
PEQ-132: Inicia configuração do Nginx par deploy (#33)
TETEURYAN May 28, 2026
e8b9aad
PEQ-132: Adiciona staging docker (#34)
TETEURYAN May 28, 2026
f45e1dc
PEQ-132: Cria ambiente de deploy para AWS (#35)
TETEURYAN May 28, 2026
cdc5221
ci: trigger first staging deploy (#36)
TETEURYAN May 28, 2026
e195175
ci(0.0.2-rc-1): fix ssh key and security group (#38)
TETEURYAN May 28, 2026
4706ffa
ci(0.0.2-rc-1): fix backend directory (#39)
TETEURYAN May 28, 2026
707c562
PEQ-84: Implement M9 ARQ workers (#31)
rafaellucian0 May 28, 2026
bdab300
ci(0.0.2-rc-1): remove some unnecessary jobs at yml (#40)
TETEURYAN May 28, 2026
721599c
ci(0.0.2-rc-1): try to fiz error at staging (#41)
TETEURYAN May 28, 2026
3717b13
ci(0.0.2-rc-1): update migration command in staging and production (…
TETEURYAN May 28, 2026
e0fcab2
ci(0.0.2-rc-1):update to staging environment (#43)
TETEURYAN May 28, 2026
e3ed30f
ci(0.0.2-rc-1): trigger staging deploy after nginx fix (#44)
TETEURYAN May 28, 2026
e48eb97
ci(0.0.2-rc-1): increase delay time to response API (#45)
TETEURYAN May 28, 2026
5ff493e
ci(0.0.2-rc-1): solve syntax error at deploy archive (#46)
TETEURYAN May 28, 2026
1da50a0
ci(0.0.2-rc-1): Add more steps to check health (#47)
TETEURYAN May 28, 2026
a33eb19
ci(0.0.2-rc-1): trigger staging deploy validation (#48)
TETEURYAN May 28, 2026
4f9136f
[PEQ-24-25]: Criar fluxo de login e cadastro (#37)
sarahdomingos May 29, 2026
358e632
[PEQ 43-44] Implementação de mapa corporal/registro de fotos (#18)
LukeHer0 May 29, 2026
e3b8a7b
[PEQ-139]: toast component created (#49)
lawtherea May 29, 2026
56705ba
hotfix: correção de bug no step 3 do forms da CheckinComponent (#55)
sarahdomingos May 31, 2026
90dc0c4
[PEQ-23]: onboarding screen (#52)
lawtherea May 31, 2026
6d201e2
feat: toasts para login e register funcionando (#56)
sarahdomingos May 31, 2026
b8d6bab
PEQ-85: Implement M10 Integrations (#51)
rafaellucian0 Jun 1, 2026
5506640
Feat/medications and cards 32 35 (#29)
sarahdomingos Jun 1, 2026
7bb7609
[PEQ-136-137]: Calendário mensal e ajuste de rolagem no calendário se…
LukeHer0 Jun 1, 2026
8a01cec
PEQ-86: Implement M11 LGPD & Account (#58)
rafaellucian0 Jun 2, 2026
a4b0e99
PEQ-152: feat(auth) add username to user registration and login (#59)
TETEURYAN Jun 2, 2026
8a50524
[PEQ-54]: education tab already connected to back (#50)
lawtherea Jun 2, 2026
51d5760
PEQ-154: Solve squash issues (#60)
TETEURYAN Jun 3, 2026
e7b6f0e
Merge branch 'main' into development
TETEURYAN Jun 3, 2026
eee097c
hotfix: declara variáveis faltantes e ajusta níveis de feelings no ch…
LukeHer0 Jun 3, 2026
8a09013
[PEQ-42] Image upload in checkin (#57)
LukeHer0 Jun 3, 2026
4b4a970
Merge branch 'main' into development
TETEURYAN Jun 3, 2026
3158809
fix(community): create patient profiles for users (#63)
rafaellucian0 Jun 4, 2026
e0057ef
PEQ-141: Integra seção de comunidade com rotas corrigidas (#64)
lawtherea Jun 6, 2026
4e04608
[PEQ-143-144-150-151-156]: Integra e implementa dados de formulário p…
lawtherea Jun 6, 2026
f7f1b56
PEQ-159: adiciona configuração do ambiente de teste e configurações d…
TETEURYAN Jun 6, 2026
32bbaa4
feat: tela de checkin com integração funcionando (#70)
sarahdomingos Jun 8, 2026
3270ddd
PEQ-160: refatora M3 para centralizar paciente (#69)
TETEURYAN Jun 9, 2026
16f987d
PEQ-167: Changing localhost to API (#73)
lawtherea Jun 9, 2026
a8f08f2
Merge branch 'main' into development
TETEURYAN Jun 9, 2026
736a6cd
test: add integration tests for dose registration and adherence retri…
rafaellucian0 Jun 9, 2026
62f9099
test: add integration test suites for dose registration flow and pati…
rafaellucian0 Jun 9, 2026
0961e38
PEQ-157: calendar integration (#71)
LukeHer0 Jun 9, 2026
6a9a54e
fix: implement body map management with repository, schemas, and pers…
rafaellucian0 Jun 9, 2026
3aa28c7
PEQ-168: update revision identifier for body areas alignment migration
TETEURYAN Jun 9, 2026
c79b474
[PEQ-47-145]: Implementar tela de jornada (#68)
sarahdomingos Jun 9, 2026
8903548
hotfix: update down_revision for daily medication progress table migr…
TETEURYAN Jun 9, 2026
3acdfe8
[PEQ-148] Body map integration (#75)
LukeHer0 Jun 9, 2026
00958da
[PEQ-163-164-165]: Icons on homepage, paddings, real article instead …
lawtherea Jun 9, 2026
87b37ad
[PEQ-169] Active places persistence in body map (#77)
LukeHer0 Jun 9, 2026
635877b
Merge branch 'main' into development
LukeHer0 Jun 9, 2026
0b965bc
fix: lint error
LukeHer0 Jun 9, 2026
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
208 changes: 208 additions & 0 deletions backend/alembic/versions/112_align_body_areas_with_frontend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
"""align body area catalog with frontend

Revision ID: 112_align_body_areas_with_frontend
Revises: 111_create_journey_events
Create Date: 2026-06-09
"""

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects.postgresql import UUID

revision: str = "112_align_body_areas"
down_revision: str | None = "111_create_journey_events"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


BODY_AREAS = (
("d7246d41-427a-4acf-b7f1-19c87e045a23", "face", "Face", "center", "head", 50, 10, "front"),
("e4718197-848b-488c-a9e6-29ce3c978526", "neck", "Pescoço", "center", "head", 50, 17, "front"),
(
"7a9d2743-a641-46f2-8206-a6bc967652e0",
"shoulders",
"Ombros",
"center",
"upper_limb",
25,
25,
"front",
),
(
"57d0040e-9cb5-4930-8d68-e5db16409026",
"arms",
"Braços",
"center",
"upper_limb",
20,
50,
"front",
),
(
"d0427a6e-14da-4f46-a2f5-6df4581e0b3b",
"hands",
"Mãos",
"center",
"upper_limb",
15,
75,
"front",
),
(
"64d0af93-f2d5-484f-a1a6-53d8f3778cad",
"abdomen",
"Abdômen",
"center",
"trunk",
50,
35,
"front",
),
("93d7f00b-cde9-4e2d-a84d-f6618e3dafaf", "hip", "Quadril", "center", "trunk", 50, 50, "front"),
(
"2c242eb6-0c2f-43ee-a625-7aed0593c953",
"legs",
"Pernas",
"center",
"lower_limb",
35,
65,
"front",
),
(
"3ae541eb-62b2-4298-aa6f-b95a785a35a9",
"knees",
"Joelhos",
"center",
"lower_limb",
35,
80,
"front",
),
(
"b0d125a5-366f-43b4-b17c-d0b61743ed69",
"feet",
"Pés",
"center",
"lower_limb",
35,
95,
"front",
),
(
"5c19647e-df64-4bc1-893a-c8a077612631",
"scalp",
"Couro cabeludo",
"center",
"head",
50,
8,
"back",
),
("49201184-5df7-4f50-a3de-d28258586138", "nape", "Nuca", "center", "head", 50, 17, "back"),
("04947b01-d28b-4db1-993a-3bb18b68ecac", "back", "Costas", "center", "trunk", 50, 35, "back"),
(
"e224e751-dff5-4215-b165-d9a2d03c4431",
"buttocks",
"Glúteos",
"center",
"trunk",
50,
52,
"back",
),
(
"43265efe-892f-45f6-afb4-639373512cfb",
"posterior_thighs",
"Posterior das coxas",
"center",
"lower_limb",
35,
65,
"back",
),
(
"3d0353f1-5c81-4c17-9d22-b900f67d141e",
"calves",
"Panturrilhas",
"center",
"lower_limb",
35,
85,
"back",
),
)


def upgrade() -> None:
body_view_enum = sa.Enum("front", "back", name="body_view_enum")
body_view_enum.create(op.get_bind(), checkfirst=True)

op.add_column("body_areas", sa.Column("x", sa.SmallInteger(), nullable=True))
op.add_column("body_areas", sa.Column("y", sa.SmallInteger(), nullable=True))
op.add_column("body_areas", sa.Column("view", body_view_enum, nullable=True))
op.add_column(
"body_areas",
sa.Column("is_active", sa.Boolean(), server_default=sa.text("true"), nullable=False),
)

op.execute("UPDATE body_areas SET x = 50, y = 50, view = 'front', is_active = false")
op.alter_column("body_areas", "x", nullable=False)
op.alter_column("body_areas", "y", nullable=False)
op.alter_column("body_areas", "view", nullable=False)
op.create_check_constraint("body_areas_x_range", "body_areas", "x >= 0 AND x <= 100")
op.create_check_constraint("body_areas_y_range", "body_areas", "y >= 0 AND y <= 100")

body_areas = sa.table(
"body_areas",
sa.column("id", UUID(as_uuid=True)),
sa.column("code", sa.Text()),
sa.column("label", sa.Text()),
sa.column("side", sa.Enum(name="body_side_enum")),
sa.column("system_part", sa.Enum(name="body_system_part_enum")),
sa.column("x", sa.SmallInteger()),
sa.column("y", sa.SmallInteger()),
sa.column("view", sa.Enum(name="body_view_enum")),
sa.column("is_active", sa.Boolean()),
)
op.bulk_insert(
body_areas,
[
{
"id": area_id,
"code": code,
"label": label,
"side": side,
"system_part": system_part,
"x": x,
"y": y,
"view": view,
"is_active": True,
}
for area_id, code, label, side, system_part, x, y, view in BODY_AREAS
if code != "abdomen"
],
)
op.execute(
"""
UPDATE body_areas
SET label = 'Abdômen', side = 'center', system_part = 'trunk',
x = 50, y = 35, view = 'front', is_active = true
WHERE code = 'abdomen'
"""
)


def downgrade() -> None:
codes = ", ".join(f"'{area[1]}'" for area in BODY_AREAS if area[1] != "abdomen")
op.execute(f"DELETE FROM body_areas WHERE code IN ({codes})")
op.execute("UPDATE body_areas SET is_active = true WHERE code = 'abdomen'")
op.drop_constraint("body_areas_y_range", "body_areas", type_="check")
op.drop_constraint("body_areas_x_range", "body_areas", type_="check")
op.drop_column("body_areas", "is_active")
op.drop_column("body_areas", "view")
op.drop_column("body_areas", "y")
op.drop_column("body_areas", "x")
sa.Enum(name="body_view_enum").drop(op.get_bind(), checkfirst=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"""create daily medication progress table

Revision ID: aeb509f804c0
Revises: 108_patient_health_appointments
Create Date: 2026-06-08 23:56:27.762692

"""

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = "aeb509f804c0"
down_revision: str | None = "112_align_body_areas"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
op.create_table(
"daily_medication_progress",
sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
sa.Column("patient_id", postgresql.UUID(as_uuid=True), nullable=False),
sa.Column("progress_date", sa.Date(), nullable=False),
sa.Column("expected_count", sa.Integer(), nullable=False),
sa.Column("taken_count", sa.Integer(), nullable=False),
sa.Column(
"created_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.Column(
"updated_at",
sa.DateTime(timezone=True),
server_default=sa.text("now()"),
nullable=False,
),
sa.ForeignKeyConstraint(
["patient_id"],
["patient_profiles.id"],
ondelete="RESTRICT",
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint(
"patient_id",
"progress_date",
name="uq_daily_medication_progress_patient_date",
),
)

op.create_index(
"ix_daily_medication_progress_patient_id",
"daily_medication_progress",
["patient_id"],
unique=False,
)
op.create_index(
"ix_daily_medication_progress_progress_date",
"daily_medication_progress",
["progress_date"],
unique=False,
)


def downgrade() -> None:
op.drop_index(
"ix_daily_medication_progress_progress_date",
table_name="daily_medication_progress",
)
op.drop_index(
"ix_daily_medication_progress_patient_id",
table_name="daily_medication_progress",
)
op.drop_table("daily_medication_progress")
1 change: 1 addition & 0 deletions backend/bruno/ROUTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Contrato HTTP da API v1. Fonte: `docs/milestones/M*.md`.
| `PATCH` | `/v1/patients/me` | 20/min | patient | `patient/update_profile.bru` ✅ |
| `GET` | `/v1/patients` | 100/min | professional, admin | `patient/list_patients.bru` |
| `GET` | `/v1/patients/{id}` | 100/min | professional, admin | `patient/get_patient.bru` |
| `GET` | `/v1/patients/me/journey` | 100/min | patient | `patient/get_journey.bru` |

---

Expand Down
19 changes: 19 additions & 0 deletions backend/bruno/patient/get_journey.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
meta {
name: Get Journey
type: http
seq: 10
}

get {
url: {{baseUrl}}/v1/patients/me/journey
auth: bearer
}

assert {
res.status: eq 200
res.body.summary: isDefined
res.body.summary.classification: isDefined
res.body.summary.treatment_duration_months: isDefined
res.body.summary.progress_percent: isDefined
res.body.months: isDefined
}
5 changes: 0 additions & 5 deletions backend/src/pequi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ async def health_check() -> JSONResponse:
from pequi.routers import treatment_v2 as treatment_v2_router

app.include_router(patient_router.router, prefix="/v1/patients", tags=["patients"])
app.include_router(
journey_router.router,
prefix="/v1/patients/me/journey",
tags=["journey"],
)
app.include_router(journey_router.router, prefix="/v2/journey", tags=["journey"])
app.include_router(account_router.router, prefix="/v1/account", tags=["account"])
app.include_router(auth_router.router, prefix="/v1/auth", tags=["auth"])
Expand Down
2 changes: 2 additions & 0 deletions backend/src/pequi/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
CommunityPost,
)
from pequi.models.consent import Consent
from pequi.models.daily_medication_progress import DailyMedicationProgress
from pequi.models.data_deletion import DataDeletionRequest
from pequi.models.dose_log import AdherenceSnapshot, DoseLog
from pequi.models.health_appointment import PatientHealthAppointment
Expand Down Expand Up @@ -50,4 +51,5 @@
"Treatment",
"User",
"WeeklySymptomSummary",
"DailyMedicationProgress",
]
12 changes: 12 additions & 0 deletions backend/src/pequi/models/body_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from enum import StrEnum

from sqlalchemy import (
Boolean,
CheckConstraint,
Column,
DateTime,
Expand Down Expand Up @@ -33,6 +34,11 @@ class BodySystemPart(StrEnum):
lower_limb = "lower_limb"


class BodyView(StrEnum):
front = "front"
back = "back"


class BodyFindingType(StrEnum):
lesion = "lesion"
hypoesthesia = "hypoesthesia"
Expand All @@ -44,6 +50,8 @@ class BodyFindingType(StrEnum):
class BodyArea(Base):
__tablename__ = "body_areas"
__table_args__ = (
CheckConstraint("x >= 0 AND x <= 100", name="body_areas_x_range"),
CheckConstraint("y >= 0 AND y <= 100", name="body_areas_y_range"),
Index("ix_body_areas_system_part", "system_part"),
Index("ix_body_areas_label", "label"),
)
Expand All @@ -59,6 +67,10 @@ class BodyArea(Base):
Enum(BodySystemPart, name="body_system_part_enum"),
nullable=False,
)
x = Column(SmallInteger, nullable=False, default=50)
y = Column(SmallInteger, nullable=False, default=50)
view = Column(Enum(BodyView, name="body_view_enum"), nullable=False, default=BodyView.front)
is_active = Column(Boolean, nullable=False, default=True, server_default=text("true"))


class BodyMapEntry(Base):
Expand Down
Loading
Loading