-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
42 deletions.
There are no files selected for viewing
53 changes: 32 additions & 21 deletions
53
migrations/1718888344202-seedNotificationTypeForNotifyRewardAmount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
import { NOTIFICATION_CATEGORY, NOTIFICATION_TYPE_NAMES } from '../src/types/general'; | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { | ||
NOTIFICATION_CATEGORY, | ||
NOTIFICATION_TYPE_NAMES, | ||
} from '../src/types/general'; | ||
import { MICRO_SERVICES } from '../src/utils/utils'; | ||
import { NotificationType, SCHEMA_VALIDATORS_NAMES } from '../src/entities/notificationType'; | ||
import { | ||
NotificationType, | ||
SCHEMA_VALIDATORS_NAMES, | ||
} from '../src/entities/notificationType'; | ||
|
||
const NotifyRewardAmountNotificationType = [ | ||
{ | ||
name: NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT, | ||
description: NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT, | ||
microService: MICRO_SERVICES.givethio, | ||
category: NOTIFICATION_CATEGORY.NOTIFY_REWARD_AMOUNT, | ||
schemaValidator: SCHEMA_VALIDATORS_NAMES.NOTIFY_REWARD_AMOUNT, | ||
title: "Notify reward report", | ||
} | ||
] | ||
{ | ||
name: NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT, | ||
description: NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT, | ||
microService: MICRO_SERVICES.givethio, | ||
category: NOTIFICATION_CATEGORY.NOTIFY_REWARD_AMOUNT, | ||
schemaValidator: SCHEMA_VALIDATORS_NAMES.NOTIFY_REWARD_AMOUNT, | ||
title: 'Notify reward report', | ||
}, | ||
]; | ||
|
||
export class seedNotificationTypeForNotifyRewardAmount1718888344202 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.save(NotificationType, NotifyRewardAmountNotificationType); | ||
} | ||
export class seedNotificationTypeForNotifyRewardAmount1718888344202 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.save( | ||
NotificationType, | ||
NotifyRewardAmountNotificationType, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`DELETE FROM notification_type WHERE "name" = ${NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT};`, | ||
); | ||
} | ||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`DELETE FROM notification_type WHERE "name" = ${NOTIFICATION_TYPE_NAMES.NOTIFY_REWARD_AMOUNT};`, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters