diff --git a/app/Enums/InvoiceStatus.php b/app/Enums/InvoiceStatus.php index c6a99af..4b20e11 100644 --- a/app/Enums/InvoiceStatus.php +++ b/app/Enums/InvoiceStatus.php @@ -8,14 +8,19 @@ enum InvoiceStatus: string implements HasColor, HasIcon, HasLabel { - case UNPAID = 'Not paid'; - case PARTIALLY_PAID = 'Partially paid'; - case PAID = 'Paid'; - case VOID = 'Void'; + case UNPAID = 'not_paid'; + case PARTIALLY_PAID = 'partially_paid'; + case PAID = 'paid'; + case VOID = 'void'; - public function getLabel(): ?string + public function getLabel(): string { - return $this->value; + return match ($this) { + self::UNPAID => 'Not paid', + self::PARTIALLY_PAID => 'Partially paid', + self::PAID => 'Paid', + self::VOID => 'Void', + }; } public function getColor(): string|array|null diff --git a/app/Enums/OrderStatus.php b/app/Enums/OrderStatus.php index decc509..ffe7453 100644 --- a/app/Enums/OrderStatus.php +++ b/app/Enums/OrderStatus.php @@ -8,16 +8,23 @@ enum OrderStatus: string implements HasColor, HasIcon, HasLabel { - case DRAFT = 'Draft'; - case APPROVED = 'Approved'; - case PRODUCTION = 'Production'; - case SHIPPED = 'Shipped'; - case READY_FOR_INVOICE = 'Ready for Invoice'; - case INVOICED = 'Invoiced'; + case DRAFT = 'draft'; + case APPROVED = 'approved'; + case PRODUCTION = 'production'; + case SHIPPED = 'shipped'; + case READY_FOR_INVOICE = 'ready_for_invoice'; + case INVOICED = 'invoiced'; - public function getLabel(): ?string + public function getLabel(): string { - return $this->value; + return match ($this) { + self::DRAFT => 'Draft', + self::APPROVED => 'Approved', + self::PRODUCTION => 'Production', + self::SHIPPED => 'Shipped', + self::READY_FOR_INVOICE => 'Ready for Invoice', + self::INVOICED => 'Invoiced', + }; } public function getColor(): string|array|null diff --git a/app/Enums/OrderType.php b/app/Enums/OrderType.php index fc2f886..bb36484 100644 --- a/app/Enums/OrderType.php +++ b/app/Enums/OrderType.php @@ -6,14 +6,20 @@ enum OrderType: string implements HasLabel { - case EMB = 'Embroidery'; - case SCP = 'Screen printing'; - case DTG = 'Direct-to-garment'; - case VINYL = 'Vinyl'; - case MISC = 'Misc'; + case EMB = 'embroidery'; + case SCP = 'screen_printing'; + case DTG = 'direct_to_garment'; + case VINYL = 'vinyl'; + case MISC = 'misc'; - public function getLabel(): ?string + public function getLabel(): string { - return $this->value; + return match ($this) { + self::EMB => 'Embroidery', + self::SCP => 'Screen printing', + self::DTG => 'Direct-to-garment', + self::VINYL => 'Vinyl', + self::MISC => 'Misc', + }; } } diff --git a/resources/views/pdf/order.blade.php b/resources/views/pdf/order.blade.php index bc4820f..adfbc9d 100644 --- a/resources/views/pdf/order.blade.php +++ b/resources/views/pdf/order.blade.php @@ -13,8 +13,8 @@