feat: implement comprehensive modules for daily reports, project management, material logistics, and approval workflows
This commit is contained in:
@@ -28,16 +28,16 @@ class ProjectClassificationTaggingTest extends TestCase
|
||||
$this->assertDatabaseCount('project_classifications', 10);
|
||||
|
||||
$expectedClassifications = [
|
||||
'road highway, pavement, railways, airport horizontal structures and bridges',
|
||||
'irrigation and flood control',
|
||||
'dam, reservoir, and tunneling',
|
||||
'water supply',
|
||||
'port, harbor and offshore engineering',
|
||||
'building and industrial plant',
|
||||
'sewerage treatment/disposal plant',
|
||||
'water treatment plant and system',
|
||||
'park, playground and recreational work',
|
||||
'electrical work',
|
||||
'Road, Highway, Pavement, Railways, Airport Horizontal Structures and Bridges',
|
||||
'Irrigation and Flood Control',
|
||||
'Dam, Reservoir, and Tunneling',
|
||||
'Water Supply',
|
||||
'Port, Harbor and Offshore Engineering',
|
||||
'Building and Industrial Plant',
|
||||
'Sewerage Treatment / Disposal Plant',
|
||||
'Water Treatment Plant and System',
|
||||
'Park, Playground and Recreational Work',
|
||||
'Electrical Work',
|
||||
];
|
||||
|
||||
foreach ($expectedClassifications as $name) {
|
||||
@@ -50,16 +50,23 @@ class ProjectClassificationTaggingTest extends TestCase
|
||||
public function test_project_can_be_created_with_multiple_classifications_tagging(): void
|
||||
{
|
||||
$selectedTags = [
|
||||
'road highway, pavement, railways, airport horizontal structures and bridges',
|
||||
'electrical work',
|
||||
'water supply',
|
||||
'Road, Highway, Pavement, Railways, Airport Horizontal Structures and Bridges',
|
||||
'Electrical Work',
|
||||
'Water Supply',
|
||||
];
|
||||
|
||||
$response = $this->actingAs($this->admin)
|
||||
->post(route('projects.store'), [
|
||||
'name' => 'Mega Bypass & Substation Construction',
|
||||
'client_name' => 'Department of Public Works and Highways',
|
||||
'location' => 'Davao City, Philippines',
|
||||
'description' => 'Construction of bypass highway and electrical substation.',
|
||||
'project_type' => 'standard',
|
||||
'contract_value' => 50000000,
|
||||
'start_date' => now()->addDays(10)->format('Y-m-d'),
|
||||
'target_end_date' => now()->addYears(2)->format('Y-m-d'),
|
||||
'contract_duration' => 730,
|
||||
'pm_id' => $this->admin->id,
|
||||
'classifications' => $selectedTags,
|
||||
]);
|
||||
|
||||
@@ -78,20 +85,28 @@ class ProjectClassificationTaggingTest extends TestCase
|
||||
$project = Project::factory()->create([
|
||||
'name' => 'Initial Project',
|
||||
'project_type' => 'standard',
|
||||
'classifications' => ['building and industrial plant'],
|
||||
'classifications' => ['Building and Industrial Plant'],
|
||||
'current_wizard_step' => 1,
|
||||
]);
|
||||
|
||||
$updatedTags = [
|
||||
'building and industrial plant',
|
||||
'sewerage treatment/disposal plant',
|
||||
'water treatment plant and system',
|
||||
'Building and Industrial Plant',
|
||||
'Sewerage Treatment / Disposal Plant',
|
||||
'Water Treatment Plant and System',
|
||||
];
|
||||
|
||||
$response = $this->actingAs($this->admin)
|
||||
->post(route('projects.wizard.save-details', $project->ulid), [
|
||||
'name' => 'Updated Industrial Plant Project',
|
||||
'client_name' => 'San Miguel Corporation',
|
||||
'location' => 'Batangas City',
|
||||
'description' => 'Industrial water treatment and disposal facility expansion.',
|
||||
'project_type' => 'standard',
|
||||
'contract_value' => 25000000,
|
||||
'start_date' => now()->addDays(5)->format('Y-m-d'),
|
||||
'target_end_date' => now()->addMonths(12)->format('Y-m-d'),
|
||||
'contract_duration' => 365,
|
||||
'pm_id' => $this->admin->id,
|
||||
'classifications' => $updatedTags,
|
||||
]);
|
||||
|
||||
@@ -100,6 +115,6 @@ class ProjectClassificationTaggingTest extends TestCase
|
||||
$project->refresh();
|
||||
$this->assertEquals('Updated Industrial Plant Project', $project->name);
|
||||
$this->assertCount(3, $project->classifications);
|
||||
$this->assertContains('sewerage treatment/disposal plant', $project->classifications);
|
||||
$this->assertContains('Sewerage Treatment / Disposal Plant', $project->classifications);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user