Skip to content

feat(services): desativar e reativar pessoa atendida (#157, #158, backend) - #173

Merged
evertonschuster merged 4 commits into
mainfrom
feat/157-158-clients-deactivate-reactivate-backend
Oct 8, 2026
Merged

evertonschuster merged 4 commits into
mainfrom
feat/157-158-clients-deactivate-reactivate-backend

Conversation

@evertonschuster

@evertonschuster evertonschuster commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Resumo

Parte backend de #157 e #158: POST /api/v1/clients/{id}/deactivate e POST /api/v1/clients/{id}/reactivate. Os dois mudam só a situação da pessoa, preservam id, dados e contatos, e devolvem o mesmo ClientResponse de POST, PUT e GET.

Os botões Desativar e Reativar, a confirmação e as mensagens são do frontend e não estão aqui. Por isso a descrição usa Refs, não Closes.

Decisões (ADR 0062)

  • Repetir a ação não é erro. Desativar quem já está inativo, ou reativar quem já está ativo, responde 200 com o estado atual e não grava nada, nem UpdatedAt. O domínio continua recusando a transição repetida (Client.AlreadyInactive, Client.AlreadyActive); o handler só não chega a ela.
  • Desativar consulta agendamentos por uma porta. O módulo de agendamentos (Agendar um atendimento #153) ainda não existe, então IAppointmentRepository.HasUpcomingAppointmentsAsync(clientId) tem um adaptador provisório, PendingAppointmentRepository, que responde "nenhum". Hoje isso é verdade. Quem criar o primeiro agendamento em Agendar um atendimento #153 precisa trocar o registro em Infrastructure/DependencyInjection.cs e apagar o adaptador.
  • Limite estrito. A porta não recebe horário: o adaptador decide o que é "futuro" com o TimeProvider em UTC. Bloqueia se o início do atendimento é depois desse instante. Um atendimento que começa exatamente no instante, um já em andamento e um cancelado não bloqueiam. Bloqueio responde 409 Client.HasUpcomingAppointments e a pessoa segue ativa.
  • Reativar verifica o CPF e o e-mail. Outra pessoa ativa do tenant com o mesmo e-mail responde 409 Client.DuplicateEmail (campo email, meta.clientId e meta.clientName, o contrato do ADR 0044) com mensagem própria mandando corrigir o e-mail. Pessoa inativa com o mesmo e-mail não bloqueia, e quem não tem e-mail reativa. A correção é o PUT que já existe. A checagem de CPF (409 Client.DuplicateCpf, igual a criar e editar) vem antes e é defensiva: o índice de CPF cobre ativas e inativas, então o fluxo normal nunca a dispara.
  • Corrida sem migração. O índice único parcial IX_Clients_TenantId_Email ... WHERE Status = 'Active' já impede duas ativas com o e-mail. A gravação perdedora responde 409 Client.SaveFailed (ADR 0048) e a nova tentativa recebe a resposta específica.
  • Mudança de situação usa o UpdateAsync completo. Ele lançava exceção para um cliente cujos contatos não mudaram (reinseria os contatos carregados sob ids marcados para remoção; provado com uma sonda). Agora compara por id e grava só a diferença: o PUT segue substituindo tudo, porque cria contatos com ids novos, e uma mudança de status não toca em nenhuma linha de contato. Não há método de repositório só para status.
  • O log de save falho mora no UnitOfWork. Um Warning com tipo e constraint por save rejeitado, uma vez para todos os handlers. Criar, editar, desativar e reativar cliente perdem o ILogger; ARCHITECTURE §4, ADR 0048 e a skill de slice acompanham. Tags, Categories e Services seguem com seus mappers, então numa constraint não reconhecida o mesmo save aparece duas vezes no log até serem convertidos.

Também entram: services-api.d.ts regenerado (só adições), a linha de transição de estado no §10 do ARCHITECTURE, e os dois helpers de teste que deixavam um cliente inativo por reflexão agora chamam Inactivate().

Verificação

  • dotnet build backend/AdminBackend.slnx -c Release: 0 avisos, 0 erros. dotnet test: verde, com o gate de cobertura (ServicesService.Tests 427, ServicesService.PersistenceTests 61, Admin.SharedKernel.Tests 228, Admin.Logging.Tests 36, IdentityService.Tests 19).
    • Unit: transições do domínio, validators (id vazio), cada ramo dos dois handlers com chamadas assertadas (Received, DidNotReceive): sucesso, contatos mantidos, uma única consulta de agendamentos, bloqueio, conflito de CPF e de e-mail com meta, não encontrado, repetição, falha de gravação.
    • Persistência: uma mudança de status mantém as mesmas linhas de contato (nenhuma inserida ou apagada), ciclo desativar e reativar liberando e retomando o e-mail, e o UnitOfWork (violação única devolve a falha e loga um aviso, sucesso não loga, outra falha propaga sem log).
  • dotnet ef migrations has-pending-model-changes: sem mudanças. Não há migração.
  • À mão, em PostgreSQL descartável (ARCHITECTURE §9): postgres:18 inicializado por infra/postgres/init, com identity e services em portas privadas (5180/5181/5433), sem tocar na stack Aspire nem no volume agenza-postgres-data. 55 verificações com token real (PKCE) passaram:
    • 200 nas duas ações, mesmo id, status novo, contatos com os mesmos ids e nenhuma linha de contato tocada; repetição sem gravar.
    • 404 Client.NotFound com o mesmo corpo para id desconhecido, de outro tenant (a linha existe na tabela, segue intacta) e excluído; 400 Client.IdRequired para id vazio; 401 sem token.
    • Conflito de e-mail com meta apontando a pessoa ativa; edição corrige o e-mail (o PUT ainda substitui os contatos) e a reativação passa; inativa contra inativa não bloqueia e a segunda reativação é bloqueada pela primeira.
    • 12 corridas de reativação com o mesmo e-mail: sempre um 200 e um conflito (Client.SaveFailed ou, se a corrida não foi perdida, Client.DuplicateEmail), nunca duas ativas; o log do serviço trouxe um aviso do UnitOfWork por corrida perdida e nenhuma mensagem de handler. 6 desativações paralelas: todas 200.
    • O OpenAPI documenta 200, 400, 404 e 409 nas duas rotas.

Limites conhecidos

Fora deste PR

  • Ações Desativar e Reativar no admin-frontend, com confirmação e as mensagens de bloqueio.
  • Elegibilidade de pessoa inativa para novos agendamentos, que é de Agendar um atendimento #153.

Refs #157
Refs #158

🤖 Generated with Claude Code

…kend)

Expõe POST /api/v1/clients/{id}/deactivate e /reactivate, que mudam a
situação da pessoa sem tocar nos dados nem nos contatos e devolvem o
mesmo ClientResponse de POST, PUT e GET.

- Client.Inactivate() e Client.Reactivate() recusam a transição que já
  estão (Client.AlreadyInactive, Client.AlreadyActive). O handler
  responde 200 com o estado atual quando a ação é repetida, sem consultar
  nem gravar nada.
- Desativar consulta IAppointmentRepository.ExistsNotCancelledStartingAfter
  com o instante da operação: início estritamente futuro e não cancelado
  bloqueia com 409 Client.HasUpcomingAppointments. Enquanto o módulo de
  agendamentos (#153) não existe, PendingAppointmentRepository responde
  "nenhum" e deve ser trocado no DI por quem criar o primeiro agendamento.
- Reativar verifica o e-mail contra outra pessoa ativa do tenant: 409
  Client.DuplicateEmail, com meta clientId e clientName. Pessoa inativa
  com o mesmo e-mail não bloqueia. A corrida é decidida pelo índice
  único parcial e responde Client.SaveFailed (ADR 0048).
- IClientRepository.UpdateStatusAsync grava só a coluna Status, sem
  recriar os contatos como o UpdateAsync faz.
- Tipos do frontend regenerados (services-api.d.ts).
- ADR 0062 e linha de transição de estado no §10 do ARCHITECTURE.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98650ae0-ef6a-422c-9e38-22703adfbf2c
📥 Commits

Reviewing files that changed from the base of the PR and between a1eab17 and de7a7a9.

📒 Files selected for processing (59)
  • .claude/skills/agenza-backend-slice/references/persistence.md
  • .claude/skills/agenza-backend-slice/references/use-case.md
  • backend/ServiceDefaults/Extensions.cs
  • backend/docs/ARCHITECTURE.md
  • backend/services/identity-service/IdentityService.Api/Controllers/AuthorizationController.cs
  • backend/services/identity-service/IdentityService.Api/Program.cs
  • backend/services/identity-service/IdentityService.Api/Setup/DocumentationExtensions.cs
  • backend/services/identity-service/IdentityService.Application/DependencyInjection.cs
  • backend/services/identity-service/IdentityService.Infrastructure/Identity/TenantClaimsPrincipalFactory.cs
  • backend/services/identity-service/IdentityService.Infrastructure/Persistence/Migrations/20260725172020_InitialCreate.cs
  • backend/services/services-service/ServicesService.Api/Setup/DocumentationExtensions.cs
  • backend/services/services-service/ServicesService.Application/Clients/CreateClient/CreateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/Clients/DeactivateClient/DeactivateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/Clients/ReactivateClient/ReactivateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/Clients/UpdateClient/UpdateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/DependencyInjection.cs
  • backend/services/services-service/ServicesService.Infrastructure/Persistence/Configurations/TenantSequenceConfiguration.cs
  • backend/services/services-service/ServicesService.Infrastructure/Persistence/Migrations/20260725172036_InitialCreate.cs
  • backend/services/services-service/ServicesService.Infrastructure/Persistence/Migrations/20261002174511_AddClients.cs
  • backend/services/services-service/ServicesService.Infrastructure/Persistence/UnitOfWork.cs
  • backend/services/services-service/ServicesService.Infrastructure/Repositories/ClientRepository.cs
  • backend/services/services-service/ServicesService.PersistenceTests/ClientPersistenceTests.cs
  • backend/services/services-service/ServicesService.PersistenceTests/UnitOfWorkTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/ClientUpdateTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandBirthDateBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandCpfBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandEmailBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandFullNameBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandNotesBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandPhoneBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/CreateClient/CreateClientCommandPurposesBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/DeactivateClient/DeactivateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/GetClientById/GetClientByIdQueryHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/ReactivateClient/ReactivateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/UpdateClient/UpdateClientCommandBindingTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/UpdateClient/UpdateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/WireJson.cs
  • backend/shared/Admin.Logging.Tests/ReadableConsoleTests.cs
  • backend/shared/Admin.Logging.Tests/ReadableLoggingExtensionsTests.cs
  • backend/shared/Admin.Logging/ReadableConsole.cs
  • backend/shared/Admin.Logging/ReadableLoggingExtensions.cs
  • backend/shared/Admin.SharedKernel.AspNetCore/ApiProblemDetailsFactory.cs
  • backend/shared/Admin.SharedKernel.AspNetCore/GenericExceptionHandler.cs
  • backend/shared/Admin.SharedKernel.EntityFrameworkCore/DateValueObjectConverter.cs
  • backend/shared/Admin.SharedKernel.EntityFrameworkCore/ModelBuilderExtensions.cs
  • backend/shared/Admin.SharedKernel.EntityFrameworkCore/RepositoryBase.cs
  • backend/shared/Admin.SharedKernel.EntityFrameworkCore/StringValueObjectConverter.cs
  • backend/shared/Admin.SharedKernel.Tests/GenericExceptionHandlerTests.cs
  • backend/shared/Admin.SharedKernel.Tests/ModelStateErrorMapperTests.cs
  • backend/shared/Admin.SharedKernel.Tests/MvcBuilderExtensionsTests.cs
  • backend/shared/Admin.SharedKernel.Tests/OpenApiOptionsExtensionsTests.cs
  • backend/shared/Admin.SharedKernel.Tests/ServiceCollectionExtensionsTests.cs
  • backend/shared/Admin.SharedKernel.ValueObjects/ValueObjectContract.cs
  • backend/shared/Admin.SharedKernel/Dispatcher.cs
  • backend/shared/Admin.SharedKernel/ServiceCollectionExtensions.cs
  • docs/adr/0048-database-failures-are-generic-to-the-user.md
  • docs/adr/0062-clients-deactivate-and-reactivate.md
 ______________________________________________
< Winning the war on bugs, one line at a time. >
 ----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79e7cfb4-97da-47ec-8d32-36f4ada3ed1a
📥 Commits

Reviewing files that changed from the base of the PR and between 952f7f4 and a1eab17.

⛔ Files ignored due to path filters (1)
  • apps/admin-frontend/src/shared/api/generated/services-api.d.ts is excluded by !**/generated/**
📒 Files selected for processing (24)
  • backend/docs/ARCHITECTURE.md
  • backend/services/services-service/ServicesService.Api/Controllers/ClientsController.cs
  • backend/services/services-service/ServicesService.Application/Abstractions/IAppointmentRepository.cs
  • backend/services/services-service/ServicesService.Application/Abstractions/IClientRepository.cs
  • backend/services/services-service/ServicesService.Application/Clients/DeactivateClient/DeactivateClientCommand.cs
  • backend/services/services-service/ServicesService.Application/Clients/DeactivateClient/DeactivateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/Clients/DeactivateClient/DeactivateClientCommandValidator.cs
  • backend/services/services-service/ServicesService.Application/Clients/ReactivateClient/ReactivateClientCommand.cs
  • backend/services/services-service/ServicesService.Application/Clients/ReactivateClient/ReactivateClientCommandHandler.cs
  • backend/services/services-service/ServicesService.Application/Clients/ReactivateClient/ReactivateClientCommandValidator.cs
  • backend/services/services-service/ServicesService.Domain/Entities/Client.cs
  • backend/services/services-service/ServicesService.Infrastructure/DependencyInjection.cs
  • backend/services/services-service/ServicesService.Infrastructure/Repositories/ClientRepository.cs
  • backend/services/services-service/ServicesService.Infrastructure/Repositories/PendingAppointmentRepository.cs
  • backend/services/services-service/ServicesService.PersistenceTests/ClientPersistenceTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/ClientStatusTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/DeactivateClient/DeactivateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/DeactivateClient/DeactivateClientCommandValidatorTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/GetClientById/GetClientByIdQueryHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/ReactivateClient/ReactivateClientCommandHandlerTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/ReactivateClient/ReactivateClientCommandValidatorTests.cs
  • backend/services/services-service/ServicesService.Tests/Clients/UpdateClient/UpdateClientCommandHandlerTests.cs
  • docs/adr/0062-clients-deactivate-and-reactivate.md
  • docs/adr/README.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

This change adds client deactivation and reactivation commands and API endpoints. Domain methods guard status transitions. The application checks appointments before deactivation and email conflicts before reactivation. Both flows persist status changes without updating other client fields.

Changes

Client status lifecycle

Layer / File(s) Summary
Status transitions and persistence
backend/services/services-service/ServicesService.Domain/Entities/Client.cs, backend/services/services-service/ServicesService.Application/Abstractions/IClientRepository.cs, backend/services/services-service/ServicesService.Infrastructure/Repositories/ClientRepository.cs, backend/services/services-service/ServicesService.PersistenceTests/ClientPersistenceTests.cs, backend/services/services-service/ServicesService.Tests/Clients/ClientStatusTests.cs, backend/services/services-service/ServicesService.Tests/Clients/GetClientById/GetClientByIdQueryHandlerTests.cs, backend/services/services-service/ServicesService.Tests/Clients/UpdateClient/UpdateClientCommandHandlerTests.cs
Client now provides Inactivate and Reactivate methods that reject transitions to the current status. ClientRepository.UpdateStatusAsync marks only Status as modified. Tests cover transition errors, preserved client and contact data, active-email lookup, and persistence across sessions.
Deactivation command flow
backend/services/services-service/ServicesService.Application/Abstractions/IAppointmentRepository.cs, backend/services/services-service/ServicesService.Application/Clients/DeactivateClient/*, backend/services/services-service/ServicesService.Infrastructure/DependencyInjection.cs, backend/services/services-service/ServicesService.Infrastructure/Repositories/PendingAppointmentRepository.cs, backend/services/services-service/ServicesService.Tests/Clients/DeactivateClient/*
The handler returns not found for a missing client and returns the current response for an already inactive client. Otherwise, it checks for upcoming appointments before inactivating and saving status. The registered pending adapter returns false for the appointment check. Tests cover validation, conflict and save outcomes, and data preservation.
Reactivation command flow
backend/services/services-service/ServicesService.Application/Clients/ReactivateClient/*, backend/services/services-service/ServicesService.Tests/Clients/ReactivateClient/*
The handler returns not found for a missing client and returns the current response for an already active client. Otherwise, it checks for another active client with the same non-null email before reactivating and saving status. Tests cover validation, duplicate-email and save conflicts, and preserved data.
API wiring and decision records
backend/services/services-service/ServicesService.Api/Controllers/ClientsController.cs, backend/docs/ARCHITECTURE.md, docs/adr/0062-clients-deactivate-and-reactivate.md, docs/adr/README.md
The controller adds deactivate and reactivate endpoints that dispatch the corresponding command and declare 400, 404, and 409 problem responses. ADR 0062 and the architecture reference describe the transition rules and implementation references.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ClientsController
  participant DeactivateClientCommandHandler
  participant IAppointmentRepository
  participant IClientRepository
  participant IUnitOfWork
  Client->>ClientsController: POST deactivate
  ClientsController->>DeactivateClientCommandHandler: Dispatch command
  DeactivateClientCommandHandler->>IClientRepository: Look up client
  DeactivateClientCommandHandler->>IAppointmentRepository: Check upcoming appointments
  DeactivateClientCommandHandler->>IClientRepository: Update status
  DeactivateClientCommandHandler->>IUnitOfWork: Save changes
  IUnitOfWork-->>ClientsController: Save result
  ClientsController-->>Client: Return response
Loading
sequenceDiagram
  participant Client
  participant ClientsController
  participant ReactivateClientCommandHandler
  participant IClientRepository
  participant IUnitOfWork
  Client->>ClientsController: POST reactivate
  ClientsController->>ReactivateClientCommandHandler: Dispatch command
  ReactivateClientCommandHandler->>IClientRepository: Look up client
  ReactivateClientCommandHandler->>IClientRepository: Check active email match
  ReactivateClientCommandHandler->>IClientRepository: Update status
  ReactivateClientCommandHandler->>IUnitOfWork: Save changes
  IUnitOfWork-->>ClientsController: Save result
  ClientsController-->>Client: Return response
Loading

Merge Risk: ⚪ Minimal · up to a1eab

The change is mergeable on the supplied evidence. Appointment-based blocking remains deferred until the appointments module is integrated.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 66 functions across 21 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding backend support to deactivate and reactivate a client. It is concise and specific.
Full details: Docstring Coverage

Explanation

Docstring coverage is 3.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 66 functions across 21 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

evertonschuster and others added 3 commits October 7, 2026 20:36
… backend)

IAppointmentRepository.ExistsNotCancelledStartingAfterAsync(clientId,
instant) vira HasUpcomingAppointmentsAsync(clientId): a porta deixa de
carregar um DateTimeOffset e o adaptador decide o que é "futuro" com o
TimeProvider em UTC. O handler de desativar deixa de injetar o
TimeProvider.

A regra não muda: bloqueia o agendamento não cancelado cujo início do
atendimento é estritamente depois do instante da consulta. O ADR 0062
registra o novo desenho e a versão com parâmetro como rejeitada.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ativação (#157, #158, backend)

Atende a revisão do PR.

- UnitOfWork passa a logar, uma vez, todo save rejeitado pelo banco
  (Warning, tipo e constraint). Criar, editar, desativar e reativar
  cliente perdem o ILogger e só devolvem Client.SaveFailed.
- IClientRepository.UpdateAsync compara os contatos por id e grava só a
  diferença. Antes lançava exceção para um cliente com contatos que não
  mudaram, então desativar e reativar usam o mesmo UpdateAsync do PUT e
  UpdateStatusAsync deixa de existir. O PUT continua substituindo tudo,
  porque cria contatos com ids novos.
- Reativar também checa o CPF contra outra pessoa (409
  Client.DuplicateCpf, antes do e-mail), como criar e editar. O índice
  já impede o conflito, então é uma checagem defensiva.
- ADR 0062 reescrito nessas partes, ADR 0048 e ARCHITECTURE §4 e as
  referências da skill de slice acompanham.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Updated client repository update logic to synchronize guardians and reference contacts instead of manually tracking stale entries, keeping client contact records consistent during edits. This also removes redundant usings and stale documentation imports across backend services and fixes a few compile-time cleanups in the identity and shared kernel projects.
@evertonschuster
evertonschuster merged commit 0d25fe4 into main Oct 8, 2026
16 of 17 checks passed
@evertonschuster
evertonschuster deleted the feat/157-158-clients-deactivate-reactivate-backend branch October 8, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant