feat(tenant): separate admin and storefront website types
This commit is contained in:
@@ -2,18 +2,19 @@
|
||||
|
||||
namespace App\Domains\Integration\Models;
|
||||
|
||||
use App\Domains\Tenant\Models\WebsiteType;
|
||||
use App\Domains\Tenant\Models\AdminWebsiteType;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class WebsiteTypeIntegration extends Model
|
||||
class AdminWebsiteTypeIntegration extends Model
|
||||
{
|
||||
protected $fillable = ['website_type_code', 'integration_code', 'integration_instance_id'];
|
||||
protected $table = 'admin_website_type_integrations';
|
||||
protected $fillable = ['admin_website_type_code', 'integration_code', 'integration_instance_id'];
|
||||
|
||||
/** @return BelongsTo<WebsiteType, $this> */
|
||||
public function websiteType(): BelongsTo
|
||||
/** @return BelongsTo<AdminWebsiteType, $this> */
|
||||
public function adminWebsiteType(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(WebsiteType::class, 'website_type_code', 'codigo');
|
||||
return $this->belongsTo(AdminWebsiteType::class, 'admin_website_type_code', 'codigo');
|
||||
}
|
||||
|
||||
/** @return BelongsTo<Integration, $this> */
|
||||
@@ -34,9 +34,9 @@ class Integration extends Model
|
||||
return $this->hasMany(ClientIntegration::class, 'integration_code', 'integration_code');
|
||||
}
|
||||
|
||||
/** @return HasMany<WebsiteTypeIntegration, $this> */
|
||||
/** @return HasMany<AdminWebsiteTypeIntegration, $this> */
|
||||
public function websiteTypeIntegrations(): HasMany
|
||||
{
|
||||
return $this->hasMany(WebsiteTypeIntegration::class, 'integration_code', 'integration_code');
|
||||
return $this->hasMany(AdminWebsiteTypeIntegration::class, 'integration_code', 'integration_code');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ class IntegrationInstance extends Model
|
||||
return $this->hasMany(ClientIntegration::class);
|
||||
}
|
||||
|
||||
/** @return HasMany<WebsiteTypeIntegration, $this> */
|
||||
/** @return HasMany<AdminWebsiteTypeIntegration, $this> */
|
||||
public function websiteTypeIntegrations(): HasMany
|
||||
{
|
||||
return $this->hasMany(WebsiteTypeIntegration::class);
|
||||
return $this->hasMany(AdminWebsiteTypeIntegration::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user