- Implement OfferOptionAdminTest to validate offer option management, including price display, activation, and cancellation. - Create OrganizationPurchaseTest to ensure correct handling of organization purchases, including access control and order processing. - Add ShopProductPageTest to verify shop product listings, search functionality, and product page details. - Introduce BuildsShop trait for seeding test data related to shop functionality. - Implement MoneyTest to validate money parsing and formatting, ensuring correct handling of euro amounts.
47 lines
1016 B
PHP
47 lines
1016 B
PHP
<?php
|
|
|
|
namespace App\Domain\Commerce;
|
|
|
|
use App\Domain\Catalog\OfferVersion;
|
|
use App\Domain\Identity\Party;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class OrderLine extends Model
|
|
{
|
|
protected $fillable = [
|
|
'order_id',
|
|
'offer_version_id',
|
|
'offer_name',
|
|
'price_cents',
|
|
'term_rule',
|
|
'update_promise',
|
|
'holder_kind',
|
|
'currency',
|
|
'tax_class',
|
|
'grant_kind',
|
|
'holder_party_id',
|
|
];
|
|
|
|
public function order(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Order::class);
|
|
}
|
|
|
|
public function holder(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Party::class, 'holder_party_id');
|
|
}
|
|
|
|
public function offerVersion(): BelongsTo
|
|
{
|
|
return $this->belongsTo(OfferVersion::class);
|
|
}
|
|
|
|
public function scopeItems(): HasMany
|
|
{
|
|
return $this->hasMany(OrderScopeItem::class);
|
|
}
|
|
}
|