Class RatingBehaviour

Rating Behaviour adds rating functionality.

Usage (config.yml):

behaviours:
- type: rating

Hierarchy

Constructors

Properties

accessControl: AccessControl
dataSourceWrapper: DataSourceWrapper
graphHandler: GraphHandler
graphQlSchemaManager: GraphQLSchemaManager

Accessors

Methods

  • Adds Rating of a given entity.

    Parameters

    • vertexLabel: string

      Entity type (vertex label).

    • entityId: string

      Entity ID.

    • rating: number
    • traitData: TraitDataObject<unknown, Record<string, any>, Promise<any>>

    Returns Promise<void>

  • Calculates an average of ratings for a given entity.

    Returns

    The ratings average.

    Parameters

    • tenant: string

      Tenant ID.

    • vertexLabel: string

      Entity type (vertex label).

    • entityId: string

      Entity ID.

    Returns Promise<number>

  • Retrieves UUID of Rating of a given entity.

    Returns

    Rating UUID or null if it doesn't exist.

    Parameters

    • userId: string

      User ID

    • tenant: string

      Tenant ID.

    • vertexLabel: string

      Entity type (vertex label).

    • entityId: string

      Entity ID.

    Returns Promise<any>

  • Removes Rating of a given entity.

    Parameters

    • vertexLabel: string

      Entity type (vertex label).

    • entityId: string

      Entity ID.

    • traitData: TraitDataObject<unknown, Record<string, any>, Promise<any>>

    Returns Promise<void>

  • Provides user rating.

    Returns

    User rating or null if it doesn't exist.

    Parameters

    • user: string

      User ID.

    • tenant: string

      Tenant ID.

    • vertexLabel: string

      Entity type (vertex label).

    • entityId: string

      Entity ID.

    Returns Promise<boolean>

Generated using TypeDoc