Module Reference

Branches

The business's Locations, their opening hours and closed days, the company each trades under, and the first-run setup.

Branches holds the business's Locations: each shop, branch, kitchen or warehouse. For each one it keeps the opening hours, the days it's closed, and the company (legal entity) it trades under, with that company's tax ID and payment accounts. It also owns the business-wide settings (time zone, currency, languages, bank transfer, card and PromptPay) and the setup page a new app opens on. Almost every Module that stores something per Location needs it, from Booking and POS to Staff. Branches doesn't take bookings, sell or charge anything. A Module that takes payments reads these settings when it creates the payment.

What it handles

  • Duplicate Locations and edits from the wrong person. A Location code that's taken, or a name that differs only in capitals, is refused, and two people adding the same name at once end with one Location. A manager tied to one Location can't add, rename or retire Locations. Tested: "Branches: registry"
  • First-run setup clicked twice. The setup page checks the whole form before it saves anything, so a bad currency, time zone, address or tax ID saves nothing. Two submits at once end with one Location, one company and one audit row for each. Staff without settings:write can't open it. Tested: "Branches: business setup"
  • Closed days that overlap. Closing a range writes one row per day. Closing an overlapping range adds only the new days and keeps the earlier days' reason, and a range longer than 366 days is refused. A manager tied to one Location closes only their own Location's days, never every Location's. Tested: "Branches: closed days"
  • Several edits to one company at once. Edits to the English name, the Thai name, the payment accounts and the tax ID that land together all survive. A tax ID with a wrong check digit is refused, and a company must keep an English or a Thai name. Tested: "Branches: legal entities"

What you build on top

  • Sections on a Location's page. A Module that keeps something per Location adds its own section to that Location's page with branches.location-section: Booking adds its resources, POS its register options and tables, Staff its staff list. Your app adds sections the same way.
  • Settings tabs. branches.settings-tab adds a tab to Settings → Application after General. Booking adds Booking & Queue and Booking page; Membership adds Customers. See Extend a Module.
  • Card and PromptPay. These settings do something only when the app's Beam payment account is connected.
  • In code. Your coding agent imports Branches only through its public API: index.ts and server/index.ts in apps/web/src/modules/branches/. See Build on a Module.

Limits

  • A Location can't be deleted, only made inactive.
  • Only the time zone can differ by Location. Currency and languages are business-wide.
  • The currency can't change once Membership has recorded customer activity, since each activity row is stamped with it.

Facts

Pages

WherePath
Admin/admin/locations
Setup/admin/setup

Permissions

Admin holds every key. The other roles listed hold it when the app first gets the Module; after that, roles are yours to change under Settings → Roles & Permissions.

PermissionWhat it allowsOrganization roles that start with it
settings:writeConfigure resources, schedules, availability, fares, blocked periods, and queue setup.Admin

Data

  • Tables: branch, branch_hours, legal_entity, branch_closure

Slots

Places other Modules and your app code can add to. See Extend a Module.

  • branches.location-section
  • branches.settings-tab

Tested workflows

  • Branches: registry
  • Branches: legal entities
  • Branches: workspace settings
  • Branches: opening hours
  • Branches: closed days
  • Branches: location type
  • Branches: admin home
  • Branches: an app nobody has set up opens on its setup
  • Branches: business setup
  • Branches: language completeness
  • Branches: bank transfer settings