import { Entity, model, property, belongsTo } from '@loopback/repository'; import { User, UserGroup, UserWithRelations, UserGroupWithRelations } from '../../data'; @model({settings: {strict: false}}) export class UserToGroup extends Entity { @property({ type: "number", id: true, }) id?: number; @belongsTo(() => User, { "keyTo": "id" }) userId: number; @belongsTo(() => UserGroup, { "keyTo": "id" }) groupId: number; [prop: string]: any; constructor(data?: Partial) { super(data); } } export interface UserToGroupRelations { // describe navigational properties here user: UserWithRelations; group: UserGroupWithRelations; } export type UserToGroupWithRelations = UserToGroup & UserToGroupRelations;