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
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class AccountSeeder extends Seeder
+20 -21
View File
@@ -4,7 +4,6 @@
use App\Models\Action;
use App\Models\Decision;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ActionSeeder extends Seeder
@@ -17,34 +16,34 @@ public function run(): void
Action::create([
'name' => 'KLIC - IZHODNI',
'color_tag' => '',
'segment_id' => 1
'segment_id' => 1,
]);
Action::create([
'name' => 'KLIC - VHODNI',
'color_tag' => '',
'segment_id' => 1
'segment_id' => 1,
]);
Action::create([
'name' => 'ePOŠTA',
'color_tag' => '',
'segment_id' => 1
'segment_id' => 1,
]);
Action::create([
'name' => 'VROČANJE',
'color_tag' => '',
'segment_id' => 1
'segment_id' => 1,
]);
Action::create([
'name' => 'SMS',
'color_tag' => '',
'segment_id' => 1
'segment_id' => 1,
]);
//------- 1
// ------- 1
Decision::create([
'name' => 'Obljuba',
'color_tag' => '',
@@ -52,15 +51,15 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 1,
'decision_id' => 1
'decision_id' => 1,
]);
\DB::table('action_decision')->insert([
'action_id' => 2,
'decision_id' => 1
'decision_id' => 1,
]);
//------- 2
// ------- 2
Decision::create([
'name' => 'Poslana',
'color_tag' => '',
@@ -68,10 +67,10 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 3,
'decision_id' => 2
'decision_id' => 2,
]);
//-------- 3
// -------- 3
Decision::create([
'name' => 'Prejeta',
'color_tag' => '',
@@ -79,10 +78,10 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 3,
'decision_id' => 3
'decision_id' => 3,
]);
//--------- 4
// --------- 4
Decision::create([
'name' => 'Neuspešna',
'color_tag' => '',
@@ -90,10 +89,10 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 4,
'decision_id' => 4
'decision_id' => 4,
]);
//--------- 5
// --------- 5
Decision::create([
'name' => 'Uspešna',
'color_tag' => '',
@@ -101,10 +100,10 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 4,
'decision_id' => 5
'decision_id' => 5,
]);
//--------- 6
// --------- 6
Decision::create([
'name' => 'Poslan SMS',
'color_tag' => '',
@@ -112,10 +111,10 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 5,
'decision_id' => 6
'decision_id' => 6,
]);
//--------- 7
// --------- 7
Decision::create([
'name' => 'Prejet SMS',
'color_tag' => '',
@@ -123,7 +122,7 @@ public function run(): void
\DB::table('action_decision')->insert([
'action_id' => 5,
'decision_id' => 7
'decision_id' => 7,
]);
}
}
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ActivitySeeder extends Seeder
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ClientCaseSeeder extends Seeder
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ClientSeeder extends Seeder
+3 -7
View File
@@ -2,9 +2,7 @@
namespace Database\Seeders;
use App\Models\Contract;
use App\Models\ContractType;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ContractSeeder extends Seeder
@@ -12,16 +10,14 @@ class ContractSeeder extends Seeder
/**
* Run the database seeds.
*/
public function run(): void
{
$contractType = [
[ 'name' => 'delivery', 'description' => ''],
[ 'name' => 'leasing', 'description' => '']
['name' => 'delivery', 'description' => ''],
['name' => 'leasing', 'description' => ''],
];
foreach($contractType as $ct){
foreach ($contractType as $ct) {
ContractType::create($ct);
}
}
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DebtSeeder extends Seeder
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DecisionSeeder extends Seeder
+16 -1
View File
@@ -125,6 +125,21 @@ public function run(): void
],
'ui' => ['order' => 7],
],
[
'key' => 'case_objects',
'canonical_root' => 'case_object',
'label' => 'Case Objects',
'fields' => ['reference', 'name', 'description', 'type', 'contract_id'],
'aliases' => ['case_object', 'case_objects', 'object', 'objects', 'predmet', 'predmeti'],
'rules' => [
['pattern' => '/^(sklic|reference|ref)\b/i', 'field' => 'reference'],
['pattern' => '/^(ime|naziv|name|title)\b/i', 'field' => 'name'],
['pattern' => '/^(tip|vrsta|type|kind)\b/i', 'field' => 'type'],
['pattern' => '/^(komentar|opis|opomba|comment|description|note)\b/i', 'field' => 'description'],
['pattern' => '/^(contract\s*id|contract_id|pogodba\s*id|pogodba_id)\b/i', 'field' => 'contract_id'],
],
'ui' => ['order' => 8],
],
[
'key' => 'payments',
'canonical_root' => 'payment',
@@ -158,7 +173,7 @@ public function run(): void
['pattern' => '/^(datum|date|paid\s*at|payment\s*date)\b/i', 'field' => 'payment_date'],
['pattern' => '/^(znesek|amount|vplacilo|vplačilo|placilo|plačilo)\b/i', 'field' => 'amount'],
],
'ui' => ['order' => 8],
'ui' => ['order' => 9],
],
];
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PaymentSeeder extends Seeder
+37 -38
View File
@@ -19,54 +19,53 @@ public function run(): void
{
//
$personTypes = [
[ 'name' => 'legal', 'description' => ''],
[ 'name' => 'natural', 'description' => '']
['name' => 'legal', 'description' => ''],
['name' => 'natural', 'description' => ''],
];
$personGroups = [
[ 'name' => 'naročnik', 'description' => '', 'color_tag' => 'blue-500'],
[ 'name' => 'primer naročnika', 'description' => '', 'color_tag' => 'red-400']
['name' => 'naročnik', 'description' => '', 'color_tag' => 'blue-500'],
['name' => 'primer naročnika', 'description' => '', 'color_tag' => 'red-400'],
];
$phoneTypes = [
[ 'name' => 'mobile', 'description' => ''],
[ 'name' => 'telephone', 'description' => '']
['name' => 'mobile', 'description' => ''],
['name' => 'telephone', 'description' => ''],
];
$addressTypes = [
[ 'name' => 'permanent', 'description' => ''],
[ 'name' => 'temporary', 'description' => '']
['name' => 'permanent', 'description' => ''],
['name' => 'temporary', 'description' => ''],
];
$contractTypes = [
['name' => 'early', 'description' => ''],
['name' => 'hard', 'description' => '']
['name' => 'hard', 'description' => ''],
];
foreach($personTypes as $pt){
foreach ($personTypes as $pt) {
PersonType::create($pt);
}
foreach($personGroups as $pg){
foreach ($personGroups as $pg) {
PersonGroup::create($pg);
}
foreach($phoneTypes as $pt){
foreach ($phoneTypes as $pt) {
PhoneType::create($pt);
}
foreach($addressTypes as $at){
foreach ($addressTypes as $at) {
AddressType::create($at);
}
foreach($contractTypes as $ct){
foreach ($contractTypes as $ct) {
ContractType::create($ct);
}
//client
// client
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => '',
'last_name' => '',
'full_name' => 'Naročnik d.o.o.',
@@ -77,12 +76,12 @@ public function run(): void
'description' => 'sdwwf',
'group_id' => 1,
'type_id' => 1,
'user_id' => 1
'user_id' => 1,
])->client()->create();
//debtors
// debtors
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => 'test',
'last_name' => 'test',
'full_name' => 'test test',
@@ -93,13 +92,13 @@ public function run(): void
'description' => 'sdwwf',
'group_id' => 2,
'type_id' => 2,
'user_id' => 1
'user_id' => 1,
])->clientCase()->create([
'client_id' => 1
'client_id' => 1,
]);
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => 'test2',
'last_name' => 'test2',
'full_name' => 'test2 test2',
@@ -110,14 +109,14 @@ public function run(): void
'description' => 'dw323',
'group_id' => 2,
'type_id' => 2,
'user_id' => 1
'user_id' => 1,
])->clientCase()->create([
'client_id' => 1
'client_id' => 1,
]);
//client
// client
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => '',
'last_name' => '',
'full_name' => 'test d.o.o.',
@@ -128,12 +127,12 @@ public function run(): void
'description' => 'sdwwf',
'group_id' => 1,
'type_id' => 1,
'user_id' => 1
'user_id' => 1,
])->client()->create();
//debtors
// debtors
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => 'test3',
'last_name' => 'test3',
'full_name' => 'test3 test3',
@@ -144,15 +143,15 @@ public function run(): void
'description' => 'sdwwf',
'group_id' => 2,
'type_id' => 2,
'user_id' => 1
'user_id' => 1,
])->clientCase()->create(
[
'client_id' => 2
'client_id' => 2,
]
);
Person::create([
'nu' => rand(100000,200000),
'nu' => rand(100000, 200000),
'first_name' => '',
'last_name' => '',
'full_name' => 'test4 d.o.o.',
@@ -163,12 +162,12 @@ public function run(): void
'description' => 'dw323',
'group_id' => 2,
'type_id' => 1,
'user_id' => 1
'user_id' => 1,
])->clientCase()->create(
[
'client_id' => 2
'client_id' => 2,
]
);
}
}
-1
View File
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class PostSeeder extends Seeder
@@ -5,7 +5,6 @@
use App\Models\Permission;
use App\Models\Role;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Seeder;
class RolePermissionSeeder extends Seeder
+3 -4
View File
@@ -3,7 +3,6 @@
namespace Database\Seeders;
use App\Models\Segment;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class SegmentSeeder extends Seeder
@@ -14,11 +13,11 @@ class SegmentSeeder extends Seeder
public function run(): void
{
$sements = [
[ 'name' => 'global', 'description' => ''],
[ 'name' => 'terrain', 'description' => '']
['name' => 'global', 'description' => ''],
['name' => 'terrain', 'description' => ''],
];
foreach($sements as $st){
foreach ($sements as $st) {
Segment::create($st);
}
}
@@ -21,6 +21,7 @@ public function run(): void
if (! $user) {
$this->command?->warn("User {$email} not found nothing updated.");
return;
}