Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# DF Wallet User Service
# DF Wallet Auth Service

Developers Foundry Wallet User Service System
Developers Foundry Wallet Auth Service

 
[![Version: v1.2.0](https://img.shields.io/badge/api-v1.2.0-blue?style=flat&logo=money)](CHANGELOG.md)
[![Version: v1.0.0](https://img.shields.io/badge/api-v1.0.0-blue?style=flat&logo=money)](CHANGELOG.md)
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
[![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)

---

## OpenAPI/Swagger Documentation

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

## Setup

- Clone the repository

```bash
git clone https://github.com/Ifechukwu001/finapp.git finapp
cd finapp
git clone https://github.com/Developer-s-Foundry/auth-service.git auth-service
cd auth-service
```

- Setup UV. \
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "df-wallet-user-service"
name = "df-wallet-auth-service"
dynamic = ["version"]
description = "Developers Foundry Wallet System"
description = "Developers Foundry Wallet Auth Service"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
Expand Down
9 changes: 4 additions & 5 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__name__ = "df-wallet-user-service"
__display_name__ = "DF Wallet User Service API"
__description__ = "Developers Foundry Wallet System User Service RESTful API"
__version__ = "1.2.0"
__author__ = "Ogidi Ifechukwu ([email protected])"
__name__ = "df-wallet-auth-service"
__display_name__ = "DF Wallet Auth Service API"
__description__ = "Developers Foundry Wallet Auth Service RESTful API"
__version__ = "1.0.0"
24 changes: 0 additions & 24 deletions src/api/constants/activity_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,9 @@ class ActivityTypes(TypedDict):
RESEND_EMAIL: str
EMAIL_VALIDATION: str
USER_LOGIN: str
FETCH_USER: str
UPDATE_USER: str
SET_PIN: str
ADD_WITHDRAW_ACCOUNT: str
UPDATE_WITHDRAW_ACCOUNT: str
LIST_WITHDRAW_ACCOUNTS: str
FETCH_WITHDRAW_ACCOUNT: str
DELETE_WITHDRAW_ACCOUNT: str
CHANGE_PASSWORD: str
REQUEST_RESET_PASSWORD: str
CONFIRM_RESET_PASSWORD: str
FETCH_NOK: str
UPDATE_NOK: str
FETCH_KYC: str
UPDATE_KYC: str


ACTIVITY_TYPES: ActivityTypes = {
Expand All @@ -34,21 +22,9 @@ class ActivityTypes(TypedDict):
"RESEND_EMAIL": "Resend email validation",
"EMAIL_VALIDATION": "Email validation",
"USER_LOGIN": "User login",
"FETCH_USER": "Get user details",
"UPDATE_USER": "Update User Details",
"SET_PIN": "Set user pin",
"ADD_WITHDRAW_ACCOUNT": "Add withdraw account",
"UPDATE_WITHDRAW_ACCOUNT": "Update withdraw account",
"LIST_WITHDRAW_ACCOUNTS": "List withdraw accounts",
"FETCH_WITHDRAW_ACCOUNT": "Get withdraw account",
"DELETE_WITHDRAW_ACCOUNT": "Delete withdraw account",
"CHANGE_PASSWORD": "Change user password",
"REQUEST_RESET_PASSWORD": "Request for password reset",
"CONFIRM_RESET_PASSWORD": "Confirm password reset",
"FETCH_NOK": "Fetch Next Of Kin",
"UPDATE_NOK": "Update Next Of Kin",
"FETCH_KYC": "Fetch KYC Information",
"UPDATE_KYC": "Update KYC Information",
}

__all__ = ["ACTIVITY_TYPES"]
4 changes: 4 additions & 0 deletions src/api/constants/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class PasswordResetMessages(TypedDict):
TOKEN_EXPIRED: str
PASSWORD_RESET: str
DOESNT_EXIST: str
INACTIVE: str
DISABLED: str


class Messages(TypedDict):
Expand Down Expand Up @@ -154,6 +156,8 @@ class DynamicMessages(TypedDict):
"INVALID_TOKEN": "Invalid password reset token!",
"DOESNT_EXIST": "You don't have an account with us yet!",
"TOKEN_EXPIRED": "Password reset token has expired!",
"INACTIVE": "You can only reset the password of an active account!",
"DISABLED": "You can only reset the password of an enabled account!",
},
}

Expand Down
16 changes: 16 additions & 0 deletions src/api/controllers/AuthController.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from src.api.models.payload.requests.AuthenticateUserRequest import (
AuthenticateUserRequest,
)
from src.api.models.payload.requests.ChangeUserPasswordRequest import (
ChangeUserPasswordRequest,
)


@Service()
Expand Down Expand Up @@ -67,3 +70,16 @@ async def login(self, credentials: AuthenticateUserRequest) -> tuple:
data={"user": auth_user["user"], "token": auth_user["token"]},
status_code=HTTPStatus.OK,
)

async def change_password(
self, id: str, user_data: ChangeUserPasswordRequest
) -> tuple:
updated_password = await self.auth_service.change_password(id, user_data)
if not updated_password["is_success"]:
return error_response(
message=updated_password["message"], status_code=HTTPStatus.BAD_REQUEST
)
return success_response(
message=updated_password["message"],
status_code=HTTPStatus.OK,
)
70 changes: 0 additions & 70 deletions src/api/controllers/UserController.py

This file was deleted.

38 changes: 0 additions & 38 deletions src/api/controllers/UserKYCController.py

This file was deleted.

38 changes: 0 additions & 38 deletions src/api/controllers/UserNOKController.py

This file was deleted.

73 changes: 0 additions & 73 deletions src/api/controllers/WithdrawalAccountController.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/api/enums/Currency.py

This file was deleted.

8 changes: 0 additions & 8 deletions src/api/enums/DocumentType.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/api/enums/NextOfKinRelationship.py

This file was deleted.

Loading
Loading