Files
medusa-store/packages/authentication/src/models/auth-provider.ts
Philip Korsholm 479a8b82a9 feat(authentication, types): Create authentication entities and services (#5979)
* 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>
2024-01-08 09:50:12 +01:00

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
}