feat(events): implement numeric code check-in#297
Conversation
Add self-service check-in via short-lived numeric codes announced by the organizer. - Add revoked_at column to events_check_in_codes (soft revoke) - Create NumericCodeCheckInAction with validation pipeline (existence, date, expiry, max uses, revoked) - Create CheckInCodesRelationManager for admin panel (generate codes with 4/6 digit length, revoke) - Create NumericCodeCheckIn Livewire component for participant code entry - Add 4 new CheckInException factory methods with translated error messages - Add feature tests covering valid, invalid, expired, revoked, exhausted, and concurrent scenarios Refs #245 Closes #296
…firmed non-null at that point) and added eager-loading for `event.enrollmentPolicy` to avoid N+1.
|
Fiz uma passada focada em seguranca, consistencia e comportamento em producao. A feature esta bem encaminhada, mas eu seguraria o merge por alguns pontos:
Arquivo: O admin salva Sugestao: validar tambem
Arquivos:
O componente Livewire permite tentativas repetidas de Sugestao: adicionar rate limit por
Arquivos:
A tabela permite o mesmo Sugestao: incluir
Arquivo:
Sugestao: gerar uma unica vez o codigo que sera salvo, ou atualizar o preview de forma reativa com o mesmo valor usado na persistencia. Tambem vale adicionar testes cobrindo esses casos: codigo antes de |
…expiry Set pgsql session timezone to UTC (matching APP_TIMEZONE) to prevent +3h shift when Laravel serializes Carbon values. Use Carbon::isFuture() for timezone-safe starts_at comparison. Add format validation on admin panel code generation. Closes #297
|
Boa, os pontos anteriores parecem enderecados nesta ultima versao. Fiquei com uma duvida sobre a mudanca em 'timezone' => 'UTC',Essa alteracao muda o timezone da conexao Postgres de forma global, fora do escopo direto do check-in numerico. Como o app usa Se a intencao era apenas estabilizar os testes/validacoes desse fluxo, talvez seja melhor resolver localmente no teste ou na comparacao de datas, para evitar impacto transversal. |
|
Corrigido, codex tava fritando ontem pra corrigir 2 testes q nao passavam e acabou trocando a timezone do banco 🤡 @sirelves |
Closes #245
Summary
Implements self-service check-in via short-lived numeric codes announced by the organizer. Participants enter the code on the event detail page to check themselves in without organizer intervention.
What was done
Domain layer
revoked_atcolumn toevents_check_in_codes(soft revoke, per ADR-0003)NumericCodeCheckInDTOcarrying enrollment, code, and eventDateNumericCodeCheckInActionwith 5-step validation pipeline: existence → date binding → expiry/revoked → max uses → atomic increment + delegation to coreCheckInActionCheckInExceptionfactory methods:invalidCheckInCode,checkInCodeExpired,checkInCodeExhausted,checkInCodeWrongDateAdmin panel
CheckInCodesRelationManageron the Event edit pageevent_datedefaults to the event's starts_at, constrained to the event date rangerevoked_at)App panel
NumericCodeCheckInLivewire component embedded in the event detail pageconfirmedorchecked_inTests
Quality
ADR