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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 1x 1x 1x 1x 1x 1x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x | import {Getter, inject} from '@loopback/core';
import {BelongsToAccessor, HasManyRepositoryFactory, HasOneRepositoryFactory, repository} from '@loopback/repository';
import {
TradeLaneFlowJourneyPointRepository,
TradeLaneFlowPersonaRepository,
TradeLaneRepository,
UserRepository,
} from '.';
import {LogChainDataSource} from '../datasources';
import {
TradeLane,
TradeLaneFlow,
TradeLaneFlowJourneyPoint,
TradeLaneFlowPersona,
TradeLaneFlowRelations,
User,
} from '../models';
import {BaseCrudRepository} from './base-crud.repository.base';
export class TradeLaneFlowRepository extends BaseCrudRepository<
TradeLaneFlow,
typeof TradeLaneFlow.prototype.id,
TradeLaneFlowRelations
> {
public readonly trade_lane: HasOneRepositoryFactory<TradeLane, typeof TradeLane.prototype.id>;
public readonly personas: HasManyRepositoryFactory<TradeLaneFlowPersona, typeof TradeLaneFlowPersona.prototype.id>;
public readonly journey_points: HasManyRepositoryFactory<
TradeLaneFlowJourneyPoint,
typeof TradeLaneFlow.prototype.id
>;
public readonly creator: BelongsToAccessor<User, typeof User.prototype.id>;
public readonly modifier: BelongsToAccessor<User, typeof User.prototype.id>;
constructor(
@inject('datasources.logchain') dataSource: LogChainDataSource,
@repository.getter('TradeLaneRepository')
protected trade_lane_repo_getter: Getter<TradeLaneRepository>,
@repository.getter('TradeLaneFlowPersonaRepository')
protected flow_persona_repo_getter: Getter<TradeLaneFlowPersonaRepository>,
@repository.getter('TradeLaneFlowJourneyPointRepository')
protected trade_lane_flow_journey_point_repo_getter: Getter<TradeLaneFlowJourneyPointRepository>,
@repository.getter('UserRepository')
protected user_repo_getter: Getter<UserRepository>,
) {
super(TradeLaneFlow, dataSource);
// ------- TRADE LANE ------- //
this.trade_lane = this.createHasOneRepositoryFactoryFor('trade_lane', trade_lane_repo_getter);
this.registerInclusionResolver('trade_lane', this.trade_lane.inclusionResolver);
// ------- TRADE LANE ------- //
// ------- JOURNEY POINTS ------- //
this.journey_points = this.createHasManyRepositoryFactoryFor(
'journey_points',
trade_lane_flow_journey_point_repo_getter,
);
this.registerInclusionResolver('journey_points', this.journey_points.inclusionResolver);
// ------- JOURNEY POINTS ------- //
// ------- REFERENCE PERSONAS ------- //
this.personas = this.createHasManyRepositoryFactoryFor('personas', flow_persona_repo_getter);
this.registerInclusionResolver('personas', this.personas.inclusionResolver);
// ------- REFERENCE PERSONAS ------- //
// ------- CREATOR ------- //
this.creator = this.createBelongsToAccessor('creator', user_repo_getter);
// ------- CREATOR ------- //
// ------- MODIFIER ------- //
this.modifier = this.createBelongsToAccessor('modifier', user_repo_getter);
// ------- MODIFIER ------- //
}
}
|