Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add create_user endpoint #658

Merged
merged 9 commits into from
Feb 27, 2025

Conversation

Oluwatos94
Copy link
Contributor

Draft: [Margin App] Create endpoint for creating user

Description

This PR adds a new endpoint for creating a user. The endpoint accepts a wallet_id and returns the created user object.

Changes

  • Added create_user endpoint in user.py
  • Added CRUD method for creating a user in crud/user.py

Notes

This is a draft PR. Further implementation and testing will be done in subsequent commits.

@Oluwatos94 Oluwatos94 marked this pull request as draft February 25, 2025 15:10
@djeck1432 djeck1432 self-requested a review February 25, 2025 15:49
@djeck1432 djeck1432 linked an issue Feb 25, 2025 that may be closed by this pull request
@djeck1432
Copy link
Owner

@Oluwatos94 fix pylint issue


router = APIRouter()

class UserCreate(BaseModel):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in another file, schemas/user.py

class UserCreate(BaseModel):
wallet_id: str

class UserResponse(BaseModel):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in another file, schemas/user.py

created_at: datetime

@router.post("/users/", response_model=UserResponse)
async def create_user(user: UserCreate, db: AsyncSession = Depends(get_db)):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djeck1432 djeck1432 marked this pull request as ready for review February 25, 2025 15:51
Copy link
Owner

@djeck1432 djeck1432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix pylint issue as well

@Oluwatos94 Oluwatos94 changed the title Draft: Add create_user endpoint Add create_user endpoint Feb 26, 2025
@Oluwatos94 Oluwatos94 requested a review from djeck1432 February 26, 2025 16:39
Copy link
Owner

@djeck1432 djeck1432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix pylint issues

@djeck1432
Copy link
Owner

@Oluwatos94 Please finalize your PR as soon as possible, You ran out of time
sync als with main

@Oluwatos94 Oluwatos94 requested a review from djeck1432 February 27, 2025 12:27
@Oluwatos94
Copy link
Contributor Author

@djeck1432 Could you check if it's all good now? Thank you!

Copy link
Owner

@djeck1432 djeck1432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix pylint issue

@djeck1432
Copy link
Owner

@Oluwatos94 sync with main branch please

@djeck1432
Copy link
Owner

@Oluwatos94 any updates so far?

@Oluwatos94
Copy link
Contributor Author

Oluwatos94 commented Feb 27, 2025 via email

Copy link
Owner

@djeck1432 djeck1432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djeck1432 djeck1432 merged commit 76fad22 into djeck1432:main Feb 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Margin App] Create endpoint for creating user
2 participants