All files / src/dtos module.dto.ts

73.33% Statements 11/15
0% Branches 0/10
0% Functions 0/2
69.23% Lines 9/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 311x 1x 1x 1x       1x   1x     1x     1x     1x                        
import {model} from '@loopback/repository';
import {Exclude, Expose} from 'class-transformer';
import {FeatureDto} from '.';
import {Module} from '../models';
 
@Exclude()
@model({name: 'ModuleDto'})
export class ModuleDto extends Module {
  @Expose()
  id: number;
 
  @Expose()
  name: string;
 
  @Expose()
  status: boolean;
 
  @Expose()
  features: FeatureDto[];
 
  constructor(data?: Partial<ModuleDto>) {
    super(data);
 
    if (data?.features) {
      this.features = data?.features.map(feature => {
        return new FeatureDto(feature);
      });
    }
  }
}