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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# DF Wallet User Service

Developers Foundry Wallet User Service System
Developers Foundry Wallet User 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)

Expand All @@ -18,8 +18,8 @@ The Swagger documentation for the application is hosted on [Render](https://df-u
- Clone the repository

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

- Setup UV. \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "df-wallet-user-service"
dynamic = ["version"]
description = "Developers Foundry Wallet System"
description = "Developers Foundry Wallet User Service"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
Expand Down
5 changes: 2 additions & 3 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])"
__description__ = "Developers Foundry Wallet User Service RESTful API"
__version__ = "1.0.0"
69 changes: 0 additions & 69 deletions src/api/controllers/AuthController.py

This file was deleted.

66 changes: 0 additions & 66 deletions src/api/controllers/PasswordResetController.py

This file was deleted.

18 changes: 1 addition & 17 deletions src/api/controllers/UserController.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from src.api.services.UserService import UserService
from src.api.utils.response_format import error_response, success_response
from src.api.models.payload.requests.Pin import Pin
from src.api.models.payload.requests.UpdateUserRequest import (
UpdateUserRequest,
ChangeUserPasswordRequest,
)
from src.api.models.payload.requests.UpdateUserRequest import UpdateUserRequest


@Service()
Expand Down Expand Up @@ -55,16 +52,3 @@ async def set_account_pin(self, id: str, user_pin: Pin) -> tuple:
return success_response(
message=updated_pin["message"], status_code=HTTPStatus.OK
)

async def change_password(
self, id: str, user_data: ChangeUserPasswordRequest
) -> tuple:
updated_password = await self.user_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,
)
8 changes: 2 additions & 6 deletions src/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 5.1.6 on 2025-03-31 13:40
# Generated by Django 5.1.8 on 2025-04-03 15:46

import django.db.models.deletion
import uuid
from django.db import migrations, models


Expand Down Expand Up @@ -43,18 +42,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='User',
fields=[
('id', models.CharField(default=uuid.uuid4, max_length=255, primary_key=True, serialize=False)),
('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
('email', models.EmailField(max_length=255, unique=True)),
('password', models.CharField(max_length=255)),
('first_name', models.CharField(max_length=255)),
('last_name', models.CharField(max_length=255)),
('address', models.CharField(max_length=255)),
('phone_number', models.CharField(max_length=20)),
('profile_picture', models.CharField(max_length=255)),
('tier', models.IntegerField(default=1)),
('pin', models.CharField(max_length=10)),
('password_reset_token', models.CharField(max_length=255)),
('token_expires_at', models.DateTimeField(null=True)),
('is_validated', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=False)),
('is_enabled', models.BooleanField(default=False)),
Expand Down
27 changes: 0 additions & 27 deletions src/api/migrations/0002_otp.py

This file was deleted.

6 changes: 0 additions & 6 deletions src/api/models/payload/requests/AuthenticateUserOtp.py

This file was deleted.

8 changes: 0 additions & 8 deletions src/api/models/payload/requests/AuthenticateUserRequest.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/api/models/payload/requests/PasswordResetRequest.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/api/models/payload/requests/ResendUserOtp.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/api/models/payload/requests/UpdateUserRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

from pydantic import Field, BaseModel

from src.api.typing.PasswordValidator import IsStrongPassword


class UpdateUserRequest(BaseModel):
first_name: str | None = None
last_name: str | None = None
address: str | None = None
phone_number: str | None = None
state_lga_id: Annotated[int, Field(default=None, ge=1)]


class ChangeUserPasswordRequest(BaseModel):
old_password: str
new_password: IsStrongPassword
23 changes: 0 additions & 23 deletions src/api/models/postgres/Otp.py

This file was deleted.

11 changes: 1 addition & 10 deletions src/api/models/postgres/User.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import uuid

from django.db import models

from ._base import PostgresBaseModel
from .StateLGA import StateLGA


class User(PostgresBaseModel):
id: models.CharField = models.CharField(
max_length=255,
primary_key=True,
default=uuid.uuid4, # type: ignore
)
id: models.CharField = models.CharField(max_length=255, primary_key=True)
email: models.EmailField = models.EmailField(max_length=255, unique=True)
password: models.CharField = models.CharField(max_length=255)
first_name: models.CharField = models.CharField(max_length=255)
last_name: models.CharField = models.CharField(max_length=255)
address: models.CharField = models.CharField(max_length=255)
Expand All @@ -24,8 +17,6 @@ class User(PostgresBaseModel):
profile_picture: models.CharField = models.CharField(max_length=255)
tier: models.IntegerField = models.IntegerField(default=1)
pin: models.CharField = models.CharField(max_length=10)
password_reset_token: models.CharField = models.CharField(max_length=255)
token_expires_at: models.DateTimeField = models.DateTimeField(null=True)
is_validated: models.BooleanField = models.BooleanField(default=False)
is_active: models.BooleanField = models.BooleanField(default=False)
is_enabled: models.BooleanField = models.BooleanField(default=False)
Expand Down
2 changes: 0 additions & 2 deletions src/api/models/postgres/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .Otp import Otp
from .Bank import Bank
from .User import User
from .StateLGA import StateLGA
Expand All @@ -8,7 +7,6 @@

__all__ = [
"Bank",
"Otp",
"StateLGA",
"User",
"UserKYCInformation",
Expand Down
Loading