All files / src/models gate-group-detail.model.ts

90.91% Statements 10/11
100% Branches 0/0
50% Functions 1/2
88.89% Lines 8/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 471x 1x 1x                                 1x 36x 1x           1x           1x                          
import {belongsTo, model, property} from '@loopback/repository';
import {BaseEntity} from '.';
import {GateGroup} from './gate-group.model';
 
@model({
  settings: {
    postgresql: {table: 'gate_group_details'},
    foreignKeys: {
      fk_gate_group_details_gate_groups_id: {
        name: 'fk_gate_group_details_gate_groups_id',
        entity: 'GateGroup',
        entityKey: 'id',
        foreignKey: 'gate_group_id',
        onDelete: 'CASCADE',
        onUpdate: 'RESTRICT'
      },
    },
  },
})
export class GateGroupDetail extends BaseEntity {
  @belongsTo(() => GateGroup, {name: 'gate_group'})
  gate_group_id: number;
 
  @property({
    type: 'number',
    required: true,
  })
  order: number;
 
  @property({
    type: 'string',
    required: true,
  })
  question: string;
 
  constructor(data?: Partial<GateGroupDetail>) {
    super(data);
  }
}
 
export interface GateGroupDetailRelations {
  // describe navigational properties here
}
 
export type GateGroupDetailWithRelations = GateGroupDetail &
  GateGroupDetailRelations;