Skip to content

Commit 9750061

Browse files
authored
Merge pull request #1 from Ifechukwu001/chore/cleanup
Cleaned Up the Repository, to contain only Auth functionality
2 parents 48c5c84 + df5bd3e commit 9750061

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+273
-1835
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# DF Wallet User Service
1+
# DF Wallet Auth Service
22

3-
Developers Foundry Wallet User Service System
3+
Developers Foundry Wallet Auth Service
44

55
 
6-
[![Version: v1.2.0](https://img.shields.io/badge/api-v1.2.0-blue?style=flat&logo=money)](CHANGELOG.md)
6+
[![Version: v1.0.0](https://img.shields.io/badge/api-v1.0.0-blue?style=flat&logo=money)](CHANGELOG.md)
77
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
88
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
99

1010
---
1111

1212
## OpenAPI/Swagger Documentation
1313

14-
The Swagger documentation for the application is hosted on [Render](https://df-user-service.onrender.com/api/docs) along with the application server.
14+
The Swagger documentation for the application is hosted on [Render](https://df-auth-service.onrender.com/api/docs) along with the application server.
1515

1616
## Setup
1717

1818
- Clone the repository
1919

2020
```bash
21-
git clone https://github.com/Ifechukwu001/finapp.git finapp
22-
cd finapp
21+
git clone https://github.com/Developer-s-Foundry/auth-service.git auth-service
22+
cd auth-service
2323
```
2424

2525
- Setup UV. \

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
2-
name = "df-wallet-user-service"
2+
name = "df-wallet-auth-service"
33
dynamic = ["version"]
4-
description = "Developers Foundry Wallet System"
4+
description = "Developers Foundry Wallet Auth Service"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [

src/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
__name__ = "df-wallet-user-service"
2-
__display_name__ = "DF Wallet User Service API"
3-
__description__ = "Developers Foundry Wallet System User Service RESTful API"
4-
__version__ = "1.2.0"
5-
__author__ = "Ogidi Ifechukwu ([email protected])"
1+
__name__ = "df-wallet-auth-service"
2+
__display_name__ = "DF Wallet Auth Service API"
3+
__description__ = "Developers Foundry Wallet Auth Service RESTful API"
4+
__version__ = "1.0.0"

src/api/constants/activity_types.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,9 @@ class ActivityTypes(TypedDict):
99
RESEND_EMAIL: str
1010
EMAIL_VALIDATION: str
1111
USER_LOGIN: str
12-
FETCH_USER: str
13-
UPDATE_USER: str
14-
SET_PIN: str
15-
ADD_WITHDRAW_ACCOUNT: str
16-
UPDATE_WITHDRAW_ACCOUNT: str
17-
LIST_WITHDRAW_ACCOUNTS: str
18-
FETCH_WITHDRAW_ACCOUNT: str
19-
DELETE_WITHDRAW_ACCOUNT: str
2012
CHANGE_PASSWORD: str
2113
REQUEST_RESET_PASSWORD: str
2214
CONFIRM_RESET_PASSWORD: str
23-
FETCH_NOK: str
24-
UPDATE_NOK: str
25-
FETCH_KYC: str
26-
UPDATE_KYC: str
2715

2816

2917
ACTIVITY_TYPES: ActivityTypes = {
@@ -34,21 +22,9 @@ class ActivityTypes(TypedDict):
3422
"RESEND_EMAIL": "Resend email validation",
3523
"EMAIL_VALIDATION": "Email validation",
3624
"USER_LOGIN": "User login",
37-
"FETCH_USER": "Get user details",
38-
"UPDATE_USER": "Update User Details",
39-
"SET_PIN": "Set user pin",
40-
"ADD_WITHDRAW_ACCOUNT": "Add withdraw account",
41-
"UPDATE_WITHDRAW_ACCOUNT": "Update withdraw account",
42-
"LIST_WITHDRAW_ACCOUNTS": "List withdraw accounts",
43-
"FETCH_WITHDRAW_ACCOUNT": "Get withdraw account",
44-
"DELETE_WITHDRAW_ACCOUNT": "Delete withdraw account",
4525
"CHANGE_PASSWORD": "Change user password",
4626
"REQUEST_RESET_PASSWORD": "Request for password reset",
4727
"CONFIRM_RESET_PASSWORD": "Confirm password reset",
48-
"FETCH_NOK": "Fetch Next Of Kin",
49-
"UPDATE_NOK": "Update Next Of Kin",
50-
"FETCH_KYC": "Fetch KYC Information",
51-
"UPDATE_KYC": "Update KYC Information",
5228
}
5329

5430
__all__ = ["ACTIVITY_TYPES"]

src/api/constants/messages.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class PasswordResetMessages(TypedDict):
6464
TOKEN_EXPIRED: str
6565
PASSWORD_RESET: str
6666
DOESNT_EXIST: str
67+
INACTIVE: str
68+
DISABLED: str
6769

6870

6971
class Messages(TypedDict):
@@ -154,6 +156,8 @@ class DynamicMessages(TypedDict):
154156
"INVALID_TOKEN": "Invalid password reset token!",
155157
"DOESNT_EXIST": "You don't have an account with us yet!",
156158
"TOKEN_EXPIRED": "Password reset token has expired!",
159+
"INACTIVE": "You can only reset the password of an active account!",
160+
"DISABLED": "You can only reset the password of an enabled account!",
157161
},
158162
}
159163

src/api/controllers/AuthController.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
from src.api.models.payload.requests.AuthenticateUserRequest import (
1313
AuthenticateUserRequest,
1414
)
15+
from src.api.models.payload.requests.ChangeUserPasswordRequest import (
16+
ChangeUserPasswordRequest,
17+
)
1518

1619

1720
@Service()
@@ -67,3 +70,16 @@ async def login(self, credentials: AuthenticateUserRequest) -> tuple:
6770
data={"user": auth_user["user"], "token": auth_user["token"]},
6871
status_code=HTTPStatus.OK,
6972
)
73+
74+
async def change_password(
75+
self, id: str, user_data: ChangeUserPasswordRequest
76+
) -> tuple:
77+
updated_password = await self.auth_service.change_password(id, user_data)
78+
if not updated_password["is_success"]:
79+
return error_response(
80+
message=updated_password["message"], status_code=HTTPStatus.BAD_REQUEST
81+
)
82+
return success_response(
83+
message=updated_password["message"],
84+
status_code=HTTPStatus.OK,
85+
)

src/api/controllers/UserController.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/api/controllers/UserKYCController.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/api/controllers/UserNOKController.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/api/controllers/WithdrawalAccountController.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)