import { ApiProperty } from "@nestjs/swagger";
import { BelongsToMany } from "sequelize-typescript";
import { Column, DataType, Model, Table } from "sequelize-typescript";
import { Users } from "src/users/users.model";
import { UserRoles } from "./user-roles.model";
interface RoleCreationAttrs {
value: string;
description: string;
}
@Table({tableName: 'roles'})
export class Role extends Model<Role, RoleCreationAttrs> {
@ApiProperty({example: '1', description: 'User unique Id number'})
@Column({type: DataType.INTEGER, unique: true, autoIncrement: true, primaryKey: true})
id: number;
@ApiProperty({example: 'Admin/Moder/User', description: 'Role unique value'})
@Column({type: DataType.STRING, unique: true, allowNull: false})
value: string;
@ApiProperty({example: 'Short desc', description: 'Short description of role'})
@Column({type: DataType.STRING, allowNull: false})
description: string;
@BelongsToMany(() => Users, () => UserRoles)
users: Users[];
}
а если вывожу в консоль homeContent.content то выдает proxy