Shelftara Documentation 1.0.0

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

ModulePermissionEntry point
Inventory and catalogueproducts.view, products.edit, products.delete/app/products
Warehouses and stockstock.view, stock.edit/app/stock
Purchasingpurchases.view, purchases.edit, suppliers.view, suppliers.edit/app/purchases
Sales documentssales.view, sales.edit, customers.view, customers.edit/app/quotations
Point of salepos.use, pos.discount, pos.void/app/pos
Online storestore.manage/app/store
Accountingaccounting.view, accounting.edit/app/accounting
Reportsreports.view/app/reports
CRMcrm.manage/app/crm
Rentalrental.manage/app/rental
Restaurantrestaurant.manage/app/restaurant
Bookingbooking.manage/app/bookings
Assetsasset.manage/app/assets
Human resourceshr.manage/app/hr
Courier and shipmentcourier.manage/app/couriers
Productionproduction.manage/app/production
Integrationssettings.manage/app/integrations
Business assistantdashboard.view/app/assistant
Audit logsettings.manage/app/audit-log
Users and rolesusers.manage/app/users
Platform layerthe 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.

RouteMethodWhat it does
/app/productsGETThe list of the catalogue, with the stock and the value of every product.
/app/products/new, /app/products/:id/editGETThe form of a product.
/app/products/savePOSTCreates or changes a product.
/app/products/:id/deletePOSTRemoves a product with its stock levels, its variants and its pictures.
/app/categories, /app/categories/new, /app/categories/:id/editGETThe list and the form of the categories.
/app/categories/savePOSTCreates or changes a category.
/app/brands, /app/brands/saveGET, POSTThe list and the save of the brands.
/app/units, /app/units/saveGET, POSTThe 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_id filter.

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.

RouteMethodWhat it does
/app/warehouses, /app/warehouses/saveGET, POSTThe list and the save of the warehouses. One of them carries the flag default.
/app/stockGETThe quantity of every product per warehouse, with the value and the alert badge.
/app/stock/adjustmentsGETThe list of the counted corrections.
/app/stock/adjustments/new, /app/stock/adjustments/saveGET, POSTCreates an adjustment with its lines.
/app/stock/transfersGETThe list of the transfers between the warehouses.
/app/stock/transfers/new, /app/stock/transfers/saveGET, POSTCreates a transfer with its lines.
/app/stock/transfers/:id/receivePOSTReceives 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.

RouteMethodWhat it does
/app/purchasesGETThe list of the purchases, with the supplier, the value and the balance.
/app/purchases/new, /app/purchases/:id/editGETThe form of a purchase.
/app/purchases/savePOSTCreates or changes a purchase, writes its lines and its payments.
/app/suppliersGETThe list of the suppliers with their balance.
/app/suppliers/new, /app/suppliers/:id/editGETThe form of a supplier.
/app/suppliers/savePOSTCreates or changes a supplier.
/app/suppliers/:id/wallet, /app/suppliers/:id/walletGET, POSTShows 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.

RouteMethodWhat it does
/app/quotations, /app/quotations/new, /app/quotations/:id/editGETThe list and the form of the quotations.
/app/quotations/savePOSTCreates or changes a quotation.
/app/orders, /app/orders/new, /app/orders/:id/editGETThe list and the form of the orders.
/app/orders/savePOSTCreates or changes an order and reserves the stock.
/app/invoices, /app/invoices/new, /app/invoices/:id/editGETThe list and the form of the invoices.
/app/invoices/:id/viewGETThe printable view of an invoice.
/app/invoices/savePOSTCreates or changes an invoice.
/app/invoices/:id/payPOSTRecords a payment on an invoice and recomputes its state.
/app/credit-notes, /app/credit-notes/saveGET, POSTThe list and the save of the credit notes.
/app/returns, /app/returns/saveGET, POSTThe list and the save of the sales returns.
/app/customers, /app/customers/new, /app/customers/:id/editGETThe list and the form of the customers.
/app/customers/savePOSTCreates or changes a customer.
/app/customers/:id/walletGET, POSTShows 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, CN and RET.
  • The state of an invoice is unpaid, partial, paid, overdue or cancelled. 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.

RouteMethodWhat it does
/app/posGETThe register.
/app/pos/shiftsGETThe list of the shifts of the cash drawer.
/app/pos/shift/open, /app/pos/shift/closePOSTOpens a shift with the opening cash, closes it with the counted cash and records the variance.
/app/pos/holdsGETThe list of the parked carts.
/app/pos/holdPOSTParks the basket of the register.
/app/pos/hold/:id/loadPOSTLoads a parked cart back into the register.
/api/v1/pos/productsGETThe products of the register, with the quantity on hand.
/api/v1/pos/salePOSTRecords a sale: the order, the invoice, the payments and the stock.
/api/v1/pos/holdPOSTParks a basket from the API.
/api/v1/pos/syncPOSTStores the sales that were taken while the line was down.
/api/v1/pos/configGETThe 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/sync stores 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.

