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

transactions #2

Merged
merged 8 commits into from
Sep 29, 2024
Merged

transactions #2

merged 8 commits into from
Sep 29, 2024

Conversation

andeen171
Copy link
Owner

No description provided.

Implement Wallet and Transaction models with appropriate relationships to the User model. Add corresponding migration files to create wallets and transactions tables with necessary foreign key constraints. This lays the foundation for handling user transactions and wallet balances in the database.
Created an `init.sql` file to initialize `payment` and `payment-testing` databases if they do not exist. Updated `docker-compose.dev.yml` to mount the init script, ensuring the databases are set up during the container initialization.
Restructure token handling by extracting token data logic and load wallet relationships. Introduce TokenBuilder for better test token creation and HttpTestCase improvements for easier authentication setup. Added ShowUserTest to verify user details and adjusted test cases accordingly.
Introduce TransactionController for handling transfers, including validation and exception handling. Enhance User model to create wallet on user creation. Update routes and add repositories for listing users and shopkeepers.
Introduced TransactionFactory and WalletFactory for easier creation of relevant models in tests. Added ListUsersTest and ListShopkeepersTest for listing user types and TransferTest for validating transfer functionality. These enhancements improve test coverage and development efficiency.
@andeen171 andeen171 self-assigned this Sep 29, 2024
Refactored `TransactionService` to use parallel execution for authorizations and notifications, including retry mechanisms. Introduced new service requests, dependencies, and configuration for external APIs, and enhanced validation to prevent shopkeepers from initiating payments.
…onService

Removed TransferTest and replaced it with an API version located under the Api namespace for consistency. Reorganized other tests into the correct directory structure, and added a new TransactionServiceTest to cover transaction-related test cases.
Moved transfer validation logic from TransferRequest to TransactionService. Introduced `ShopkeeperCannotTransferException` to handle shopkeeper-specific validation. Added a new test to verify shopkeeper transfer restriction.
@andeen171 andeen171 merged commit fb737e5 into master Sep 29, 2024
3 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.

1 participant