Files
GSB-Construction/Modules/MaterialLogistics/database/seeders/ConstructionMaterialsSeeder.php

107 lines
9.5 KiB
PHP

<?php
namespace Modules\MaterialLogistics\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
use Modules\MasterData\Models\Material;
class ConstructionMaterialsSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$materials = [
// Concrete & Cement
['name' => 'Portland Cement Type I', 'category' => 'Concrete & Cement', 'unit' => 'Bag (40kg)', 'unit_cost' => 8.50, 'description' => 'General purpose portland cement.'] ,
['name' => 'Portland Cement Type III', 'category' => 'Concrete & Cement', 'unit' => 'Bag (40kg)', 'unit_cost' => 10.00, 'description' => 'High early strength portland cement.'],
['name' => 'Ready Mix Concrete (20 MPa)', 'category' => 'Concrete & Cement', 'unit' => 'Cubic Meter', 'unit_cost' => 110.00, 'description' => 'Standard strength ready mix concrete.'],
['name' => 'Ready Mix Concrete (30 MPa)', 'category' => 'Concrete & Cement', 'unit' => 'Cubic Meter', 'unit_cost' => 130.00, 'description' => 'High strength ready mix concrete.'],
['name' => 'Concrete Blocks (Hollow) 8x8x16', 'category' => 'Concrete & Cement', 'unit' => 'Piece', 'unit_cost' => 1.50, 'description' => 'Standard 8-inch hollow concrete block.'],
// Aggregates
['name' => 'River Sand', 'category' => 'Aggregates', 'unit' => 'Ton', 'unit_cost' => 20.00, 'description' => 'Washed river sand for mixing.'],
['name' => 'Crushed Stone (Gravel) 3/4"', 'category' => 'Aggregates', 'unit' => 'Ton', 'unit_cost' => 25.00, 'description' => '3/4 inch curshed limestone base.'],
['name' => 'Pea Gravel', 'category' => 'Aggregates', 'unit' => 'Ton', 'unit_cost' => 30.00, 'description' => 'Smooth round pea gravel.'],
['name' => 'Base Gravel (Class 5)', 'category' => 'Aggregates', 'unit' => 'Ton', 'unit_cost' => 18.00, 'description' => 'Class 5 aggregate base course material.'],
// Steel & Rebar
['name' => 'Rebar #4 (1/2" x 20 ft)', 'category' => 'Steel & Metal', 'unit' => 'Piece', 'unit_cost' => 6.20, 'description' => 'Standard #4 reinforcing bar, 20 feet length.'],
['name' => 'Rebar #5 (5/8" x 20 ft)', 'category' => 'Steel & Metal', 'unit' => 'Piece', 'unit_cost' => 9.50, 'description' => 'Standard #5 reinforcing bar.'],
['name' => 'Wire Mesh (6x6 W1.4/W1.4) 150ft Roll', 'category' => 'Steel & Metal', 'unit' => 'Roll', 'unit_cost' => 125.00, 'description' => 'Welded wire mesh for concrete slabs.'],
['name' => 'Structural Steel Beam (W8x10)', 'category' => 'Steel & Metal', 'unit' => 'Foot', 'unit_cost' => 15.00, 'description' => 'W8x10 wide flange steel beam.'],
['name' => 'Tie Wire (Black Annealed) 16 Gauge', 'category' => 'Steel & Metal', 'unit' => 'Roll (3 lb)', 'unit_cost' => 8.00, 'description' => 'Tie wire for rebar.'],
// Timber & Wood
['name' => '2x4 Framing Lumber (8 ft)', 'category' => 'Timber & Wood', 'unit' => 'Piece', 'unit_cost' => 3.50, 'description' => 'Standard SPF 2x4 framing stud.'],
['name' => '2x6 Framing Lumber (10 ft)', 'category' => 'Timber & Wood', 'unit' => 'Piece', 'unit_cost' => 6.00, 'description' => 'Standard 2x6 timber.'],
['name' => 'Plywood (CDX) 15/32" (4x8 ft)', 'category' => 'Timber & Wood', 'unit' => 'Sheet', 'unit_cost' => 22.00, 'description' => 'CDX structural plywood panel.'],
['name' => 'OSB Sheathing 7/16" (4x8 ft)', 'category' => 'Timber & Wood', 'unit' => 'Sheet', 'unit_cost' => 14.50, 'description' => 'Oriented strand board.'],
['name' => 'Treated Timber 4x4 (8 ft)', 'category' => 'Timber & Wood', 'unit' => 'Piece', 'unit_cost' => 11.20, 'description' => 'Pressure treated 4x4 post.'],
// Masonry & Bricks
['name' => 'Red Clay Brick', 'category' => 'Masonry', 'unit' => 'Thousand', 'unit_cost' => 450.00, 'description' => 'Standard solid red clay brick.'],
['name' => 'Mortar Mix (Type S)', 'category' => 'Masonry', 'unit' => 'Bag (80 lb)', 'unit_cost' => 9.00, 'description' => 'High strength masonry mortar.'],
['name' => 'Grout Mix (Non-Shrink)', 'category' => 'Masonry', 'unit' => 'Bag (50 lb)', 'unit_cost' => 14.00, 'description' => 'Structural non-shrink grout.'],
// Roofing
['name' => 'Asphalt Shingles (Architectural)', 'category' => 'Roofing', 'unit' => 'Bundle (33 sq ft)', 'unit_cost' => 35.00, 'description' => 'High quality architectural asphalt shingle.'],
['name' => 'Roofing Felt (15 lb, 400 sq ft)', 'category' => 'Roofing', 'unit' => 'Roll', 'unit_cost' => 20.00, 'description' => 'Asphalt saturated roofing felt base.'],
['name' => 'Corrugated Metal Roof Panel (12 ft)', 'category' => 'Roofing', 'unit' => 'Piece', 'unit_cost' => 28.00, 'description' => 'Galvanized iron corrugated sheet.'],
['name' => 'Roofing Nails (1-1/4", 50 lb)', 'category' => 'Roofing', 'unit' => 'Box', 'unit_cost' => 45.00, 'description' => 'Galvanized roofing nails.'],
// Insulation & Drywall
['name' => 'Fiberglass Insulation (R-13) 15" x 32\'', 'category' => 'Insulation', 'unit' => 'Roll', 'unit_cost' => 22.00, 'description' => 'Unfaced fiberglass insulation batt.'],
['name' => 'Rigid Foam Insulation 1" (4x8 ft)', 'category' => 'Insulation', 'unit' => 'Sheet', 'unit_cost' => 16.50, 'description' => 'Extruded polystyrene (XPS) rigid foam.'],
['name' => 'Drywall (Gypsum Board) 1/2" (4x8 ft)', 'category' => 'Drywall', 'unit' => 'Sheet', 'unit_cost' => 13.00, 'description' => 'Standard interior drywall.'],
['name' => 'Joint Compound (All-Purpose) 4.5 Gal', 'category' => 'Drywall', 'unit' => 'Bucket', 'unit_cost' => 16.00, 'description' => 'Ready-mixed joint compound.'],
['name' => 'Drywall Screws (1-1/4", 5 lb)', 'category' => 'Drywall', 'unit' => 'Box', 'unit_cost' => 18.00, 'description' => 'Coarse thread phosphate drywall screws.'],
// Plumbing & Piping
['name' => 'PVC Pipe SCH 40 (2" x 10 ft)', 'category' => 'Plumbing', 'unit' => 'Piece', 'unit_cost' => 15.00, 'description' => 'Schedule 40 PVC pipe.'],
['name' => 'PVC Pipe SCH 40 (4" x 10 ft)', 'category' => 'Plumbing', 'unit' => 'Piece', 'unit_cost' => 26.00, 'description' => 'Schedule 40 PVC pipe for drainage.'],
['name' => 'Copper Pipe Type L (1/2" x 10 ft)', 'category' => 'Plumbing', 'unit' => 'Piece', 'unit_cost' => 24.00, 'description' => 'Standard soft/hard copper piping.'],
['name' => 'PVC Cement & Primer Pack', 'category' => 'Plumbing', 'unit' => 'Pack', 'unit_cost' => 12.00, 'description' => 'Clear PVC cement and purple primer.'],
// Electrical
['name' => 'NM-B Wire 12/2 (250 ft Roll)', 'category' => 'Electrical', 'unit' => 'Roll', 'unit_cost' => 85.00, 'description' => 'Romex 12/2 residential wire w/ ground.'],
['name' => 'THHN Wire 10 AWG (500 ft Spool)', 'category' => 'Electrical', 'unit' => 'Spool', 'unit_cost' => 115.00, 'description' => 'Stranded copper building wire.'],
['name' => 'Electrical Box (1-Gang, 18 cu in)', 'category' => 'Electrical', 'unit' => 'Piece', 'unit_cost' => 0.85, 'description' => 'Nail-on PVC electrical box.'],
['name' => 'Conduit PVC SCH 40 (3/4" x 10 ft)', 'category' => 'Electrical', 'unit' => 'Piece', 'unit_cost' => 3.50, 'description' => 'Electrical PVC conduit.'],
// Paint & Finishes
['name' => 'Latex Primer (Interior) 5 Gal', 'category' => 'Paint', 'unit' => 'Bucket', 'unit_cost' => 55.00, 'description' => 'White interior latex drywall primer.'],
['name' => 'Interior Flat Paint (White) 5 Gal', 'category' => 'Paint', 'unit' => 'Bucket', 'unit_cost' => 70.00, 'description' => 'Professional grade flat white.'],
['name' => 'Exterior Semi-Gloss Paint 5 Gal', 'category' => 'Paint', 'unit' => 'Bucket', 'unit_cost' => 95.00, 'description' => 'Durable exterior grade semi-gloss paint.'],
// Consumables & Tools
['name' => 'Construction Adhesive (10 oz)', 'category' => 'Consumables', 'unit' => 'Tube', 'unit_cost' => 4.50, 'description' => 'Heavy duty polyurethane adhesive.'],
['name' => 'Painter\'s Tape (1.88" x 60 yds)', 'category' => 'Consumables', 'unit' => 'Roll', 'unit_cost' => 6.00, 'description' => 'Blue masking tape.'],
['name' => 'Work Gloves (Leather Palm)', 'category' => 'PPE', 'unit' => 'Pair', 'unit_cost' => 3.00, 'description' => 'Standard heavy-duty work gloves.'],
['name' => 'Safety Glasses', 'category' => 'PPE', 'unit' => 'Piece', 'unit_cost' => 4.00, 'description' => 'Clear polycarbonate safety glasses.'],
];
foreach ($materials as $materialData) {
$baseSku = strtoupper(substr($materialData['category'], 0, 3)) . '-' . rand(1000, 9999);
// Ensure unique sku
while(Material::where('sku', $baseSku)->exists()) {
$baseSku = strtoupper(substr($materialData['category'], 0, 3)) . '-' . rand(1000, 9999);
}
Material::firstOrCreate(
['name' => $materialData['name']],
[
'sku' => $baseSku,
'category' => $materialData['category'],
'unit' => $materialData['unit'],
'unit_cost' => $materialData['unit_cost'],
'description' => $materialData['description'],
'status' => 'active'
]
);
}
}
}