Skip to content

Add BankWeb API implementation with 300 unit tests (100% coverage)#4

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782937343-add-unit-tests
Open

Add BankWeb API implementation with 300 unit tests (100% coverage)#4
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782937343-add-unit-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

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 paginated DataTableResp wrappers. Each model supports to_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:

  • Model serialization roundtrips, computed properties, edge cases (None datetimes, missing keys)
  • Validator boundary values (min/max lengths, required fields, format checks)
  • Service business logic (balance transfers, auth flows, token lifecycle, search filtering, pagination offsets, purchase grouping)

Link to Devin session: https://app.devin.ai/sessions/302764aaadcd4f35812a21171d6ac359
Requested by: @wsh92

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>
@wsh92 wsh92 self-assigned this Jul 1, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant