Ergänze das U1-Fachmodell für Inhalt, Paket und Angebot.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2035c46edd
commit
2ded4b7fad
35 files changed
+2115
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Entitlement;
|
||||
|
||||
use App\Domain\Identity\Party;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* Individuelle Berechtigungsquelle eines Inhabers. Die Entscheidung, wann ein Erwerb entsteht, folgt später.
|
||||
* Der Bezug ist je Typ eine Bestellposition, ein Angebot, ein Verwaltungsvorgang oder ein Abonnement.
|
||||
*/
|
||||
class Acquisition extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'party_id',
|
||||
'type',
|
||||
'reference_type',
|
||||
'reference_id',
|
||||
'conditions',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'type' => AcquisitionType::class,
|
||||
'conditions' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function party(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Party::class);
|
||||
}
|
||||
|
||||
public function grants(): HasMany
|
||||
{
|
||||
return $this->hasMany(Grant::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Entitlement;
|
||||
|
||||
enum AcquisitionType: string
|
||||
{
|
||||
case Bestellposition = 'bestellposition';
|
||||
case FreierAbruf = 'freier_abruf';
|
||||
case ManuelleVergabe = 'manuelle_vergabe';
|
||||
case Abonnement = 'abonnement';
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Entitlement;
|
||||
|
||||
use App\Domain\Catalog\ArticleRelease;
|
||||
use App\Domain\Catalog\LicenseArticle;
|
||||
use App\Domain\Catalog\RightsProfileVersion;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Grant extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'acquisition_id',
|
||||
'license_article_id',
|
||||
'rights_profile_version_id',
|
||||
'rights_snapshot',
|
||||
'valid_from',
|
||||
'valid_until',
|
||||
'release_at_grant_id',
|
||||
'status',
|
||||
'status_reason',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'rights_snapshot' => 'array',
|
||||
'valid_from' => 'datetime',
|
||||
'valid_until' => 'datetime',
|
||||
'status' => GrantStatus::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function acquisition(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Acquisition::class);
|
||||
}
|
||||
|
||||
public function article(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(LicenseArticle::class, 'license_article_id');
|
||||
}
|
||||
|
||||
public function rights(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(RightsProfileVersion::class, 'rights_profile_version_id');
|
||||
}
|
||||
|
||||
public function releaseAtGrant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ArticleRelease::class, 'release_at_grant_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Entitlement;
|
||||
|
||||
enum GrantStatus: string
|
||||
{
|
||||
case Aktiv = 'aktiv';
|
||||
case Ausgesetzt = 'ausgesetzt';
|
||||
case Widerrufen = 'widerrufen';
|
||||
case Abgelaufen = 'abgelaufen';
|
||||
}
|
||||
Reference in new issue
Block a user