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 ​
| Class | Description |
|---|---|
| PointOfSale | TypeORM entity for the point_of_sales table. |
| PointOfSaleController | Controller for managing all routes related to the point of sale entity. |
| PointOfSaleRevision | TypeORM 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. |
| PointOfSaleService | Service class for the point of sale entity. |
| ProductOrdering | TypeORM 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 ​
| Interface | Description |
|---|---|
| BasePointOfSaleInfoResponse | Minimal API Response for the point of sale entity, carrying only the id and revision. |
| BasePointOfSaleParams | Base parameters shared between point-of-sale create and update requests. |
| BasePointOfSaleResponse | Base API Response for the point of sale entity. |
| CreatePointOfSaleParams | Parameters for creating a new point of sale. |
| CreatePointOfSaleRequest | API Request for creating a point of sale entity. |
| PaginatedPointOfSaleResponse | Paginated API Response for the point of sale entity. |
| PointOfSaleAssociateUsersResponse | API 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). |
| PointOfSaleParameters | Define point of sale filtering parameters used to filter query results. |
| PointOfSaleResponse | API Response for the point of sale entity. |
| PointOfSaleWithContainersResponse | API Response for the point of sale entity, including its containers and their products. |
| UpdatePointOfSaleParams | Parameters for updating an existing point of sale. |
| UserWithIndex | A 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 Alias | Description |
|---|---|
| UpdatePointOfSaleRequest | API Request for updating a point of sale entity. |