|
|
@@ -126,6 +126,7 @@ public function create(array $data): StudentContract
|
|
|
$data['protocol'] = $this->generateNextProtocol();
|
|
|
}
|
|
|
|
|
|
+ $data['status'] = 'pending';
|
|
|
$contract = StudentContract::create($data);
|
|
|
|
|
|
$this->generateInstallments($contract);
|
|
|
@@ -279,6 +280,10 @@ public function attachFile(int $id, UploadedFile $file, bool $signed = false): ?
|
|
|
$typeAttribute => $file->getMimeType(),
|
|
|
]);
|
|
|
|
|
|
+ if ($signed && $model->status === 'pending') {
|
|
|
+ $model->update(['status' => 'active']);
|
|
|
+ }
|
|
|
+
|
|
|
return $model->fresh();
|
|
|
}
|
|
|
|