-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateUserPassword
More file actions
144 lines (128 loc) · 6.92 KB
/
UpdateUserPassword
File metadata and controls
144 lines (128 loc) · 6.92 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package features {
package UpdateUserPassword {
package UpdateUserPasswordMain {
package database {
class UserPasswordUpdateOnPostgreSQLDatabase implements UpdateUserPasswordGateway {
- PostgreSQLDatabase postgreSQLDatabase
+ constructor()
+ UserPasswordUpdateOutput updateUserPassword(UserPasswordUpdateInput userPasswordUpdateInput)
+ boolean originalPasswordMatches(string userId, string originalPassword)
+ string getUserRole(string userId)
+ void connect()
+ void close()
+ any query()
}
}
package router {
class UpdateUserPasswordRouter {
// register "post" route to retrieve chosen user
}
}
package validation {
class UpdateUserPasswordInputJoiValidation implements UserPasswordUpdateInputValidator {
- Joi joiValidationLibrary
+ constructor()
+ boolean userIdIsValid(string userId)
+ boolean passwordMustBeAtLeast12CharactersLong(string password)
+ boolean passwordMustHaveAtLeast3LowercaseLetters(string password)
+ boolean passwordMustHaveAtLeast3UppercaseLetters(string password)
+ boolean passwordMustHaveAtLeast3Symbols(string password)
+ boolean passwordMustHaveAtLeast3Numbers(string password)
}
class UpdateUserPasswordTypeValidator implements UpdateUserPasswordTypeValidation {
- TypeValidator typeValidator
+ bool isString(testedVariable: any, variableName: string)
}
}
}
package UpdateUserPasswordController {
class UpdateUserPasswordController implements UpdateUserPasswordInput {
+ UpdateUserPasswordResponse handleUpdateUserPasswordRequest(UpdateUserPasswordRequest updateUserPasswordRequest, UpdateUserPasswordGateway retrieveUserGateway, UserPasswordUpdateInputValidator userPasswordUpdateInputValidator)
+ UpdateUserPasswordOutput updateUserPassword(UserPasswordUpdateInput userPasswordUpdateInput, UpdateUserPasswordGateway updateUserPasswordGateway)
}
class UpdateUserPasswordRequest {
- string userId
- string udpatedUserId
- string orignalPassword
- string changedPassword
- string changedPasswordConfirmation
- UpdateUserPasswordTypeValidation updateUserPasswordTypeValidation
+ constructor(UpdateUserPasswordTypeValidation updateUserPasswordTypeValidation)
+ string getUserId()
+ self setUserId(string userId)
+ string getUpdatedUserId()
+ self setUpdatedUserId(string updatedUserId)
+ string getOrignalPassword()
+ self setOrignalPassword(string orignalPassword)
+ string getChangedPassword()
+ self setChangedPassword(string changedPassword)
+ string getChangedPasswordConfirmation()
+ self setChangedPasswordConfirmation(string changedPasswordConfirmation)
}
interface UpdateUserPasswordTypeValidation {
+ bool isString(testedVariable: any, variableName: string)
}
class UpdateUserPasswordPresenter implements UpdateUserPasswordOutput {
- UpdateUserPasswordResponse updateUserPasswordResponse
+ UpdateUserPasswordResponse getUpdateUserPasswordResponse()
+ void retrieveUserPasswordUpdateOutput(UserPasswordUpdateOutput userPasswordUpdateOutput)
}
class UpdateUserPasswordResponse {
- boolean _userPasswordWasUpdated
+ boolean userPasswordWasUpdated()
+ self setWetherTheUserPasswordWasUpdated(boolean userPasswordWasUpdated)
}
}
package UpdateUserPasswordUseCase {
class UpdateUserPasswordUseCase {
+ UserPasswordUpdateOutput updateUserPassword(UserPasswordUpdateInput userPasswordUpdateInput, UpdateUserPasswordGateway updateUserPasswordGateway)
}
interface UpdateUserPasswordInput {
+ UserPasswordUpdateOutput updateUserPassword(UserPasswordUpdateInput userPasswordUpdateInput, UpdateUserPasswordGateway updateUserPasswordGateway)
}
class UserPasswordUpdateInput {
- string userId
- string udpatedUserId
- string orignalPassword
- string changedPassword
- string changedPasswordConfirmation
- UserPasswordUpdateInputValidator userPasswordUpdateInputValidator
+ constructor(UserPasswordUpdateInputValidator userPasswordUpdateInputValidator)
+ string getUserId()
+ self setUserId(string userId)
+ string getUpdatedUserId()
+ self setUpdatedUserId(string updatedUserId)
+ string getOrignalPassword()
+ self setOrignalPassword(string orignalPassword)
+ string getChangedPassword()
+ self setChangedPassword(string changedPassword)
+ string getChangedPasswordConfirmation()
+ self setChangedPasswordConfirmation(string changedPasswordConfirmation)
}
interface UpdateUserPasswordGateway {
+ UserPasswordUpdateOutput updateUserPassword(UserPasswordUpdateInput userPasswordUpdateInput)
+ boolean originalPasswordMatches(string userId, string originalPassword)
+ string getUserRole(string userId)
}
class UserPasswordUpdateOutput {
- boolean _userPasswordWasUpdated
+ boolean userPasswordWasUpdated()
+ self setWetherTheUserPasswordWasUpdated(boolean userPasswordWasUpdated)
}
interface UpdateUserPasswordOutput {
+ void retrieveUserPasswordUpdateOutput(UserPasswordUpdateOutput userPasswordUpdateOutput)
}
interface UserPasswordUpdateInputValidator {
+ boolean userIdIsValid(string userId)
+ boolean passwordMustBeAtLeast12CharactersLong(string password)
+ boolean passwordMustHaveAtLeast3LowercaseLetters(string password)
+ boolean passwordMustHaveAtLeast3UppercaseLetters(string password)
+ boolean passwordMustHaveAtLeast3Symbols(string password)
+ boolean passwordMustHaveAtLeast3Numbers(string password)
}
}
package tests {
// retrieveUserTests.ts file
}
}
}