Services run commands through a CommandRunner that runs one again (up to 5 times, waiting a little longer each time) when its aggregate changed underneath, e.g. a saga writing to the same ticket. Each command loads its aggregate fresh and stores its events in one transaction, so a ConcurrencyError means nothing was stored and running it again is safe. People no longer get a 409 for it, and the e2e suite stops flaking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api-identity-application
Casos de uso de identidad.
- Import:
@task-stream/api/identity/application - Capa:
application· Tags:scope:api-identity,type:application
Contenido
IdentityService: punto de entrada para los presenters.- Queries:
ResolveSessionQuery(token → usuario, con caché),FindUserQuery,FindUsersByIdsQuery,SearchUsersQuery,GetAuthorizationConfigQuery. - Commands:
IssueTokenCommand(login / refresh vía Pireon),HandleIdentityWebhookCommand(al desactivar a un usuario, guardaUserDeactivatedEventen el event store para que el tracker reaccione). - Puertos:
IdentityProvider,SessionCache,UserRegistry.
Ver Autenticación.
Comandos
npx nx lint api-identity-application
npx nx test api-identity-application # Jest
Reglas de dependencia entre capas: Arquitectura.