From 611249f521a69cc1ebed600bd37265e58c06fb38 Mon Sep 17 00:00:00 2001 From: magnusandy Date: Mon, 2 Mar 2015 19:26:17 -0600 Subject: [PATCH] Started better parser tests Got a basic system in place that loads a statement file and executes it within a transaction in the database. all it does is droptables and insert locations/inspections generated from the parser. later i will make it so that the inserts are checked against expected values --- app/databaseParser/Main.scala | 32 +-- database/statements.sql | 8 +- database/test/test.sql | 267 ++++++++++++++++-- ...t Stockade - Kitchen [1700 17th Av...].csv | Bin 0 -> 2682 bytes ..._TJ's Pizza [#3 - 1100 S Service Rd E].csv | Bin 0 -> 2386 bytes ...Family Restaurant [83 N Service Rd W].csv | Bin 0 -> 2834 bytes ...nt_Taco Time [#3 - 410 S Service Rd E].csv | Bin 0 -> 1228 bytes ...urrent_The Daily Grind [130 Jasper St].csv | Bin 0 -> 1342 bytes ...les - Restaurant [1910 S Service Rd W].csv | Bin 0 -> 1306 bytes ...t Current_The Lobby [508 Cheadle St W].csv | Bin 0 -> 1322 bytes ...vation Army - Kitchen [780 1st Ave NW].csv | Bin 0 -> 2142 bytes ...im Hortons - Downtown [225 1st Ave NW].csv | Bin 0 -> 1490 bytes ...rrent_Tim Hortons [515 N Service Rd E].csv | Bin 0 -> 2390 bytes ...port City - Cafe [2615 N Service Rd W].csv | Bin 0 -> 4084 bytes database/test/tests.sql | 178 ++++++++++++ test/ParserSpec.scala | 87 +++++- 16 files changed, 531 insertions(+), 41 deletions(-) create mode 100644 database/test/testReports/Cypress_Swift Current_Swift Current Stockade - Kitchen [1700 17th Av...].csv create mode 100644 database/test/testReports/Cypress_Swift Current_TJ's Pizza [#3 - 1100 S Service Rd E].csv create mode 100644 database/test/testReports/Cypress_Swift Current_TNT Family Restaurant [83 N Service Rd W].csv create mode 100644 database/test/testReports/Cypress_Swift Current_Taco Time [#3 - 410 S Service Rd E].csv create mode 100644 database/test/testReports/Cypress_Swift Current_The Daily Grind [130 Jasper St].csv create mode 100644 database/test/testReports/Cypress_Swift Current_The Eagles - Restaurant [1910 S Service Rd W].csv create mode 100644 database/test/testReports/Cypress_Swift Current_The Lobby [508 Cheadle St W].csv create mode 100644 database/test/testReports/Cypress_Swift Current_The Salvation Army - Kitchen [780 1st Ave NW].csv create mode 100644 database/test/testReports/Cypress_Swift Current_Tim Hortons - Downtown [225 1st Ave NW].csv create mode 100644 database/test/testReports/Cypress_Swift Current_Tim Hortons [515 N Service Rd E].csv create mode 100644 database/test/testReports/Cypress_Swift Current_Transport City - Cafe [2615 N Service Rd W].csv create mode 100644 database/test/tests.sql diff --git a/app/databaseParser/Main.scala b/app/databaseParser/Main.scala index 7c31a8f..4743c8e 100755 --- a/app/databaseParser/Main.scala +++ b/app/databaseParser/Main.scala @@ -49,11 +49,11 @@ object Main { + "VALUES (1, \'Potentially hazardous foods and perishable foods must be stored at 4°C/40°F or below. Hazardous foods must be thawed in a refrigerator or under cold, running water.\', \'Refrigeration/Cooling/Thawing (must be 4°C/40°F or lower)\', \'Critical Item\')," + "\n" + "(2, \'Cook foods to an internal temperature of: " - + "a) 63°C (145°F) or above for: eggs (if prepared for immediate service); medium rare beef and veal steaks and roasts; " - + "b) 68°C (155°F) or above for: game farm meat products; " - + "c) 70°C (158°F) for: fish; " - + "d) 71°C (160°F) or above for: ground beef/pork/veal; food made with ground beef/pork/veal, e.g. sausages, meatballs; pork chops, ribs and roasts; " - + "e) 74°C (165°F) or above for: ground chicken/turkey; food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs; chicken and turkey breasts, legs, thighs and wings; stuffing (inside a carcass); stuffed pasta; hot dogs; leftovers; egg dishes (if not prepared as specified in 2a); and stuffed fish; " + + "a) 63°C (145°F) or above for: eggs (if prepared for immediate service) medium rare beef and veal steaks and roasts " + + "b) 68°C (155°F) or above for: game farm meat products " + + "c) 70°C (158°F) for: fish " + + "d) 71°C (160°F) or above for: ground beef/pork/veal, food made with ground beef/pork/veal, e.g. sausages, meatballs, pork chops, ribs and roasts. " + + "e) 74°C (165°F) or above for: ground chicken/turkey, food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs. chicken and turkey breasts, legs, thighs and wings. stuffing (inside a carcass) stuffed pasta hot dogs leftovers egg dishes (if not prepared as specified in 2a) and stuffed fish " + "f) 85°C (185°C) or above for: chicken and turkey, whole bird. " + "Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. " + "Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.\', \'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)\', \'Critical Item\')," @@ -62,14 +62,14 @@ object Main { + "\n" + "(4, \'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas." + "Hand washing Procedure: " - + "a) Wet hands and exposed arms (at least up to wrist) with warm running water; " - + "b) Apply liquid soap; " - + "c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist; " - + "d) Use a nailbrush under fingernails and other very dirty areas; " - + "e) Thoroughly rinse with clean, warm water running from wrists to fingertips; " - + "f) Apply soap and lather vigorously again; " - + "g) Rinse hands and wrists thoroughly; " - + "h) Dry hands with a single-use paper towel; and " + + "a) Wet hands and exposed arms (at least up to wrist) with warm running water " + + "b) Apply liquid soap " + + "c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist " + + "d) Use a nailbrush under fingernails and other very dirty areas " + + "e) Thoroughly rinse with clean, warm water running from wrists to fingertips " + + "f) Apply soap and lather vigorously again " + + "g) Rinse hands and wrists thoroughly " + + "h) Dry hands with a single-use paper towel and " + "i) Use paper towel to turn off tap.\', \'Hand Washing Facilities/Practices\', \'Critical Item\')," + "\n" + "(5, \'Good personal hygiene must be practiced at all times. " @@ -80,8 +80,8 @@ object Main { + "(7, \' Proper dish washing procedures must be followed. " + "Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. " + "Manual washing: (wash/rinse/sanitize in a three-compartment sink): " - + "first compartment - clean hot water 44°C (111°F) with detergent; " - + "second compartment - clean hot water 44°C (111°F); " + + "first compartment - clean hot water 44°C (111°F) with detergent " + + "second compartment - clean hot water 44°C (111°F) " + "third compartment - approved sanitizing method.\', \'Cleaning/Sanitizing of Equipment/Utensils\', \'Critical Item\')," + "\n" + "(8, \'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. \', \'Food Received from Approved Source\', \'Critical Item\')," @@ -103,7 +103,7 @@ object Main { + "\n" + "(16, \'Approved plumbing must be installed and properly maintained to prevent food contamination. " + "Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. " - + "Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.\', \'Plumbing/Lighting/Ventilation\', \'General Item\');" + + "Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.\', \'Plumbing/Lighting/Ventilation\', \'General Item\'); " + "\n\n\n") } diff --git a/database/statements.sql b/database/statements.sql index 6843dfa..51cc171 100644 --- a/database/statements.sql +++ b/database/statements.sql @@ -3,12 +3,12 @@ -- Before running this file, run CreateTables.sql first INSERT INTO violation_type (id, description, name, priority) VALUES (1, 'Potentially hazardous foods and perishable foods must be stored at 4°C/40°F or below. Hazardous foods must be thawed in a refrigerator or under cold, running water.', 'Refrigeration/Cooling/Thawing (must be 4°C/40°F or lower)', 'Critical Item'), -(2, 'Cook foods to an internal temperature of: a) 63°C (145°F) or above for: eggs (if prepared for immediate service); medium rare beef and veal steaks and roasts; b) 68°C (155°F) or above for: game farm meat products; c) 70°C (158°F) for: fish; d) 71°C (160°F) or above for: ground beef/pork/veal; food made with ground beef/pork/veal, e.g. sausages, meatballs; pork chops, ribs and roasts; e) 74°C (165°F) or above for: ground chicken/turkey; food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs; chicken and turkey breasts, legs, thighs and wings; stuffing (inside a carcass); stuffed pasta; hot dogs; leftovers; egg dishes (if not prepared as specified in 2a); and stuffed fish; f) 85°C (185°C) or above for: chicken and turkey, whole bird. Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.', 'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)', 'Critical Item'), +(2, 'Cook foods to an internal temperature of: a) 63°C (145°F) or above for: eggs (if prepared for immediate service) medium rare beef and veal steaks and roasts b) 68°C (155°F) or above for: game farm meat products c) 70°C (158°F) for: fish d) 71°C (160°F) or above for: ground beef/pork/veal, food made with ground beef/pork/veal, e.g. sausages, meatballs, pork chops, ribs and roasts. e) 74°C (165°F) or above for: ground chicken/turkey, food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs. chicken and turkey breasts, legs, thighs and wings. stuffing (inside a carcass) stuffed pasta hot dogs leftovers egg dishes (if not prepared as specified in 2a) and stuffed fish f) 85°C (185°C) or above for: chicken and turkey, whole bird. Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.', 'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)', 'Critical Item'), (3, 'Foods must be stored in food grade containers, properly labelled and protected from contamination at all times.', 'Storage/Preparation of Foods', 'Critical Item'), -(4, 'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas.Hand washing Procedure: a) Wet hands and exposed arms (at least up to wrist) with warm running water; b) Apply liquid soap; c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist; d) Use a nailbrush under fingernails and other very dirty areas; e) Thoroughly rinse with clean, warm water running from wrists to fingertips; f) Apply soap and lather vigorously again; g) Rinse hands and wrists thoroughly; h) Dry hands with a single-use paper towel; and i) Use paper towel to turn off tap.', 'Hand Washing Facilities/Practices', 'Critical Item'), +(4, 'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas.Hand washing Procedure: a) Wet hands and exposed arms (at least up to wrist) with warm running water b) Apply liquid soap c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist d) Use a nailbrush under fingernails and other very dirty areas e) Thoroughly rinse with clean, warm water running from wrists to fingertips f) Apply soap and lather vigorously again g) Rinse hands and wrists thoroughly h) Dry hands with a single-use paper towel and i) Use paper towel to turn off tap.', 'Hand Washing Facilities/Practices', 'Critical Item'), (5, 'Good personal hygiene must be practiced at all times. Food handlers with infectious or contagious diseases (or symptoms) should not work. ', 'Food Handler Illness/Hygiene/Habits', 'Critical Item'), (6, 'Foods must be protected from contamination at all times. ', 'Food Protection', 'Critical Item'), -(7, ' Proper dish washing procedures must be followed. Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. Manual washing: (wash/rinse/sanitize in a three-compartment sink): first compartment - clean hot water 44°C (111°F) with detergent; second compartment - clean hot water 44°C (111°F); third compartment - approved sanitizing method.', 'Cleaning/Sanitizing of Equipment/Utensils', 'Critical Item'), +(7, ' Proper dish washing procedures must be followed. Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. Manual washing: (wash/rinse/sanitize in a three-compartment sink): first compartment - clean hot water 44°C (111°F) with detergent second compartment - clean hot water 44°C (111°F) third compartment - approved sanitizing method.', 'Cleaning/Sanitizing of Equipment/Utensils', 'Critical Item'), (8, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Food Received from Approved Source', 'Critical Item'), (9, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Water Received from Approved Source', 'Critical Item'), (10, 'Food must be protected from contamination during storage, preparation, display, service and transport. No food is to be stored on the floor unless it is in an approved container. The lowest shelf is to be high enough to allow easy cleaning of the floor.', 'Food Protection', 'General Item'), @@ -17,7 +17,7 @@ VALUES (1, 'Potentially hazardous foods and perishable foods must be stored at 4 (13, 'An adequate number of approved, covered garbage containers must be provided at all food preparation areas. Containers are to be kept clean and the contents removed at least daily. Garbage storage must be of an approved design with a lid that seals. It must be kept clean and free of vermin and serviced as required. ', 'Garbage Storage and/or Removal', 'General Item'), (14, 'All restaurants are to be free of vermin.', 'Insect/Rodent Control', 'General Item'), (15, 'Floors, walls and ceilings of all rooms in which food is stored, prepared or served or in which dishes, utensils and equipment are washed or stored should be kept clean and in good repair.', 'Construction/Maintenance and/or Cleaning of Premises', 'General Item'), -(16, 'Approved plumbing must be installed and properly maintained to prevent food contamination. Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.', 'Plumbing/Lighting/Ventilation', 'General Item'); +(16, 'Approved plumbing must be installed and properly maintained to prevent food contamination. Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.', 'Plumbing/Lighting/Ventilation', 'General Item'); INSERT INTO location(id, name, address, postcode, city, rha) diff --git a/database/test/test.sql b/database/test/test.sql index 0479507..815cd5a 100644 --- a/database/test/test.sql +++ b/database/test/test.sql @@ -3,12 +3,12 @@ -- Before running this file, run CreateTables.sql first INSERT INTO violation_type (id, description, name, priority) VALUES (1, 'Potentially hazardous foods and perishable foods must be stored at 4°C/40°F or below. Hazardous foods must be thawed in a refrigerator or under cold, running water.', 'Refrigeration/Cooling/Thawing (must be 4°C/40°F or lower)', 'Critical Item'), -(2, 'Cook foods to an internal temperature of: a) 63°C (145°F) or above for: eggs (if prepared for immediate service); medium rare beef and veal steaks and roasts; b) 68°C (155°F) or above for: game farm meat products; c) 70°C (158°F) for: fish; d) 71°C (160°F) or above for: ground beef/pork/veal; food made with ground beef/pork/veal, e.g. sausages, meatballs; pork chops, ribs and roasts; e) 74°C (165°F) or above for: ground chicken/turkey; food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs; chicken and turkey breasts, legs, thighs and wings; stuffing (inside a carcass); stuffed pasta; hot dogs; leftovers; egg dishes (if not prepared as specified in 2a); and stuffed fish; f) 85°C (185°C) or above for: chicken and turkey, whole bird. Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.', 'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)', 'Critical Item'), +(2, 'Cook foods to an internal temperature of: a) 63°C (145°F) or above for: eggs (if prepared for immediate service) medium rare beef and veal steaks and roasts b) 68°C (155°F) or above for: game farm meat products c) 70°C (158°F) for: fish d) 71°C (160°F) or above for: ground beef/pork/veal, food made with ground beef/pork/veal, e.g. sausages, meatballs, pork chops, ribs and roasts. e) 74°C (165°F) or above for: ground chicken/turkey, food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs. chicken and turkey breasts, legs, thighs and wings. stuffing (inside a carcass) stuffed pasta hot dogs leftovers egg dishes (if not prepared as specified in 2a) and stuffed fish f) 85°C (185°C) or above for: chicken and turkey, whole bird. Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.', 'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)', 'Critical Item'), (3, 'Foods must be stored in food grade containers, properly labelled and protected from contamination at all times.', 'Storage/Preparation of Foods', 'Critical Item'), -(4, 'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas.Hand washing Procedure: a) Wet hands and exposed arms (at least up to wrist) with warm running water; b) Apply liquid soap; c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist; d) Use a nailbrush under fingernails and other very dirty areas; e) Thoroughly rinse with clean, warm water running from wrists to fingertips; f) Apply soap and lather vigorously again; g) Rinse hands and wrists thoroughly; h) Dry hands with a single-use paper towel; and i) Use paper towel to turn off tap.', 'Hand Washing Facilities/Practices', 'Critical Item'), +(4, 'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas.Hand washing Procedure: a) Wet hands and exposed arms (at least up to wrist) with warm running water b) Apply liquid soap c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist d) Use a nailbrush under fingernails and other very dirty areas e) Thoroughly rinse with clean, warm water running from wrists to fingertips f) Apply soap and lather vigorously again g) Rinse hands and wrists thoroughly h) Dry hands with a single-use paper towel and i) Use paper towel to turn off tap.', 'Hand Washing Facilities/Practices', 'Critical Item'), (5, 'Good personal hygiene must be practiced at all times. Food handlers with infectious or contagious diseases (or symptoms) should not work. ', 'Food Handler Illness/Hygiene/Habits', 'Critical Item'), (6, 'Foods must be protected from contamination at all times. ', 'Food Protection', 'Critical Item'), -(7, ' Proper dish washing procedures must be followed. Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. Manual washing: (wash/rinse/sanitize in a three-compartment sink): first compartment - clean hot water 44°C (111°F) with detergent; second compartment - clean hot water 44°C (111°F); third compartment - approved sanitizing method.', 'Cleaning/Sanitizing of Equipment/Utensils', 'Critical Item'), +(7, ' Proper dish washing procedures must be followed. Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. Manual washing: (wash/rinse/sanitize in a three-compartment sink): first compartment - clean hot water 44°C (111°F) with detergent second compartment - clean hot water 44°C (111°F) third compartment - approved sanitizing method.', 'Cleaning/Sanitizing of Equipment/Utensils', 'Critical Item'), (8, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Food Received from Approved Source', 'Critical Item'), (9, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Water Received from Approved Source', 'Critical Item'), (10, 'Food must be protected from contamination during storage, preparation, display, service and transport. No food is to be stored on the floor unless it is in an approved container. The lowest shelf is to be high enough to allow easy cleaning of the floor.', 'Food Protection', 'General Item'), @@ -17,7 +17,7 @@ VALUES (1, 'Potentially hazardous foods and perishable foods must be stored at 4 (13, 'An adequate number of approved, covered garbage containers must be provided at all food preparation areas. Containers are to be kept clean and the contents removed at least daily. Garbage storage must be of an approved design with a lid that seals. It must be kept clean and free of vermin and serviced as required. ', 'Garbage Storage and/or Removal', 'General Item'), (14, 'All restaurants are to be free of vermin.', 'Insect/Rodent Control', 'General Item'), (15, 'Floors, walls and ceilings of all rooms in which food is stored, prepared or served or in which dishes, utensils and equipment are washed or stored should be kept clean and in good repair.', 'Construction/Maintenance and/or Cleaning of Premises', 'General Item'), -(16, 'Approved plumbing must be installed and properly maintained to prevent food contamination. Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.', 'Plumbing/Lighting/Ventilation', 'General Item'); +(16, 'Approved plumbing must be installed and properly maintained to prevent food contamination. Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.', 'Plumbing/Lighting/Ventilation', 'General Item'); INSERT INTO location(id, name, address, postcode, city, rha) @@ -135,44 +135,275 @@ INSERT INTO violation(inspection_id, violation_id) VALUES (14, 15); INSERT INTO location(id, name, address, postcode, city, rha) - VALUES (6, 'Lorraine''s Kitchen', 'North Qu''appelle', 'DATA MISSING', 'DATA MISSING', 'Regina QuAppelle Health Authority'); + VALUES (6, 'Swift Current Stockade - Kitchen', '1700 17th Ave Se', 'S9H 3V5', 'Swift Current', 'Cypress Health Authority'); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (15, 6, '2014-07-16', 'Routine', 'Low'); + VALUES (15, 6, '2014-03-12', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (15, 12); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (15, 15); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (15, 16); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (16, 6, '2013-06-11', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (16, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (17, 6, '2013-03-08', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (17, 4); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (7, 'Taco Time', '#3 - 410 S Service Rd E', 'S9H 3T6', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (18, 7, '2014-12-01', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (19, 7, '2014-07-08', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (20, 7, '2013-10-10', 'Routine', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (8, 'The Daily Grind', '130 Jasper St', 'S0N 1N0', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (21, 8, '2014-08-26', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (21, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (22, 8, '2014-02-14', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (23, 8, '2013-08-20', 'Routine', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (9, 'The Eagles - Restaurant', '1910 S Service Rd W', 'S9H 5J4', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (24, 9, '2014-09-10', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (25, 9, '2014-02-12', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (26, 9, '2013-02-25', 'Routine', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (10, 'The Lobby', '508 Cheadle St W', 'S9H 0B8', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (27, 10, '2014-11-07', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (27, 7); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (28, 10, '2014-03-26', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (29, 10, '2013-02-13', 'Routine', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (11, 'The Salvation Army - Kitchen', '780 1st Ave Nw', 'S9H 4M7', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (30, 11, '2014-02-19', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (31, 11, '2013-04-23', 'Follow-up', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (31, 11); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (32, 11, '2013-02-14', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (32, 1); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (32, 11); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (12, 'Tim Hortons - Downtown', '225 1st Ave Nw', 'S9H 0M9', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (33, 12, '2014-09-10', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (34, 12, '2014-02-12', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (34, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (35, 12, '2013-09-20', 'Complaint', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (35, 14); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (13, 'Tim Hortons', '515 N Service Rd E', 'S9H 4W8', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (36, 13, '2014-12-16', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (36, 4); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (36, 7); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (36, 12); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (37, 13, '2014-06-11', 'Follow-up', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (38, 13, '2014-02-03', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (38, 4); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (14, 'Tj''s Pizza', '#3 - 1100 S Service Rd E', 'S9H 3Z4', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (39, 14, '2015-01-29', 'Follow-up', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (39, 16); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (40, 14, '2014-10-07', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (40, 7); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (40, 10); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (40, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (41, 14, '2014-05-07', 'Follow-up', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (15, 'Tnt Family Restaurant', '83 N Service Rd W', 'S9H 3S8', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (42, 15, '2015-01-20', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (43, 15, '2014-08-05', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (43, 10); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (43, 14); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (43, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (44, 15, '2014-02-12', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (44, 10); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (44, 15); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (16, 'Transport City - Cafe', '2615 N Service Rd W', 'S9H 5L4', 'Swift Current', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (45, 16, '2014-09-26', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (45, 3); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (45, 4); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (45, 10); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (45, 12); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (45, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (46, 16, '2014-05-20', 'Complaint', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (46, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (47, 16, '2014-03-12', 'Follow-up', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (47, 12); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (47, 15); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (17, 'Lorraine''s Kitchen', 'North Qu''appelle', 'DATA MISSING', 'DATA MISSING', 'Regina QuAppelle Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (48, 17, '2014-07-16', 'Routine', 'Low'); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (16, 6, '2013-06-25', 'Routine', 'Low'); + VALUES (49, 17, '2013-06-25', 'Routine', 'Low'); INSERT INTO violation(inspection_id, violation_id) - VALUES (16, 1); + VALUES (49, 1); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (17, 6, '2012-06-28', 'Routine', 'Low'); + VALUES (50, 17, '2012-06-28', 'Routine', 'Low'); INSERT INTO location(id, name, address, postcode, city, rha) - VALUES (7, 'Imperial Family Restaurant', '214 Royal St.', 'S0G 2J0', 'Imperial', 'Regina QuAppelle Health Authority'); + VALUES (18, 'Imperial Family Restaurant', '214 Royal St.', 'S0G 2J0', 'Imperial', 'Regina QuAppelle Health Authority'); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (18, 7, '2014-12-17', 'Follow-up', 'Moderate'); + VALUES (51, 18, '2014-12-17', 'Follow-up', 'Moderate'); INSERT INTO violation(inspection_id, violation_id) - VALUES (18, 16); + VALUES (51, 16); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (19, 7, '2014-10-24', 'Follow-up', 'Moderate'); + VALUES (52, 18, '2014-10-24', 'Follow-up', 'Moderate'); INSERT INTO violation(inspection_id, violation_id) - VALUES (19, 16); + VALUES (52, 16); INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) - VALUES (20, 7, '2014-09-25', 'Routine', 'High'); + VALUES (53, 18, '2014-09-25', 'Routine', 'High'); INSERT INTO violation(inspection_id, violation_id) - VALUES (20, 1); + VALUES (53, 1); INSERT INTO violation(inspection_id, violation_id) - VALUES (20, 4); + VALUES (53, 4); INSERT INTO violation(inspection_id, violation_id) - VALUES (20, 7); + VALUES (53, 7); diff --git a/database/test/testReports/Cypress_Swift Current_Swift Current Stockade - Kitchen [1700 17th Av...].csv b/database/test/testReports/Cypress_Swift Current_Swift Current Stockade - Kitchen [1700 17th Av...].csv new file mode 100644 index 0000000000000000000000000000000000000000..e9110d41a077f59007b354cc84ff8945bdf837c6 GIT binary patch literal 2682 zcmeH}OK;Oa6otqb-Fd)j8aiezdxu#R>cSf>33)>Ws0?X0zTutu(_+my

BqF>7eW%zbXjv!MvdiHv?xjeg%Mav!PQ}mPT z1@dq4K4+$kw(aTH(b{^BeolOcx*(SmY+N&b!_4x^bpRe<nYww!HRs~#G6*sGD6vu4i4NQ*eVw$>e? z)x!UTcb_?DJ3@a7D}fw7qFEB#E%WB3rAwY3&%h@?xxWy(INDBUiDS z{XK#IWsmsVoL&(3j~)FLh&!G;b`~ox_4Cd@-_QTIdj9!eV)ZO<>-mOqe@55ze~M34 z_tif+)q80BgfHpGKL1zG_3omkPZnJ|@PE;#`;L)LXZ8`_gILGOhU=##cWdLx>at&d E2jyI{r~m)} literal 0 HcmV?d00001 diff --git a/database/test/testReports/Cypress_Swift Current_TJ's Pizza [#3 - 1100 S Service Rd E].csv b/database/test/testReports/Cypress_Swift Current_TJ's Pizza [#3 - 1100 S Service Rd E].csv new file mode 100644 index 0000000000000000000000000000000000000000..98f8209540718ed0c1f664caac0b3fe1151e3af3 GIT binary patch literal 2386 zcmeH|Ur!T36vfZ8iQi#TAAG54S3ts}X+T6!!lER;wRXWxV5{3*6+XQBJF_jeE>THn z;scrN?#!LJ=l(f!@Ba8+DbqJq8fn7!nYzpuC5iei*_t+5vP7FL*}B$RvZpuVZQXFL zt=m48;PFE}P)9o|m20e_F2M?{Gh!-LBPo#uHI|!iLIfSo9cxdIHD&h@?JLF*X$Sd7 zG)s1VA?~qPEaBOoWxPj39Q1@IVe}b6X?!x!zF^}6egz$Y8?=r74tYOkO!O7KTA!l* zlvS=%xCk0VPfGL(*0z}HInOKJ$L#KcbHe;JJM)oh3wgks_gasU?net<&R=4~Xww+? zF0&!_DeJ1jpn{PoyZ-=cgQ`iWaeAsYPhezf9ad6W@%%_(g0>$I~5$&3;gtSKpncn zn71OItSZ5aTWdc1mrQ^Ecaad?f>rG^xFUbKiQ4B F{Rx*ic#Hr5 literal 0 HcmV?d00001 diff --git a/database/test/testReports/Cypress_Swift Current_TNT Family Restaurant [83 N Service Rd W].csv b/database/test/testReports/Cypress_Swift Current_TNT Family Restaurant [83 N Service Rd W].csv new file mode 100644 index 0000000000000000000000000000000000000000..c1fa113cc3c71c7002a9aa17317417cbea2b84b6 GIT binary patch literal 2834 zcmeH|+fKqj5QhJ26W?LOb&Xc=bV-N`o?~?o{ zc257!%==reo?eveRulgFidcWA#M&v*s@f~jVjYxdHC0Qr-G%aw7Vwqtmbqdq-qeOF zI#H&fQg!u;tiZm9Pnl*=GH5}C=HegYK?S~!t{BGM)dTlO&e`VflsI&`oiUGDNAP#p z+sT)fGe2Ff^aLf`&h&(yJ63_OjjW&>q_>Ix3_U}%^;}z`XLk3{f*Ni~#z|p| z$*MEXnLC^|b&Qm{YcaX@B|3s0(4Oefy}dxkGqM|a`G_Uv%M^|#t1iCh8nCOo9RqkR zqPfR2T4|KcqCUeg3A`VBeV;hi+_V1><5Nf1UWj24)WX{yuQHP5V9*xh1XL#eX0G9z zIL96Hko9sliXv?^(8_0Ox{Ob7<18yDS(43n8T zbMHBGANl&MRp?!{9`wR`tcZOVv5EsMQ9r<}P68}d5@1JL`376;Lf_EJ^5T8%sizB7 zD)p$TKHxH(3u3CY2C2Y|8s%oSM9{-7=XOTqhFz&8J`wm0$a9D541C61!dSp&h{1Xl z$7z*%t^=YqI%K9`F>B_h^LT^ZF&ItYH9E(8g36j~muNM*nKqoBz>G%RRg8k$+G}MR z!g$3u=XMOoJ^Nd1+mUGiZg@vdUR-?FXlz(VWZ>1at+c{o4DVD6nCF~^{vC5{T@GuX z!Dt70&Cw~)|Eba?$ii1A)~S#3Kcm0t)SUXcKI!K4j!vtoW!tOGAKdnR@@ISX8*XF1 AjQ{`u literal 0 HcmV?d00001 diff --git a/database/test/testReports/Cypress_Swift Current_The Daily Grind [130 Jasper St].csv b/database/test/testReports/Cypress_Swift Current_The Daily Grind [130 Jasper St].csv new file mode 100644 index 0000000000000000000000000000000000000000..49a2fbad31997aad0d0512d07b8d5d98236601dd GIT binary patch literal 1342 zcmds%OHaa35QWd$#Q$)^x&|t!aY?G;J4TwgMySw)S6T@A=hbh9kdTyw6$?#s+qq}X zoO#@~Ki>;w`qV=2n(;hWguRW#YE-bM&MH`}iwf3Kvx1%O)VtiltHxGYF%=){NHyK4 zP_BV``a&zP&*-Vp5~KhNT4!EAV>+n8OErQQbOkHd*m)gSnxYlKNm0mDZYj4xhOClF znVQXPquO%Sn7$ie_o$Yd6JN0F!jJUIoR?U+rr?&Ls};KsS4;2}Tp3 zTV3l7`x(#X>XOU$G53b&e=!Aaeu2xbG0G!$)`wX$7&(^Bt>c-kUgHJb zfoGcFv55tpuo5Ds-n~t?42zi*w^BOUL`#(?Dlx zv{a>1Z`3mQH8VBpKpHTkz#QI|2?oT?wII&ul&E_>U_av>aL>Hmf_LPXTA@oqP61xw zxyWy}9DnVVdxW(n!zd`%^Nl>8)x_gQIT0?a(F=XwVmZ!=X93TQZFJOIdM3x4YlC+O zW;FFZHROb@T%{B43!ZbnX3SGyUlZG3Im{W}Smz48T*9$|Yl=E+`fwAu=`*YnEn2iO zRB?SQh;{n5UftwZXdZ9avSYVNFMQ8);ObAcjF1hp-qet7k_4@gYPNuwbRv^zUH zZ|3dp=SQwsugW#nBkwbn`TmXsIxS!|H40duW&x|KR=}!z^;&y)#kECNfa7BwsiaG# zN;FlZH?$n%m`tfwASsyBrt;<;ke~!_s5v~R8`6(?{Mw>cpV=393m7qKjtoBSPOENO z4bXG2&@>~wJec-?jyjFt-=ec(lxWF}uQbq_(aabjb16^EY;NiUwP9TIKSZ^w4k~T+ zQQJKOwZOff3u^mBJ!(wNWrT{a5|Zl4bTegeyPy%?a(p`UyrVg*eE)LmK)C%*G%=>r zm1!+dYqI8qUufwfy!tfvs^D}p^7-Dks6%%KyQ637B=}ft^Hp?bnoB$-Xk~w}k0WYL ut=HMNlhLyiF|qVjJMo9OkN!lif3$n$f9quNjs9dkfwcx$0F2Ck?e164XrBd?%tTG{;up z_bEKLIlaf8bQbtIo*kXwIRRPe>X&(Qx$bq|LFC=jYk0_%OgOaQs|Jl>!+lK15N{dWKQn<137MZ59x3j z(XOZ^162hViB8Rd>$n7Kc2jWMeKf|8spdZ0MbtiJcIMZLS@Ycg1D;3pHRCZ8+r(bt z|FpQ?k11EMZ+&KZ#|$b|*+n@yXDhQnm1m&|tJi97RBiPx_*7x718IeutuebX3v2?D zp$co>6ZWLNJqw;m#B#nRSl5suk7w{$Tj$=a|KIK0U_&kZi=8velUpXe*_&_QklsC~ zDKl?tqEW;VInD!jaht8V)p}&~WM}x#b)jBpWgNGQ&zYVx?bXj)=@f6@8DH`0@!sLr b2uq`pW^b&E7ys437H)b2{|z-f?fc;eGy`0u literal 0 HcmV?d00001 diff --git a/database/test/testReports/Cypress_Swift Current_Tim Hortons - Downtown [225 1st Ave NW].csv b/database/test/testReports/Cypress_Swift Current_Tim Hortons - Downtown [225 1st Ave NW].csv new file mode 100644 index 0000000000000000000000000000000000000000..59535b9f79a53356f96681824d18710a4c26f4f4 GIT binary patch literal 1490 zcmdUvTTjA35QWdPiT`24a}Ab@hDU-Ih?f{k;xpPRO(-=jsQh{LnRM^4Sv%TfH^HQFUODyYWNM=lVR&qeL>~9rYc$Q@jGJm%-T>J19sdH zHD;dR^^q%L{pkCakuxEZ)3R@?Y%QOy!5P}#R^si{)f3)Mm&6TpO`bV;>f>9sh`g!p zy>Aa&!I$_GS%ne%Bc1U-RF4XdiP9yOTYr%{;Es-8Ftd8keJuh03r=j&N?&iE*+>&I zjq&gLbByt|p3ZzngDvQDmD7-pS}%;-Q2)Qnr=DL^kg?%3p!*354XDnPW4i3Yi>Y*m z*IajusYmLtJo4(XJyYgWtfnuU#j1NgZT|$+FjLwC_8g5lU3ooZpe6S5Px=0SdpF&v yulKk4iyLK~%Fy{_-Ir~r$+@e)L#LHSz zNo^&HG*Dmna5?0VoDyXq37AvvIsXS_P{Qt%IWf8p*(YQ^(O4;X2~7q=`igNI`GPlw zH^kb>yqhm$4pj4ubw+itBi^pJyTOOeb2@>|sl}WVJZ1Qc@E3Z2UELxL!JL}t5}pw4 z%zNl+3$}f}r)WEH^cb6um#3>ua7Pq9ZTLtI@iFib^kFeCP1a%Rc~dg8tV333g!T$) z%SUwOS0Vzlb!=j7W6QuSopwD}jIM^X>RI~4X_@t~N#U}rE|J^F7f7QyhplH>$8Z{+ zvl_OjpjGkjE7-uRRj^5gY$uH8l`9iVE?JEp=BQ(546$zMnw=7{lVWDs4lV1!xu%=YZqN}JlyGP}lBU_4??rLB;Z$bv=B@tv@OJ?0Jgmsw$zEm(ia+Jp76 zvviGpA7wViR%?ro6#2sUE63LeeOcEY-gxP{7s=!?*n4himG%`cmwW{~C+c7qXq^+o z3VTx`iXKzDVl-aIwL-7tPr+C|QtNTQ<2fMe6Fb66&wT{`>PqbpdBFFn#aPbpG4u#B zkGzHEHLH-_iYqXG#GcIfJ7LuGh$g-}abKjNy;hu;J~P-`x0MrB2OaHOibOk_*=Ovv z?Sp$*FqTZZbJh`fj(HyQR$Nts=95CRyGHW_%!+lMW}q|yzXD{1Tt*g5$(NWB%A$z2 z|3v!&tcT=h9r2P%rhYS_gZ|b2S*O{IOPK7FR|_otJ*fYy^}WIT K{yywa)b*eH+>#~$ literal 0 HcmV?d00001 diff --git a/database/test/tests.sql b/database/test/tests.sql new file mode 100644 index 0000000..404c527 --- /dev/null +++ b/database/test/tests.sql @@ -0,0 +1,178 @@ +-- EatSafe +-- This file will populate the database +-- Before running this file, run CreateTables.sql first +INSERT INTO violation_type (id, description, name, priority) +VALUES (1, 'Potentially hazardous foods and perishable foods must be stored at 4°C/40°F or below. Hazardous foods must be thawed in a refrigerator or under cold, running water.', 'Refrigeration/Cooling/Thawing (must be 4°C/40°F or lower)', 'Critical Item'), +(2, 'Cook foods to an internal temperature of: a) 63°C (145°F) or above for: eggs (if prepared for immediate service) medium rare beef and veal steaks and roasts b) 68°C (155°F) or above for: game farm meat products c) 70°C (158°F) for: fish d) 71°C (160°F) or above for: ground beef/pork/veal, food made with ground beef/pork/veal, e.g. sausages, meatballs, pork chops, ribs and roasts. e) 74°C (165°F) or above for: ground chicken/turkey, food made with ground chicken/turkey or mixtures containing poultry, meat, fish, or eggs. chicken and turkey breasts, legs, thighs and wings. stuffing (inside a carcass) stuffed pasta hot dogs leftovers egg dishes (if not prepared as specified in 2a) and stuffed fish f) 85°C (185°C) or above for: chicken and turkey, whole bird. Reheat foods rapidly to an internal temperature of 74°C (165°F) prior to serving. Hot Holding must maintain an internal temperature of 60°C (140°F) or higher.', 'Cooking/Reheating/Hot Holding (must be 60°C/140°F or higher)', 'Critical Item'), +(3, 'Foods must be stored in food grade containers, properly labelled and protected from contamination at all times.', 'Storage/Preparation of Foods', 'Critical Item'), +(4, 'Hand washing must be properly done at appropriate times and intervals. An accessible, plumbed hand basin with hot and cold running water, soap in a dispenser and single-use paper towels in wall-mounted dispensers are required in food preparation areas.Hand washing Procedure: a) Wet hands and exposed arms (at least up to wrist) with warm running water b) Apply liquid soap c) Vigorously rub together wet surfaces for at least 20 seconds, lathering at least up to wrist d) Use a nailbrush under fingernails and other very dirty areas e) Thoroughly rinse with clean, warm water running from wrists to fingertips f) Apply soap and lather vigorously again g) Rinse hands and wrists thoroughly h) Dry hands with a single-use paper towel and i) Use paper towel to turn off tap.', 'Hand Washing Facilities/Practices', 'Critical Item'), +(5, 'Good personal hygiene must be practiced at all times. Food handlers with infectious or contagious diseases (or symptoms) should not work. ', 'Food Handler Illness/Hygiene/Habits', 'Critical Item'), +(6, 'Foods must be protected from contamination at all times. ', 'Food Protection', 'Critical Item'), +(7, ' Proper dish washing procedures must be followed. Mechanical washing: dishwashers must be National Sanitation Foundation (NSF) approved or equivalent, designed to wash at 60oC (140oF) and utilize an approved sanitizing agent. Manual washing: (wash/rinse/sanitize in a three-compartment sink): first compartment - clean hot water 44°C (111°F) with detergent second compartment - clean hot water 44°C (111°F) third compartment - approved sanitizing method.', 'Cleaning/Sanitizing of Equipment/Utensils', 'Critical Item'), +(8, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Food Received from Approved Source', 'Critical Item'), +(9, 'Food, water and ice must be from an approved source and must also be wholesome, free from damage or spoilage and transported under proper temperatures, where applicable. ', 'Water Received from Approved Source', 'Critical Item'), +(10, 'Food must be protected from contamination during storage, preparation, display, service and transport. No food is to be stored on the floor unless it is in an approved container. The lowest shelf is to be high enough to allow easy cleaning of the floor.', 'Food Protection', 'General Item'), +(11, 'An accurate, metal-stemmed (food-grade) probe thermometer must be available to monitor temperatures of potentially hazardous foods.', 'Accurate Thermometer Available to Monitor Food Temperatures', 'General Item'), +(12, 'Approved dishwashing facilities must be installed and properly maintained. An adequate supply of cleaning supplies, chemicals, etc. must be available at all times. ''Clean-in-place'' equipment must be washed and sanitized according to manufacturers instructions.', 'Construction/Storage/Cleaning of Equipment/Utensils', 'General Item'), +(13, 'An adequate number of approved, covered garbage containers must be provided at all food preparation areas. Containers are to be kept clean and the contents removed at least daily. Garbage storage must be of an approved design with a lid that seals. It must be kept clean and free of vermin and serviced as required. ', 'Garbage Storage and/or Removal', 'General Item'), +(14, 'All restaurants are to be free of vermin.', 'Insect/Rodent Control', 'General Item'), +(15, 'Floors, walls and ceilings of all rooms in which food is stored, prepared or served or in which dishes, utensils and equipment are washed or stored should be kept clean and in good repair.', 'Construction/Maintenance and/or Cleaning of Premises', 'General Item'), +(16, 'Approved plumbing must be installed and properly maintained to prevent food contamination. Light shields or shatterproof bulbs are to be provided in every room in which food is prepared or stored. Unless otherwise approved, every restaurant is to have a ventilation system that prevents the accumulation of odours, smoke, grease/oils and condensation.', 'Plumbing/Lighting/Ventilation', 'General Item'); + + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (1, 'Burstall Arena - Kitchen', '615 Maharg Ave', 'S0N 0H0', 'Burstall', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (1, 1, '2014-11-07', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (1, 12); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (1, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (2, 1, '2013-11-18', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (2, 12); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (2, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (3, 1, '2012-12-03', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (3, 15a); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (2, 'Cabri Inn - Kitchen', '103 Railway Ave S', 'S0N 0J0', 'Cabri', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (4, 2, '2014-11-10', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (4, 1); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (4, 4); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (4, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (5, 2, '2014-08-29', 'Follow-up', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (6, 2, '2014-05-12', 'Routine', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (6, 1); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (6, 12); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (3, 'Consul Saloon', '120 Railway Ave', 'S0N 0P0', 'Consul', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (7, 3, '2014-09-23', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (7, 15); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (8, 3, '2014-05-02', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (8, 15); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (4, 'Frontier Motel - Restaurant', 'Hwy 18 E', 'S0N 0W0', 'Frontier', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (9, 4, '2014-10-09', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (10, 4, '2013-10-23', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (10, 16); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (11, 4, '2012-09-07', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (11, 15); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (11, 16); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (5, 'Frontier Recreation Centre - Concession', '306 1st St E', 'S0N 0W0', 'Frontier', 'Cypress Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (12, 5, '2013-10-23', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (12, 12); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (13, 5, '2012-10-25', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (13, 12); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (14, 5, '2012-01-16', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (14, 10); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (14, 15); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (6, 'Lorraine''s Kitchen', 'North Qu''appelle', 'DATA MISSING', 'DATA MISSING', 'Regina QuAppelle Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (15, 6, '2014-07-16', 'Routine', 'Low'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (16, 6, '2013-06-25', 'Routine', 'Low'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (16, 1); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (17, 6, '2012-06-28', 'Routine', 'Low'); + +INSERT INTO location(id, name, address, postcode, city, rha) + VALUES (7, 'Imperial Family Restaurant', '214 Royal St.', 'S0G 2J0', 'Imperial', 'Regina QuAppelle Health Authority'); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (18, 7, '2014-12-17', 'Follow-up', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (18, 16); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (19, 7, '2014-10-24', 'Follow-up', 'Moderate'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (19, 16); + +INSERT INTO inspection(id, location_id, inspection_date, inspection_type, reinspection_priority) + VALUES (20, 7, '2014-09-25', 'Routine', 'High'); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (20, 1); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (20, 4); + +INSERT INTO violation(inspection_id, violation_id) + VALUES (20, 7); + diff --git a/test/ParserSpec.scala b/test/ParserSpec.scala index 204af86..18ff6c1 100644 --- a/test/ParserSpec.scala +++ b/test/ParserSpec.scala @@ -13,6 +13,12 @@ import java.io.FileOutputStream import java.io.IOException import java.io.OutputStreamWriter import java.io.Writer +import java.io.Reader +import java.io.FileReader +import java.io.BufferedReader +import play.api.db.DB +import anorm._ +import play.api.Play.current /** * Add your spec here. * You can mock out a whole application including requests, plugins etc. @@ -21,13 +27,88 @@ import java.io.Writer @RunWith(classOf[JUnitRunner]) class ParserSpec extends Specification { "Parser" should { - "run with changed parameters" in { + "run with changed parameters" in new WithApplication{ Main.FILE_NAME = "database/test/test.sql" Main.FOLDER_PATH = "database/test/testReports/" Main.main(Array("")) - true - } + var sb = new StringBuffer(); + var s = new String(); + var fr = new FileReader(new File("database/test/test.sql")); + // be sure to not have line starting with "--" or "/*" or any other non aplhabetical character + + var br = new BufferedReader(fr); + (s = br.readLine()) + while(s != null) + { + sb.append(s); + (s = br.readLine()) + } + br.close(); + var inst = sb.toString().split(";"); + + var i = 1; + + /*System.out.println(inst(i)) + System.out.println("------------------------------------------------------------------------------------------") + i = i +1;*/ + DB.withConnection("test") { implicit connection => + val query1 = SQL("begin;").execute() + val query2 = SQL("DROP TABLE IF EXISTS location CASCADE;").executeUpdate() + val query3 = SQL("DROP TABLE IF EXISTS inspection CASCADE;").executeUpdate() + val query4 = SQL("DROP TABLE IF EXISTS violation CASCADE;").executeUpdate() + val query5 = SQL( + """CREATE TABLE location( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL, + address TEXT NOT NULL, + postcode TEXT NOT NULL, + city TEXT NOT NULL, + rha TEXT NOT NULL + ); + """).executeUpdate() + val query6 = SQL( + """CREATE TABLE inspection( + id SERIAL PRIMARY KEY, + location_id INT NOT NULL, + inspection_date DATE NOT NULL, + inspection_type TEXT NOT NULL, + reinspection_priority TEXT NOT NULL, + FOREIGN KEY (location_id) + REFERENCES location + ON UPDATE NO ACTION + ON DELETE NO ACTION + ); + """).executeUpdate() + val query7 = SQL( + """CREATE TABLE violation( + inspection_id INT NOT NULL, + violation_id INT NOT NULL, + PRIMARY KEY (inspection_id, violation_id), + FOREIGN KEY (inspection_id) + REFERENCES inspection + ON UPDATE NO ACTION + ON DELETE NO ACTION, + FOREIGN KEY (violation_Id) + REFERENCES violation_type + ON UPDATE NO ACTION + ON DELETE NO ACTION + ); + """).executeUpdate() + //insert all the files into the database + while(i