mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
courier deliver service seeder
This commit is contained in:
@@ -149,8 +149,6 @@ class ContractModule extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// log
|
||||
ContractModule::makeLog($contract->id, 'user (' . Auth::guard('user-api')->user()->id . ') created');
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ class ContractObligation extends Model
|
||||
public function getContractObligationDependencyListAttribute()
|
||||
{
|
||||
return $this->contract_obligation_dependency()
|
||||
->where('status', config('constants.contract_obligation.status.active'))
|
||||
// ->where('status', config('constants.contract_obligation.status.active'))
|
||||
->get()->makeHidden(['contract_obligation_list', 'depend_contract_obligation_list']);
|
||||
}
|
||||
|
||||
public function getDependContractObligationDependencyListAttribute()
|
||||
{
|
||||
return $this->depend_contract_obligation_dependency()
|
||||
->where('status', config('constants.contract_obligation.status.active'))
|
||||
// ->where('status', config('constants.contract_obligation.status.active'))
|
||||
->get()->makeHidden(['contract_obligation_list', 'depend_contract_obligation_list']);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,65 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Http\Helpers\Hasher;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ContractObligationDependency extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'contract_obligation_dependencies';
|
||||
|
||||
protected $appends = [
|
||||
'hash_id',
|
||||
'contract_obligation_hash_id',
|
||||
'depend_contract_obligation_hash_id',
|
||||
'contract_obligation_list',
|
||||
'depend_contract_obligation_list'
|
||||
];
|
||||
|
||||
public function contract_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractObligation', 'contract_obligation_id');
|
||||
}
|
||||
|
||||
public function depend_contract_obligation()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractObligation', 'depend_contract_obligation_id');
|
||||
}
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_obligation_dependencies', $this->id);
|
||||
}
|
||||
|
||||
public function getContractObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_obligations', $this->contract_obligation_id);
|
||||
}
|
||||
|
||||
public function getDependContractObligationHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_obligations', $this->depend_contract_obligation_id);
|
||||
}
|
||||
|
||||
public function getContractObligationListAttribute()
|
||||
{
|
||||
return $this->contract_obligation()->get()->makeHidden(['contract_obligation_dependency_list']);
|
||||
}
|
||||
|
||||
public function getDependContractObligationListAttribute()
|
||||
{
|
||||
return $this->depend_contract_obligation()->get()->makeHidden(['contract_obligation_dependency_list']);
|
||||
}
|
||||
|
||||
public function getUpdatedAtAttribute($date)
|
||||
{
|
||||
return $date ? Carbon::parse($date)->timezone('Asia/Kuala_Lumpur')->format('Y-m-d') : '';
|
||||
}
|
||||
|
||||
public function getCreatedAtAttribute($date)
|
||||
{
|
||||
return $date ? Carbon::parse($date)->timezone('Asia/Kuala_Lumpur')->format('Y-m-d') : '';
|
||||
}
|
||||
}
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceContractEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_entities')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'entity_id' => 101,
|
||||
'entity_signature_id' => 101,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 102,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'entity_id' => 102,
|
||||
'entity_signature_id' => 102,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 103,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'entity_id' => 103,
|
||||
'entity_signature_id' => 103,
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceContractObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 102, // seller requst J&T deliver service
|
||||
'depend_contract_obligation_id' => 101, // user made payment to seller
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 102,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 103, // J&T provide service to seller
|
||||
'depend_contract_obligation_id' => 102, // seller requst J&T deliver service
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 103,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 104, // seller pack up the parcel and wait J&T pick up
|
||||
'depend_contract_obligation_id' => 103, // J&T provide service to seller
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 104,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 105, // J&T picke up seller parcel
|
||||
'depend_contract_obligation_id' => 104, // seller pack up the parcel and wait J&T pick up
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 105,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 106, // J&T deliver parcel to user
|
||||
'depend_contract_obligation_id' => 105, // J&T picke up seller parcel
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 106,
|
||||
'user_id' => 4,
|
||||
'contract_obligation_id' => 107, // user recieve parcel
|
||||
'depend_contract_obligation_id' => 106, // J&T deliver parcel to user
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CourierDeliverServiceContractObligationsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
// user made payment to seller
|
||||
// seller requst J&T deliver service
|
||||
// J&T provide service to seller
|
||||
// seller pack up the parcel and wait J&T pick up
|
||||
// J&T picke up seller parcel
|
||||
// J&T deliver parcel to user
|
||||
// user recieve parcel
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligations')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 101,
|
||||
'contract_entity_id' => 101,
|
||||
'name' => 'user made payment to seller',
|
||||
'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' => 102,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 102,
|
||||
'contract_entity_id' => 102,
|
||||
'name' => 'seller requst J&T deliver service',
|
||||
'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' => 103,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 103,
|
||||
'contract_entity_id' => 103,
|
||||
'name' => 'J&T provide service to seller',
|
||||
'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' => 104,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 104,
|
||||
'contract_entity_id' => 102,
|
||||
'name' => 'seller pack up the parcel and wait J&T pick up',
|
||||
'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' => 105,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 105,
|
||||
'contract_entity_id' => 103,
|
||||
'name' => 'J&T picke up seller parcel',
|
||||
'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' => 106,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 106,
|
||||
'contract_entity_id' => 103,
|
||||
'name' => 'J&T deliver parcel to user',
|
||||
'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' => 107,
|
||||
'user_id' => 4,
|
||||
'contract_id' => 101,
|
||||
'contract_template_obligation_id' => 107,
|
||||
'contract_entity_id' => 101,
|
||||
'name' => 'user recieve parcel',
|
||||
'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')
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceContractTemplateObligationDependenciesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligation_dependencies')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 102, // seller requst J&T deliver service
|
||||
'depend_contract_template_obligation_id' => 101, // user made payment to seller
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 102,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 103, // J&T provide service to seller
|
||||
'depend_contract_template_obligation_id' => 102, // seller requst J&T deliver service
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 103,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 104, // seller pack up the parcel and wait J&T pick up
|
||||
'depend_contract_template_obligation_id' => 103, // J&T provide service to seller
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 104,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 105, // J&T picke up seller parcel
|
||||
'depend_contract_template_obligation_id' => 104, // seller pack up the parcel and wait J&T pick up
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 105,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 106, // J&T deliver parcel to user
|
||||
'depend_contract_template_obligation_id' => 105, // J&T picke up seller parcel
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 106,
|
||||
'user_id' => 4,
|
||||
'contract_template_obligation_id' => 107, // user recieve parcel
|
||||
'depend_contract_template_obligation_id' => 106, // J&T deliver parcel to user
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CourierDeliverServiceContractTemplateObligationsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
// user made payment to seller
|
||||
// seller requst J&T deliver service
|
||||
// J&T provide service to seller
|
||||
// seller pack up the parcel and wait J&T pick up
|
||||
// J&T picke up seller parcel
|
||||
// J&T deliver parcel to user
|
||||
// user recieve parcel
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligations')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'user made payment to seller',
|
||||
'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' => 102,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'seller requst J&T deliver service',
|
||||
'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' => 103,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'J&T provide service to seller',
|
||||
'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' => 104,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'seller pack up the parcel and wait J&T pick up',
|
||||
'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' => 105,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'J&T picke up seller parcel',
|
||||
'sequence' => 5.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' => 106,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'J&T deliver parcel to user',
|
||||
'sequence' => 6.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' => 107,
|
||||
'user_id' => 4,
|
||||
'contract_template_id' => 101,
|
||||
'name' => 'user recieve parcel',
|
||||
'sequence' => 7.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')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceContractTemplateTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_templates')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'name' => 'J&T Contract Deliver Service',
|
||||
'complete_day_range' => 7,
|
||||
'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,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceEntitiesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entities')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'user_id' => 4,
|
||||
'name' => 'Siti Nurhaliza',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 102,
|
||||
'user_id' => 4,
|
||||
'name' => 'H&M',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 103,
|
||||
'user_id' => 4,
|
||||
'name' => 'J&T Deliver Man',
|
||||
'status' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class CourierDeliverServiceEntitySignaturesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('entity_signatures')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'entity_id' => 101,
|
||||
'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' => 102,
|
||||
'entity_id' => 102,
|
||||
'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' => 103,
|
||||
'entity_id' => 103,
|
||||
'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,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\CourierDeliverService;
|
||||
|
||||
use App\Models\ContractTemplate;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CourierDeliverServicesContractTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$contract_template = ContractTemplate::find(101);
|
||||
|
||||
DB::table('contracts')->insert([
|
||||
[
|
||||
'id' => 101,
|
||||
'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')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,18 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(SodaVendorMachine\SodaVendorContractObligationsTableSeeder::class);
|
||||
$this->call(SodaVendorMachine\SodaVendorContractObligationDependenciesTableSeeder::class);
|
||||
|
||||
// Courier Deliver Servive
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractTemplateTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractTemplateObligationsTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractTemplateObligationDependenciesTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceEntitiesTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceEntitySignaturesTableSeeder::class);
|
||||
|
||||
$this->call(CourierDeliverService\CourierDeliverServicesContractTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractEntitiesTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractObligationsTableSeeder::class);
|
||||
$this->call(CourierDeliverService\CourierDeliverServiceContractObligationDependenciesTableSeeder::class);
|
||||
|
||||
DB::commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ class SodaVendorContractObligationsTableSeeder extends Seeder
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
// user insert coin and select soda at vendor machine
|
||||
// vendor machine drop selected soda to user
|
||||
// user pickup the soda
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_obligations')->insert([
|
||||
|
||||
+5
@@ -13,6 +13,11 @@ class SodaVendorContractTemplateObligationsTableSeeder extends Seeder
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
// user insert coin and select soda at vendor machine
|
||||
// vendor machine drop selected soda to user
|
||||
// user pickup the soda
|
||||
|
||||
public function run()
|
||||
{
|
||||
DB::table('contract_template_obligations')->insert([
|
||||
|
||||
@@ -21,7 +21,7 @@ class SodaVendorContractTemplatesTableSeeder extends Seeder
|
||||
'user_id' => 2,
|
||||
'name' => 'Coca Cola Contract Service',
|
||||
'complete_day_range' => 1,
|
||||
'status' => 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')
|
||||
]
|
||||
|
||||
@@ -57,6 +57,20 @@ class UsersTableSeeder extends Seeder
|
||||
'login_at' => date('Y-m-d H:i:s'),
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'first_name' => 'J&T',
|
||||
'last_name' => 'project',
|
||||
'username' => 'J&T',
|
||||
'email' => 'one@j-t.com',
|
||||
'password' => bcrypt('pass123'),
|
||||
'img' => null,
|
||||
'status' => 1,
|
||||
'active_at' => date('Y-m-d H:i:s'),
|
||||
'login_at' => date('Y-m-d H:i:s'),
|
||||
'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