kept the mark as show or complete and cacle button stay after the user chose

This commit is contained in:
Naser Mansour
2026-01-09 19:40:51 +02:00
parent 773e1d3f7f
commit 0aa1b7f675
4 changed files with 82 additions and 56 deletions
+2 -2
View File
@@ -116,7 +116,7 @@ class Consultation extends Model
*/
public function markAsCompleted(): void
{
if ($this->status !== ConsultationStatus::Approved) {
if (! in_array($this->status, [ConsultationStatus::Approved, ConsultationStatus::NoShow])) {
throw new \InvalidArgumentException(
__('messages.invalid_status_transition', ['from' => $this->status->value, 'to' => 'completed'])
);
@@ -131,7 +131,7 @@ class Consultation extends Model
*/
public function markAsNoShow(): void
{
if ($this->status !== ConsultationStatus::Approved) {
if (! in_array($this->status, [ConsultationStatus::Approved, ConsultationStatus::Completed])) {
throw new \InvalidArgumentException(
__('messages.invalid_status_transition', ['from' => $this->status->value, 'to' => 'no_show'])
);