-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add serviceEmailsPermission field (#390)
- Loading branch information
1 parent
b238f4c
commit 2dfd39e
Showing
14 changed files
with
140 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class bloomBackend1706174260018 implements MigrationInterface { | ||
name = 'bloomBackend1706174260018'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ADD "serviceEmailsPermission" boolean NOT NULL DEFAULT true`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "user" ALTER COLUMN "contactPermission" SET DEFAULT false`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "contactPermission" DROP DEFAULT`); | ||
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "serviceEmailsPermission"`); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,19 +35,23 @@ const createUserDto: CreateUserDto = { | |
password: 'password', | ||
name: 'name', | ||
contactPermission: false, | ||
serviceEmailsPermission: true, | ||
signUpLanguage: 'en', | ||
}; | ||
|
||
const createUserRepositoryDto = { | ||
email: '[email protected]', | ||
name: 'name', | ||
contactPermission: false, | ||
serviceEmailsPermission: true, | ||
signUpLanguage: 'en', | ||
firebaseUid: mockUserRecord.uid, | ||
}; | ||
|
||
const updateUserDto: UpdateUserDto = { | ||
name: 'new name', | ||
contactPermission: true, | ||
serviceEmailsPermission: false, | ||
}; | ||
|
||
const mockPartnerWithAutomaticAccessCodeFeature = { | ||
|
@@ -240,6 +244,7 @@ describe('UserService', () => { | |
expect(user.name).toBe('new name'); | ||
expect(user.email).toBe('[email protected]'); | ||
expect(user.contactPermission).toBe(true); | ||
expect(user.serviceEmailsPermission).toBe(false); | ||
|
||
expect(repoSpySave).toBeCalledWith({ ...mockUserEntity, ...updateUserDto }); | ||
expect(repoSpySave).toBeCalled(); | ||
|
@@ -280,6 +285,7 @@ describe('UserService', () => { | |
partnerAccess, | ||
signUpLanguage, | ||
contactPermission, | ||
serviceEmailsPermission, | ||
courseUser, | ||
eventLog, | ||
...userBase | ||
|
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
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 |
---|---|---|
|
@@ -135,6 +135,7 @@ export const mockUserEntity: UserEntity = { | |
crispTokenId: '123', | ||
firebaseUid: '123', | ||
contactPermission: true, | ||
serviceEmailsPermission: true, | ||
email: '[email protected]', | ||
name: 'name', | ||
signUpLanguage: 'en', | ||
|