Skip to content

Ratings

Mounir Ghlaiel edited this page Apr 11, 2022 · 1 revision

Ratings

Ratings service takes 'scores' from 1 to 5 from both collectors and customers, calculates average, and stores the final rating per userId and per pick-up request.

Components

schema:
  rating:
    type: object
    properties:
      Id:
        type: string
        format: UUID
      pick-up-requestId:
        type: string
        format: UUID
      userId:
        type: string
        format: UUID

The following fields are expected from the collector to rate the pick-up

      quality:
        type: number
        format: int8
        minimum: 1
        maximum: 5
        nullable: true
      quantity:
        type: number
        format: int8
        minimum: 1
        maximum: 5
        nullable: true
      treatment:
        type: number
        format: int8
        minimum: 1
        maximum: 5
        nullable: true

Overall represents the average of 3 values from quality, quantity, and treatment to be saved as the customer's rating. When customers are rating the collector, they provide an overall value directly.

      overrall:
        type: Float32

Required fields

   required:
     - Id
     - userId
     - pick-up-requestId
     - Overall
Clone this wiki locally