diff --git a/migrations/1731590176819-addUserEmailNotification.ts b/migrations/1731590176819-addUserEmailNotification.ts deleted file mode 100644 index cec4190..0000000 --- a/migrations/1731590176819-addUserEmailNotification.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { MigrationInterface, QueryRunner } from 'typeorm'; -import { - SCHEMA_VALIDATORS_NAMES, - NotificationType, -} from '../src/entities/notificationType'; -import { NOTIFICATION_CATEGORY } from '../src/types/general'; -import { NOTIFICATIONS_EVENT_NAMES } from '../src/types/notifications'; -import { MICRO_SERVICES } from '../src/utils/utils'; - -const UserEmailConfirmationNotificationCodeFlowType = [ - { - name: NOTIFICATIONS_EVENT_NAMES.SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW, - description: - NOTIFICATIONS_EVENT_NAMES.SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW, - microService: MICRO_SERVICES.givethio, - category: NOTIFICATION_CATEGORY.ORTTO, - schemaValidator: - SCHEMA_VALIDATORS_NAMES.SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW, - }, -]; - -export class AddUserEmailNotification1731590176819 - implements MigrationInterface -{ - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.manager.save( - NotificationType, - UserEmailConfirmationNotificationCodeFlowType, - ); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query( - `DELETE FROM notification_type WHERE "name" = 'Send email confirmation code flow';`, - ); - } -} diff --git a/src/entities/notificationType.ts b/src/entities/notificationType.ts index 9a70611..a26fad5 100644 --- a/src/entities/notificationType.ts +++ b/src/entities/notificationType.ts @@ -13,7 +13,6 @@ import { NotificationSetting } from './notificationSetting'; // Export Object with Schemas to N1 lookup export const SCHEMA_VALIDATORS_NAMES = { SEND_EMAIL_CONFIRMATION: 'sendEmailConfirmation', - SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW: 'sendUserEmailConfirmationCodeFlow', CREATE_ORTTO_PROFILE: 'createOrttoProfile', SUBSCRIBE_ONBOARDING: 'subscribeOnboarding', SUPERFLUID: 'userSuperTokensCritical', diff --git a/src/services/notificationService.ts b/src/services/notificationService.ts index 85e5edb..2640ed9 100644 --- a/src/services/notificationService.ts +++ b/src/services/notificationService.ts @@ -39,13 +39,6 @@ export const activityCreator = ( 'str:cm:verificationlink': payload.verificationLink, }; break; - case NOTIFICATIONS_EVENT_NAMES.SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW: - attributes = { - 'str:cm:email': payload.email, - 'int:cm:code': Number(payload.verificationCode), - 'str:cm:userid': payload.userId?.toString(), - }; - break; case NOTIFICATIONS_EVENT_NAMES.CREATE_ORTTO_PROFILE: attributes = { 'str:cm:email': payload.email, diff --git a/src/types/notifications.ts b/src/types/notifications.ts index 3d22ecc..68d1d35 100644 --- a/src/types/notifications.ts +++ b/src/types/notifications.ts @@ -50,7 +50,6 @@ export enum NOTIFICATIONS_EVENT_NAMES { SUPER_TOKENS_BALANCE_DEPLETED = 'Stream balance depleted', CREATE_ORTTO_PROFILE = 'Create Ortto profile', SEND_EMAIL_CONFIRMATION = 'Send email confirmation', - SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW = 'Send email confirmation code flow', SUBSCRIBE_ONBOARDING = 'Subscribe onboarding', NOTIFY_REWARD_AMOUNT = 'Notify reward amount', } @@ -82,6 +81,4 @@ export const ORTTO_EVENT_NAMES = { 'verification-form-email-verification', [NOTIFICATIONS_EVENT_NAMES.NOTIFY_REWARD_AMOUNT]: 'notify-reward', [NOTIFICATIONS_EVENT_NAMES.SUBSCRIBE_ONBOARDING]: 'onboarding-form', - [NOTIFICATIONS_EVENT_NAMES.SEND_USER_EMAIL_CONFIRMATION_CODE_FLOW]: - 'email-verification-code', }; diff --git a/src/utils/validators/segmentAndMetadataValidators.ts b/src/utils/validators/segmentAndMetadataValidators.ts index 145ceb1..915d5bf 100644 --- a/src/utils/validators/segmentAndMetadataValidators.ts +++ b/src/utils/validators/segmentAndMetadataValidators.ts @@ -162,12 +162,6 @@ const sendEmailConfirmationSchema = Joi.object({ verificationLink: Joi.string().required(), }); -const sendUserEmailConfirmationCodeFlowSchema = Joi.object({ - email: Joi.string().required(), - verificationCode: Joi.string().required(), - userId: Joi.number().required(), -}); - const notifyRewardAmountSegmentSchema = Joi.object({ round: Joi.number().required(), date: Joi.string().required(), @@ -191,10 +185,6 @@ export const SEGMENT_METADATA_SCHEMA_VALIDATOR: { metadata: null, segment: sendEmailConfirmationSchema, }, - sendUserEmailConfirmationCodeFlow: { - metadata: null, - segment: sendUserEmailConfirmationCodeFlowSchema, - }, createOrttoProfile: { segment: createOrttoProfileSegmentSchema, metadata: null, diff --git a/src/validators/schemaValidators.ts b/src/validators/schemaValidators.ts index ae7afcd..ccd99ff 100644 --- a/src/validators/schemaValidators.ts +++ b/src/validators/schemaValidators.ts @@ -55,7 +55,6 @@ export const sendNotificationValidator = Joi.object({ email: Joi.string().allow(null).allow(''), title: Joi.string(), slug: Joi.string(), - verificationCode: Joi.string().allow(null).allow(''), firstName: Joi.string().allow(null).allow(''), userId: Joi.number(), projectLink: Joi.string().allow(null).allow(''),