Skip to main content

Overview

SushiGo supports multiple cash registers per branch, each with distinct workflows for on-premise, delivery, and event operations. Card terminals and bank accounts are configured per branch and linked to transactions via tender lines.

Cash Registers

Register Types

From CashRegister.php:29-34:
public const TYPE_ON_PREMISE = 'ON_PREMISE';
public const TYPE_DELIVERY = 'DELIVERY';
public const TYPE_EVENT = 'EVENT';
TypeDescriptionUse Case
ON_PREMISEStore register for dine-in serviceMain counter, bar, or service station
DELIVERYRegister for delivery operationsSeparate tracking for delivery/takeout
EVENTTemporary register for special eventsCatering, festivals, pop-ups
Event registers can be linked to an OperatingUnit for temporary tracking outside the main branch.

Register Fields

FieldTypeDescription
branch_idForeign KeyParent branch (required)
operating_unit_idForeign KeyOptional link to event unit
codeStringUnique identifier (e.g., “REG-001”)
nameStringDisplay name (e.g., “Main Counter”)
typeEnumON_PREMISE, DELIVERY, or EVENT
is_activeBooleanEnable/disable register
metaJSONCustom data (e.g., external system IDs)

Create a Register

POST /cash-registers
{
  "branch_id": 1,
  "code": "REG-MAIN",
  "name": "Main Counter",
  "type": "ON_PREMISE",
  "is_active": true,
  "meta": {
    "external_id": "POS-001"
  }
}

Query Scopes

From CashRegister.php:62-82:
// Filter active registers
CashRegister::active()->get();

// Filter by branch
CashRegister::byBranch($branchId)->get();

// Filter by type
CashRegister::byType('ON_PREMISE')->get();

Helper Methods

$register->isOnPremise(); // true if type === ON_PREMISE
$register->isDelivery();  // true if type === DELIVERY
$register->isEvent();     // true if type === EVENT

Relationships


Cash Terminals

Card terminals process card payments and must be linked to adjustment lines or expenses via card_terminal_id.

Terminal Fields

FieldTypeDescription
branch_idForeign KeyParent branch
nameStringTerminal name or alias (e.g., “Terminal A”)
providerStringPayment processor (e.g., “Stripe”, “Clip”)
account_refStringMerchant ID or account reference
last_fourStringLast 4 digits of terminal serial/account
is_activeBooleanEnable/disable terminal
metaJSONAdditional metadata (fees, commission rates)

Create a Terminal

POST /cash-terminals
{
  "branch_id": 1,
  "name": "Terminal A - Main",
  "provider": "Clip",
  "account_ref": "MERCHANT-12345",
  "last_four": "6789",
  "is_active": true,
  "meta": {
    "commission_rate": 3.5,
    "settlement_days": 2
  }
}

Query Scopes

From CashTerminal.php:54-75:
// Filter active terminals
CashTerminal::active()->get();

// Filter by branch
CashTerminal::byBranch($branchId)->get();

// Filter by provider
CashTerminal::byProvider('Clip')->get();

Relationships

When creating a cash adjustment line with tender_type: 'CARD', you must provide a valid card_terminal_id.

Bank Accounts

Bank accounts receive transfer payments and are referenced in adjustment lines or expenses with tender_type: 'TRANSFER'.

Account Fields

FieldTypeDescription
branch_idForeign KeyParent branch
aliasStringFriendly name (e.g., “Main Checking”)
bank_nameStringFinancial institution name
account_number_maskedStringMasked account number (e.g., “****1234”)
clabe_maskedStringMasked CLABE (Mexican interbank key)
is_activeBooleanEnable/disable account
metaJSONAdditional metadata
Store full account numbers and CLABE keys in secure credential storage, not in the database. Only masked values should be persisted.

Create a Bank Account

POST /bank-accounts
{
  "branch_id": 1,
  "alias": "Main Checking",
  "bank_name": "BBVA",
  "account_number_masked": "****5678",
  "clabe_masked": "************4321",
  "is_active": true,
  "meta": {
    "currency": "MXN",
    "account_type": "checking"
  }
}

Query Scopes

From BankAccount.php:55-67:
// Filter active accounts
BankAccount::active()->get();

// Filter by branch
BankAccount::byBranch($branchId)->get();

Relationships


Setup Workflow

1

Create Registers

Set up cash registers for each branch by type (on-premise, delivery, event)
POST /cash-registers
{
  "branch_id": 1,
  "code": "REG-001",
  "name": "Main Counter",
  "type": "ON_PREMISE"
}
2

Register Terminals

Add card terminals with provider details and account references
POST /cash-terminals
{
  "branch_id": 1,
  "name": "Terminal A",
  "provider": "Clip",
  "account_ref": "MERCHANT-12345"
}
3

Configure Bank Accounts

Register bank accounts for transfer payments
POST /bank-accounts
{
  "branch_id": 1,
  "alias": "Main Checking",
  "bank_name": "BBVA",
  "account_number_masked": "****5678"
}
4

Link in Transactions

Reference terminals and accounts when creating adjustment lines or expenses
POST /cash-adjustments
{
  "lines": [
    {
      "tender_type": "CARD",
      "amount": 500.00,
      "card_terminal_id": 1  // Links to Terminal A
    },
    {
      "tender_type": "TRANSFER",
      "amount": 300.00,
      "bank_account_id": 1  // Links to Main Checking
    }
  ]
}

Multi-Branch Configuration

Each branch should have:

Registers

1+ per operational type (on-premise, delivery, event)

Terminals

1+ card terminals with provider details

Accounts

1+ bank accounts for transfers

Example: Branch Setup

// Branch 1: Downtown Location
const branch1Registers = [
  { code: 'REG-001', name: 'Main Counter', type: 'ON_PREMISE' },
  { code: 'REG-002', name: 'Delivery Station', type: 'DELIVERY' }
];

const branch1Terminals = [
  { name: 'Terminal A', provider: 'Clip', account_ref: 'MERCHANT-001' },
  { name: 'Terminal B', provider: 'Clip', account_ref: 'MERCHANT-001' }
];

const branch1Accounts = [
  { alias: 'Main Checking', bank_name: 'BBVA', clabe_masked: '************1234' }
];

Entity Relationships

Best Practices

Use clear, descriptive names that indicate location and purpose: “Kitchen Counter”, “Bar Register”, “Delivery Hub”
Store the last four digits of terminal serial numbers for easy physical identification
Never store full account numbers in account_number_masked or clabe_masked. Use masked versions only.
Mark registers, terminals, or accounts as inactive instead of deleting to preserve historical transaction links
Link event registers to temporary OperatingUnit records for proper scoping and cleanup

Next Steps

Cash Sessions

Create and manage daily cash sessions

Cash Adjustments

Record income with tender breakdown

Build docs developers (and LLMs) love