4.1 KiB
4.1 KiB
Plan: Seeding FGEN-PPA Service Road Project Data
This document outlines the design and implementation plan for seeding the "Construction of FGEN-PPA Service Road" project data in the system.
1. Objectives & Scope
Create a Laravel Database Seeder class named FgenPpaServiceRoadSeeder located under Modules/ProjectManagement/database/seeders/.
This seeder will:
- Validate that it can only be executed by a Super Admin (or in CLI mode).
- Create the project "Construction of FGEN-PPA Service Road".
- Build 8 Milestones with their planned dates, weight percentages, and sort orders.
- Seed Tasks for each Milestone.
- Seed, map, and associate relevant Materials to tasks (using
task_materialspivot table). - Seed, map, and associate relevant Equipments to tasks (using
task_equipmentstable). - Assign personnel (Project Manager, Site Engineer, Foreman) to the Project and specific Tasks (using
task_usertable).
2. Model & Database Mapping
A. Project details
- Name: Construction of FGEN-PPA Service Road
- Description: Construction of the FGEN-PPA Service Road including site clearing, drainage, subgrade prep, base course, concrete pavement, shoulder protection, safety markings, and cleanup.
- Location: Batangas, Philippines
- Status:
planning - Contract Value: 15,500,000.00
- Duration: 8 Months
- Start Date: 2026-07-01
- Target End Date: 2027-02-28
B. Milestones and Tasks
The 8 milestones will be seeded with:
- Milestone 1: Site Clearing and Earthworks (Weight: 10%)
- Milestone 2: Drainage Construction (Weight: 15%)
- Milestone 3: Subgrade Preparation (Weight: 10%)
- Milestone 4: Aggregate Base Course Installation (Weight: 15%)
- Milestone 5: Concrete Pavement Construction (Weight: 30%)
- Milestone 6: Shoulder and Slope Protection Works (Weight: 10%)
- Milestone 7: Road Safety and Finishing Works (Weight: 5%)
- Milestone 8: Final Restoration and Site Cleanup (Weight: 5%)
C. Materials Mapping (via task_materials table)
We will firstOrCreate materials:
- Selected Fill Materials, Water for Compaction, Reinforced Concrete Pipes (RCP), Portland Cement Type I, River Sand, Crushed Stone (Gravel) 3/4", Rebar #4 (1/2" x 20 ft), Plywood (CDX) 15/32" (4x8 ft), Backfill Materials, Soil Stabilizer, Base Gravel (Class 5), Ready Mix Concrete (30 MPa), Tie Bars, Dowel Bars, Joint Sealant, Curing Compound, Riprap Stones, Geotextile Fabric, Traffic Signs, Guardrails, Thermoplastic Paint, Glass Beads, Reflectors, Delineators, Topsoil, Landscaping Materials.
D. Equipment Mapping (via task_equipments table)
We will firstOrCreate equipment:
- Excavator, Bulldozer, Motor Grader, Vibratory Roller, Water Truck, Dump Truck, Concrete Mixer, Concrete Vibrator, Plate Compactor, Wheel Loader, Transit Mixer, Concrete Cutter, Power Trowel, Crane, Road Marking Machine, Air Compressor, Pickup Truck.
3. Security & Access Control
To ensure only a Super Admin can run it:
- Within the
run()method of the Seeder, if a web request or session is active (auth()->check()), we will verify the user has theSuper Adminrole. - If not, we will abort with an unauthorized exception.
- Running via
artisan db:seedfrom command line (whereauth()->check()is false) will bypass the session check.
4. User Assignments
We will fetch or create the following users:
- Project Manager:
pm@fgen.com(assigned to project aspmand associated tasks). - Site Technical (Site Engineer):
engineer@fgen.com(assigned to tasks as technical member). - Construction Supervisor (Foreman):
foreman@fgen.com(assigned to tasks as field supervisor).
They will be attached to the tasks via the task_user relation.
5. Verification Plan
- Register
FgenPpaServiceRoadSeederinsideModules/ProjectManagement/database/seeders/ProjectManagementDatabaseSeeder.phpor invoke it directly. - Execute the seeder command:
php artisan db:seed --class=Modules\ProjectManagement\Database\Seeders\FgenPpaServiceRoadSeeder. - Verify database records for the project, milestones, tasks, task materials, task equipments, and user assignments are created correctly.