-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuthenticateUser
More file actions
113 lines (98 loc) · 4.63 KB
/
AuthenticateUser
File metadata and controls
113 lines (98 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package features {
package AuthenticateUser {
package AuthenticateUserMain {
package database {
class UserAuthenticationOnPostgreSQLDatabase implements AuthenticateUserGateway {
- PostgreSQLDatabase postgreSQLDatabase
+ constructor()
+ string|false authenticateUser(string email, string password)
+ void connect()
+ void close()
+ any query()
}
}
package router {
class AuthenticateUserRouter {
// register "post" route to register new user
}
}
package validation {
class AuthenticateUserJoiValidation implements UserAuthenticationInputValidator {
+ constructor()
+ boolean emailMustBeValid(string email)
}
class AuthenticateUserTypeValidator implements AuthenticateUserTypeValidation {
- TypeValidator typeValidator
+ bool isString(testedVariable: any, variableName: string)
}
}
}
package AuthenticateUserController {
class AuthenticateUserController implements AuthenticateUserInput {
+ AuthenticateUserResponse handleAuthenticateUserRequest(AuthenticateUserRequest authenticateUserRequest, AuthenticateUserGateway authenticateUserGateway, UserAuthenticationInputValidator userAuthenticationInputValidator)
+ UserAuthenticationOutput authenticateUser(UserAuthenticationInput userAuthenticationInput, AuthenticateUserGateway authenticateUserGateway)
}
class AuthenticateUserRequest {
- string email
- string password
- AuthenticateUserTypeValidation authenticateUserTypeValidation
+ constructor(AuthenticateUserTypeValidation authenticateUserTypeValidation)
+ string getEmail()
+ self setEmail(string email)
+ string getPassword()
+ self setPassword(string password)
}
interface AuthenticateUserTypeValidation {
+ bool isString(testedVariable: any, variableName: string)
}
class AuthenticateUserPresenter implements AuthenticateUserOutput {
- AuthenticateUserResponse authenticateUserResponse
+ Response getAuthenticateUserResponse()
+ void retrieveUserAuthenticationOutput(UserAuthenticationOutput userAuthenticationOutput)
}
class AuthenticateUserResponse {
- boolean _userIsLoggedIn
- int userId
+ boolean userIsLoggedIn()
+ self setWetherUserSuccessfullyLoggedIn(boolean user_is_logged_in)
+ int getUserId()
+ self setUserId(int userId)
}
}
package AuthenticateUserUseCase {
class AuthenticateUserUseCase {
+ AuthenticateUserOutput authenticateUser(UserAuthenticationInput userAuthenticationInput, AuthenticateUserGateway authenticateUserGateway)
}
interface AuthenticateUserInput {
+ AuthenticateUserOutput authenticateUser(UserAuthenticationInput userAuthenticationInput, AuthenticateUserGateway authenticateUserGateway)
}
class UserAuthenticationInput {
- string email
- string password
- UserAuthenticationInputValidator userAuthenticationInputValidator
+ construct(UserAuthenticationInputValidator userAuthenticationInputValidator)
+ string getEmail()
+ self setEmail(string email)
+ string getPassword()
+ self setPassword(string password)
}
interface AuthenticateUserGateway {
+ string|false authenticateUser(string email, string password)
}
class UserAuthenticationOutput {
- boolean userIsLoggedIn
- int userId
+ boolean userIsLoggedIn()
+ self setWetherUserSuccessfullyLoggedIn(boolean user_is_logged_in)
+ int getUserId()
+ self setUserId(int userId)
}
interface AuthenticateUserOutput {
+ void retrieveUserAuthenticationOutput(UserAuthenticationOutput userAuthenticationOutput)
}
}
package tests {
// AuthenticateUserTests.ts file
}
}
}