RouteMethodWhat it does
/app/store, /app/store/saveGET, POSTThe settings of the shop and the save of them.
/app/store/ordersGETThe list of the orders of the shop.
/app/store/orders/:idGETThe detail of one order.
/app/store/orders/:id/statusPOSTMoves an order to another state.
/storeGETThe home of the shop: the categories, the featured products and the basket button.
/store/category/:slugGETThe products of a category.
/store/product/:slugGETThe page of a product, with the reviews.
/store/cartGETThe basket.
/store/cart/add, /store/cart/update, /store/cart/removePOSTThe three operations on the basket.
/store/checkoutGET, POSTThe checkout form and the creation of the order.
/store/order/:numberGETThe tracking page of an order.
/store/reviewPOSTRecords 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/:slug or 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 state pending and the payment state unpaid.
  • The state of an order moves through pending, processing, shipped, completed and cancelled. 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.

RouteMethodWhat it does
/app/accountingGETThe overview of the module: the balances and the figures of the period.
/app/accounting/accounts, /app/accounting/accounts/saveGET, POSTThe chart of accounts and the save of an account.
/app/accounting/transactions, /app/accounting/transactions/saveGET, POSTThe transactions and the save of one.
/app/accounting/expenses, /app/accounting/expenses/saveGET, POSTThe expenses, their categories and the save of an expense.
/app/accounting/transfers, /app/accounting/transfers/saveGET, POSTThe transfers between two accounts and the save of one.
/app/accounting/deposits, /app/accounting/deposits/saveGET, POSTThe 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.

KeyReportFiltersWhat it shows
productsProduct performancesearchEvery product with its category, its stock, its cost, its price and the value of its stock.
salesSales reportperiod, searchEvery invoice of the period with the subtotal, the tax, the total, what was paid and the state.
profitProfit and lossperiodThe revenue, the cost of the goods and the gross profit per product, with the margin.
customersCustomer report—Every customer with the number of invoices, the turnover, what was paid, the balance and the wallet.
suppliersSupplier report—Every supplier with the purchases, the value, what was paid, the balance and the wallet.
taxTax reportperiodThe tax collected, grouped by rate, with the net amount it was calculated on.
stockStock reportwarehouse, low onlyThe quantity and the value of every item on hand, per warehouse.
valuationInventory 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 from and to from 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.

RouteMethodWhat it does
/app/crmGETThe dashboard of the module: the leads by stage, the activities of the week and the targets.
/app/crm/leadsGETThe list of the leads.
/app/crm/leads/new, /app/crm/leads/:id/editGETThe form of a lead.
/app/crm/leads/savePOSTCreates or changes a lead and its activities.
/app/crm/pipelines, /app/crm/pipelines/saveGET, POSTThe 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.

RouteMethodWhat it does
/app/rentalGETThe dashboard of the module: the items on rent, the contracts that run and the reservations of the day.
/app/rental/items, /app/rental/items/saveGET, POSTThe rentable items and the save of one.
/app/rental/contractsGETThe list of the contracts.
/app/rental/contracts/new, /app/rental/contracts/saveGET, POSTThe form of a contract and its save.
/app/rental/reservations, /app/rental/reservations/saveGET, POSTThe reservations and the save of one.
/app/rental/maintenance, /app/rental/maintenance/saveGET, POSTThe 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 RNT and 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.

RouteMethodWhat it does
/app/restaurantGETThe dashboard of the module: the tables, the tickets of the kitchen and the sales of the day.
/app/restaurant/tables, /app/restaurant/tables/saveGET, POSTThe floors and the tables, and the save of a table.
/app/restaurant/menu, /app/restaurant/menu/saveGET, POSTThe menu and the save of a dish or of a modifier.
/app/restaurant/ordersGETThe orders of the tables.
/app/restaurant/kitchenGETThe kitchen display: the tickets that are waiting.
/app/restaurant/kitchen/:idPOSTUpdates 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, ready or served, 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.

RouteMethodWhat it does
/app/bookingsGETThe list of the reservations.
/app/bookings/new, /app/bookings/:id/editGETThe form of a reservation.
/app/bookings/savePOSTCreates or changes a reservation.
/app/booking/services, /app/booking/services/saveGET, POSTThe services and the save of one.
/app/booking/staff, /app/booking/staff/saveGET, POSTThe staff and the save of one.
/app/booking/schedule, /app/booking/schedule/saveGET, POSTThe 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 BKG and 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.

RouteMethodWhat it does
/app/assetsGETThe list of the assets with their book value.
/app/assets/savePOSTCreates or changes an asset.
/app/assets/:id/depreciatePOSTRecords a depreciation entry and lowers the book value.
/app/assets/:id/disposePOSTRecords 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.

