Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 2 0 release #126

Merged
merged 55 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d95526b
add eslint
RamRamez Jul 2, 2024
5a7e13c
add eslint
RamRamez Jul 2, 2024
007f753
add eslint
RamRamez Jul 2, 2024
18976dd
add eslint
RamRamez Jul 2, 2024
8c0aac4
fix eslint errors
RamRamez Jul 2, 2024
16b0e81
remove lock file
RamRamez Jul 2, 2024
8a6ab3a
Merge branch 'refs/heads/staging' into eslint
RamRamez Jul 17, 2024
966fd17
fix eslint errors
RamRamez Jul 17, 2024
10fe752
Change date schema to be compatible with ortto schema
ae2079 Jul 22, 2024
1a469c7
Merge pull request #105 from Giveth/eslint
RamRamez Jul 22, 2024
fe1c9f9
Fix unit test based on changes
ae2079 Jul 22, 2024
c548c78
Pull staging and resolve conflicts
ae2079 Jul 22, 2024
90528ac
Fix lint errors
ae2079 Jul 22, 2024
5eab9eb
Fix lint errors
ae2079 Jul 22, 2024
3a8e70b
change main-pipeline
RamRamez Jul 22, 2024
b530e65
feat: change GivethNotificationTypes seed
Reshzera Jul 22, 2024
c8fe8a6
fix: remove brake line
Reshzera Jul 22, 2024
aa3423a
Merge pull request #108 from Giveth/4194-make-orto-schema-compatible
ae2079 Jul 22, 2024
1922f6e
change Dockerfile
RamRamez Jul 23, 2024
385dd19
change Dockerfile to use yarn
RamRamez Jul 23, 2024
5e2fb97
Merge pull request #111 from Giveth/change-Dockerfile
RamRamez Jul 23, 2024
14a0d7f
remove userId from notify reward amount ortto request
ae2079 Jul 23, 2024
e45646a
Merge pull request #112 from Giveth/4194-make-notification-compatible…
ae2079 Jul 23, 2024
d779dfb
add email to payload for notify reward
ae2079 Jul 24, 2024
c36d275
Fix tests for notify reward
ae2079 Jul 24, 2024
37cfa70
fix: create migration to change givbacks notification
Reshzera Jul 24, 2024
42428dc
Merge pull request #110 from Giveth/feat/issue-2527
Reshzera Jul 24, 2024
64ebbfd
Change scripts to use ts-node for running migrations
ae2079 Jul 30, 2024
9d3823e
Add tsconfig-paths module to application
ae2079 Jul 30, 2024
b2678d6
ensure dataSource initialize before running migrations
ae2079 Jul 31, 2024
4618870
Update packages
ae2079 Jul 31, 2024
c1d245d
Use the previous version of ts
ae2079 Jul 31, 2024
c0e9ce3
Allow ts to resolve json modules
ae2079 Jul 31, 2024
ed56844
Run pretest scripts before test migrations
ae2079 Jul 31, 2024
9c6662d
Make pretest scripts stand alone
ae2079 Jul 31, 2024
6186262
Revert changes on pre-test-scripts.ts
ae2079 Jul 31, 2024
45f2075
remove pre-test-scripts from migration commands
ae2079 Jul 31, 2024
a02e696
downgrade typeorm version to fix migration execution
ae2079 Jul 31, 2024
0b6839d
run migrations using scripts
ae2079 Jul 31, 2024
5018277
Upgrade typeorm version again
ae2079 Jul 31, 2024
db16aa0
add create test database step to the staging-pipeline.yml
ae2079 Aug 1, 2024
5ed076b
add wait for database step to the staging-pipeline.yml
ae2079 Aug 1, 2024
a805727
change database port in the staging-pipeline.yml
ae2079 Aug 1, 2024
135f6d1
change database name in the staging-pipeline.yml and remove redundant…
ae2079 Aug 1, 2024
5a290b8
change database name in the main-pipeline.yml
ae2079 Aug 1, 2024
1436576
Merge pull request #113 from Giveth/fix-migrations-execution-issue
ae2079 Aug 1, 2024
28d21a2
add migration for create Qacc third party
ae2079 Aug 12, 2024
0a22290
Merge pull request #117 from Giveth/addQaccThirdParty
aminlatifi Aug 12, 2024
ede15cf
support Qacc on Ortto
ae2079 Aug 20, 2024
9ba9425
Add Qacc to microServices
ae2079 Aug 20, 2024
6d73ff7
Merge pull request #119 from Giveth/supportQaccOnOrtto
ae2079 Aug 20, 2024
b452f6b
Resolve merge conflicts
mohammadranjbarz Aug 28, 2024
a69f240
Feat/User mail verification notification
kkatusic Nov 15, 2024
3eada61
Merge pull request #124 from Giveth/enable_user_email_verification
kkatusic Nov 22, 2024
ada2cff
Merge branch 'main' into v2_2_0_release
kkatusic Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions migrations/1731590176819-addUserEmailNotification.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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<void> {
await queryRunner.manager.save(
NotificationType,
UserEmailConfirmationNotificationCodeFlowType,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`DELETE FROM notification_type WHERE "name" = 'Send email confirmation code flow';`,
);
}
}
1 change: 1 addition & 0 deletions src/entities/notificationType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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',
Expand Down
7 changes: 7 additions & 0 deletions src/services/notificationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ 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,
Expand Down
3 changes: 3 additions & 0 deletions src/types/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ 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',
}
Expand Down Expand Up @@ -81,4 +82,6 @@ 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',
};
10 changes: 10 additions & 0 deletions src/utils/validators/segmentAndMetadataValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ 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(),
Expand All @@ -185,6 +191,10 @@ export const SEGMENT_METADATA_SCHEMA_VALIDATOR: {
metadata: null,
segment: sendEmailConfirmationSchema,
},
sendUserEmailConfirmationCodeFlow: {
metadata: null,
segment: sendUserEmailConfirmationCodeFlowSchema,
},
createOrttoProfile: {
segment: createOrttoProfileSegmentSchema,
metadata: null,
Expand Down
1 change: 1 addition & 0 deletions src/validators/schemaValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ 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(''),
Expand Down
Loading