Description
User Story
As a liquidity provider, I want to be able to set my availability independently for each currency I support, so that I can manage my liquidity more effectively and control which currencies I'm available to process at any given time.
Acceptance Criteria
-
GIVEN a provider profile exists
WHEN the provider updates their availability
THEN they should be able to specify which currencies they are available for -
GIVEN a provider is available for specific currencies
WHEN an order is created for a currency
THEN the provider should only be matched if they are available for that specific currency -
GIVEN a provider profile is created
WHEN the provider specifies their supported currencies
THEN they should be able to set availability for each currency independently -
GIVEN a provider's availability is checked
WHEN the check is performed for a specific currency
THEN the system should only return true if the provider is available for that currency
Tech Details
-
Database Changes:
- Remove
is_available
boolean field fromprovider_profiles
table - Add
available_for text[]
field to store currency codes - Create migration for schema changes
- Remove
-
Code Changes:
- Update Ent schema in
ent/schema/providerprofile.go
- Modify type definitions in
types/types.go
- Update controller logic in
controllers/accounts/profile.go
- Update provider matching logic in relevant services
- Update Ent schema in
-
API Changes:
- Update provider profile creation/update endpoints to accept currency-specific availability
- Update response schemas to include available currencies
Notes/Assumptions
- Currency codes in
available_for
must be valid ISO currency codes - The change should be backward compatible during migration
- Existing providers will need to be migrated to specify their available currencies