* create authentication entities * ensure hashes are not returned * re-add integration test argument * update filterableprops * update type * pr feedback * update serialization * move finding existing entities and validation to service layer * update types * update models * update user model * pr feedback * fix build * pr feedback * update integration test fixtures --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
28 lines
597 B
TypeScript
28 lines
597 B
TypeScript
import {
|
|
Entity,
|
|
Enum,
|
|
OptionalProps,
|
|
PrimaryKey,
|
|
Property,
|
|
} from "@mikro-orm/core"
|
|
import { ProviderDomain } from "../types/repositories/auth-provider"
|
|
|
|
type OptionalFields = "domain" | "is_active"
|
|
|
|
@Entity()
|
|
export default class AuthProvider {
|
|
[OptionalProps]: OptionalFields
|
|
|
|
@PrimaryKey({ columnType: "text" })
|
|
provider!: string
|
|
|
|
@Property({ columnType: "text" })
|
|
name: string
|
|
|
|
@Enum({ items: () => ProviderDomain, default: ProviderDomain.ALL })
|
|
domain: ProviderDomain = ProviderDomain.ALL
|
|
|
|
@Property({ columnType: "boolean", default: false })
|
|
is_active = false
|
|
}
|