<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Get the migration connection name.
*/
public function getConnection(): ?string
{
return config('telescope.storage.database.connection');
}
/**
* Run the migrations.
*/
public function up(): void
{
$schema = Schema::connection($this->getConnection());
$schema->create('telescope_entries', function (Blueprint $table) {
$table->bigIncrements('sequence');
$table->uuid('uuid');
$table->uuid('batch_id');
$table->string('family_hash')->nullable();
$table->boolean('should_display_on_index')->default(true);
$table->string('type', 20);
$table->longText('content');
$table->dateTime('created_at')->nullable();
$table->unique('uuid');
$table->index('batch_id');
$table->index('family_hash');
$table->index('created_at');
$table->index(['type', 'should_display_on_index']);
});
$schema->create('telescope_entries_tags', function (Blueprint $table) {
$table->uuid('entry_uuid');
$table->string('tag');
$table->primary(['entry_uuid', 'tag']);
$table->index('tag');
$table->foreign('entry_uuid')
->references('uuid')
->on('telescope_entries')
->onDelete('cascade');
});
$schema->create('telescope_monitoring', function (Blueprint $table) {
$table->string('tag')->primary();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$schema = Schema::connection($this->getConnection());
$schema->dropIfExists('telescope_entries_tags');
$schema->dropIfExists('telescope_entries');
$schema->dropIfExists('telescope_monitoring');
}
};
...@@ -13,14 +13,9 @@ return new class extends Migration ...@@ -13,14 +13,9 @@ return new class extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('company_types', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('uid');
$table->string('name'); $table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps(); $table->timestamps();
}); });
} }
...@@ -32,6 +27,6 @@ return new class extends Migration ...@@ -32,6 +27,6 @@ return new class extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('users'); Schema::dropIfExists('company_types');
} }
}; };
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('companies', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('company_type_id');
$table->foreign('company_type_id')->references('id')->on('company_types')->onDelete('cascade');
$table->string("name", 50);
$table->string("name_en", 50);
$table->longText("address");
$table->string("district");
$table->string("sub_province");
$table->string("province");
$table->string("postcode");
$table->string("contry_code");
$table->string("phone");
$table->string("fax");
$table->string("tax",13);
$table->string("branch");
$table->string("tax_incentive");
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('companies');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('groups', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->unsignedBigInteger('company_id');
$table->foreign('company_id')->references('id')->on('companies');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('groups');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permissions', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('description');
$table->string('permission_group_name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('permissions');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menues', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('menues');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permission_role', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('role_id');
$table->unsignedBigInteger('permission_id');
$table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('permission_role');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('menu_role', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('role_id');
$table->unsignedBigInteger('menu_id');
$table->foreign('menu_id')->references('id')->on('menues')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('menu_role');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('group_role', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('group_id');
$table->unsignedBigInteger('role_id');
$table->foreign('group_id')->references('id')->on('groups')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('group_role');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('group_user', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('group_id');
$table->unsignedBigInteger('user_id');
$table->foreign('group_id')->references('id')->on('groups')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('group_user');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('companies', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('companies', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_master_messages', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('value');
$table->timestamps();
});
DB::table('mr_master_messages')->insert([
[
'name' => 'export',
'value' => 'EXPORT',
],
[
'name' => 'import',
'value' => 'IMPORT',
],
[
'name' => 'gcl',
'value' => 'GCL',
],
[
'name' => 'short',
'value' => 'SHORT',
]
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_master_messages');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('mr_master_response_templates');
Schema::create('mr_master_response_templates', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('mid');
$table->string('code');
$table->string('type');
$table->string('name');
$table->string('description');
$table->text('template');
$table->timestamps();
// Foreign key constraint
// onDelete('cascade'); means when delete data from main table, sub table will be deleted too.
$table->foreign('mid')->references('id')->on('master_messages')->onDelete('cascade');
});
DB::table('mr_master_response_templates')->insert([
//Export
[
'mid' => 1,
'code' => '0209',
'type' => 'XDCA',
'name' => 'DECLARATION ACCEPTED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"DECLARATION ACCEPTED"}}}}'
],
[
'mid' => 1,
'code' => '0300',
'type' => 'GCLD',
'name' => 'พบหน่วยงานผู้ออกใบอนุญาตหรือใบรับรองอิเล็กทรอนิกส์เพื่อตรวจสอบของ',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"พบหน่วยงานผู้ออกใบอนุญาตหรือใบรับรองอิเล็กทรอนิกส์เพื่อตรวจสอบของ","AuditDateTime":""}}}}'
],
[
'mid' => 1,
'code' => '0301',
'type' => 'GCLD',
'name' => 'Goods Transition Control Already Checked ให้มาตรวจของที่ท่าที่ส่งออก',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"Goods Transition Control Already Checked ให้มาตรวจของที่ท่าที่ส่งออก","AuditDateTime":""}}}}'
],
[
'mid' => 1,
'code' => '0309',
'type' => 'GCLD',
'name' => 'Goods Transition Control Already Checked',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"Goods Transition Control Already Checked","AuditDateTime":""}}}}'
],
[
'mid' => 1,
'code' => '0409',
'type' => 'GCLD',
'name' => 'GOODS LOADED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONCONT1234567","LoadPort":"0010","Message":"GOODS LOADED","AuditDateTime":""}}}}'
],
[
'mid' => 1,
'code' => 'REJECT',
'type' => 'XDCR',
'name' => 'REJECT',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XDCR","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationReject":{"ItemNumber":"0","ErrorCode":"GDEX-00044","Message":"INVALID DEPARTURE DATE"}}}}'
],
[
'mid' => 1,
'code' => 'CANCEL ACCEPTED',
'type' => 'XCDA',
'name' => 'DECLARATION CANCELED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentAccept":{"DocumentNumber":"","Message":"DECLARATION CANCELED"}}}}'
],
[
'mid' => 1,
'code' => 'CANCEL REJECT',
'type' => 'XCDR',
'name' => 'INVALID DECLARATION NUMBER',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDR","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentReject":{"DocumentNumber":"","ErrorCode":"CLGD-00016","Message":"DECLARATION STATUS CAN NOT CANCEL"}}}}'
],
[
'mid' => 1,
'code' => '9904',
'type' => 'GCLD',
'name' => 'Goods Transition Control Already Cancel Matching',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"Goods Transition Control Already Cancel Matching","AuditDateTime":""}}}}'
],
[
'mid' => 1,
'code' => 'ERR_TRANS',
'type' => 'ERR_TRANS',
'name' => 'Error Trans',
'description' => '',
'template' => '{"root":"ErrorMessage","namespace":null,"DocumentDetails":{"TransactionNo":"E06@240209210907_418","ReferenceNo":"","ErrorType":"ERR_TRANS","ErrorItems":"1","ErrorDate":"","ErrorDescription":"Incorrect length = 0. Facet length = 2. element=\'CustomsExportDeclaration[1]/SEQUENCE1[1]/DocumentControl[1]/SEQUENCE1[1]/TotalPackage[1]/SEQUENCE1[1]/UnitCode\'. At line = 1536 column = 1."}}'
],
//Import
[
'mid' => 2,
'code' => '0109',
'type' => 'IDCA',
'name' => 'พร้อมที่จะชำระเงินค่าภาษีอากรที่หน่วยงานของกรมศุลกากร',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"พร้อมที่จะชำระเงินค่าภาษีอากรที่หน่วยงานของกรมศุลกากร"}}}}'
],
[
'mid' => 2,
'code' => '0209',
'type' => 'IDCA',
'name' => 'DECLARATION ACCEPTED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"DECLARATION ACCEPTED"}}}}'
],
[
'mid' => 2,
'code' => '0209',
'type' => 'IDCA',
'name' => 'รอการตัดบัญชีธนาคาร',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"รอการตัดบัญชีธนาคาร"}}}}'
],
[
'mid' => 2,
'code' => '0209',
'type' => 'PMTA',
'name' => 'ได้รับการชำระเงินเรียบร้อยแล้ว',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"PMTA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationPayment":{"DeclarationNumber":"","Status":"A","PaymentType":"PMT","Message":"ได้รับการชำระเงินเรียบร้อยแล้ว","PaymentNumber":"123456","BankTransactionNumber":"FCN0000000001","TotalAmount":"1000"}}}}'
],
[
'mid' => 2,
'code' => '0301',
'type' => 'IDCA',
'name' => 'สินค้าต้องตรวจสอบ',
'description' => 'R',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"สินค้าต้องตรวจสอบ"}}}}'
],
[
'mid' => 2,
'code' => '0309',
'type' => 'IDCA',
'name' => 'ไม่ต้องตรวจสอบพิกัดศุลกากร ราคาและของ ไปรับของ ที่ท่าหรือที่นำเข้า',
'description' => 'G',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"ไม่ต้องตรวจสอบพิกัดศุลกากร ราคาและของ ไปรับของ ที่ท่าหรือที่นำเข้า"}}}}'
],
[
'mid' => 2,
'code' => '0409',
'type' => 'IDCA',
'name' => 'ส่งมอบสินค้า',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationAccept":{"Status":"00","DeclarationNumber":"","TotalTax":"1000","TotalDeposit":"0","ReleasePort":"1193","Message":"ส่งมอบสินค้า"}}}}'
],
[
'mid' => 2,
'code' => 'REJECT',
'type' => 'IDCR',
'name' => 'REJECT',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCR","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"DeclarationReject":{"ItemNumber":"0","ErrorCode":"ITEM-00058","Message":"INVALID DISCHARGE PORT"}}}}'
],
[
'mid' => 2,
'code' => 'ERR_TRANS',
'type' => 'ERR_TRANS',
'name' => 'Error Trans',
'description' => '',
'template' => '{"root":"ErrorMessage","namespace":null,"DocumentDetails":{"TransactionNo":"E06@240209210907_418","ReferenceNo":"","ErrorType":"ERR_TRANS","ErrorItems":"1","ErrorDate":"","ErrorDescription":"Value too short, length = 0. Facet minLength = 1. element=\'CustomsImportDeclaration[1]/SEQUENCE1[1]/DocumentControl[1]/SEQUENCE1[1]/BorderTransportMeans[1]/SEQUENCE1[1]/VesselName\'. At line = 1149 column = 1."}}'
],
[
'mid' => 2,
'code' => 'CANCEL ACCEPTED',
'type' => 'XCDA',
'name' => 'DECLARATION CANCELED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentAccept":{"DocumentNumber":"","Message":"DECLARATION CANCELED"}}}}'
],
[
'mid' => 2,
'code' => 'CANCEL REJECT',
'type' => 'XCDR',
'name' => 'INVALID DECLARATION NUMBER',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDR","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentReject":{"DocumentNumber":"","ErrorCode":"CLGD-00008","Message":"INVALID DECLARATION NUMBER"}}}}'
],
//GCL
[
'mid' => 3,
'code' => '0209',
'type' => 'GCLA',
'name' => 'GOODS CONTROL ACCEPT',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsTransitionAccept":{"GoodsTransitionNumber":"","ContainerNumber":"CONT1234567","LoadPort":"2801","Message":"GOODS CONTROL ACCEPT"}}}}'
],
[
'mid' => 3,
'code' => '0209',
'type' => 'GCLA_BKK',
'name' => 'GOODS CONTROL ACCEPT (Port)',
'description' => 'PORT',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLA_BKK","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsTransitionAccept":{"GoodsTransitionNumber":"","ContainerNumber":"CONT1234567","LoadPort":"2801","Message":"GOODS CONTROL ACCEPT"}}}}'
],
[
'mid' => 3,
'code' => '0301',
'type' => 'GCLD',
'name' => 'Goods Transition Control Already Checked ให้มาตรวจของที่ท่าที่ส่งออก',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0041010353980000000010001T5","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"Goods Transition Control Already Checked ให้มาตรวจของที่ท่าที่ส่งออก","AuditDateTime":""}}}}'
],
[
'mid' => 3,
'code' => '0309',
'type' => 'GCLD',
'name' => 'Goods Transition Control Already Checked',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0041010353980000000010001T5","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"0010","Message":"Goods Transition Control Already Checked","AuditDateTime":""}}}}'
],
[
'mid' => 3,
'code' => 'REJECT',
'type' => 'GCLR',
'name' => 'REJECT',
'description' => 'INVALID CONTAINER SIZE AND TYPE CODE',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLR","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsTransitionReject":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","ErrorCode":"GCEX-00052 ","Message":"INVALID CONTAINER SIZE AND TYPE CODE"}}}}'
],
[
'mid' => 3,
'code' => 'CANCEL ACCEPT',
'type' => 'XCDA',
'name' => 'CANCEL',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentAccept":{"DocumentNumber":"","Message":"GOODS CONTROL CANCELED"}}}}'
],
[
'mid' => 3,
'code' => 'CANCEL ACCEPT - PORT',
'type' => 'XCDA_LCB',
'name' => 'CANCEL',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"XCDA_LCB","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"CancelDocumentAccept":{"DocumentNumber":"","Message":"GOODS CONTROL CANCELED"}}}}'
],
[
'mid' => 3,
'code' => 'CANCEL MATCHING',
'type' => 'GCLD',
'name' => 'CANCEL MATCHING',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"GCLD","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"GoodsAudit":{"DeclarationNumber":"","ContainerNumber":"CONT1234567","LoadPort":"2801","Message":"Goods Transition Control Already Cancel Matching","AuditDateTime":""}}}}'
],
[
'mid' => 3,
'code' => 'ERR_TRANS',
'type' => 'ERR_TRANS',
'name' => 'Error Trans',
'description' => '',
'template' => '{"root":"ErrorMessage","namespace":null,"DocumentDetails":{"TransactionNo":"E06@240209210907_418","ReferenceNo":"","ErrorType":"ERR_TRANS","ErrorItems":"1","ErrorDate":"","ErrorDescription":"Too few occurences of element=\'CustomsGoodsTransition[1]/SEQUENCE1[1]/DocumentControl[1]/SEQUENCE1[1]/ContainerInfo[1]/SEQUENCE1[1]/TaxNumber\'. Found = 0. Min = 1. At line = 822 column = 1."}}'
],
//SHORT
[
'mid' => 4,
'code' => '9980',
'type' => 'SDCA',
'name' => 'SHORT DECLARATION ACCEPTED',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"SDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"ShortDeclarationAccept":{"DeclarationNumber":"","Message":"SHORT DECLARATION ACCEPTED"}}}}'
],
[
'mid' => 4,
'code' => '0000',
'type' => 'SDCR',
'name' => 'SHORT DECLARATION REJECT',
'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"SDCR","ReferenceNumber":"","RegistrationID":"TH0041010353980000000010001T5","DocumentDetail":{"ShortDeclarationReject":{"DeclarationNumber":"","DeclarationLineNumber":"0","ErrorCode":"SHEX-00029","Message":"CAN NOT SHORT IF DECLARATION ITEM MORE THAN 1 ITEM AND SOME VALUE IN ITEM = 0"}}}}'
],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_master_response_templates');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_declaration_running', function (Blueprint $table) {
$table->id();
$table->string('document_type');
$table->integer('running_number')->default(0);
$table->date('last_updated_date');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_declaration_runnings');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_master_doc_types', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('mid');
$table->string('code');
$table->string('name');
$table->string('mode');
$table->timestamps();
$table->foreign('mid')->references('id')->on('master_messages')->onDelete('cascade');
});
DB::table('mr_master_doc_types')->insert([
['mid' => '2', 'code' => '0', 'name' => '0-ใบขนสินค้าขาเข้า', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '3', 'name' => '3-คำร้องขอรับของไปก่อน', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => '5', 'name' => '5-ใบขนสินค้าขาเข้าปากระวาง', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'A', 'name' => 'A-ใบขนสินค้าขาเข้าโอนย้ายในประเทศ', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'C', 'name' => 'C-ใบขนสินค้าขาเข้าโอนย้ายจากเขตปลอดอากร', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'X', 'name' => 'X-ใบขนสินค้าขาเข้าเร่งด่วน', 'mode' => 'IMDECL'],
['mid' => '2', 'code' => 'P', 'name' => 'P-ใบขนสินค้าขาเข้าโอนย้ายชำระค่าภาษีอากร', 'mode' => 'IMDECL'],
['mid' => '1', 'code' => '1', 'name' => '1-ใบขนสินค้าขาออก', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => '4', 'name' => '4-คำร้องขอออกของไปก่อน', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'B', 'name' => 'B-ใบขนสินค้าขาออกโอนย้ายภายในประเทศ', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'D', 'name' => 'D-ใบขนสินค้าขาออกโอนย้ายเข้าเขตปลอดอากร', 'mode' => 'EXDECL'],
['mid' => '1', 'code' => 'Y', 'name' => 'Y-ใบขนสินค้าขาออกเร่งด่วน', 'mode' => 'EXDECL'],
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_master_doc_types');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_users_connect_spn', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('uid');
$table->string('username');
$table->string('password');
$table->string('link');
$table->timestamps();
$table->foreign('uid')->references('id')->on('users')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_users_connect_spn');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mr_tab_manual_response_log', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('uid');
$table->string('title');
$table->string('detail');
$table->text('xml_content');
$table->string('reference_number');
$table->string('declaration_number');
$table->string('link');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mr_tab_manual_response_log');
}
};
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
};