Modules
The modules of Shelftara
Shelftara 1.0.0 ships twenty-one modules. Each one is described here with the permission it needs, the routes it uses and the way it behaves. Everything on this page is implemented in the code of the release: the routes exist in internal/web/app.go, the permissions in internal/auth/auth.go and the tables in internal/models/registry.go.
Unless stated otherwise, a route under /app needs a signed in session, and the permission of the module is checked again on the server for every request. The navigation on the left of the panel only shows the entries the user may open, but the check is never on the menu — it is on the handler.
At a glance
| Module | Permission | Entry point |
|---|---|---|
| Inventory and catalogue | products.view, products.edit, products.delete | /app/products |
| Warehouses and stock | stock.view, stock.edit | /app/stock |
| Purchasing | purchases.view, purchases.edit, suppliers.view, suppliers.edit | /app/purchases |
| Sales documents | sales.view, sales.edit, customers.view, customers.edit | /app/quotations |
| Point of sale | pos.use, pos.discount, pos.void | /app/pos |
| Online store | store.manage | /app/store |
| Accounting | accounting.view, accounting.edit | /app/accounting |
| Reports | reports.view | /app/reports |
| CRM | crm.manage | /app/crm |
| Rental | rental.manage | /app/rental |
| Restaurant | restaurant.manage | /app/restaurant |
| Booking | booking.manage | /app/bookings |
| Assets | asset.manage | /app/assets |
| Human resources | hr.manage | /app/hr |
| Courier and shipment | courier.manage | /app/couriers |
| Production | production.manage | /app/production |
| Integrations | settings.manage | /app/integrations |
| Business assistant | dashboard.view | /app/assistant |
| Audit log | settings.manage | /app/audit-log |
| Users and roles | users.manage | /app/users |
| Platform layer | the role super_admin | /platform |
Inventory and catalogue
The catalogue is what everything else is built on. It holds the products that are bought, stocked and sold, and the classification around them: the categories, the brands and the units of measure.
Permissions: products.view to read, products.edit to write, products.delete to remove. Tables: categories, brands, units, products, product_variants, product_images, batches, serials.
| Route | Method | What it does |
|---|---|---|
/app/products | GET | The list of the catalogue, with the stock and the value of every product. |
/app/products/new, /app/products/:id/edit | GET | The form of a product. |
/app/products/save | POST | Creates or changes a product. |
/app/products/:id/delete | POST | Removes a product with its stock levels, its variants and its pictures. |
/app/categories, /app/categories/new, /app/categories/:id/edit | GET | The list and the form of the categories. |
/app/categories/save | POST | Creates or changes a category. |
/app/brands, /app/brands/save | GET, POST | The list and the save of the brands. |
/app/units, /app/units/save | GET, POST | The list and the save of the units of measure. |
How it works
- The list is a generated table: it searches on the name, the reference and the barcode, and it can be filtered on the state.
- A product carries a reference, a barcode, a name, a type, a category, a brand, a unit, the cost price, the selling price, the promotional price, the tax rate, a discount, the minimum level, the weight, a picture and a description.
- The switches track batches, track serial numbers and track expiry dates prepare a product for the tracked variants; a batch holds a manufacturing and an expiry date, a serial holds a serial or IMEI number with its own state.
- A unit carries a conversion rate against the base unit, so a box of six is one line in the stock with a rate of six.
- The category of a product is what the storefront groups by; the colour of the category is what the storefront paints the tile with.
- Every record of the catalogue belongs to one workspace: the queries of the module always carry the
tenant_idfilter.
Warehouses and stock
The stock is not a number on the product. It is a quantity per product, per variant and per warehouse, and every change of that quantity is written in a ledger of movements that is never rewritten.
Permissions: stock.view to read, stock.edit to adjust and to transfer. Tables: warehouses, stock_levels, stock_movements, stock_adjustments, stock_adjustment_items, stock_transfers, stock_transfer_items.
| Route | Method | What it does |
|---|---|---|
/app/warehouses, /app/warehouses/save | GET, POST | The list and the save of the warehouses. One of them carries the flag default. |
/app/stock | GET | The quantity of every product per warehouse, with the value and the alert badge. |
/app/stock/adjustments | GET | The list of the counted corrections. |
/app/stock/adjustments/new, /app/stock/adjustments/save | GET, POST | Creates an adjustment with its lines. |
/app/stock/transfers | GET | The list of the transfers between the warehouses. |
/app/stock/transfers/new, /app/stock/transfers/save | GET, POST | Creates a transfer with its lines. |
/app/stock/transfers/:id/receive | POST | Receives a transfer: the goods leave the source and arrive in the destination. |
How it works
- A stock level is unique for the triplet product, variant and warehouse. The cost that is kept on the line is the last cost that entered the warehouse, and it is what the valuation uses.
- An adjustment is a counted correction: it carries a type (increase or decrease), a reason, a note and one line per product with the quantity before and the quantity after.
- A transfer moves goods from one warehouse to another. When it is received, the server checks that the source really holds the quantity, subtracts it, adds it to the destination and writes the two movements. A transfer that is already received is refused.
- Every movement keeps the type, the quantity, the cost, the reference of the document that caused it and the user who did it. The ledger is what the stock report and the valuation read.
- The products below their minimum level are counted on the dashboard and listed in the low stock panel.
Purchasing
The purchasing side covers what comes in: the suppliers, the orders you place, the goods you receive and the money you have already paid.
Permissions: purchases.view and purchases.edit, suppliers.view and suppliers.edit. Tables: suppliers, purchases, purchase_items, purchase_returns, purchase_return_items, purchase_payments, price_groups, wallet_transactions.
| Route | Method | What it does |
|---|---|---|
/app/purchases | GET | The list of the purchases, with the supplier, the value and the balance. |
/app/purchases/new, /app/purchases/:id/edit | GET | The form of a purchase. |
/app/purchases/save | POST | Creates or changes a purchase, writes its lines and its payments. |
/app/suppliers | GET | The list of the suppliers with their balance. |
/app/suppliers/new, /app/suppliers/:id/edit | GET | The form of a supplier. |
/app/suppliers/save | POST | Creates or changes a supplier. |
/app/suppliers/:id/wallet, /app/suppliers/:id/wallet | GET, POST | Shows the wallet of a supplier and tops it up. |
How it works
- A purchase carries a number with the prefix
PUR, a supplier, a warehouse, a date, a due date, a state, the subtotal, the discount, the tax, the freight, the landed cost, the total and the amount already paid. - The landed cost is what the freight and the customs cost add on top of the invoice of the supplier. It is spread over the lines so that the stock enters the warehouse at the price you really paid.
- The payments are recorded on the purchase itself, so the balance of the document and the balance of the supplier always agree.
- The supplier wallet holds the money you have paid in advance. The balance of a supplier is the sum of its purchases minus its payments.
- A purchase that is received adds the quantity to the warehouse and writes the movements into the stock ledger.
Sales documents
Everything that goes out. The chain is a quotation, then an order, then an invoice; a credit note and a return close the loop when something goes wrong.
Permissions: sales.view and sales.edit, customers.view and customers.edit. Tables: quotations, quotation_items, orders, order_items, invoices, invoice_items, credit_notes, credit_note_items, sale_returns, sale_return_items, sale_payments, sale_payment_splits, customers.
| Route | Method | What it does |
|---|---|---|
/app/quotations, /app/quotations/new, /app/quotations/:id/edit | GET | The list and the form of the quotations. |
/app/quotations/save | POST | Creates or changes a quotation. |
/app/orders, /app/orders/new, /app/orders/:id/edit | GET | The list and the form of the orders. |
/app/orders/save | POST | Creates or changes an order and reserves the stock. |
/app/invoices, /app/invoices/new, /app/invoices/:id/edit | GET | The list and the form of the invoices. |
/app/invoices/:id/view | GET | The printable view of an invoice. |
/app/invoices/save | POST | Creates or changes an invoice. |
/app/invoices/:id/pay | POST | Records a payment on an invoice and recomputes its state. |
/app/credit-notes, /app/credit-notes/save | GET, POST | The list and the save of the credit notes. |
/app/returns, /app/returns/save | GET, POST | The list and the save of the sales returns. |
/app/customers, /app/customers/new, /app/customers/:id/edit | GET | The list and the form of the customers. |
/app/customers/save | POST | Creates or changes a customer. |
/app/customers/:id/wallet | GET, POST | Shows the wallet of a customer and tops it up. |
How it works
- The three documents share the same structure: a number, a customer, a warehouse, a date, a due date, a state, the lines, the subtotal, the discount, the tax, the shipping, the total and the amount paid.
- The numbers come from a counter that lives in the database, so two requests at the same time never produce the same number. The prefixes are
QUO,ORD,INV,CNandRET. - The state of an invoice is
unpaid,partial,paid,overdueorcancelled. It is recomputed from the payments every time one is recorded. - A line keeps the cost and the tax rate of the product at the moment the document was saved, so the profit and the tax reports stay correct when the catalogue changes.
- The customer wallet holds the money the customer has paid in advance; it is deducted from the balance of the new invoices.
- A sales return puts the goods back into the stock and writes the movements. A credit note corrects the amount of an invoice without touching the goods.
Point of sale
The register is the screen at the counter. It is the only module with a JSON API, because it is the one that is driven by a script while the sale is running.
Permissions: pos.use to sell, pos.discount to give a discount, pos.void to void a line or to cancel an order. Tables: pos_shifts, pos_holds, pos_favorites, offline_sales, manager_approvals.
| Route | Method | What it does |
|---|---|---|
/app/pos | GET | The register. |
/app/pos/shifts | GET | The list of the shifts of the cash drawer. |
/app/pos/shift/open, /app/pos/shift/close | POST | Opens a shift with the opening cash, closes it with the counted cash and records the variance. |
/app/pos/holds | GET | The list of the parked carts. |
/app/pos/hold | POST | Parks the basket of the register. |
/app/pos/hold/:id/load | POST | Loads a parked cart back into the register. |
/api/v1/pos/products | GET | The products of the register, with the quantity on hand. |
/api/v1/pos/sale | POST | Records a sale: the order, the invoice, the payments and the stock. |
/api/v1/pos/hold | POST | Parks a basket from the API. |
/api/v1/pos/sync | POST | Stores the sales that were taken while the line was down. |
/api/v1/pos/config | GET | The currency, the open shift and the right to discount. |
How it works
- A shift belongs to one user and one cash drawer. A user can have only one open shift; the server refuses a second one.
- When the shift is closed, the server adds the opening cash to the cash payments of the shift and compares the result with the cash that was counted. The difference is the variance and it is stored with the shift.
- A sale is written in one transaction: the order, the invoice, the lines, the payments and their splits, the movements of the stock and the audit entry. If one of them fails, nothing is written.
- Several payments can be combined on the same sale, and the change due is returned to the register.
- The offline queue keeps the sales that were taken without a connection under a unique identifier. When the line comes back,
/api/v1/pos/syncstores them once, and the sale marks the entry as synchronised. - The tables for the favourite products of the quick bar and for the manager approval exist in the schema of 1.0.0, but they have no screen yet.
Online store
Every workspace has its own shop. The shop is public: a visitor signs in nowhere, adds to a basket and checks out. The operator follows the orders from the panel.
Permission: store.manage for the panel side. The shop itself is public. Tables: store_settings, store_orders, store_order_items, store_coupons, store_reviews.
| Route | Method | What it does |
|---|---|---|
/app/store, /app/store/save | GET, POST | The settings of the shop and the save of them. |
/app/store/orders | GET | The list of the orders of the shop. |
/app/store/orders/:id | GET | The detail of one order. |
/app/store/orders/:id/status | POST | Moves an order to another state. |
/store | GET | The home of the shop: the categories, the featured products and the basket button. |
/store/category/:slug | GET | The products of a category. |
/store/product/:slug | GET | The page of a product, with the reviews. |
/store/cart | GET | The basket. |
/store/cart/add, /store/cart/update, /store/cart/remove | POST | The three operations on the basket. |
/store/checkout | GET, POST | The checkout form and the creation of the order. |
/store/order/:number | GET | The tracking page of an order. |
/store/review | POST | Records a review, which waits for the approval of the operator. |
How it works
- The shop is reached with the slug of the workspace: a subdomain, the path
/t/:slugor the query string?tenant=. The basket is kept in a cookie that is tied to the slug of the shop. - The settings carry the name, the slogan, the description, the logo, the banner, the theme, the announcement, the currency, the delivery threshold, the payment methods, the social addresses and the address of the business. Six themes are offered: modern, fashion, electronics, restaurant, rental and booking.
- The checkout computes the tax of the lines and adds the shipping when the basket is below the threshold of the store. The order is created with the prefix
SO, the statependingand the payment stateunpaid. - The state of an order moves through
pending,processing,shipped,completedandcancelled. Only these five states are accepted. - A review is stored with the state not approved; the operator decides whether it appears on the page of the product.
- The coupons are listed on the settings page. The checkout of 1.0.0 does not apply a coupon code yet.
Accounting
The accounting module is a cash book: a chart of accounts, the movements of money, the expenses, the transfers between your accounts and the deposits.
Permissions: accounting.view to read, accounting.edit to write. The role manager does not have accounting.edit. Tables: accounts, account_transactions, expense_categories, expenses, account_transfers, deposits.
| Route | Method | What it does |
|---|---|---|
/app/accounting | GET | The overview of the module: the balances and the figures of the period. |
/app/accounting/accounts, /app/accounting/accounts/save | GET, POST | The chart of accounts and the save of an account. |
/app/accounting/transactions, /app/accounting/transactions/save | GET, POST | The transactions and the save of one. |
/app/accounting/expenses, /app/accounting/expenses/save | GET, POST | The expenses, their categories and the save of an expense. |
/app/accounting/transfers, /app/accounting/transfers/save | GET, POST | The transfers between two accounts and the save of one. |
/app/accounting/deposits, /app/accounting/deposits/save | GET, POST | The deposits and the save of one. |
How it works
- Every new workspace receives ten accounts: cash, bank, accounts receivable, inventory, accounts payable, tax payable, owner equity, sales revenue, cost of goods sold and operating expenses. They are marked as system accounts.
- An account has a type — asset, liability, equity, income or expense — a code, a currency and a current balance.
- A transaction is a debit and a credit against two accounts with a date, a reference and a note. The balance of an account is the sum of its transactions.
- An expense carries a category, an account, an amount and a date, and it feeds the expenses of the month on the dashboard.
- A deposit is money that comes in outside a sale; a transfer is money that moves between two of your own accounts.
Reports
The eight reports are read models: every figure is computed from the data of the workspace at the moment you open the page. Nothing is cached and nothing is a constant.
Permission: reports.view. Routes: /app/reports, /app/reports/:kind and /app/reports/:kind/export.
| Key | Report | Filters | What it shows |
|---|---|---|---|
products | Product performance | search | Every product with its category, its stock, its cost, its price and the value of its stock. |
sales | Sales report | period, search | Every invoice of the period with the subtotal, the tax, the total, what was paid and the state. |
profit | Profit and loss | period | The revenue, the cost of the goods and the gross profit per product, with the margin. |
customers | Customer report | — | Every customer with the number of invoices, the turnover, what was paid, the balance and the wallet. |
suppliers | Supplier report | — | Every supplier with the purchases, the value, what was paid, the balance and the wallet. |
tax | Tax report | period | The tax collected, grouped by rate, with the net amount it was calculated on. |
stock | Stock report | warehouse, low only | The quantity and the value of every item on hand, per warehouse. |
valuation | Inventory valuation | — | The stock at cost price and at selling price, with the promotional price taken into account. |
How it works
- The index lists the eight reports with a short description of each one.
- A report that accepts a period reads
fromandtofrom the query string; the default is the current month. The end date is exclusive, so the last day is included. - The export writes the same table as a CSV file named
shelftara-<key>-<date>.csv, with the values properly quoted. - The dashboard of the workspace uses the same read models: the sales of the day and of the month, the fourteen day trend, the top products, the top customers, the split of the payments and the low stock list.
CRM
The CRM follows the opportunities: the pipeline, its stages, the leads that move through them, the activities that touch them and the targets that are set.
Permission: crm.manage. Tables: crm_pipelines, crm_stages, crm_leads, crm_activities, crm_messages, crm_targets.
| Route | Method | What it does |
|---|---|---|
/app/crm | GET | The dashboard of the module: the leads by stage, the activities of the week and the targets. |
/app/crm/leads | GET | The list of the leads. |
/app/crm/leads/new, /app/crm/leads/:id/edit | GET | The form of a lead. |
/app/crm/leads/save | POST | Creates or changes a lead and its activities. |
/app/crm/pipelines, /app/crm/pipelines/save | GET, POST | The pipelines and the save of one. |
How it works
- A pipeline holds a list of stages. A stage carries a name, a colour, a probability and a sort order.
- Every new workspace receives the pipeline Sales pipeline with the stages New (10 %), Qualified (35 %), Proposal (60 %) and Won (100 %).
- A lead carries the name and the contact details of the customer, the source, the value of the opportunity, the stage, the owner and the expected closing date.
- The dashboard counts the leads per stage and sums the value of the open pipeline, which is what the targets are compared with.
Rental
The rental module runs a business that lends its goods: the rentable items, the contracts with the customers, the reservations, the handovers and the maintenance.
Permission: rental.manage. Tables: rental_items, rental_customers, rental_contracts, rental_reservations, rental_handovers, rental_maintenance, rental_billing.
| Route | Method | What it does |
|---|---|---|
/app/rental | GET | The dashboard of the module: the items on rent, the contracts that run and the reservations of the day. |
/app/rental/items, /app/rental/items/save | GET, POST | The rentable items and the save of one. |
/app/rental/contracts | GET | The list of the contracts. |
/app/rental/contracts/new, /app/rental/contracts/save | GET, POST | The form of a contract and its save. |
/app/rental/reservations, /app/rental/reservations/save | GET, POST | The reservations and the save of one. |
/app/rental/maintenance, /app/rental/maintenance/save | GET, POST | The maintenance of the items and the save of one. |
How it works
- A rentable item carries the daily, the weekly and the monthly rate, the deposit, the quantity and the condition of the goods.
- A contract is numbered with the prefix
RNTand links a customer, an item, a period and a price. The billing of the contract is what is charged to the customer. - A reservation holds a period and an item; the module refuses a reservation that overlaps one that already exists on the same item.
- A maintenance entry records what has to be repaired on an item and the state of the repair.
Restaurant
The restaurant module covers the room, the menu and the kitchen. It is the module a food business switches on on top of the register.
Permission: restaurant.manage. Tables: restaurant_floors, restaurant_tables, restaurant_menu, restaurant_modifiers, restaurant_orders, restaurant_order_items, kitchen_tickets.
| Route | Method | What it does |
|---|---|---|
/app/restaurant | GET | The dashboard of the module: the tables, the tickets of the kitchen and the sales of the day. |
/app/restaurant/tables, /app/restaurant/tables/save | GET, POST | The floors and the tables, and the save of a table. |
/app/restaurant/menu, /app/restaurant/menu/save | GET, POST | The menu and the save of a dish or of a modifier. |
/app/restaurant/orders | GET | The orders of the tables. |
/app/restaurant/kitchen | GET | The kitchen display: the tickets that are waiting. |
/app/restaurant/kitchen/:id | POST | Updates the state of a ticket. |
How it works
- Every new workspace receives the floor Main floor. A table belongs to a floor and carries a number, a name and a number of seats.
- A dish of the menu carries a category, a price, a picture and the flag vegetarian, and it can be linked to a product of the catalogue. A modifier is a group of options that changes the price of a dish.
- An order is attached to a table and to its lines; a ticket of the kitchen is created for every line and carries the station that prepares it. The state of a ticket is
queued,preparing,readyorserved, and the time it was started and the time it was ready are kept. - The module works with the catalogue of the workspace: a dish can also be a product, so it is stocked and sold like anything else.
Booking
The booking module takes appointments: the services you offer, the people who do them, the schedule of each one and the reservations themselves.
Permission: booking.manage. Tables: booking_services, booking_staff, booking_schedule, bookings.
| Route | Method | What it does |
|---|---|---|
/app/bookings | GET | The list of the reservations. |
/app/bookings/new, /app/bookings/:id/edit | GET | The form of a reservation. |
/app/bookings/save | POST | Creates or changes a reservation. |
/app/booking/services, /app/booking/services/save | GET, POST | The services and the save of one. |
/app/booking/staff, /app/booking/staff/save | GET, POST | The staff and the save of one. |
/app/booking/schedule, /app/booking/schedule/save | GET, POST | The weekly schedule and the save of a slot. |
How it works
- A service carries a name, a description, a duration in minutes, a price, a capacity, a deposit and a colour. A staff member carries a name, the contact details, the role and a colour.
- A slot of the schedule is one person, one service, one day of the week, a start hour, an end hour, the length of the slot and its capacity.
- A reservation is numbered with the prefix
BKGand links a customer, a service, a staff member, a date and a time. The server refuses a reservation that overlaps another one for the same person. - A reservation can be linked to a lead of the CRM, so the two modules share the same customer.
Assets
The assets module follows the things you own and cannot sell: the machines, the vehicles, the furniture. It keeps their book value and what happened to them.
Permission: asset.manage. Tables: assets, asset_depreciations, asset_disposals.
| Route | Method | What it does |
|---|---|---|
/app/assets | GET | The list of the assets with their book value. |
/app/assets/save | POST | Creates or changes an asset. |
/app/assets/:id/depreciate | POST | Records a depreciation entry and lowers the book value. |
/app/assets/:id/dispose | POST | Records the disposal of an asset. |
How it works
- An asset carries a name, a code, a category, a purchase date, a purchase value, a residual value, a useful life in months and a depreciation method.
- The depreciation entry lowers the book value and keeps the amount, the date and the method that was used, so the history of the asset is complete.
- The disposal entry records the date, the price it was sold for and the reason, and the asset leaves the active list.
Human resources
The human resources module holds the people of the business: who works here, when they are there, who is on leave, who is looking for a job and what the payroll run looked like.
Permission: hr.manage. Tables: departments, employees, attendance, leave_types, leaves, job_openings, applicants, payroll.
| Route | Method | What it does |
|---|---|---|
/app/hr | GET | The dashboard: the head count, the attendance of the day, the leaves and the openings. |
/app/hr/employees | GET | The list of the employees. |
/app/hr/employees/new, /app/hr/employees/save | GET, POST | The form of an employee and its save. |
/app/hr/attendance, /app/hr/attendance/save | GET, POST | The attendance of the day and the save of a record. |
/app/hr/leaves, /app/hr/leaves/save | GET, POST | The leaves and the save of a request. |
/app/hr/leaves/:id/status | POST | Approves or refuses a leave. |
/app/hr/recruitment, /app/hr/recruitment/save | GET, POST | The openings, the applicants and the save of both. |
/app/hr/applicants/:id/stage | POST | Moves an applicant to another stage of the recruitment. |
How it works
- An employee carries the name, the contact details, the department, the position, the date of the hiring and the state.
- The attendance records the presence, the absence, the leave and the delay of a person on a day.
- A leave request carries the type, the period, the reason and the state. Every new workspace receives the type Annual leave with twenty days per year.
- A job opening carries the title, the department and the description; an applicant carries the name, the contact details and the stage of the recruitment.
- The payroll table keeps the salary runs of the workspace.
Courier and shipment
The shipping module books the parcels with the carriers, follows them and keeps the ledger of what you owe the carrier and what it owes you.
Permission: courier.manage. Tables: couriers, courier_accounts, shipments, shipment_events, courier_ledger_entries.
| Route | Method | What it does |
|---|---|---|
/app/couriers, /app/couriers/save | GET, POST | The carriers and the save of one. |
/app/shipments | GET | The list of the parcels. |
/app/shipments/new | GET | The form of a parcel. |
/app/shipments/save | POST | Creates a parcel and writes its first event. |
/app/shipments/:id/status | POST | Changes the state of a parcel and writes the event. |
How it works
- A carrier carries a name, a code, a scope and the state. An account of a carrier carries the numbers used for the bookings and the ledger.
- A parcel is numbered with the prefix
SHPand links an order or a store order, a carrier, a customer address, a weight, a price and the payment on delivery. - Every state of a parcel is written as an event with its date and its place, so the tracking is a history and not a single field.
- The ledger entry records the charge of the carrier or the payment it made, which is what settles the account of the carrier.
Production
The production module transforms goods: a bill of materials says what goes into a product and how much, and a production order says how much of it you are making.
Permission: production.manage. Tables: boms, bom_items, production_orders.
| Route | Method | What it does |
|---|---|---|
/app/production | GET | The list of the production orders and of the bills of materials. |
/app/production/save | POST | Creates a production order or a bill of materials. |
/app/production/:id/complete | POST | Completes an order: the components leave the stock and the finished product enters it. |
How it works
- A bill of materials carries a name, the product it produces, the quantity it produces and the lines of the components with their quantity and their cost.
- A production order is numbered with the prefix
PRDand links the bill of materials, the warehouse, the quantity and the state. - When the order is completed, the components are taken out of the warehouse and the finished quantity is added, and the movements are written in the stock ledger.
Integrations
The integrations module connects a remote shop to the catalogue of the workspace and pulls its products in, so that both catalogues carry the same reference and the same price.
Permission: settings.manage. Tables: integrations, integration_logs.
| Route | Method | What it does |
|---|---|---|
/app/integrations | GET | The list of the connections and the log of the last runs. |
/app/integrations/save | POST | Creates or changes a connection. |
/app/integrations/:id/sync | POST | Runs a synchronisation and writes the run in the log. |
How it works
- A connection carries a provider, a name, the address of the shop, the key and the state.
- The synchronisation reads the products of the remote shop through its REST interface, fifty items at a time, with a timeout of twenty seconds.
- Only the products whose reference already exists in the workspace are updated, and only the name and the promotional price are changed. A product that does not exist locally is never created.
- Every run writes a line in the log with the direction, the number of products and the message of the run.
Business assistant
The assistant answers questions about your own business in plain language: how much you sold today, what is low in the stock, who owes you money. It reads your database directly, so it needs no external key and no figure ever leaves the server.
Permission: dashboard.view. Routes: /app/assistant and POST /api/v1/assistant/ask. Tables: ai_messages, ai_settings.
| Route | Method | What it does |
|---|---|---|
/app/assistant | GET | The page of the assistant, with the conversation. |
/api/v1/assistant/ask | POST | Asks a question and returns the answer as JSON. |
How it works
- The question is matched against a set of keywords and routed to the matching read model: the sales, the stock, the customers, the money that is owed, the suppliers, the profit or the top products.
- The answer is composed from the figures of the workspace of the session, with the currency of the installation. A question that matches nothing returns an overview.
- The question and the answer are both stored in the table of the conversation, so the page can show the history.
- The provider, the model and the key of the external service are read from the configuration, but 1.0.0 never calls an external service: the assistant works entirely inside your installation.
Audit log
The audit log records the changes that matter: the creation of a workspace, the change of a plan, a sale, a shift, the status of an order, a synchronisation, a setting.
Permission: settings.manage. Route: /app/audit-log. Table: audit_logs.
| Route | Method | What it does |
|---|---|---|
/app/audit-log | GET | The last two hundred entries of the workspace, newest first. |
How it works
- An entry carries the workspace, the user, the action, the entity, the identifier of the entity, the detail and the address of the request.
- The action names are stable and greppable:
platform.tenant_create,platform.tenant_status,platform.tenant_plan,pos.sale,pos.shift_open,pos.shift_close,store.order,store.order_status,integration.sync,settings.saveandprofile.save. - The entries of the platform layer and the entries of the workspaces share the table and are separated by the
tenant_id. - An entry that cannot be written is logged on the server and does not stop the action that caused it.
Users and roles
The users of a workspace and the roles that say what each of them may do. The role decides what the navigation shows and what the server accepts.
Permissions: users.manage for the users and the roles, settings.manage for the settings, the integrations and the audit log. Tables: users, roles, sessions, login_codes.
| Route | Method | What it does |
|---|---|---|
/app/users | GET | The list of the users of the workspace. |
/app/users/new, /app/users/:id/edit | GET | The form of a user. |
/app/users/save | POST | Creates or changes a user, with the role and the state. |
/app/roles, /app/roles/save | GET, POST | The roles and the permissions of each one. |
/app/settings, /app/settings/save | GET, POST | The settings of the workspace and the name and the currency of the business. |
/app/profile, /app/profile/save | GET, POST | The profile and the password of the signed in user. |
How it works
- Six roles ship with the product.
super_adminandownerhave every permission.adminhas all of them exceptusers.manage.managerhas all of them exceptsettings.manage,users.manageandaccounting.edit.cashierhas the register, the catalogue, the stock, the customers and the sales.store_customerhas none and is refused by the panel. - A custom role stores the list of the permission codes in the column
permissions, separated by commas. A user with a custom role gets exactly those codes. - The registration form refuses an address that is already used anywhere in the installation, so an account cannot belong to two businesses at the same time. The unique index of the table is on the pair workspace and address.
- A user can be disabled. The session of a disabled user is refused at the next request, even before the session expires.
- The password is stored as a bcrypt hash and is never sent back to the browser.
The platform layer
The platform layer is the console of the operator of the installation. It is the part you sell: it creates the workspaces, holds the plans, switches the modules on, and keeps the billing records. It is reachable only by an account with the role super_admin and a tenant_id of zero.
| Route | Method | What it does |
|---|---|---|
/platform | GET | The dashboard: the workspaces, the plans, the monthly recurring revenue and the invoices that are not paid. |
/platform/tenants | GET | The list of the workspaces, filtered by state. |
/platform/tenants/:id | GET | The detail of a workspace: its subscriptions, its invoices and its users. |
/platform/tenants | POST | Creates a workspace, its owner, its subscription and its starter data. |
/platform/tenants/:id/status | POST | Suspends or reactivates a workspace. |
/platform/tenants/:id/plan | POST | Changes the plan of a workspace and opens the new subscription. |
/platform/plans, /platform/plans | GET, POST | The list of the plans and the save of one. |
/platform/billing, /platform/billing/:id/pay | GET, POST | The billing invoices and the record of a payment. |
/platform/modules, /platform/modules | GET, POST | The catalogue of the modules and the save of one. |
/platform/settings, /platform/settings | GET, POST | The settings of the platform and their save. |
How it works
- Four plans are written on the first start and can be changed afterwards. Their code, their name, their monthly and yearly price, the maximum number of users, of products and of warehouses, the list of the modules and the order on the pricing page are all editable.
- Fifteen modules are declared in the catalogue: core, point of sale, online store, purchasing, accounting, reports, assistant, CRM, rental, restaurant, booking, assets, human resources, courier and production. The activation of a module is kept in the table of the workspaces.
- A subscription carries the workspace, the plan, the cycle, the amount, the state and the dates. Every change writes a subscription event: the trial that started, the plan that changed, the state that changed.
- A billing invoice carries the amount, the state and the due date; a payment records what was taken and when.
- Every action of the platform layer is written to the audit log with the actor
platform.
The plans of the release
| Plan | Monthly | Yearly | Users | Products | Warehouses | Modules |
|---|---|---|---|---|---|---|
| Starter | 39 | 390 | 3 | 500 | 1 | core, pos, store, reports, assistant |
| Growth | 79 | 790 | 10 | 5 000 | 5 | core, pos, store, purchasing, accounting, crm, booking, courier, production, reports, assistant |
| Business | 149 | 1 490 | 30 | 25 000 | 20 | the whole platform except the enterprise only parts |
| Enterprise | 399 | 3 990 | unlimited | unlimited | unlimited | every module |
The prices above are the defaults written on the first start. They are data, not code: change them under /platform/plans before you publish the installation.
The permissions of the panel
These are the thirty-one permission codes of the release. The code is what the role editor stores and what the server checks; the label is what the editor shows.
| Code | Label | Group |
|---|---|---|
dashboard.view | View the dashboard | Dashboard |
products.view | View products | Inventory |
products.edit | Create and change products | Inventory |
products.delete | Delete products | Inventory |
stock.view | View stock levels | Inventory |
stock.edit | Adjust and transfer stock | Inventory |
purchases.view | View purchases | Purchasing |
purchases.edit | Create and change purchases | Purchasing |
suppliers.view | View suppliers | Purchasing |
suppliers.edit | Create and change suppliers | Purchasing |
sales.view | View sales documents | Sales |
sales.edit | Create and change sales documents | Sales |
customers.view | View customers | Sales |
customers.edit | Create and change customers | Sales |
pos.use | Use the point of sale | Point of sale |
pos.discount | Give a discount in the point of sale | Point of sale |
pos.void | Void items and cancel orders | Point of sale |
accounting.view | View accounting | Accounting |
accounting.edit | Record accounting entries | Accounting |
reports.view | View reports | Reports |
store.manage | Manage the online store | Online store |
crm.manage | Manage the CRM | Business modules |
rental.manage | Manage the rental module | Business modules |
restaurant.manage | Manage the restaurant module | Business modules |
booking.manage | Manage the booking module | Business modules |
asset.manage | Manage the assets | Business modules |
hr.manage | Manage the human resources | Business modules |
courier.manage | Manage the couriers | Business modules |
production.manage | Manage the production | Business modules |
settings.manage | Change the settings | Settings |
users.manage | Manage the users and the roles | Settings |
pos.void and the tables of the quick bar and of the manager approval exist in the catalogue of 1.0.0, but no screen of the release uses them. A role that is given these codes keeps them; they will be checked when the feature is wired.