All files / src/models promo-details.model.ts

93.33% Statements 14/15
100% Branches 0/0
66.66% Functions 2/3
92.3% Lines 12/13

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 461x 1x 1x     1x           1x       1x           1x           1x   42x 1x   42x 1x                        
import { Entity, model, property, belongsTo} from '@loopback/repository';
import {User} from './user.model';
import {PromoCodes} from './promo-codes.model';
 
@model()
export class PromoDetails extends Entity {
  @property({
    type: 'string',
    id: true,
    generated: false,
  })
  UID?: string;
  @property({
    type: 'string',
  })
  leadUID?: string;
 
  @property({
    type: 'date',
    default: new Date(),
  })
  createdAt?: Date;
 
  @property({
    type: 'date',
    default: new Date(),
  })
  updatedAt?: Date;
 
  @belongsTo(() => User, {name: 'usedBy'})
  usedByUID?: string;
 
  @belongsTo(() => PromoCodes, {name: 'promoCode'})
  promoUID?: string;
 
  constructor(data?: Partial<PromoDetails>) {
    super(data);
  }
}
 
export interface PromoDetailsRelations {
  // describe navigational properties here
}
 
export type PromoDetailsWithRelations = PromoDetails & PromoDetailsRelations;