Skip to content

SudoSOS Back-end API / catalogue / point-of-sale

Catalogue: Point Of Sale ​

A point of sale (POS) is the surface on which SudoSOS transactions are created. Typical examples are the bar terminal during a drink, a committee's order form, or an app instance on an event laptop. A POS is not an organ — it is the place where people buy things.

Owner, cashiers, and user ​

A POS has three user roles tied to it:

  • owner — the user (typically an organ) that runs the POS. The owner can always open, edit, and create transactions on it.
  • user — the dedicated "POS user" that the POS authenticates as. Tokens issued to the POS carry this user, so buyers charged through this POS show up under it.
  • cashierRoles — any user that holds at least one of these roles can create transactions on this POS (but cannot open/edit/close it). Useful for shared bar shifts where many people need to ring up purchases but only the organ board manages the POS itself.

Containers and products ​

A POS exposes its products indirectly: it holds a set of ContainerRevisions, each of which groups the products of one seller. This is how a single purchase through one POS can split across multiple organs via SubTransactions. Display order within a POS is controlled by ProductOrdering.

Revisions ​

PointOfSale is paired with PointOfSaleRevision. Each edit (name, container list, authentication flag) produces a new revision; currentRevision points at the live one. Past transactions keep referencing the revision that was current at the time, so history stays intact. PointOfSaleRevision is immutable — attempting to update one throws.

POSs are soft-deleted via deletedAt; the rows remain so that historical SubTransaction references stay valid.

Authentication ​

If useAuthentication is true, buyers must present a PIN (or equivalent) before a transaction can be recorded — used on public terminals. If false, the POS can ring up purchases without buyer-side authentication (typical for trusted cashier setups).

For API interactions, refer to the Swagger Documentation.

Classes ​

ClassDescription
PointOfSaleTypeORM entity for the point_of_sales table.
PointOfSaleControllerController for managing all routes related to the point of sale entity.
PointOfSaleRevisionTypeORM entity for the point_of_sale_revisions table. Immutable snapshot of a PointOfSale at a specific revision; each edit to a POS produces a new row so historical transactions keep pointing at the revision that was live at the time.
PointOfSaleServiceService class for the point of sale entity.
ProductOrderingTypeORM entity for the product_orderings table. Stores the display order of each product within a PointOfSale, so the POS UI can render its product grid in a consistent, owner-controlled sequence.

Interfaces ​

InterfaceDescription
BasePointOfSaleInfoResponseMinimal API Response for the point of sale entity, carrying only the id and revision.
BasePointOfSaleParamsBase parameters shared between point-of-sale create and update requests.
BasePointOfSaleResponseBase API Response for the point of sale entity.
CreatePointOfSaleParamsParameters for creating a new point of sale.
CreatePointOfSaleRequestAPI Request for creating a point of sale entity.
PaginatedPointOfSaleResponsePaginated API Response for the point of sale entity.
PointOfSaleAssociateUsersResponseAPI Response describing who is associated with a point of sale: its owner, the owner's organ members, and the cashier users (users holding at least one of the POS's cashier roles).
PointOfSaleParametersDefine point of sale filtering parameters used to filter query results.
PointOfSaleResponseAPI Response for the point of sale entity.
PointOfSaleWithContainersResponseAPI Response for the point of sale entity, including its containers and their products.
UpdatePointOfSaleParamsParameters for updating an existing point of sale.
UserWithIndexA BaseUserResponse augmented with a stable position index, used to keep ordered user lists (e.g. POS owner members) rendering in a consistent order across requests.

Type Aliases ​

Type AliasDescription
UpdatePointOfSaleRequestAPI Request for updating a point of sale entity.