fixes #21: complete MerchantService implementation with registration,… #109
+2,533
−0
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.
This PR completes the full implementation of the MerchantService, covering the entire merchant lifecycle from registration to settlement readiness. The service is built with dependency injection, validated workflows, and comprehensive test coverage.
Merchants can register, verify their email, complete KYC, manage profiles and business details, link and verify bank accounts, configure settlement and notification preferences, and operate with enforced API quotas. Advanced capabilities such as merchant search with pagination, analytics aggregation, multi-currency support, and status management are included.
All service methods are documented with JSDoc, and the implementation is backed by 54 passing unit tests, ensuring correctness, stability, and maintainability.
Key Features
Merchant registration with validation
Email verification and resend flow
KYC document submission and verification
Profile and business details management
Bank account update and verification
Merchant status lifecycle management (activate, suspend, close)
Merchant search and filtering with pagination
Merchant analytics aggregation
Multi-currency configuration per merchant
Settlement preferences management
Notification preferences management
API quota enforcement with cron-based reset
Full JSDoc documentation
Comprehensive unit test coverage (54 tests)
Acceptance Criteria
Merchants can register and complete KYC
Profile and business updates are validated and persisted
Bank accounts are verified before settlement
All service methods are fully tested and passing
Closes #21