@webshop/root - v1.0.0
    Preparing search index...
    Index

    Constructors

    Properties

    _databaseService: DatabaseService = ...
    _priceService: PriceService = ...

    Methods

    • Checks if an user has a shoppingCart and calls _makeNewCart() in case user doesn't

      Parameters

      • connection: PoolConnection

        the poolconnection used to communicate with the database.

      • userId: number

        the id of the user that needs to be checked for a shoppingCart.

      Returns Promise<void>

      Tim Denkers

    • private helper method that automatically makes a new cart in case user doesn't have a shoppingCart. Uses an already existing poolconnection

      Parameters

      • userId: number

        the user's id to make a new shopping cart

      • connection: PoolConnection

        the pool connection that this method can use to communicate with the database. To prevent multiple pool connections from being used by the same person.

      Returns Promise<void>

      Tim Denkers

    • Adds a single product to an user's cart

      Parameters

      • amount: number

        the amount of a single product the user wants to buy

      • gameSku: string

        the id of the game or product the user wants to buy

      • userId: number

        the id of the current user

      Returns Promise<void>

      Tim Denkers

    • Changes the amount of a shoppingItem in a logged in user's shopping cart

      Parameters

      • amount: number

        the amount the user wants to product to have. Not add, have.

      • idShoppingCartItem: number

        the id of the shoppingItem the user wants to change.

      • userId: number

        the id of the logged in user that wants to change the amount of a shopping item.

      Returns Promise<void>

      Tim Denkers

    • Deletes from the database, a shoppingitem from a logged in user's shoppingcart

      Parameters

      • idShoppingCartItem: number

        the id of the shoppingItem that needs to be deleted

      • userId: number

        the id of the user that wants to remove a shopping item from their shopping cart

      Returns Promise<void>

      Tim Denkers

    • Retrieves all the products in an user's shoppingcart

      Parameters

      • userId: number

        requires the id of the current user

      • sessionId: string

      Returns Promise<IShoppingCart>

      returns an array of all the shoppingItems of the current user and a total price. This price also includes any active prices.

      Tim Denkers