Phase 6 and 7 scope contact safeguards

This commit is contained in:
Codex
2026-07-10 14:14:23 -05:00
parent 6ce2b294d0
commit 5009269907
27 changed files with 1158 additions and 60 deletions
+84 -11
View File
@@ -1,19 +1,92 @@
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold">Post Job</h2></x-slot>
<div class="mx-auto max-w-5xl p-6">
<form method="POST" action="{{ route('jobs.store') }}" class="space-y-4 rounded border bg-white p-6">
<form method="POST" action="{{ route('jobs.store') }}" class="space-y-6 rounded border bg-white p-6 dark:border-slate-800 dark:bg-slate-900">
@csrf
<x-field name="title" label="Title" />
<x-field name="service_category" label="Service category" />
<x-field name="location" label="Location" />
<x-field name="starts_at" label="Start date/time" type="datetime-local" />
<x-field name="time_window" label="Time window" />
<x-field name="scope" label="Scope" textarea />
<x-field name="required_skills" label="Required skills" textarea />
<x-field name="required_tools" label="Required tools" textarea />
<x-field name="deliverables" label="Deliverables checklist" textarea />
<section class="grid gap-4 md:grid-cols-2">
<x-field name="title" label="Title" />
<x-field name="service_category" label="Service category" />
<x-field name="location" label="Location" />
<x-field name="starts_at" label="Start date/time" type="datetime-local" />
<x-field name="time_window" label="Time window" />
<div>
<label for="schedule_type" class="block text-sm font-medium text-slate-800 dark:text-slate-200">Schedule type</label>
<select id="schedule_type" name="schedule_type" class="mt-1 block w-full rounded-md border-slate-300 bg-white text-slate-950 shadow-sm focus:border-sky-500 focus:ring-sky-500 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100">
@foreach (['hard_start' => 'Hard start', 'flex_window' => 'Flexible window', 'appointment' => 'Appointment', 'remote' => 'Remote'] as $value => $label)
<option value="{{ $value }}">{{ $label }}</option>
@endforeach
</select>
</div>
<label class="flex items-center gap-2 rounded-md border border-slate-200 px-3 py-2 text-sm text-slate-700 dark:border-slate-800 dark:text-slate-300">
<input type="checkbox" name="remote_eligible" value="1" class="rounded border-slate-300 text-sky-600 shadow-sm focus:ring-sky-500 dark:border-slate-700 dark:bg-slate-950">
Remote eligible
</label>
</section>
<section class="space-y-4">
<div>
<h3 class="font-semibold text-slate-950 dark:text-white">Structured scope</h3>
<p class="text-sm text-slate-500 dark:text-slate-400">These fields define the job. Supplemental instructions cannot override these boundaries.</p>
</div>
<x-field name="primary_objective" label="Primary objective" textarea />
<div class="grid gap-4 md:grid-cols-2">
<x-field name="included_work" label="Included work" textarea />
<x-field name="excluded_work" label="Excluded work" textarea />
<x-field name="maximum_onsite_expectations" label="Maximum onsite expectations" textarea />
<x-field name="expected_duration" label="Expected duration" />
</div>
<x-field name="scope" label="Legacy summary scope" textarea help="Short summary for compatibility with the first prototype views." />
<x-field name="supplemental_instructions" label="Supplemental instructions" textarea help="Long instructions are preserved, but they are supplemental and do not create undefined onsite obligations." />
</section>
<section class="space-y-4">
<h3 class="font-semibold text-slate-950 dark:text-white">Requirements and closeout</h3>
<div class="grid gap-4 md:grid-cols-2">
<x-field name="required_skills" label="Required skills" textarea />
<x-field name="required_tools" label="Required tools" textarea />
<x-field name="required_certifications" label="Required certifications" textarea />
<x-field name="required_safety_gear" label="Required safety gear" textarea />
<x-field name="deliverables" label="Deliverables checklist" textarea />
<x-field name="closeout_conditions" label="Closeout conditions" textarea />
<x-field name="buyer_provided_equipment" label="Buyer-provided equipment" textarea />
<x-field name="provider_provided_equipment" label="Provider-provided equipment" textarea />
<x-field name="return_shipment_expectations" label="Return shipment expectations" textarea />
<x-field name="parking_access_notes" label="Parking and access notes" textarea />
<x-field name="onsite_restrictions" label="Onsite restrictions" textarea />
<x-field name="vendor_onboarding" label="Vendor onboarding" textarea />
</div>
</section>
<section class="space-y-4">
<div>
<h3 class="font-semibold text-slate-950 dark:text-white">Contact and support availability</h3>
<p class="text-sm text-slate-500 dark:text-slate-400">Certify real support coverage for the scheduled work window before dispatch.</p>
</div>
<div class="grid gap-4 md:grid-cols-3">
<x-field name="primary_contact_name" label="Primary contact name" />
<x-field name="primary_contact_phone" label="Primary contact phone" />
<x-field name="primary_contact_email" label="Primary contact email" type="email" />
<x-field name="backup_contact_name" label="Backup contact name" />
<x-field name="backup_contact_phone" label="Backup contact phone" />
<x-field name="backup_contact_email" label="Backup contact email" type="email" />
<x-field name="dispatch_contact_name" label="Dispatch contact name" />
<x-field name="dispatch_contact_phone" label="Dispatch contact phone" />
<x-field name="dispatch_contact_email" label="Dispatch contact email" type="email" />
</div>
<div class="grid gap-4 md:grid-cols-2">
<x-field name="technical_bridge" label="Technical bridge or meeting link" />
<x-field name="escalation_contact" label="Escalation contact" />
<x-field name="support_channel" label="Support channel" />
<x-field name="support_expected_response_time" label="Expected response time" />
<x-field name="support_availability_window" label="Support availability window" />
<label class="flex items-center gap-2 rounded-md border border-slate-200 px-3 py-2 text-sm text-slate-700 dark:border-slate-800 dark:text-slate-300">
<input type="checkbox" name="contact_certified" value="1" class="rounded border-slate-300 text-sky-600 shadow-sm focus:ring-sky-500 dark:border-slate-700 dark:bg-slate-950">
I certify these contacts and support channels will be available during the work window.
</label>
</div>
</section>
<x-field name="payment_terms" label="Payment terms" textarea />
<x-field name="vendor_onboarding" label="Vendor onboarding" textarea />
<input type="hidden" name="visibility" value="public">
<x-primary-button>Post job</x-primary-button>
</form>
+17 -2
View File
@@ -14,8 +14,23 @@
@auth @role('buyer')<a class="rounded bg-indigo-600 px-4 py-2 text-white" href="{{ route('jobs.create') }}">Post job</a>@endrole @endauth
@foreach ($jobs as $job)
<a href="{{ route('jobs.show', $job) }}" class="block rounded border bg-white p-4 shadow-sm">
<h3 class="font-semibold">{{ $job->title }}</h3>
<p class="text-sm text-gray-600">{{ $job->location }} | {{ $job->service_category }} | {{ $job->status }}</p>
<div class="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
<div>
<h3 class="font-semibold">{{ $job->title }}</h3>
<p class="text-sm text-gray-600">{{ $job->location }} | {{ $job->service_category }} | {{ $job->status }}</p>
</div>
<div class="flex flex-wrap gap-2">
<x-badge tone="{{ $job->scope_clarity_status === 'clear' ? 'emerald' : 'amber' }}">Scope {{ str_replace('_', ' ', $job->scope_clarity_status) }}</x-badge>
<x-badge tone="{{ $job->contact_certified ? 'emerald' : 'rose' }}">{{ $job->contact_certified ? 'Support certified' : 'Support not certified' }}</x-badge>
</div>
</div>
@if (is_array($job->risk_flags) && $job->risk_flags)
<div class="mt-2 flex flex-wrap gap-2">
@foreach ($job->risk_flags as $flag)
<x-badge tone="amber">{{ str_replace('_', ' ', $flag) }}</x-badge>
@endforeach
</div>
@endif
<p class="mt-2 line-clamp-2 text-sm">{{ $job->scope }}</p>
<x-rating-summary :ratings="$job->ratings" />
</a>
+69 -3
View File
@@ -1,15 +1,81 @@
<x-app-layout>
<x-slot name="header"><h2 class="text-xl font-semibold">{{ $job->title }}</h2></x-slot>
<div class="mx-auto max-w-6xl space-y-6 p-6">
<section class="rounded border bg-white p-6">
<p class="text-sm text-gray-500">{{ $job->location }} | {{ $job->service_category }} | {{ $job->status }}</p>
<p class="mt-4 whitespace-pre-line">{{ $job->scope }}</p>
<section class="rounded border bg-white p-6 dark:border-slate-800 dark:bg-slate-900">
<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
<div>
<p class="text-sm text-gray-500">{{ $job->location }} | {{ $job->service_category }} | {{ $job->status }}</p>
<div class="mt-3 flex flex-wrap gap-2">
<x-badge tone="{{ $job->scope_clarity_status === 'clear' ? 'emerald' : 'amber' }}">Scope {{ str_replace('_', ' ', $job->scope_clarity_status) }}</x-badge>
@if ($job->contact_certified)
<x-badge tone="emerald">Support certified</x-badge>
@else
<x-badge tone="rose">Support not certified</x-badge>
@endif
@if ($job->remote_eligible)
<x-badge tone="sky">Remote eligible</x-badge>
@endif
</div>
</div>
<div class="text-sm text-slate-600 dark:text-slate-400 sm:text-right">
<p>{{ $job->starts_at?->format('M j, Y g:i A') ?? 'No start set' }}</p>
<p>{{ $job->time_window ?: 'No window set' }} | {{ str_replace('_', ' ', $job->schedule_type ?: 'schedule not set') }}</p>
</div>
</div>
@if (is_array($job->risk_flags) && $job->risk_flags)
<div class="mt-4 rounded-md border border-amber-200 bg-amber-50 p-4 text-sm text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100">
<p class="font-semibold">Risk flags</p>
<div class="mt-2 flex flex-wrap gap-2">
@foreach ($job->risk_flags as $flag)
<x-badge tone="amber">{{ str_replace('_', ' ', $flag) }}</x-badge>
@endforeach
</div>
</div>
@endif
<div class="mt-6 rounded-md border border-sky-200 bg-sky-50 p-4 text-sm text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100">
<p class="font-semibold">Anti-catch-all rule</p>
<p class="mt-1">The structured scope fields define this job. Supplemental instructions are preserved for reference, but they do not override included work, excluded work, closeout conditions, or change-request requirements.</p>
</div>
<dl class="mt-6 grid gap-4 md:grid-cols-2">
<div><dt class="text-sm text-gray-500">Primary objective</dt><dd class="whitespace-pre-line">{{ $job->primary_objective ?: $job->scope }}</dd></div>
<div><dt class="text-sm text-gray-500">Expected duration</dt><dd class="whitespace-pre-line">{{ $job->expected_duration ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Included work</dt><dd class="whitespace-pre-line">{{ $job->included_work ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Excluded work</dt><dd class="whitespace-pre-line">{{ $job->excluded_work ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Maximum onsite expectations</dt><dd class="whitespace-pre-line">{{ $job->maximum_onsite_expectations ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Closeout conditions</dt><dd class="whitespace-pre-line">{{ $job->closeout_conditions ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Required skills</dt><dd class="whitespace-pre-line">{{ $job->required_skills }}</dd></div>
<div><dt class="text-sm text-gray-500">Required tools</dt><dd class="whitespace-pre-line">{{ $job->required_tools }}</dd></div>
<div><dt class="text-sm text-gray-500">Required certifications</dt><dd class="whitespace-pre-line">{{ $job->required_certifications ?: 'None listed' }}</dd></div>
<div><dt class="text-sm text-gray-500">Safety gear</dt><dd class="whitespace-pre-line">{{ $job->required_safety_gear ?: 'None listed' }}</dd></div>
<div><dt class="text-sm text-gray-500">Deliverables</dt><dd class="whitespace-pre-line">{{ $job->deliverables }}</dd></div>
<div><dt class="text-sm text-gray-500">Payment terms</dt><dd class="whitespace-pre-line">{{ $job->payment_terms }}</dd></div>
<div><dt class="text-sm text-gray-500">Buyer-provided equipment</dt><dd class="whitespace-pre-line">{{ $job->buyer_provided_equipment ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Provider-provided equipment</dt><dd class="whitespace-pre-line">{{ $job->provider_provided_equipment ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Return shipment</dt><dd class="whitespace-pre-line">{{ $job->return_shipment_expectations ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Parking/access</dt><dd class="whitespace-pre-line">{{ $job->parking_access_notes ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Onsite restrictions</dt><dd class="whitespace-pre-line">{{ $job->onsite_restrictions ?: 'Not specified' }}</dd></div>
<div><dt class="text-sm text-gray-500">Vendor onboarding</dt><dd class="whitespace-pre-line">{{ $job->vendor_onboarding ?: 'Not specified' }}</dd></div>
</dl>
@if ($job->supplemental_instructions)
<details class="mt-6 rounded-md border border-slate-200 p-4 text-sm dark:border-slate-800">
<summary class="cursor-pointer font-semibold text-slate-950 dark:text-white">Supplemental instructions</summary>
<p class="mt-3 whitespace-pre-line text-slate-700 dark:text-slate-300">{{ $job->supplemental_instructions }}</p>
</details>
@endif
<section class="mt-6 rounded-md border border-slate-200 p-4 dark:border-slate-800">
<h3 class="font-semibold text-slate-950 dark:text-white">Contact and support coverage</h3>
<dl class="mt-3 grid gap-4 text-sm md:grid-cols-3">
<div><dt class="text-gray-500">Primary contact</dt><dd>{{ $job->primary_contact_name ?: 'Not set' }}<br>{{ $job->primary_contact_phone }} {{ $job->primary_contact_email }}</dd></div>
<div><dt class="text-gray-500">Backup contact</dt><dd>{{ $job->backup_contact_name ?: 'Not set' }}<br>{{ $job->backup_contact_phone }} {{ $job->backup_contact_email }}</dd></div>
<div><dt class="text-gray-500">Dispatch contact</dt><dd>{{ $job->dispatch_contact_name ?: 'Not set' }}<br>{{ $job->dispatch_contact_phone }} {{ $job->dispatch_contact_email }}</dd></div>
<div><dt class="text-gray-500">Technical bridge</dt><dd>{{ $job->technical_bridge ?: 'Not set' }}</dd></div>
<div><dt class="text-gray-500">Escalation</dt><dd>{{ $job->escalation_contact ?: 'Not set' }}</dd></div>
<div><dt class="text-gray-500">Support availability</dt><dd>{{ $job->support_availability_window ?: 'Not set' }}<br>{{ $job->support_channel }} {{ $job->support_expected_response_time }}</dd></div>
</dl>
</section>
<x-attachments :attachments="$job->attachments" />
<x-rating-summary :ratings="$job->ratings" />
<x-rating-form type="job_post" :id="$job->id" category="job_quality" />