UNPKG

@tomei/sso

Version:
40 lines (35 loc) 1.05 kB
import { RepositoryBase, IRepositoryBase } from '@tomei/general'; import UserPasswordHistoryModel from '../../models/user-password-history'; import { Op } from 'sequelize'; export class UserPasswordHistoryRepository extends RepositoryBase<UserPasswordHistoryModel> implements IRepositoryBase<UserPasswordHistoryModel> { constructor() { super(UserPasswordHistoryModel); } async findByPk(id: string, options?: any): Promise<UserPasswordHistoryModel> { return await UserPasswordHistoryModel.findByPk(parseInt(id), options); } async destroy(HistoryId: number, dbTransaction: any): Promise<void> { await UserPasswordHistoryModel.destroy({ where: { HistoryId: HistoryId, }, transaction: dbTransaction, }); } async destroyMultiple( HistoryIdList: string[], dbTransaction: any, ): Promise<void> { await UserPasswordHistoryModel.destroy({ where: { HistoryId: { [Op.in]: HistoryIdList, }, }, transaction: dbTransaction, }); } }