Skip to content

Merchant availability, settings and onboarding end-to-end #74

@ericmt-98

Description

@ericmt-98

Problem

Several pieces are disconnected:

  • `MerchantSettings.tsx` exists but is not mounted in `App.tsx`
  • `services/api.ts` calls `setAvailability('/users/me/availability')` but that route does not exist in the backend
  • `patchMerchantAvailability('/users/me')` does not match any defined route in `users.ts`
  • `merchant.service.ts` uses `merchant_configs` but the initial schema does not create it
  • `trade.service.ts` reads `seller.availability` but the query only selects `id, stellar_address`, so availability never actually blocks new trades

Why it matters

A merchant cannot pause operations, change their rate or control limits from the APK reliably. This affects operational safety and cancellations.

In-scope

  • Mount `MerchantSettings` in routes and nav
  • Create `PATCH /users/me/availability` or align the client to a consistent existing route
  • Add `availability` column with enum `online/offline/paused`
  • Fix `createTrade()` to read real seller availability
  • Persist rate/min/max/daily cap in `merchant_configs`
  • Show availability banner and pending-sync state if network fails

Out-of-scope

  • Merchant reputation display
  • Merchant onboarding KYC

Acceptance criteria

  • Merchant can pause/resume from the APK
  • Merchant can edit their rate and limits
  • Creating a trade fails with a clear message if the merchant is offline or paused
  • Settings persist after restarting the backend and app

Test notes

  • Set merchant to paused, attempt to create a trade as buyer, verify rejection
  • Verify settings persist across app restart

Dependencies

Complexity

high

Metadata

Metadata

Assignees

Labels

Stellar WaveEligible for Stellar Drips Wave rewardscomplexity: highMeaningful integration, deep state machine, support toolingwave:backendmicopay/backend surfacewave:frontendmicopay/frontend surfacewave:merchantMerchant-side flows (profile, inbox, limits)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions