fofa.app
Client Documentation
Business logic overview of the marketplace and its built-in role-based cabinets.
1. Core marketplace model
- One product can be sold by multiple vendors through separate offers.
- The customer selects a specific vendor, and one order contains exactly one chosen offer.
- Platform staff can see the whole store and the full finance layer.
2. Vendor role
- A vendor creates a vendor profile, then products and offers for those products.
- An offer stores price, discount, stock quantity, and selling currency.
- The vendor has a dashboard, ledger, payouts, and payout accounts.
3. Customer role
- A customer creates an order against a specific seller offer.
- A coupon code can be applied to an order, which recalculates discount and grand total.
- The customer cabinet includes order history, recommendations, address settings, and payment-card settings.
4. Vendor payouts
- Staff manually defines a payout schedule: day of month, minimum payout amount, and currency.
- Staff manually records a treasury snapshot with available payout cash.
- The system builds a payout preview and highlights any funding gap.
- Then staff creates a payout cycle and executes it in batch mode.
5. Finance terms
- Ledger is the vendor financial movement journal.
- Payout is the factual payment made to a vendor.
- Funding gap is the cash shortfall when planned total exceeds available cash.
6. Services (bookable)
- In the UI this domain is called Services (bookable), while in code it is built on BookableLocation, BookableResource, BookableService, BookablePricingRule, and Booking.
- BookableLocation is the venue or address-level object. If one building contains 4 rooms, that is one Location and four Resources.
- BookableResource is the concrete bookable resource inside that location, for example Room A.
- BookableService is the separate service landing page. For example Light, Medium, and Hard can be three different Services (bookable) attached to the same Resource.
- If a customer books Light for a slot, Medium and Hard are unavailable for the same slot because occupancy is calculated on the shared Resource.
- BookablePricingRule controls pricing by starts_at/ends_at interval, weekdays, time of day, guest count, and duration.