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 | 1x 1x 1x 1x 1x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x | import {Getter, inject} from '@loopback/core'; import {DefaultCrudRepository, repository, BelongsToAccessor, HasManyRepositoryFactory, HasOneRepositoryFactory} from '@loopback/repository'; import {MysqlDataSource} from '../datasources'; import {Leads, LeadsRelations, User, Payments, Opportunities} from '../models'; import {UserRepository} from './user.repository'; import {PaymentsRepository} from './payments.repository'; import {OpportunitiesRepository} from './opportunities.repository'; export class LeadsRepository extends DefaultCrudRepository< Leads, typeof Leads.prototype.UID, LeadsRelations > { public readonly user: BelongsToAccessor<User, typeof Leads.prototype.UID>; public readonly consultant: BelongsToAccessor<User, typeof Leads.prototype.UID>; public readonly registrar: BelongsToAccessor<User, typeof Leads.prototype.UID>; public readonly updateByUser: BelongsToAccessor<User, typeof Leads.prototype.UID>; public readonly opportunities: HasManyRepositoryFactory<Opportunities, typeof Leads.prototype.UID>; public readonly payments: HasOneRepositoryFactory<Payments, typeof Leads.prototype.UID>; constructor( @inject('datasources.mysql') dataSource: MysqlDataSource, @repository.getter('UserRepository') protected userRepositoryGetter: Getter<UserRepository>, @repository.getter('PaymentsRepository') protected paymentsRepositoryGetter: Getter<PaymentsRepository>, @repository.getter('OpportunitiesRepository') protected opportunitiesRepositoryGetter: Getter<OpportunitiesRepository>, ) { super(Leads, dataSource); this.payments = this.createHasOneRepositoryFactoryFor('payments', paymentsRepositoryGetter); this.registerInclusionResolver('payments', this.payments.inclusionResolver); this.opportunities = this.createHasManyRepositoryFactoryFor('opportunities', opportunitiesRepositoryGetter,); this.registerInclusionResolver('opportunities', this.opportunities.inclusionResolver); this.updateByUser = this.createBelongsToAccessorFor('updateByUser', userRepositoryGetter,); this.registerInclusionResolver('updateByUser', this.updateByUser.inclusionResolver); this.registrar = this.createBelongsToAccessorFor('registrar', userRepositoryGetter,); this.registerInclusionResolver('registrar', this.registrar.inclusionResolver); this.consultant = this.createBelongsToAccessorFor('consultant', userRepositoryGetter,); this.registerInclusionResolver('consultant', this.consultant.inclusionResolver); this.user = this.createBelongsToAccessorFor('user', userRepositoryGetter,); this.registerInclusionResolver('user', this.user.inclusionResolver); } } |