mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-03-10 18:31:46 +00:00
- Introduce constants for notification event names - Implement interfaces for transaction created events - Create a transaction notification listener to handle transaction notifications - Develop a notification factory service for sending notifications based on user preferences - Add a migration to include a data column in the notifications table
17 lines
727 B
TypeScript
17 lines
727 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class AddDataColumnToNotifications1767172707881 implements MigrationInterface {
|
|
name = 'AddDataColumnToNotifications1767172707881'
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "notifications" ADD "data" jsonb`);
|
|
await queryRunner.query(`ALTER TABLE "kyc_transactions" ALTER COLUMN "national_id" DROP DEFAULT`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "kyc_transactions" ALTER COLUMN "national_id" SET DEFAULT ''`);
|
|
await queryRunner.query(`ALTER TABLE "notifications" DROP COLUMN "data"`);
|
|
}
|
|
|
|
}
|