Skip to content

SudoSOS Back-end API / catalogue / containers

Catalogue: Containers ​

A container is a group of products of a single seller, offered together at one or more points of sale. Typical containers are a bar fridge, a committee snack shelf, or a single event's stock.

Seller and revenue ​

The container's owner is the seller for every purchase of its products. Money from a SubTransaction flows to this user — not to the point of sale operator, and not to the product's creator. This is how a single purchase can be split across multiple organs: each SubTransaction is tied to one container, and therefore to one seller.

Revisions ​

Container is paired with ContainerRevision. Each edit (name, product list) produces a new revision; currentRevision points at the live one. Past purchases keep referencing the revision that was current at the time, so price and composition history stays intact. ContainerRevision is immutable — attempting to update one throws.

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

Visibility ​

  • public: true — any user may include the container on their own point of sale.
  • public: false — the container can only be attached to points of sale by users with explicit permission (typically the owner or an admin).

For API interactions, refer to the Swagger Documentation.

Classes ​

ClassDescription
ContainerTypeORM entity for the containers table.
ContainerControllerController for managing all routes related to the container entity.
ContainerRevisionTypeORM entity for the container_revisions table. Immutable snapshot of a Container at a specific revision; each edit to a container produces a new row so historical transactions keep pointing at the revision that was live at the time.
ContainerServiceService class for the container entity.

Interfaces ​

InterfaceDescription
BaseContainerParamsBase parameters shared between container create and update requests.
BaseContainerResponseBase API Response for the container entity.
ContainerFilterParametersDefine container filtering parameters used to filter query results.
ContainerResponseAPI Response for the container entity.
ContainerWithProductsResponseAPI Response for the container entity, including its products.
CreateContainerParamsParameters for creating a new container.
CreateContainerRequestAPI Request for creating a container entity.
PaginatedContainerResponsePaginated API Response for the container entity.
PaginatedContainerWithProductResponsePaginated API Response for the container entity, with each container's products inlined.
UpdateContainerParamsParameters for updating an existing container.

Type Aliases ​

Type AliasDescription
ContainerParamsUnion of create and update container params.
UpdateContainerRequestAPI Request for updating a container entity.