Created
February 3, 2024 14:28
-
-
Save Dionid/0e938440614d1bf87c7dad3666d89558 to your computer and use it in GitHub Desktop.
Introspection + models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instrospection.ts | |
type UserTable = { | |
id: string, | |
email: string, | |
password: string | null, | |
active: boolean | |
} | |
// models.ts | |
type UserInactive = UserTable & { | |
id: UUID, | |
email: Email, | |
password: null, | |
active: false | |
} | |
type UserActive = UserTable & { | |
id: UUID, | |
email: Email, | |
password: HashedPassword, | |
active: true | |
} | |
type User = UserInactive | UserActive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment