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 ​
| Class | Description |
|---|---|
| Container | TypeORM entity for the containers table. |
| ContainerController | Controller for managing all routes related to the container entity. |
| ContainerRevision | TypeORM 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. |
| ContainerService | Service class for the container entity. |
Interfaces ​
| Interface | Description |
|---|---|
| BaseContainerParams | Base parameters shared between container create and update requests. |
| BaseContainerResponse | Base API Response for the container entity. |
| ContainerFilterParameters | Define container filtering parameters used to filter query results. |
| ContainerResponse | API Response for the container entity. |
| ContainerWithProductsResponse | API Response for the container entity, including its products. |
| CreateContainerParams | Parameters for creating a new container. |
| CreateContainerRequest | API Request for creating a container entity. |
| PaginatedContainerResponse | Paginated API Response for the container entity. |
| PaginatedContainerWithProductResponse | Paginated API Response for the container entity, with each container's products inlined. |
| UpdateContainerParams | Parameters for updating an existing container. |
Type Aliases ​
| Type Alias | Description |
|---|---|
| ContainerParams | Union of create and update container params. |
| UpdateContainerRequest | API Request for updating a container entity. |