api fixes contracts

This commit is contained in:
Mahri Ilmedova 2022-10-16 15:57:15 +05:00
parent 0b08809f34
commit a05737df87
4 changed files with 63 additions and 19 deletions

View File

@ -17,6 +17,8 @@ public function contract(ContractRequest $request){
public function import(Request $request){
return $request->all();//test
$request->validate([
'contracts' => 'array: id, hasaba_alysh, hasaba_alysh_status, baha_seljerish, baha_seljerish_status, tdh,tdh_status, hukuk,hukuk_status'
]);

View File

@ -40,7 +40,7 @@ public function setup()
protected function setupListOperation()
{
CRUD::column('entrance_number');
CRUD::column('inputNumber');
/**
* Columns can be defined using the fluent syntax or array syntax:
* - CRUD::column('price')->type('number');
@ -58,15 +58,13 @@ protected function setupCreateOperation()
{
CRUD::setValidation(ContractRequest::class);
// CRUD::field('entrance_number');
CRUD::field('hasaba_alysh');
CRUD::field('hasaba_alysh_status');
CRUD::field('baha_seljerish');
CRUD::field('baha_seljerish_status');
CRUD::field('tdh');
CRUD::field('tdh_status');
CRUD::field('hukuk');
CRUD::field('hukuk_status');
CRUD::field('inputNumber');
CRUD::field('inputDate');
CRUD::field('regdDate');
CRUD::field('markerSpec');
CRUD::field('workflow_id');
CRUD::field('note');
CRUD::field('remark');
/**
* Fields can be defined using the fluent syntax or array syntax:

View File

@ -20,15 +20,13 @@ class Contract extends Model
// public $timestamps = false;
protected $guarded = ['id'];
protected $fillable = [
'entrance_number',
'hasaba_alysh',
'hasaba_alysh_status',
'baha_seljerish',
'baha_seljerish_status',
'tdh',
'tdh_status',
'hukuk',
'hukuk_status'
'inputNumber',
'inputDate',
'regdDate',
'markerSpec',
'workflow_id',
'note',
'remark',
];
// protected $hidden = [];
// protected $dates = [];

View File

@ -0,0 +1,46 @@
<?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('contracts', function (Blueprint $table) {
$table->dropColumn('hasaba_alysh');
$table->dropColumn('hasaba_alysh_status');
$table->dropColumn('baha_seljerish');
$table->dropColumn('baha_seljerish_status');
$table->dropColumn('tdh');
$table->dropColumn('tdh_status');
$table->dropColumn('hukuk');
$table->dropColumn('hukuk_status');
$table->string('inputNumber')->nullabale();
$table->datetime('inputDate')->nullable();
$table->datetime('regdDate')->nullable();
$table->bigInnteger('markerSpec')->nullable();
$table->bigInteger('workflow_id')->nullable();
$table->text('note')->nullable();
$table->text('remark')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('contracts', function (Blueprint $table) {
});
}
};