import { Repository , EntityRepository } from 'typeorm' ; import { User } from '@models/user.model' ; import { RefreshToken } from '@models/refresh-token.model' ; import { RefreshTokenFactory } from '@factories/refresh-token.factory' ; @ EntityRepository ( RefreshToken ) export class RefreshTokenRepository extends Repository < RefreshToken > { constructor ( ) { super ( ) ; } description param user generate ( user ) { const refreshToken = RefreshTokenFactory . get ( user ) ; void this . save ( refreshToken ) ; return refreshToken ; } }