RouteMethodWhat it does
/app/hrGETThe dashboard: the head count, the attendance of the day, the leaves and the openings.
/app/hr/employeesGETThe list of the employees.
/app/hr/employees/new, /app/hr/employees/saveGET, POSTThe form of an employee and its save.
/app/hr/attendance, /app/hr/attendance/saveGET, POSTThe attendance of the day and the save of a record.
/app/hr/leaves, /app/hr/leaves/saveGET, POSTThe leaves and the save of a request.
/app/hr/leaves/:id/statusPOSTApproves or refuses a leave.
/app/hr/recruitment, /app/hr/recruitment/saveGET, POSTThe openings, the applicants and the save of both.
/app/hr/applicants/:id/stagePOSTMoves 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.

RouteMethodWhat it does
/app/couriers, /app/couriers/saveGET, POSTThe carriers and the save of one.
/app/shipmentsGETThe list of the parcels.
/app/shipments/newGETThe form of a parcel.
/app/shipments/savePOSTCreates a parcel and writes its first event.
/app/shipments/:id/statusPOSTChanges 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 SHP and 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.

RouteMethodWhat it does
/app/productionGETThe list of the production orders and of the bills of materials.
/app/production/savePOSTCreates a production order or a bill of materials.
/app/production/:id/completePOSTCompletes 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 PRD and 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.

RouteMethodWhat it does
/app/integrationsGETThe list of the connections and the log of the last runs.
/app/integrations/savePOSTCreates or changes a connection.
/app/integrations/:id/syncPOSTRuns 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.

RouteMethodWhat it does
/app/assistantGETThe page of the assistant, with the conversation.
/api/v1/assistant/askPOSTAsks 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.

RouteMethodWhat it does
/app/audit-logGETThe 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.save and profile.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.

RouteMethodWhat it does
/app/usersGETThe list of the users of the workspace.
/app/users/new, /app/users/:id/editGETThe form of a user.
/app/users/savePOSTCreates or changes a user, with the role and the state.
/app/roles, /app/roles/saveGET, POSTThe roles and the permissions of each one.
/app/settings, /app/settings/saveGET, POSTThe settings of the workspace and the name and the currency of the business.
/app/profile, /app/profile/saveGET, POSTThe profile and the password of the signed in user.

How it works

  • Six roles ship with the product. super_admin and owner have every permission. admin has all of them except users.manage. manager has all of them except settings.manage, users.manage and accounting.edit. cashier has the register, the catalogue, the stock, the customers and the sales. store_customer has 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.

RouteMethodWhat it does
/platformGETThe dashboard: the workspaces, the plans, the monthly recurring revenue and the invoices that are not paid.
/platform/tenantsGETThe list of the workspaces, filtered by state.
/platform/tenants/:idGETThe detail of a workspace: its subscriptions, its invoices and its users.
/platform/tenantsPOSTCreates a workspace, its owner, its subscription and its starter data.
/platform/tenants/:id/statusPOSTSuspends or reactivates a workspace.
/platform/tenants/:id/planPOSTChanges the plan of a workspace and opens the new subscription.
/platform/plans, /platform/plansGET, POSTThe list of the plans and the save of one.
/platform/billing, /platform/billing/:id/payGET, POSTThe billing invoices and the record of a payment.
/platform/modules, /platform/modulesGET, POSTThe catalogue of the modules and the save of one.
/platform/settings, /platform/settingsGET, POSTThe 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

PlanMonthlyYearlyUsersProductsWarehousesModules
Starter3939035001core, pos, store, reports, assistant
Growth79790105 0005core, pos, store, purchasing, accounting, crm, booking, courier, production, reports, assistant
Business1491 4903025 00020the whole platform except the enterprise only parts
Enterprise3993 990unlimitedunlimitedunlimitedevery 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.

CodeLabelGroup
dashboard.viewView the dashboardDashboard
products.viewView productsInventory
products.editCreate and change productsInventory
products.deleteDelete productsInventory
stock.viewView stock levelsInventory
stock.editAdjust and transfer stockInventory
purchases.viewView purchasesPurchasing
purchases.editCreate and change purchasesPurchasing
suppliers.viewView suppliersPurchasing
suppliers.editCreate and change suppliersPurchasing
sales.viewView sales documentsSales
sales.editCreate and change sales documentsSales
customers.viewView customersSales
customers.editCreate and change customersSales
pos.useUse the point of salePoint of sale
pos.discountGive a discount in the point of salePoint of sale
pos.voidVoid items and cancel ordersPoint of sale
accounting.viewView accountingAccounting
accounting.editRecord accounting entriesAccounting
reports.viewView reportsReports
store.manageManage the online storeOnline store
crm.manageManage the CRMBusiness modules
rental.manageManage the rental moduleBusiness modules
restaurant.manageManage the restaurant moduleBusiness modules
booking.manageManage the booking moduleBusiness modules
asset.manageManage the assetsBusiness modules
hr.manageManage the human resourcesBusiness modules
courier.manageManage the couriersBusiness modules
production.manageManage the productionBusiness modules
settings.manageChange the settingsSettings
users.manageManage the users and the rolesSettings
Two codes are declared but not used yet

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.