mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 21:59:40 +00:00
feat: handle card status changed webhook
This commit is contained in:
@ -3,7 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { CreateApplicationResponse } from '~/common/modules/neoleap/dtos/response';
|
||||
import { Card } from '../entities';
|
||||
import { CardColors, CardIssuers, CardScheme, CardStatus, CustomerType } from '../enums';
|
||||
import { CardColors, CardIssuers, CardScheme, CardStatus, CardStatusDescription, CustomerType } from '../enums';
|
||||
|
||||
@Injectable()
|
||||
export class CardRepository {
|
||||
@ -19,7 +19,6 @@ export class CardRepository {
|
||||
firstSixDigits: card.firstSixDigits,
|
||||
lastFourDigits: card.lastFourDigits,
|
||||
color: CardColors.BLUE,
|
||||
status: CardStatus.ACTIVE,
|
||||
scheme: CardScheme.VISA,
|
||||
issuer: CardIssuers.NEOLEAP,
|
||||
accountId: accountId,
|
||||
@ -40,4 +39,11 @@ export class CardRepository {
|
||||
where: { customerId, status: CardStatus.ACTIVE },
|
||||
});
|
||||
}
|
||||
|
||||
updateCardStatus(id: string, status: CardStatus, statusDescription: CardStatusDescription) {
|
||||
return this.cardRepository.update(id, {
|
||||
status: status,
|
||||
statusDescription: statusDescription,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user