<?php  namespace App\Models;  use App\Traits\HasStorage; use App\Contracts\HasMedia; use App\Contracts\Localable; use App\Observers\OrderObserver; use Illuminate\Notifications\Notifiable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use App\Services\Orders\InvoicesAndOffers\GeneralInvoiceMaker;  /**  * @property array|null $corvus  * @property array|null $paypal  * @property string $final_price  * @property int $delivery_method  * @property string $paypalAmount  */ class Order extends Model implements HasMedia, Localable { 	use HasStorage, Notifiable;  	public const DELIVERY_SHIPPING = 1; 	public const DELIVERY_PICKUP_IN_STORE = 2;  	public const PAYMENT_METHOD_CARD = 1; 	public const PAYMENT_METHOD_POUZECE = 2; 	public const PAYMENT_METHOD_VIRMAN = 3; 	public const PAYMENT_METHOD_GIFT_CODE = 4;  	public const STATUS_PENDING = 1; 	public const STATUS_PAID = 2; 	public const STATUS_CANCELED = 3; 	public const STATUS_REFUNDED = 4; 	public const STATUS_OFFER_SENT = 5;  	public const PAYMENT_PROVIDER_PAYPAL = 1; 	public const PAYMENT_PROVIDER_CORVUS = 2;  	public const LANG_HR = 1; 	public const LANG_EN = 2;  	protected $casts = [ 		'number_of_packages' => 'integer', 		'payment_type' => 'integer', 		'status' => 'integer', 		'ready_for_pickup' => 'boolean', 		'order_details' => 'array', 		'payment_card_provider' => 'integer', 		'delivery_address' => 'array', 		'invoice_address' => 'array', 		'guest_mode' => 'boolean', 		'r1' => 'boolean', 		'discounts_applied' => 'array', 		'lang' => 'integer', 	];  	public function scopeIncludes(object $query, ?string $lang = null): Builder{}  	public static function deliveryOptions(): array 	{ 		return [ 			self::DELIVERY_SHIPPING, 			self::DELIVERY_PICKUP_IN_STORE, 		]; 	}  	public static function availablePaymentMethods(): array 	{ 		return [ 			self::PAYMENT_METHOD_CARD, 			self::PAYMENT_METHOD_POUZECE, 			self::PAYMENT_METHOD_VIRMAN, 			self::PAYMENT_METHOD_GIFT_CODE, 		]; 	}  	public function scopeAvailable(Builder $query): Builder{}  	public function scopeCanceled(Builder $query): Builder{}  	public function scopePending(Builder $query): Builder{}  	public function scopeRefunded(Builder $query): Builder{}  	public function scopeVirman(Builder $query): Builder{}  	public function scopePaid(Builder $query): Builder{}  	public function orderItems(): HasMany{}  	public function getPaymentMethodName(): ?string{}  	public function getDeliveryMethodName(): string{}  	public function getCardPaymentProviderName(): ?string{}  	public static function getCardProviders(): array 	{ 		return [ 			self::PAYMENT_PROVIDER_CORVUS, 			self::PAYMENT_PROVIDER_PAYPAL, 		]; 	}  	public static function getStatuses(): array 	{ 		return [ 			self::STATUS_PENDING, 			self::STATUS_PAID, 			self::STATUS_CANCELED, 			self::STATUS_REFUNDED, 			self::STATUS_OFFER_SENT, 		]; 	}  	public static function getOrderUpdatableStatuses(): array 	{ 		return [ 			self::STATUS_PAID, 			self::STATUS_OFFER_SENT, 		]; 	}  	public function customer(): BelongsTo{}  	public function mediaConfig(): array{}  	public function shipments(): HasMany{}  	public static function createOrderNumber(): string 	{ 		if ($order = Order::whereNotNull('order_number')->latest()->first()) { 			return (string) ((int) $order->order_number + 1); 		}  		return (string) 1; 	}  	public static function createReferenceNumber(): string 	{ 		do { 			$refNumber = (string) random_int(100000, 999999); 		} while (Order::where('reference_number', $refNumber)->exists());  		return $refNumber; 	}  	public function getCustomerName(): ?string{}  	public function isPayPalVerified(): ?string{}  	public function isShippingOrder(): bool{}  	public function routeNotificationForMail(mixed $notification): string{}  	public function createInvoicePdf(GeneralInvoiceMaker $invoiceMaker): void{}  	public function store(): BelongsTo{}  	public function scopeAccepted(Builder $query): Builder{}  	public function getStatusName(): ?string{}  	public function checkIfHasShipmentNumberApplied(): bool{}  	public function appliedDiscounts(): HasMany{}  	public function getOrderWiseDiscount(): ?array{}  	public function getOrderWiseDiscountInfo(): ?string{}  	public function getLang(): int{}  	protected static function initObservers(): ?string 	{ 		return OrderObserver::class; 	} }