Skip to content

Update Provider Profile Availability to be Currency-Specific #476

Open
@chibie

Description

@chibie

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

  1. GIVEN a provider profile exists
    WHEN the provider updates their availability
    THEN they should be able to specify which currencies they are available for

  2. 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

  3. 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

  4. 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

  1. Database Changes:

    • Remove is_available boolean field from provider_profiles table
    • Add available_for text[] field to store currency codes
    • Create migration for schema changes
  2. 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
  3. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions