src/users/schemas/user.schema.ts
Properties |
|
| _id |
Type : string
|
|
Defined in src/users/schemas/user.schema.ts:15
|
| authStrategy |
Type : string
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:45
|
Type : string
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:33
|
| emailVerified |
Type : boolean
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:37
|
| Optional id |
Type : string
|
|
Defined in src/users/schemas/user.schema.ts:17
|
| password |
Type : string
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:29
|
| realm |
Type : string
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:21
|
| username |
Type : string
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:25
|
| userSettings |
Type : UserSettings
|
Decorators :
@ApiProperty()
|
|
Defined in src/users/schemas/user.schema.ts:41
|
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { ApiProperty } from "@nestjs/swagger";
import * as mongoose from "mongoose";
import { UserSettings, UserSettingsSchema } from "./user-settings.schema";
export type UserDocument = User & mongoose.Document;
@Schema({
collection: "User",
toJSON: {
getters: true,
},
})
export class User {
_id: string;
id?: string;
@ApiProperty()
@Prop({ required: false })
realm: string;
@ApiProperty()
@Prop({ required: true })
username: string;
@ApiProperty()
@Prop({ required: false, select: false })
password: string;
@ApiProperty()
@Prop({ required: true, unique: true })
email: string;
@ApiProperty()
@Prop({ required: false })
emailVerified: boolean;
@ApiProperty()
@Prop({ type: UserSettingsSchema })
userSettings: UserSettings;
@ApiProperty()
@Prop({ type: String, required: false })
authStrategy: string;
}
export const UserSchema = SchemaFactory.createForClass(User);