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 | 1x 1x 1x 1x 1x 72x 72x 72x 72x | import {Getter, inject} from '@loopback/core'; import {DefaultCrudRepository, HasManyRepositoryFactory, repository} from '@loopback/repository'; import {MysqlDataSource} from '../datasources'; import {PromoCodes, PromoCodesRelations, PromoDetails} from '../models'; import {PromoDetailsRepository} from './promo-details.repository'; export class PromoCodesRepository extends DefaultCrudRepository< PromoCodes, typeof PromoCodes.prototype.UID, PromoCodesRelations > { public readonly promoDetails: HasManyRepositoryFactory<PromoDetails, typeof PromoCodes.prototype.UID>; constructor( @inject('datasources.mysql') dataSource: MysqlDataSource, @repository.getter('UserRepository') protected promoDetailsRepositoryGetter: Getter<PromoDetailsRepository>, ) { super(PromoCodes, dataSource); this.promoDetails = this.createHasManyRepositoryFactoryFor('promoDetails', promoDetailsRepositoryGetter,); this.registerInclusionResolver('promoDetails', this.promoDetails.inclusionResolver); } } |