12 KiB
This is a Nextjs App router application and tailwindcss with prisma and postgresql, this application is for müller company for managing and follow up the process of making milk bottles.
The application design should be responsive and mobile friendly and sleek, with :
- login page.
- system dashboard layout and left sidebar navigation menu.
- logout button.
The system works as the following :
We have machines for creating bottles (7 of them) and the work is done by 2 shifts , AM or day shift and the PM or night shift, each shift is 12 hours.
we have 4 teams for the work (red, green, blue and yellow), each day should have 2 teams (one for AM/day shift and one for PM/night shift). each team consist of :
- 7 operators or Blow Moulders, T1 blow Moulder, T2 Blow Moulder, T3 Blow Moulder, ..... to T7 Blow Moulder (from 1 to 7), each one works on a machine.
- 1 Blow Moulder Level 2 (who supervise the shift).
- 1 Shift Engineer
- The Shift Manager ( who create the shift and distrubte the 7 operators on the machines )
The tables should be
- teams table : team id, team name , team manager (shift manager) ........
- shift_Managers table: id, EMP_NO (from muller company), first name , surname, email (optional) , phone (optional), status. ........
- workers table : id, EMP_NO (from muller company), first name , surname, email (optional) , phone (optional), job position (Blow Moulder Level 1 / operator , Blow Moulder Level 2, Engineer), status ........
- machines table : id, machine name, machine status (active or inactive), machine type, number of bottle/min ........
- shifts table : id, shift name (AM 7am to 7pm or PM 8pm to 7am), shift manager id, shift start time, shift end time, shift date, shift status (active or inactive or closed), create date .......
- shift_team_member table: id, shift id, team id, worker id, shift role (was an operator or Blow Moulder Level 2 or Engineer ), machine id (in case of the worker was an operator)
........
- machine_shift_report table (a report sheet data) : id, shift id, machine id, worker id (operator),
WALL THICKNESS { Time (default current time) ,Top (numeric value), LabelPanel (numeric value), Base (numeric value), Neck (numeric value)},
SECTION WEIGHTS {Time (default current time), Top (numeric value), LabelPanel (numeric value), Base (numeric value), Neck (numeric value)},
STATION 1 WEIGHTS {Time (default current time), Log (numeric value), TopFlash (numeric value), TailFlash (numeric value), HandleEye (numeric value)},
Safety Checklist (all of them values "checked" or "unchecked") {Emergency stops accessible, Safety guards in place, PPE compliance,Walkways clear, Fire extinguisher accessible, First aid kit available},
Film Details [{TIME of replacement, WIDTH, ROLL NUMBER, PRODUCT CODE,PALLET NUMBER }, ....],
Bottle Weight Tracking (json data) : [ {Time (default current time), bottle1 weight, bottle2 weight, bottle3 weight, bottle4 weight, avarage weight (auto calculate from bottles 1,2,3 and 4), upperlimit (auto calculate), lowerlimt (auto calculate) } , .... ],
Hourly Quality Checks (Time default current time, Base weight and Neck weight are numeric values,the rest are "checked" or "unchecked" ): [{Time, Pack Inspection, Base, Handle, Body, Neck, Land, Distribution, Phase check, Head & Trimmer Visual Inspection, Base weight, Neck weight, Head/Trimmer & Mould Clean, Pack Tension Check, Catch Tray Inspection, Big ,Small , Leak Detector, VMS, VIS, Hold Stock Amount, Silo No.,HDPE % Included}, ....],
Seam Leak Test "MOULD NUMBER is int, Pass = true/false":
[
{Time ,[ {MOULD NUMBER, Pass }, {MOULD NUMBER, Pass }, ..]}, ........
] ,
Production Parameters : [{Time (default current time), Melt Temp (in Celsius), Reg , Head PSI (numeric value) }, ...]
, Production Tracking : [{Hour ,total production this shift, production this hour,comment }],
Average Weight this is auto calculated from the Bottle Weight Tracking (json data) the sum of the varage weights ((that auto calculate from bottles 1,2,3 and 4)) divided on the number of items in the list "Bottle Weight Tracking (json data)",
Total Bags Made, Quality Metrics {Height fails (A), Top Load fails (B), Big leaks (C), Small leaks (D), Check fails (E), Missed bags (F),Other losses (G) }
, Output Metrics : {Wheel Output, Production Leak Detector Infeed, Leak Detector Rejects, VIS Output, VMS Output, Held Stock / Other Losses, TOTAL GOOD BOTTLES PRODUCED }
........
- admins table ( the admin who create and edit teams, add and edit workers, add and edit shift_Managers, add and edit machines ): id, first name, surname, email, password , phone, auth level.
Application workflow
1. Admin login and can create and edit teams, add and edit workers, add and edit shift_Managers, add and edit machines.
2. Shift Manager login and can create and edit shifts, add and edit shift team members
3. When Shift Manager create new shifts, he will disribute his team team members and operators on the machines, (adding records on shift_team_member).
4. When Shift manager creates new shift and assaign shift members and machine operators, a new automatic record (on table machine_shift_report) should be created for each operator at that team for that shift.
5. operators (or Blow Moulder Level 1) of that team can login to his account, IF THERE was a shift (active) that created from his shift manager for that date and an auto machine_shift_report record was created for him he will see one Active shift record (date of the shift, AM (day)/PM(night), his team(red or green or yellow or blue), his shift manager and the machine that he will operate). AND he can click on that record to open the Report Page. (* navigation sidebar should show "Active shifts" page and "Shifts Archive" page, the operator Report Page is the "Active shifts" page. the "Shifts Archive" shows table that list all old shifts - closed shifts)
6. operator Report Page should have :
A. "basic info" section ( date, his name and his id, machine id, team , and shift time (day/night)). B. "Safety Checklist" section (from Safety Checklist in machine_shift_report table to operator to check them and save which will update Safety Checklist).
C. a "Production Pre-Checks" section, where the operator fill the WALL THICKNESS, SECTION WEIGHTS and STATION 1 WEIGHTS (edit the values of them) with save button.
D. "Production Parameters" section, this section should show a table to list the Production parametrs of each shift hour (note that day shift start from 7am and ends at 7pm so first hour should be 8am and last hour is 7pm... while in night shif the first hour is 8pm and last hour is 7 am), at each hour the operator should click on "Add Hourly Temperature Parameters" button which will show a form (popup, you can use seperated component) to add an item {Time (the input field shows default current time ), Melt Temp (in Celsius), Reg (% default is value 35.5%), Head PSI (numeric value) } to the json Production Parameters list. and update the Production Parameters table after each addition.
E. "Bottle Weight Tracking" section, this section should show a Weight Trend Graph to show the (average weight, Upper Limit, Lower Limit, Target weight = 34.0g ) of each shift hour (note that day shift start from 7am and ends at 7pm so first hour should be 8am and last hour is 7pm... while in night shif the first hour is 8pm and last hour is 7 am), at each hour the operator should click on "Add Weight Tracking record" button which will show a form (popup, you can use seperated component) to add an item {Time (the input field shows default current time ), bottle1 weight, bottle2 weight,bottle3 weight,bottle4 weight ,average weight (auto calculate from bottles 1, 2, 3 and 4)} to the json Bottle Weight Tracking (json data) list. and update the Weight Trend Graph after each addition.
F. "Hourly Quality Checks" section, this section should show a table to list the Quality Inspection parametrs of each shift hour (note that day shift start from 7am and ends at 7pm so first hour should be 8am and last hour is 7pm... while in night shif the first hour is 8pm and last hour is 7 am), at each hour the operator should click on "Add Hourly Quality Checks" button which will show a form (popup, you can use seperated component) to add an item {Time (the input field shows default current time), Pack Inspection, Base, Handle, Body, Neck, Land, Distribution, Phase check, Head & Trimmer Visual Inspection, Base weight, Neck weight, Head/Trimmer & Mould Clean, Pack Tension Check, Catch Tray Inspection, Big ,Small , Leak Detector, VMS, VIS, Hold Stock Amount, Silo No.,HDPE % Included} to the json Hourly Quality Checks list. and update the Hourly Quality Checks table after each addition.
G. "Production Tracking" section, this section should show a table to list the Production Tracking of each shift hour (note that day shift start from 7am and ends at 7pm so first hour should be 8am and last hour is 7pm... while in night shif the first hour is 8pm and last hour is 7 am), at each hour the operator should click on "Add Hourly Production Tracking" button which will show a form (popup, you can use seperated component) to add an item {shift Hour ,total production this shift, production this hour,comment } to the json Production Tracking list. and update the Production Tracking table after each addition.
H. "Seam Leak Test" section, at this section, operator usualy each 3 hours should click on "Add Seam Leak Test" button which will show a form (popup, you can use seperated component) to add an item {Time ,[{MOULD NUMBER, Pass }], [{MOULD NUMBER, Pass }, ..]} to the json Seam Leak Test list. the form deatails as the following: Input Time with default current time, a button to add new pair of Input MOULD NUMBER and "Pass" (true/false), each time the operator click on "add MOULD NUMBER" show fields and enter new MOULD NUMBER and the "Pass" (true/false) to the inner list ex:(time :10:00 am, [{MOULD NUMBER :5, Pass: true}, {MOULD NUMBER :7, Pass: true}, {MOULD NUMBER :11, Pass: true} , ...], ) and after 3 hours should add another Seam Leak Test in the same process.
I. "Film Details" section, this section shows a table that list all the record where a new Film is added, when a Film is empty then the operator will replace new Film. So the operator should click on "Add new Film" a form (popup, you can use seperated component) shows up and fill the data of the new Film {TIME of replacement, WIDTH, ROLL NUMBER, PRODUCT CODE,PALLET NUMBER} and add it to the full list [{TIME of replacement, WIDTH, ROLL NUMBER, PRODUCT CODE,PALLET NUMBER}, ....], and update the Film Details table after each addition.
J. "Production Data" section, this section should show a form in the same page with input fields for each value of Average Weight this is auto calculated from the Bottle Weight Tracking (json data) the sum of the varage weights ((that auto calculate from bottles 1,2,3 and 4)) divided on the number of items in the list and Bottle Weight Tracking, Total Bags Made, Quality Metrics fields ({Height fails (A), Top Load fails (B), Big leaks (C), Small leaks (D), Check fails (E), Missed bags (F),Other losses (G) }) and Output Metrics fields ( {Wheel Output, Production Leak Detector Infeed, Leak Detector Rejects, VIS Output, VMS Output, Held Stock / Other Losses, TOTAL GOOD BOTTLES PRODUCED }), the section should have save button to save any changes.
K. each section with popups forms should have save button or saves directly.
L. user can edit any section data that he enterd.