changes to sms packages and option to create user

This commit is contained in:
Simon Pocrnjič
2025-11-06 21:54:07 +01:00
parent ad8e0d5cee
commit 1395b72ae8
102 changed files with 1386 additions and 319 deletions
+2 -2
View File
@@ -13,6 +13,7 @@ class Action extends Model
{
/** @use HasFactory<\Database\Factories\ActionFactory> */
use HasFactory;
use Searchable;
protected $fillable = ['name', 'color_tag', 'segment_id'];
@@ -26,10 +27,9 @@ public function segment(): BelongsTo
{
return $this->belongsTo(\App\Models\Segment::class);
}
public function activities(): HasMany
{
return $this->hasMany(\App\Models\Activity::class);
}
}
+7 -8
View File
@@ -3,22 +3,23 @@
namespace App\Models;
use App\Traits\Uuid;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Builder;
use Laravel\Scout\Searchable;
class Client extends Model
{
/** @use HasFactory<\Database\Factories\ClientFactory> */
use HasFactory;
use Uuid;
use Searchable;
use Uuid;
protected $fillable = [
'person_id'
'person_id',
];
protected $hidden = [
@@ -26,8 +27,7 @@ class Client extends Model
'person_id',
];
protected function makeAllSearchableUsing(Builder $query): Builder
protected function makeAllSearchableUsing(Builder $query): Builder
{
return $query->with('person');
}
@@ -37,12 +37,11 @@ public function toSearchableArray(): array
return [
'person.full_name' => '',
'person_addresses.address' => ''
'person_addresses.address' => '',
];
}
public function person(): BelongsTo
public function person(): BelongsTo
{
return $this->belongsTo(\App\Models\Person\Person::class);
}
+2
View File
@@ -55,6 +55,7 @@ protected function startDate(): Attribute
return null;
}
$str = is_string($value) ? $value : (string) $value;
return \App\Services\DateNormalizer::toDate($str);
}
);
@@ -71,6 +72,7 @@ protected function endDate(): Attribute
return null;
}
$str = is_string($value) ? $value : (string) $value;
return \App\Services\DateNormalizer::toDate($str);
}
);
+1 -1
View File
@@ -11,7 +11,7 @@ class ImportEvent extends Model
use HasFactory;
protected $fillable = [
'import_id','user_id','event','level','message','context','import_row_id'
'import_id', 'user_id', 'event', 'level', 'message', 'context', 'import_row_id',
];
protected $casts = [
+1 -1
View File
@@ -11,7 +11,7 @@ class ImportTemplateMapping extends Model
use HasFactory;
protected $fillable = [
'import_template_id', 'entity', 'source_column', 'target_field', 'transform', 'apply_mode', 'options', 'position'
'import_template_id', 'entity', 'source_column', 'target_field', 'transform', 'apply_mode', 'options', 'position',
];
protected $casts = [
+1 -1
View File
@@ -29,7 +29,7 @@ class MailProfile extends Model
protected static function booted(): void
{
static::created(function (MailProfile $profile): void {
\Log::info('mail_profile.created', [
'id' => $profile->id,
'name' => $profile->name,
-1
View File
@@ -15,5 +15,4 @@ public function persons(): HasMany
{
return $this->hasMany(\App\Models\Person\Person::class);
}
}
+1 -3
View File
@@ -4,7 +4,6 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class PersonType extends Model
@@ -14,12 +13,11 @@ class PersonType extends Model
protected $fillable = [
'name',
'description'
'description',
];
public function persons(): HasMany
{
return $this->hasMany(\App\Models\Person\Person::class);
}
}
+1
View File
@@ -13,6 +13,7 @@ class Post extends Model
public function toSearchableArray()
{
$array = $this->toArray();
return $array;
}
}
+6 -4
View File
@@ -15,22 +15,24 @@ class Segment extends Model
'name',
'description',
'active',
'exclude'
'exclude',
];
protected function casts(): array
{
return [
'active' => 'boolean',
'exclude' => 'boolean'
'exclude' => 'boolean',
];
}
public function contracts(): BelongsToMany {
public function contracts(): BelongsToMany
{
return $this->belongsToMany(\App\Models\Contract::class);
}
public function clientCase(): BelongsToMany {
public function clientCase(): BelongsToMany
{
return $this->belongsToMany(\App\Models\ClientCase::class)->withTimestamps();
}
}