# User Login

This sample demonstrates one possible way to keep track of a user's Logins. It
maps their immutable id to their currently select login name. It can be queried
by immutable id or login name.

While this login representation could be used for an app that lets users change
their logins in a user interface, this example is inspired by building an app on
top of a third-party platform (e.g., GitHub) where the platform manages user
accounts and the app receives webhooks. Since a user could change their login at
any time, but the platform's API uses logins rather than immutable ids, the app
needs to keep track of every historical login that the user has used.

Like `UserSession`, the following actions can be performed on a `UserLogin`:

-   create - generated by codegen, but probably never used
-   delete - generated by codegen, but probably never used
-   read - generated by codegen, but probably never used
-   touch - each time we see a particular login
-   update - generated by codegen, but probably never used

Though this example doesn't wire up projections, it's unlikely that any standard
crud operation (except `touch`) would be used by this app. Instead, the app
would wire up a stream listener and update a summary record based on the most
recently touched login.

To further add to the complexity of `touch`, the app will also keep track of
which vendor might have sent the webhook event. (Even though we mentioned GitHub
above, one could imagine this app might support GitLab, Azure Dev Ops, etc)

In addition to crud operations, a `UserLogin` must also be queryable by either
the external id or the login name.
