user_sale_receipt_validations

This table stores the responses generated by users for the validation of receipts, indicating which user gave what response for which sale receipt.

Model

FieldTypeNullableDefault value

id

int4

user_id

int4

sale_receipt_id

int4

validated_at

timestamp

status

text

responses

json

is_correct_response

bool

created_at

timestamp

updated_at

timestamp

Description of fields

id

Unique identifier for the user validation record.

sale_receipt_id

Foreign key referencing the ID of the associated sales receipt in a separate table.

validated_at

Timestamp of when the validation was performed.

status

Status of the validation process.

  1. pending

  2. completed

  3. cancelled

responses

The responses corresponding to the questions selected by the user are saved in this column. For reference, as shown below.

[
    {"questionId": 1, "answer": "A"}, 
    {"questionId": 2, "answer": "A"}, 
    {"questionId": 3, "answer": "A"}, 
    {"questionId": 4, "answer": "A"}, 
    {"questionId": 5, "answer": "A"}, 
    {"questionId": 6, "answer": "A"}, 
    {"questionId": 7, "answer": "A"}, 
    {"questionId": 8, "answer": "A"}, 
    {"questionId": 9, "answer": "A"}
]

is_correct_response

Boolean flag indicating whether the user validation is correct or not. (true/false)

Last updated