Skip to content

Commit

Permalink
Merge branch 'main' of github.com:canyongbs/aidingapp into Improvemen…
Browse files Browse the repository at this point in the history
…t/AIDAPP-265
  • Loading branch information
ketan-canyon committed Oct 15, 2024
2 parents dddf893 + c1a6aba commit 687a14f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@
use AidingApp\ServiceManagement\Models\ServiceRequestType;
use AidingApp\Form\Filament\Blocks\TextInputFormFieldBlock;
use AidingApp\Form\Actions\ResolveSubmissionAuthorFromEmail;
use AidingApp\ServiceManagement\Models\ServiceRequestStatus;
use AidingApp\ServiceManagement\Models\ServiceRequestFormStep;
use AidingApp\ServiceManagement\Models\ServiceRequestFormField;
use AidingApp\Form\Filament\Blocks\EducatableEmailFormFieldBlock;
use AidingApp\ServiceManagement\Models\ServiceRequestFormSubmission;
use AidingApp\ServiceManagement\Enums\SystemServiceRequestClassification;
use AidingApp\ServiceManagement\Models\MediaCollections\UploadsMediaCollection;
use AidingApp\ServiceManagement\Actions\ResolveUploadsMediaCollectionForServiceRequest;

Expand Down Expand Up @@ -108,9 +110,16 @@ public function store(
DB::beginTransaction();

try {
$serviceRequestStatus = ServiceRequestStatus::query()
->where('classification', SystemServiceRequestClassification::Open)
->where('name', 'New')
->where('is_system_protected', true)
->firstOrFail();
$serviceRequest = new ServiceRequest([
'title' => $data->pull('Main.title'),
'close_details' => $data->pull('Main.description'),
'status_id' => $serviceRequestStatus->getKey(),
'status_updated_at' => now(),
]);

$serviceRequest->respondent()->associate($contact);
Expand Down

0 comments on commit 687a14f

Please sign in to comment.