import { Omit } from '@ulangi/extended-types' ; import { AbstractPreparer } from '@ulangi/ulangi-common/preparers' ; import * as Joi from 'joi' ; import { ResetPasswordRequestRow } from '../interfaces/ResetPasswordRequestRow' ; export class ResetPasswordRequestRowPreparer extends AbstractPreparer < ResetPasswordRequestRow > { protected insertRules = { userId : Joi . string ( ) , resetPasswordKey : Joi . string ( ) , expiredAt : Joi . forbidden ( ) . strip ( ) . optional ( ) , } ; public prepareInsert ( userId , resetPasswordKey ) { const data = { userId , resetPasswordKey , } ; return this . validateData ( data , this . insertRules ) as Omit < ResetPasswordRequestRow , 'expiredAt' > ; } }