Skip to content

Data Examples & Definitions

Dylan Barkowsky edited this page Jul 19, 2023 · 5 revisions

Data Examples & Definitions

There is only one type of record that is stored for this application: Reimbursement Requests. However, within each record are additional unique record types that data conforms to.

These data types are implemented within the application as TypeScript interfaces.

Reimbursement Request

Example

The reimbursement request changes slightly depending on its position in the application's workflow.

When incoming directly from CHEFS, it will have the following structure:

{
  "idir": "W0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A2",
  "firstName": "Fred",
  "lastName": "Rick",
  "employeeId": 432423,
  "purchases": [
    {
      "supplier": "Can Tire",
      "purchaseDate": "2023-05-28T00:00:00-07:00",
      "cost": 77.22
    }
  ],
  "additionalComments": "Building an office fort.",
  "submit": true
}

The submit field is automatically added by CHEFS, indicating that the submission was completed (as opposed to a submission draft).

Once the request has entered the SPR system and users have attached the required files, it will reflect this state:

{
  "_id": {
    "$oid": "64ab0d8176a2c8def0a639c6"
  },
  "idir": "W0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A2",
  "firstName": "Fred",
  "lastName": "Rick",
  "employeeId": 432423,
  "purchases": [
    {
      ... See Purchase below
    }
  ],
  "additionalComments": "Starting my own ice cream business.",
  "submit": true,
  "submissionDate": "2023-07-09T19:41:53.268Z",
  "state": 4,
  "approvals": [
    {
      ... See Approval below
    }
  ]
}

Definition

Property Definition
_id The Object ID assigned by MongoDB.
idir The requestor's IDIR user ID.
firstName The requestor's first name.
lastName The requestor's last name.
employeeId The requestor's employee ID.
purchases A list of Purchase objects.
approvals A list of Approval objects.
additionalComments A comment left by the requestor.
state The current state of the request. e.g. Deleted, Completed, etc.
submissionDate The date the request was submitted.
submit From CHEFS. Whether the submission was submitted. Will always be true in this application.

Purchase

Example

{
  "supplier": "Mr. Tubbs",
  "purchaseDate": "2023-06-19T00:00:00-07:00",
  "cost": 89.32,
  "fileObj": {
    ... See File below
  }
}

Definition

Property Definition
supplier The name of the business where the purchase was made.
purchaseDate The date of the purchase.
cost The amount spent according to the receipt.
fileObj The attached file. Should be a receipt.

Approval

Example

{
  "approvalDate": "2023-07-12T18:57:41.814Z",
  "fileObj": {
    ... See File below
  }
}

Definition

Property Definition
approvalDate The date approval for the purchase was obtained.
fileObj The attached file.

File

The interface for this type of data is called IFile.

Example

{
  "file": "data:application/pdf;base64,...",
  "name": "my-file.pdf",
  "size": 121080,
  "date": "2023-07-13T15:25:35.428Z",
  "deleted": false,
  "downloaded": true,
  "removed": false,
  "source": "approval"
}

Definition

Property Definition
file The base64-encoded file data.
name The name of the file.
size The size of the file in bytes.
date The date the file was uploaded in ISO format.
deleted Whether the file has been automatically cleaned up by the application.
downloaded Whether the file has been previously downloaded by an admin role.
removed Whether the file was removed in the UI. Used to detect removal upon update.
source The type of record the file belongs to. e.g. purchase, approval, temp.