@@ -33,6 +33,8 @@ class UserMessages(TypedDict):
3333 NOT_ALLOWED : str
3434 PIN_EXISTS : str
3535 PIN_SET : str
36+ INCORRECT_PASSWORD : str
37+ PASSWORD_CHANGED : str
3638
3739
3840class AccountMessages (TypedDict ):
@@ -56,6 +58,14 @@ class CommonMessages(TypedDict):
5658 VALIDATION_ERROR : str
5759
5860
61+ class PasswordResetMessages (TypedDict ):
62+ EMAIL_SENT : str
63+ INVALID_TOKEN : str
64+ TOKEN_EXPIRED : str
65+ PASSWORD_RESET : str
66+ DOESNT_EXIST : str
67+
68+
5969class Messages (TypedDict ):
6070 REGISTRATION : RegistrationMessages
6171 AUTH : AuthMessages
@@ -65,6 +75,7 @@ class Messages(TypedDict):
6575 NOK : NextOfKinMessages
6676 KYC : KYCInformationMessages
6777 COMMON : CommonMessages
78+ PASSWORD_RESET : PasswordResetMessages
6879
6980
7081class DynamicCommonMessages (TypedDict ):
@@ -78,9 +89,14 @@ class DynamicAccountMessages(TypedDict):
7889 EXISTS : Callable [[str ], str ]
7990
8091
92+ class DynamicPasswordResetMessages (TypedDict ):
93+ EMAIL_SENT : Callable [[str ], str ]
94+
95+
8196class DynamicMessages (TypedDict ):
8297 COMMON : DynamicCommonMessages
8398 ACCOUNT : DynamicAccountMessages
99+ PASSWORD_RESET : DynamicPasswordResetMessages
84100
85101
86102MESSAGES : Messages = {
@@ -112,6 +128,8 @@ class DynamicMessages(TypedDict):
112128 "PIN_EXISTS" : "You already have a transaction PIN on your account!" ,
113129 "PIN_SET" : "Transaction PIN set successfully" ,
114130 "NOT_ALLOWED" : "Unauthorized request!" ,
131+ "INCORRECT_PASSWORD" : "Incorrect old password" ,
132+ "PASSWORD_CHANGED" : "Password changed successfully" ,
115133 },
116134 "ACCOUNT" : {
117135 "SAVED" : "Withdrawal account details saved succesfully" ,
@@ -130,6 +148,13 @@ class DynamicMessages(TypedDict):
130148 "JWT_GENERATED" : "JWT was generated" ,
131149 "VALIDATION_ERROR" : "Validation errors" ,
132150 },
151+ "PASSWORD_RESET" : {
152+ "EMAIL_SENT" : "Password reset email sent successfully to your email" ,
153+ "PASSWORD_RESET" : "Password reset successfully" ,
154+ "INVALID_TOKEN" : "Invalid password reset token!" ,
155+ "DOESNT_EXIST" : "You don't have an account with us yet!" ,
156+ "TOKEN_EXPIRED" : "Password reset token has expired!" ,
157+ },
133158}
134159
135160DYNAMIC_MESSAGES : DynamicMessages = {
@@ -142,6 +167,9 @@ class DynamicMessages(TypedDict):
142167 "ACCOUNT" : {
143168 "EXISTS" : lambda x : f"You already have an account with the account number { x } !"
144169 },
170+ "PASSWORD_RESET" : {
171+ "EMAIL_SENT" : lambda x : f"Password reset email has been sent to { x } " ,
172+ },
145173}
146174
147175__all__ = ["DYNAMIC_MESSAGES" , "MESSAGES" ]
0 commit comments