AdjustmentCategory::class, 'type' => AdjustmentType::class, 'recoverable' => 'boolean', 'rate' => RateCast::class, 'computation' => AdjustmentComputation::class, 'scope' => AdjustmentScope::class, 'start_date' => 'datetime', 'end_date' => 'datetime', ]; public function account(): BelongsTo { return $this->belongsTo(Account::class, 'account_id'); } public function offerings(): MorphToMany { return $this->morphedByMany(Offering::class, 'adjustmentable', 'adjustmentables'); } public function isSalesTax(): bool { return $this->category->isTax() && $this->type->isSales(); } public function isNonRecoverablePurchaseTax(): bool { return $this->category->isTax() && $this->type->isPurchase() && $this->recoverable === false; } public function isRecoverablePurchaseTax(): bool { return $this->category->isTax() && $this->type->isPurchase() && $this->recoverable === true; } public function isSalesDiscount(): bool { return $this->category->isDiscount() && $this->type->isSales(); } public function isPurchaseDiscount(): bool { return $this->category->isDiscount() && $this->type->isPurchase(); } protected static function newFactory(): Factory { return AdjustmentFactory::new(); } }