migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Authentication\Models\Restaurant;
|
||||
use Modules\Authentication\Models\User;
|
||||
|
||||
class SupportTicket extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'readable_ticket_id',
|
||||
'user_id',
|
||||
'category_id',
|
||||
'title',
|
||||
'description',
|
||||
'purchase_code',
|
||||
'status',
|
||||
'read',
|
||||
'related_url',
|
||||
'support_plan',
|
||||
'attachments',
|
||||
'last_conversation_time',
|
||||
'last_respond_by_client_at',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'attachments' => 'array', // Cast attachments to an array
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_tickets';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class)->select('id', 'first_name', 'last_name', 'email');
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(SupportTicketCategory::class, 'category_id')->select('id', 'name');
|
||||
}
|
||||
|
||||
public function restaurant()
|
||||
{
|
||||
return $this->belongsTo(Restaurant::class)->select('id', 'name');
|
||||
}
|
||||
|
||||
public function lastTicketConversation()
|
||||
{
|
||||
return $this->hasOne(SupportTicketLastConversation::class, 'ticket_id');
|
||||
}
|
||||
|
||||
public function supportLicenses()
|
||||
{
|
||||
return $this->hasMany(SupportTicketLicense::class, 'ticket_id');
|
||||
}
|
||||
|
||||
public function conversations()
|
||||
{
|
||||
return $this->hasMany(SupportTicketConversation::class, 'ticket_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicketCategory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'description',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_categories';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Modules\Authentication\Models\User;
|
||||
|
||||
class SupportTicketConversation extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'ticket_id',
|
||||
'user_id',
|
||||
'message',
|
||||
'attachments',
|
||||
'user_type',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_conversations';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SupportTicket::class)->select('id', 'user_id', 'title', 'status');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->select('id', 'first_name', 'last_name', 'user_type');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicketFAQ extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'question',
|
||||
'answer',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_f_a_q_s';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicketIpInfo extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'ip_address',
|
||||
'country',
|
||||
'division',
|
||||
'city',
|
||||
'zip_code',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'device_type',
|
||||
'browser',
|
||||
'operating_system',
|
||||
'login_at',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_ip_infos';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicketLastConversation extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'ticket_id',
|
||||
'user_id',
|
||||
'message',
|
||||
'user_type',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_last_conversations';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SupportTicket\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SupportTicketLicense extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'ticket_id',
|
||||
'license_code',
|
||||
'expires_date',
|
||||
'transaction_id',
|
||||
'user_id',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'support_ticket_licenses';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
Reference in New Issue
Block a user