mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
Rental Service
Repair Service
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceContractEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_entities')->insert([
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 2,
|
||||
'contract_id' =>3,
|
||||
'entity_id' => 5,
|
||||
'entity_signature_id' => 5,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'entity_id' => 6,
|
||||
'entity_signature_id' =>6,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceContractObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 8,
|
||||
'user_id' => 2,
|
||||
'contract_obligation_id' => 11, // Librarian verify customer membership and book
|
||||
'depend_contract_obligation_id' => 10, // Customer select book (borrow) & show membership card
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'user_id' => 2,
|
||||
'contract_obligation_id' => 12, // Customer Get the book
|
||||
'depend_contract_obligation_id' => 11, // Librarian verify customer membership and book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 10,
|
||||
'user_id' => 2,
|
||||
'contract_obligation_id' => 13, // Customer Return book
|
||||
'depend_contract_obligation_id' => 12, // Customer Get the book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'user_id' => 2,
|
||||
'contract_obligation_id' => 14, // Librarian check the book
|
||||
'depend_contract_obligation_id' => 13, // Customer Return book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'user_id' => 2,
|
||||
'contract_obligation_id' => 15, // Librarian update customer borrow record
|
||||
'depend_contract_obligation_id' => 14, // Librarian check the book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class RenderServiceContractObligationsTableSeeder extends Seeder
|
||||
{
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligations')->insert([
|
||||
[
|
||||
'id' => 10,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'contract_template_obligation_id' => 10,
|
||||
'contract_entity_id' => 5,
|
||||
'name' => 'Customer select book (borrow) & show membership card',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.money'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => Carbon::now(),
|
||||
'end_at' => Carbon::now()->addDays(1),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'contract_template_obligation_id' => 11,
|
||||
'contract_entity_id' => 6,
|
||||
'name' => 'Librarian verify customer membership and book',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'contract_template_obligation_id' =>12,
|
||||
'contract_entity_id' => 5,
|
||||
'name' => 'Customer Get the book',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 13,
|
||||
'user_id' => 2,
|
||||
'contract_id' =>3,
|
||||
'contract_template_obligation_id' =>13,
|
||||
'contract_entity_id' => 5,
|
||||
'name' => 'Customer Return book',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>14,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'contract_template_obligation_id' =>14,
|
||||
'contract_entity_id' => 6,
|
||||
'name' => 'Librarian check the book',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 15,
|
||||
'user_id' => 2,
|
||||
'contract_id' => 3,
|
||||
'contract_template_obligation_id' =>15,
|
||||
'contract_entity_id' => 6,
|
||||
'name' => 'Librarian update customer borrow record',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceContractTemplateObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 8,
|
||||
'user_id' => 2,
|
||||
'contract_template_obligation_id' => 11, // Librarian verify customer membership and book
|
||||
'depend_contract_template_obligation_id' =>10, // Customer select book (borrow) & show membership card
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'user_id' => 2,
|
||||
'contract_template_obligation_id' => 12, // Customer Get the book
|
||||
'depend_contract_template_obligation_id' => 11, // Librarian verify customer membership and book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 10,
|
||||
'user_id' => 2,
|
||||
'contract_template_obligation_id' => 13, // Customer Return book
|
||||
'depend_contract_template_obligation_id' => 12, // Customer Get the book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'user_id' => 2,
|
||||
'contract_template_obligation_id' => 14, // Librarian check the book
|
||||
'depend_contract_template_obligation_id' => 13, // Customer Return book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'user_id' => 3,
|
||||
'contract_template_obligation_id' => 15, // Librarian update customer borrow record
|
||||
'depend_contract_template_obligation_id' => 14, // Librarian check the book
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceContractTemplateObligationsTableSeeder extends Seeder
|
||||
{
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligations')->insert([
|
||||
[
|
||||
'id' => 10,
|
||||
'user_id' => 2,
|
||||
'contract_template_id' => 3,//contract table 3 is Book Rental
|
||||
'name' => 'Customer select book (borrow) & show membership card',
|
||||
'sequence' => 1.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.money'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'user_id' => 2,
|
||||
'contract_template_id' => 3,//contract table 3 is Book Rental
|
||||
'name' => 'Librarian verify customer membership and book',
|
||||
'sequence' => 2.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'user_id' => 2,
|
||||
'contract_template_id' => 3,//contract table 3 is Book Rental
|
||||
'name' => 'Customer Get the book',
|
||||
'sequence' => 3.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 14,
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>13,
|
||||
'user_id' => 2,
|
||||
'contract_template_id' => 3,//contract table 3 is Book Rental
|
||||
'name' => 'Customer Return book',
|
||||
'sequence' => 4.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>14,
|
||||
'user_id' => 2,
|
||||
'contract_template_id' => 1,
|
||||
'name' => 'Librarian check the book',
|
||||
'sequence' => 5.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>15,
|
||||
'user_id' => 3,
|
||||
'contract_template_id' => 1,
|
||||
'name' => 'Librarian update customer borrow record',
|
||||
'sequence' => 6.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceContractTemplatesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_templates')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => 4,
|
||||
'name' => 'Book Rental',
|
||||
'complete_day_range' => 14,
|
||||
'status' => config('constants.contact.status.active'),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use App\Models\ContractTemplate;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class RenderServiceContractsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$contract_template = ContractTemplate::find(3);
|
||||
|
||||
DB::table('contracts')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => $contract_template->user_id,
|
||||
'contract_template_id' => $contract_template->id,
|
||||
'name' => $contract_template->name,
|
||||
'in_time_contract_template' => json_encode($contract_template),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => Carbon::now(),
|
||||
'end_at' => Carbon::now()->addDays($contract_template->complete_day_range),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entities')->insert([
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 2,
|
||||
'name' => 'Customer',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 2,
|
||||
'name' => 'Librarian',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RenderService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RenderServiceSignaturesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entity_signatures')->insert([
|
||||
[
|
||||
'id' => 5,
|
||||
'entity_id' => 5,
|
||||
'type' => config('constants.entity.signature.master_key'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'entity_id' => 6,
|
||||
'type' => config('constants.entity.signature.master_key'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceContractEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_entities')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => 3,
|
||||
'contract_id' =>2,
|
||||
'entity_id' => 3,
|
||||
'entity_signature_id' => 3,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 2,
|
||||
'entity_id' => 4,
|
||||
'entity_signature_id' =>4,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceContractObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 5, // Repair Guy check/analysis Car
|
||||
'depend_contract_obligation_id' => 4, // Car Owner send car to workshop and explain/describe the problem to Repair Guy
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 6, // Repair Guy repair car
|
||||
'depend_contract_obligation_id' => 5, // Repair Guy check/analysis Car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 3,
|
||||
'contract_obligation_id' => 7, // Car Owner pay repair fees
|
||||
'depend_contract_obligation_id' => 6, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 3,
|
||||
'contract_obligation_id' => 8, // Car Owner check car
|
||||
'depend_contract_obligation_id' => 6, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'user_id' => 3,
|
||||
'contract_obligation_id' => 9, // Repair Service complete & Car Owner drive car back home
|
||||
'depend_contract_obligation_id' => 7, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class RepairServiceContractObligationsTableSeeder extends Seeder
|
||||
{
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligations')->insert([
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 3,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' => 4,
|
||||
'contract_entity_id' => 3,
|
||||
'name' => 'Car Owner send car to workshop and explain/describe the problem to Repair Guy',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.money'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => Carbon::now(),
|
||||
'end_at' => Carbon::now()->addDays(1),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' => 5,
|
||||
'contract_entity_id' => 4,
|
||||
'name' => 'Repair Guy check/analysis Car',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' =>6,
|
||||
'contract_entity_id' => 4,
|
||||
'name' => 'Repair Guy repair car',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'user_id' => 3,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' =>7,
|
||||
'contract_entity_id' => 3,
|
||||
'name' => 'Car Owner pay repair fees',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'user_id' => 3,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' =>8,
|
||||
'contract_entity_id' => 3,
|
||||
'name' => 'Car Owner check car',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'user_id' => 3,
|
||||
'contract_id' => 2,
|
||||
'contract_template_obligation_id' =>9,
|
||||
'contract_entity_id' => 3,
|
||||
'name' => 'Repair Service complete & Car Owner drive car back home',
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_status' => config('constants.contract_obligation.complete_status.pending'),
|
||||
'accept_status' => config('constants.contract_obligation.accept_status.pending'),
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'in_time_contract_obligation_template' => json_encode([]),
|
||||
'status' => 1,
|
||||
'completed_at' => Carbon::now(),
|
||||
'failed_at' => null,
|
||||
'start_at' => null,
|
||||
'end_at' => null,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceContractTemplateObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 5, // Repair Guy check/analysis Car
|
||||
'depend_contract_template_obligation_id' =>4, // Car Owner send car to workshop and explain/describe the problem to Repair Guy
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 6, // Repair Guy repair car
|
||||
'depend_contract_template_obligation_id' => 5, // Repair Guy check/analysis Car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 3,
|
||||
'contract_template_obligation_id' => 7, // Car Owner pay repair fees
|
||||
'depend_contract_template_obligation_id' => 6, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 3,
|
||||
'contract_template_obligation_id' => 8, // Car Owner check car
|
||||
'depend_contract_template_obligation_id' => 6, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'user_id' => 3,
|
||||
'contract_template_obligation_id' => 9, // Repair Service complete & Car Owner drive car back home
|
||||
'depend_contract_template_obligation_id' => 7, // Repair Guy repair car
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceContractTemplateObligationsTableSeeder extends Seeder
|
||||
{
|
||||
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligations')->insert([
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 3,
|
||||
'contract_template_id' => 2,//contract table 2 is repair service
|
||||
'name' => 'Car Owner send car to workshop and explain/describe the problem to Repair Guy',
|
||||
'sequence' => 1.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.money'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 2,//contract table 2 is repair service
|
||||
'name' => 'Repair Guy check/analysis Car',
|
||||
'sequence' => 2.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 2,//contract table 2 is repair service
|
||||
'name' => 'Repair Guy repair car',
|
||||
'sequence' => 3.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.offer_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>7,
|
||||
'user_id' => 3,
|
||||
'contract_template_id' => 1,
|
||||
'name' => 'Car Owner pay repair fees',
|
||||
'sequence' => 4.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>8,
|
||||
'user_id' => 3,
|
||||
'contract_template_id' => 1,
|
||||
'name' => 'Car Owner check car',
|
||||
'sequence' => 5.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' =>9,
|
||||
'user_id' => 3,
|
||||
'contract_template_id' => 1,
|
||||
'name' => 'Repair Service complete & Car Owner drive car back home',
|
||||
'sequence' => 6.0,
|
||||
'reference' => null,
|
||||
'content' => null,
|
||||
'must_complete' => 1,
|
||||
'must_accept' => 1,
|
||||
'complete_day_range' => 1,
|
||||
'type' => config('constants.contract_obligation.type.received_service'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceContractTemplatesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_templates')->insert([
|
||||
[
|
||||
'id' => 2,
|
||||
'user_id' => 4,
|
||||
'name' => 'Repair Car Service',
|
||||
'complete_day_range' => 1,
|
||||
'status' => config('constants.contact.status.active'),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use App\Models\ContractTemplate;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class RepairServiceContractsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$contract_template = ContractTemplate::find(2);
|
||||
|
||||
DB::table('contracts')->insert([
|
||||
[
|
||||
'id' => 2,
|
||||
'user_id' => $contract_template->user_id,
|
||||
'contract_template_id' => $contract_template->id,
|
||||
'name' => $contract_template->name,
|
||||
'in_time_contract_template' => json_encode($contract_template),
|
||||
'status' => 1,
|
||||
'completed_at' => null,
|
||||
'failed_at' => null,
|
||||
'start_at' => Carbon::now(),
|
||||
'end_at' => Carbon::now()->addDays($contract_template->complete_day_range),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entities')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'user_id' => 2,
|
||||
'name' => 'Car Owner',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'user_id' => 2,
|
||||
'name' => 'Repair Guy',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\RepairService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class RepairServiceSignaturesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entity_signatures')->insert([
|
||||
[
|
||||
'id' => 3,
|
||||
'entity_id' => 3,
|
||||
'type' => config('constants.entity.signature.master_key'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'entity_id' => 4,
|
||||
'type' => config('constants.entity.signature.master_key'),
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user