import { Entity, model, property, hasMany } from '@loopback/repository'; import { User, UserToGroup, UserToGroupWithRelations, UserGroupEndPointPermission, UserGroupEndPointPermissionWithRelations, } from '../../data'; @model({settings: {strict: false}}) export class UserGroup extends Entity { @property({ type: "number", id: true, }) id: number; @property({ type: "string", required: true, }) name: string; @hasMany(() => UserToGroup, { "keyTo": "groupId" }) toUsers?: UserToGroup[]; @hasMany(() => UserGroupEndPointPermission, { "keyTo": "groupId" }) permissions?: UserGroupEndPointPermission[]; [prop: string]: any; constructor(data?: Partial) { super(data); } } export interface UserGroupRelations { toUsers?: UserToGroupWithRelations; permissions?: UserGroupEndPointPermissionWithRelations; } export type UserGroupWithRelations = UserGroup & UserGroupRelations;