Update api requests

This commit is contained in:
miroman-afk
2021-05-31 16:11:03 +03:00
parent 8990126842
commit 3b61b27200
54 changed files with 1911 additions and 362 deletions

View File

@@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTestTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('test', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('test');
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddRevenueToExchangeShiftsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
if (!Schema::hasColumn('exchange_shifts', 'revenue')) {
Schema::table('exchange_shifts', function (Blueprint $table) {
$table->decimal('revenue', $precision = 16, $scale = 2)->nullable()->after('closed');
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('exchange_shifts', function (Blueprint $table) {
$table->dropColumn('revenue');
});
}
}

View File

@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddValueToExchangeActionsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('exchange_actions', function (Blueprint $table) {
$table->string('value', 255)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('exchange_actions', function (Blueprint $table) {
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddForeignKeyToClientsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('clients', function (Blueprint $table) {
$table->string('user_code')->unique()->change();
});
Schema::table('clients_phone', function (Blueprint $table) {
$table->foreign('client_guid')->references('user_code')->on('clients');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('clients', function (Blueprint $table) {
});
}
}

View File

@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddOrderToOrderbotStorageTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('orderbot_storage', function (Blueprint $table) {
$table->text('order')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::table('orderbot_storage', function (Blueprint $table) {
});
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateClientsBarcodesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('clients_barcodes', function (Blueprint $table) {
$table->id();
$table->string('client_guid');
$table->string('code_id');
$table->string('name');
$table->string('block');
$table->string('value');
$table->string('symptom_block');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('clients_barcodes');
}
}

View File

@@ -1,19 +0,0 @@
<?php
namespace Database\Component\Seeders;
use App\Models\Subscriber;
use Illuminate\Database\Seeder;
class AddAfterMenuUploadSubscriber extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Subscriber::add('sync:postmenu', 'hello:gethello', 10);
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace Database\Component\Seeders;
use App\Models\Subscriber;
use Illuminate\Database\Seeder;
class AddAfterSyncHelloSubscriber extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run() {
Subscriber::add('sync:gethello', 'v1:getbot', 10);
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Database\Component\Seeders;
use App\Component\Models\ClientsGroup;
use Illuminate\Database\Seeder;
class AddClientGroup extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run() {
if (ClientsGroup::where('code', '0')->count() == 0) {
$group = new ClientsGroup([
'code' => '0',
'name' => 'Без группы',
]);
$group->save();
}
}
}

View File

@@ -1,19 +0,0 @@
<?php
namespace Database\Component\Seeders;
use App\Models\Right;
use Illuminate\Database\Seeder;
class AddTestRight extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Right::add('test', 'Тестовый раздел');
}
}