mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
feat: allowance journey
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { BadRequestException, Injectable } from '@nestjs/common';
|
||||
import { BadRequestException, forwardRef, Inject, Injectable } from '@nestjs/common';
|
||||
import { Transactional } from 'typeorm-transactional';
|
||||
import { Roles } from '~/auth/enums';
|
||||
import { UserService } from '~/auth/services';
|
||||
@ -14,9 +14,9 @@ import { JuniorTokenService } from './junior-token.service';
|
||||
export class JuniorService {
|
||||
constructor(
|
||||
private readonly juniorRepository: JuniorRepository,
|
||||
private readonly userService: UserService,
|
||||
private readonly customerService: CustomerService,
|
||||
private readonly juniorTokenService: JuniorTokenService,
|
||||
@Inject(forwardRef(() => UserService)) private readonly userService: UserService,
|
||||
) {}
|
||||
|
||||
@Transactional()
|
||||
@ -86,4 +86,10 @@ export class JuniorService {
|
||||
generateToken(juniorId: string) {
|
||||
return this.juniorTokenService.generateToken(juniorId);
|
||||
}
|
||||
|
||||
async doesJuniorBelongToGuardian(guardianId: string, juniorId: string) {
|
||||
const junior = await this.findJuniorById(juniorId, false, guardianId);
|
||||
|
||||
return !!junior;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user