All files / src/repositories gate-group.repository.ts

100% Statements 14/14
100% Branches 0/0
100% Functions 1/1
100% Lines 12/12

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 47 48 49 50 511x 1x         1x 1x           1x       1x                                 18x   18x   18x 18x 18x       18x            
import {Getter, inject} from '@loopback/core';
import {
  BelongsToAccessor,
  HasManyRepositoryFactory,
  repository,
} from '@loopback/repository';
import {LogChainDataSource} from '../datasources';
import {
  GateGroup,
  GateGroupDetail,
  GateGroupRelations,
  TemplateDocument,
} from '../models';
import {BaseCrudRepository} from './base-crud.repository.base';
import {GateGroupDetailRepository} from './gate-group-detail.repository';
import {TemplateDocumentRepository} from './template-document.repository';
 
export class GateGroupRepository extends BaseCrudRepository<
  GateGroup,
  typeof GateGroup.prototype.id,
  GateGroupRelations
> {
  public readonly document: BelongsToAccessor<
    TemplateDocument,
    typeof GateGroup.prototype.id
  >;
  public readonly gate_group_details: HasManyRepositoryFactory<
    GateGroupDetail,
    typeof GateGroup.prototype.id
  >;
 
  constructor(
    @inject('datasources.logchain') dataSource: LogChainDataSource,
    @repository.getter('DocumentRepository')
    protected template_document_repo_getter: Getter<TemplateDocumentRepository>,
    @repository.getter('GateGroupDetailRepository')
    protected gate_group_detail_repo_getter: Getter<GateGroupDetailRepository>,
  ) {
    super(GateGroup, dataSource);
    this.document = this.createBelongsToAccessor('document', template_document_repo_getter);
    this.gate_group_details = this.createHasManyRepositoryFactoryFor(
      'gate_group_details',
      gate_group_detail_repo_getter,
    );
    this.registerInclusionResolver(
      'gate_group_details',
      this.gate_group_details.inclusionResolver,
    );
  }
}