Skip to content

SudoSOS Back-end API / service/websocket/pos-relation-helper / getPointOfSaleRelation

Function: getPointOfSaleRelation() ​

ts
function getPointOfSaleRelation(
   userId, 
   token, 
pointOfSaleId): Promise<"all" | "organ" | "own">;

Determines the relation between a user and a point of sale. Returns 'all' if user is not connected to POS, 'organ' if connected via organ, 'own' if directly connected.

Parameters ​

ParameterTypeDescription
userIdnumberThe user ID.
tokenJsonWebTokenThe JWT token containing organ information.
pointOfSaleIdnumberThe point of sale ID.

Returns ​

Promise<"all" | "organ" | "own">

The relation: 'all', 'organ', or 'own'.