2022-05-29 08:38:22 +12:00
|
|
|
import { User, Account } from "../documents"
|
2022-06-13 21:51:29 +12:00
|
|
|
import { IdentityType } from "./events/identification"
|
2022-05-29 08:38:22 +12:00
|
|
|
|
|
|
|
export interface BaseContext {
|
|
|
|
_id: string
|
|
|
|
type: IdentityType
|
2022-07-14 00:22:21 +12:00
|
|
|
tenantId?: string
|
2022-05-29 08:38:22 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AccountUserContext extends BaseContext {
|
|
|
|
tenantId: string
|
|
|
|
account: Account
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserContext extends BaseContext, User {
|
|
|
|
_id: string
|
2022-07-14 00:22:21 +12:00
|
|
|
tenantId: string
|
2022-05-29 08:38:22 +12:00
|
|
|
account?: Account
|
|
|
|
}
|
|
|
|
|
|
|
|
export type IdentityContext = BaseContext | AccountUserContext | UserContext
|