Add BankWeb API implementation with 300 unit tests (100% coverage)#4
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Add BankWeb API implementation with 300 unit tests (100% coverage)#4devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Implement models, validators, and services based on the OpenAPI 3.0 spec in README.md. Add 300 unit tests covering all modules. Modules: - bankweb/models: UserModel, TransactionDBModel, TransactionResp, StoreItem, BuyProductReq, PurchaseHistoryItemResp, and related response types - bankweb/validators: UserValidator, TransactionValidator, StoreValidator - bankweb/services: AuthService, TransactionService, StoreService, UserService, SearchService Tests: - tests/test_models: serialization roundtrips, computed properties, defaults - tests/test_validators: boundary values, required fields, format checks - tests/test_services: full business logic including balance, auth flows, search, pagination, purchase history Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo previously contained only an OpenAPI 3.0 spec in README.md with zero source code or tests. This PR implements the full BankWeb API domain layer in Python and adds comprehensive unit tests achieving 100% line coverage across all 15 modules (612 statements).
Modules added (derived from the OpenAPI schema):
bankweb/models/—UserModel,TransactionDBModel,TransactionResp,StoreItem,BuyProductReq,PurchaseHistoryItemResp, plus paginatedDataTableRespwrappers. Each model supportsto_dict()/from_dict()serialization with camelCase ↔ snake_case mapping, and computed properties (full_name,is_admin,installment_amount,total_cost).bankweb/validators/—UserValidator(login/registration/recovery/contact-us/profile-image validation with password strength rules),TransactionValidator(sender≠receiver, amount bounds, pagination params),StoreValidator(item CRUD and purchase request validation).bankweb/services/—AuthService(register → hash+account-number, login → token, logout, password recovery flow with token consumption),TransactionService(create with balance check, paginated listing with search, user history),StoreService(CRUD + buy with balance deduction + purchase history grouped by user),UserService(profile images, balances, admin user listing),SearchService(user search by name/surname/username, portal content search).Test suite — 300 tests across 9 test files covering:
Link to Devin session: https://app.devin.ai/sessions/302764aaadcd4f35812a21171d6ac359
Requested by: @wsh92