S4-G1 / management

1 stars 0 forks source link

Batch report #5

Open kepet19 opened 3 years ago

kepet19 commented 3 years ago

REQUIREMENT

--

ID Requirement
R04 Batch report

DESIRED OUTCOME --
As an end-user I want to be able to have a batch report for each production, that have happened. The batch report includes:

Batch report is a interactive history page

ACCEPTANCE CRITERIA

A story can cover multiple requirements and aims to describe the desired outcome that meets the expectations of the requirement(s). The acceptance criteria are the agreed measure to prove the story is functionally complete and indirectly proving the requirements are met.

Test Case ID S4G1_DST_xx
Requirement(so) Rae
Preconditions The system should have produced some batch reports.
Test Steps Click to see a specific batch report.
Expected Output The system should show the batch report from the selected report and show the information mention above

DEFINITION OF DONE

The Definition of Done describes the different steps to be completed to ensure the product/solution increment is completed.

SOLUTION DESCRIPTION

The solution description describes how we expect to implement a solution that satisfies the desired outcome of the user story.

The batch report will be displayed on the history page on the website. The data for the history page is fetched from the database using a HTTP GET request to the relevant API endpoint.

GET /batches/ will return the following:

[
  {
    "speed": 189,
    "started_dt": "2021-01-17T14:14:48.392470+00:00",
    "amount_to_produce": 100,
    "recipe_id": "Pilsner",
    "finished_dt": "2021-01-17T14:15:20.135025+00:00",
    "oee": 29.295000000000005,
    "identifier": 7
  },
  {
    "speed": 200,
    "started_dt": "2021-01-17T14:04:31.460101+00:00",
    "amount_to_produce": 100,
    "recipe_id": "Pilsner",
    "finished_dt": "2021-01-17T14:12:52.279874+00:00",
    "oee": 29.333333333333332,
    "identifier": 6
  }
]

The JSON above is an array of batches that have been produced and stored in the database. The array is then used to make a list on the history page, from there you can. Click on one item on the list you want to see.

On click it will then go ahead and fetch data over time with batch_id as argument for the API endpoint. The batch_id comes from the earlier fetch done above.
GET /data_over_time/{batch_id}

{
  "results": [
    {
      "batch_id": 7,
      "measurement_ts": "2021-01-17T14:15:20.135025+00:00",
      "temperature": 30.05,
      "humidity": 69.85,
      "vibration": 1.76,
      "produced": 100,
      "state": 17,
      "rejected": 7,
      "inserted_ts": "2021-01-17T14:15:58.929560+00:00"
    },
    {
      "batch_id": 7,
      "measurement_ts": "2021-01-17T14:15:19.817564+00:00",
      "temperature": 30.04,
      "humidity": 67.41,
      "vibration": 1.54,
      "produced": 99,
      "state": 16,
      "rejected": 7,
      "inserted_ts": "2021-01-17T14:15:58.610986+00:00"
    },
    {
      "batch_id": 7,
      "measurement_ts": "2021-01-17T14:15:19.500113+00:00",
      "temperature": 30.02,
      "humidity": 69.28,
      "vibration": 1.9,
      "produced": 98,
      "state": 6,
      "rejected": 7,
      "inserted_ts": "2021-01-17T14:15:58.286730+00:00"
    }  
    ],
  "pagination": {
    "more": true,
    "total": 100,
    "number_of_pages": 33
  }
}

The JSON above is an array of "data over time" that have been produced. The data is then used to show a graph over:

There is also other data points that shows it total: