prepare table
parent
eca09a6cd6
commit
935be0886f
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CashDepositLocation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomerCart extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomerLocationFavorite extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LocationProfile extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LocationProfilePrice extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class VoucherPrice extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'customer_level_id',
|
||||
'voucher_id',
|
||||
'price',
|
||||
'display_price',
|
||||
];
|
||||
|
||||
public function level()
|
||||
{
|
||||
return $this->belongsTo(CustomerLevel::class, 'customer_level_id');
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('location_profiles', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('location_id')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('quota')->nullable();
|
||||
$table->string('display_note')->nullable();
|
||||
$table->string('expired')->nullable();
|
||||
$table->string('expired_unit')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->integer('min_stock')->default(0);
|
||||
|
||||
$table->decimal('price', 20, 2)->default(0);
|
||||
$table->decimal('display_price', 20, 2)->default(0);
|
||||
$table->decimal('discount', 20, 0)->default(0);
|
||||
$table->decimal('price_poin', 20, 2)->default(0);
|
||||
$table->decimal('bonus_poin', 20, 2)->default(0);
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('location_profiles');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customer_location_favorites', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('location_id')->nullable();
|
||||
$table->ulid('customer_id')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customer_location_favorites');
|
||||
}
|
||||
};
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('customer_carts', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->ulid('customer_id')->nullable();
|
||||
$table->ulid('sale_id')->nullable();
|
||||
$table->string('entity_type')->nullable();
|
||||
$table->ulid('entity_id')->nullable();
|
||||
$table->decimal('price', 20, 2)->default(0);
|
||||
$table->integer('quantity')->default(0);
|
||||
$table->text('additional_info_json')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('customer_carts');
|
||||
}
|
||||
};
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('cash_deposit_locations', function (Blueprint $table) {
|
||||
$table->ulid('id')->primary();
|
||||
|
||||
$table->string('name')->nullable();
|
||||
$table->text('address')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('gmap_url', 1000)->nullable();
|
||||
$table->string('image')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->string('open_hour')->nullable();
|
||||
$table->string('close_hour')->nullable();
|
||||
$table->smallInteger('is_active')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->ulid('created_by')->nullable();
|
||||
$table->ulid('updated_by')->nullable();
|
||||
$table->ulid('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cash_deposit_locations');
|
||||
}
|
||||
};
|
@ -0,0 +1,51 @@
|
||||
import React from 'react'
|
||||
import { isEmpty } from 'lodash'
|
||||
import { HiFilter } from 'react-icons/hi'
|
||||
|
||||
export default function FormLocation({
|
||||
type,
|
||||
name,
|
||||
onChange,
|
||||
value,
|
||||
label,
|
||||
autoComplete,
|
||||
autoFocus,
|
||||
placeholder,
|
||||
disabled,
|
||||
readOnly,
|
||||
onKeyDownCapture,
|
||||
max,
|
||||
min,
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<label
|
||||
htmlFor={name}
|
||||
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
|
||||
>
|
||||
{label}
|
||||
</label>
|
||||
<div className="relative">
|
||||
<input
|
||||
id={name}
|
||||
type="text"
|
||||
className="mb-2 bg-gray-50 border text-gray-900 text-sm rounded-lg block w-full p-2.5 dark:bg-gray-700 dark:placeholder-gray-400 dark:text-white active:ring-blue-500 focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
onChange={onChange}
|
||||
name={name}
|
||||
value={value}
|
||||
autoComplete={autoComplete ? 'on' : 'off'}
|
||||
autoFocus={autoFocus}
|
||||
placeholder={placeholder}
|
||||
disabled={disabled}
|
||||
readOnly={readOnly}
|
||||
onKeyDownCapture={onKeyDownCapture}
|
||||
max={max}
|
||||
min={min}
|
||||
/>
|
||||
<div className="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
|
||||
<HiFilter />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue