This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($release): improvements and fixes
Whats new: - added pg2web for ease access to PSQL data - launch integration to lokalise - added verification for email code after account creating Whats fixed: - fix for validators - trash cleanup Signed-off-by: Andrew Ghostuhin <[email protected]>
- Loading branch information
1 parent
21c98b4
commit 640ef1f
Showing
24 changed files
with
56 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
import { MinLength, IsEmail } from 'class-validator' | ||
import { IsFieldEqual } from '@er/common' | ||
import { IsEmailExists, IsLoginExists } from '../constraints' | ||
import messages from '../messages' | ||
|
||
export class CreateAccountDto { | ||
@MinLength(3) | ||
@IsLoginExists() | ||
@MinLength(3, { | ||
message: messages.minLength, | ||
}) | ||
@IsLoginExists({ | ||
message: messages.loginExists, | ||
}) | ||
readonly login: string | ||
|
||
@IsEmail() | ||
@IsEmailExists() | ||
@IsEmail({}, { | ||
message: messages.invalidEmail, | ||
}) | ||
@IsEmailExists({ | ||
message: messages.emailExists, | ||
}) | ||
readonly email: string | ||
|
||
readonly password: string | ||
|
||
@IsFieldEqual('password', { | ||
message: 'Password not equal', | ||
message: messages.confirmPassword, | ||
}) | ||
readonly confirmPassword: string | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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,5 +1,2 @@ | ||
import { CreateUserHandler } from './CreateUserHandler' | ||
|
||
export const CommandHandlers = [ | ||
CreateUserHandler, | ||
] |
This file was deleted.
Oops, something went wrong.
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 +0,0 @@ | ||
export * from './CreateUserCommand' | ||
This file was deleted.
Oops, something went wrong.
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 +1 @@ | ||
export * from './CreateUserDto' | ||
|
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,25 +1,12 @@ | ||
import { Injectable } from '@nestjs/common' | ||
import { Mutation } from '@nestjs/graphql' | ||
import { CreateUserDto } from '../dto' | ||
import { Validate } from '@er/common' | ||
import { CommandBus } from '@er/cqrs' | ||
import { CreateUserCommand } from '../commands/impl' | ||
|
||
@Injectable() | ||
export class UserMutations { | ||
constructor( | ||
private readonly commandBus: CommandBus, | ||
) {} | ||
|
||
@Mutation() | ||
@Validate(CreateUserDto) | ||
createUser(request, { input }) { | ||
return this.commandBus.execute( | ||
new CreateUserCommand( | ||
input.login, | ||
input.email, | ||
input.password, | ||
), | ||
) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { IsVerificationCodeValid } from '../constraints' | ||
import messages from '../messages' | ||
|
||
export class ConfirmVerificationCodeDto { | ||
public readonly verificationId: string | ||
|
||
@IsVerificationCodeValid({ | ||
message: 'Invalid code', | ||
message: messages.invalidVerificationCode, | ||
}) | ||
public readonly verificationCode: string | ||
} |