contract template obligation dependency api

This commit is contained in:
glovetleong
2021-06-29 19:27:01 +08:00
parent 64280f5754
commit 2b65de855a
11 changed files with 464 additions and 16 deletions
@@ -19,8 +19,8 @@ class CreateContractTemplateObligationDependenciesTable extends Migration
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->bigInteger('contract_template_obligation_id')->unsigned()->nullable();
$table->foreign('contract_template_obligation_id', 'ctod_cto_id')->references('id')->on('contract_template_obligations')->onDelete('cascade');
$table->bigInteger('depend_template_contract_obligation_id')->unsigned()->nullable();
$table->foreign('depend_template_contract_obligation_id', 'dctod_cto_id')->references('id')->on('contract_template_obligations')->onDelete('cascade');
$table->bigInteger('depend_contract_template_obligation_id')->unsigned()->nullable();
$table->foreign('depend_contract_template_obligation_id', 'ctod_dcto_id')->references('id')->on('contract_template_obligations')->onDelete('cascade');
$table->integer('status')->nullable()->default(1);
$table->timestamps();
});
@@ -20,7 +20,7 @@ class SodaVendorContractTemplateObligationDependenciesTableSeeder extends Seeder
'id' => 1,
'user_id' => 2,
'contract_template_obligation_id' => 2, // vendor machine drop selected soda to user
'depend_template_contract_obligation_id' => 1, // user insert coin and select soda at vendor machine
'depend_contract_template_obligation_id' => 1, // user insert coin and select soda at vendor machine
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
@@ -29,7 +29,7 @@ class SodaVendorContractTemplateObligationDependenciesTableSeeder extends Seeder
'id' => 2,
'user_id' => 2,
'contract_template_obligation_id' => 3, // user pickup the soda
'depend_template_contract_obligation_id' => 2, // vendor machine drop selected soda to user
'depend_contract_template_obligation_id' => 2, // vendor machine drop selected soda to user
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')