-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from bildvitta/develop
Develop to Master
- Loading branch information
Showing
30 changed files
with
1,429 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
'base_uri' => env('MS_CRM_BASE_URI', 'https://api.almobi.com.br'), | ||
'base_uri' => env('MS_CRM_BASE_URI', 'https://crm-server.nave.dev.br'), | ||
'prefix' => env('MS_CRM_API_PREFIX', '/api'), | ||
|
||
'front_uri' => env('MS_HUB_FRONT_URI', 'https://develop.crm.nave.dev'), | ||
'front_uri' => env('MS_HUB_FRONT_URI', 'https://crm.nave.dev.br'), | ||
|
||
'redirects' => [ | ||
'customers' => [ | ||
'show' => '/customers/%s' | ||
] | ||
] | ||
], | ||
|
||
'db' => [ | ||
'host' => env('MS_CRM_DB_HOST'), | ||
'port' => env('MS_CRM_DB_PORT'), | ||
'database' => env('MS_CRM_DB_DATABASE'), | ||
'username' => env('MS_CRM_DB_USERNAME'), | ||
'password' => env('MS_CRM_DB_PASSWORD'), | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class Bank extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'banks'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CarType extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'car_types'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models; | ||
|
||
use Bildvitta\IssCrm\Models\Hub\HubCompany; | ||
use Bildvitta\IssCrm\Scopes\Channel\CompanyScope; | ||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class Channel extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'channels'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
protected static function booted() | ||
{ | ||
static::addGlobalScope(new CompanyScope()); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
|
||
public function channel() | ||
{ | ||
return $this->belongsTo(Channel::class, 'channel_id', 'id'); | ||
} | ||
|
||
public function channels() | ||
{ | ||
return $this->hasMany(Channel::class, 'channel_id', 'id'); | ||
} | ||
|
||
public function hub_company() | ||
{ | ||
return $this->belongsTo(HubCompany::class, 'company_id', 'id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CivilStatus extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'civil_statuses'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models\CreditProcess; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CreditAgent extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'credit_agents'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
|
||
public function credit_agent_queues() | ||
{ | ||
return $this->hasMany(CreditAgentQueue::class, 'credit_agent_id', 'id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models\CreditProcess; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CreditAgentQueue extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'credit_agent_queues'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
|
||
public function credit_agent() | ||
{ | ||
return $this->belongsTo(CreditAgent::class, 'credit_agent_id', 'id')->withTrashed(); | ||
} | ||
|
||
public function credit_agent_statuses() | ||
{ | ||
return $this->hasMany(CreditAgentStatus::class, 'credit_agent_queue_id', 'id'); | ||
} | ||
|
||
public function credit_processes() | ||
{ | ||
return $this->hasMany(CreditProcess::class, 'credit_agent_queue_id', 'id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Bildvitta\IssCrm\Models\CreditProcess; | ||
|
||
use Bildvitta\IssCrm\Traits\UsesCrmDB; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\SoftDeletes; | ||
use Ramsey\Uuid\Uuid; | ||
|
||
class CreditAgentStatus extends Model | ||
{ | ||
use UsesCrmDB; | ||
use SoftDeletes; | ||
|
||
protected $connection = 'iss-crm'; | ||
|
||
protected $table = 'credit_agent_statuses'; | ||
|
||
protected $guard_name = 'web'; | ||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
self::creating(function ($model) { | ||
$model->uuid = (string)Uuid::uuid4(); | ||
}); | ||
} | ||
|
||
public function getRouteKeyName() | ||
{ | ||
return 'uuid'; | ||
} | ||
|
||
// | ||
|
||
public function credit_agent_queue() | ||
{ | ||
return $this->belongsTo(CreditAgentQueue::class, 'credit_agent_queue_id', 'id')->withTrashed(); | ||
} | ||
|
||
public function credit_processes() | ||
{ | ||
return $this->hasMany(CreditProcess::class, 'credit_agent_status_id', 'id'); | ||
} | ||
} |
Oops, something went wrong.