diff --git a/TODO.md b/TODO.md index f73e8ed..59646d6 100644 --- a/TODO.md +++ b/TODO.md @@ -5,6 +5,9 @@ - [ ] CRUD Voucher - [ ] Import Voucher - [ ] CRUD Customer +- [ ] CRUD Rekening / Account +- [ ] CRUD Info +- [ ] CRUD Banner - [ ] Deposit Menu (view daftar histori deposit) - [ ] Manual Approve Deposit - [ ] Setting Web (enable affilate, amount bonus affilate) @@ -19,7 +22,7 @@ ### Customer -- [ ] Tampilan Depan Customer (banner, info, voucher, saldo, coin) - mobile page +- [x] Tampilan Depan Customer (banner, info, voucher, saldo, coin) - mobile page - [ ] Register Customer (wajib data lengkap) - [ ] Register Customer Gmail - [ ] Login Customer diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index fa25bf6..ebf83f5 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,7 +2,6 @@ namespace App\Http\Middleware; -use App\Providers\RouteServiceProvider; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -25,6 +24,7 @@ class RedirectIfAuthenticated if ($guard == 'web') { return redirect()->route('dashboard'); } + return redirect()->route('home.index'); } } diff --git a/app/Models/Account.php b/app/Models/Account.php new file mode 100644 index 0000000..6c85709 --- /dev/null +++ b/app/Models/Account.php @@ -0,0 +1,14 @@ +string('description')->nullable(); $table->string('destination')->nullable(); $table->string('type')->nullable(); + $table->smallInteger('is_publish')->nullable(); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_05_24_130552_create_customers_table.php b/database/migrations/2023_05_24_130552_create_customers_table.php index ab6d87f..ea1b764 100644 --- a/database/migrations/2023_05_24_130552_create_customers_table.php +++ b/database/migrations/2023_05_24_130552_create_customers_table.php @@ -27,6 +27,7 @@ return new class extends Migration $table->decimal('coin_balance', 20, 2)->default(0); $table->smallInteger('identity_verified')->nullable(); $table->string('identity_image')->nullable(); + $table->ulid('customer_level_id')->nullable(); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_05_24_130630_create_customer_levels_table.php b/database/migrations/2023_05_24_130630_create_customer_levels_table.php index d775b53..63e531b 100644 --- a/database/migrations/2023_05_24_130630_create_customer_levels_table.php +++ b/database/migrations/2023_05_24_130630_create_customer_levels_table.php @@ -17,6 +17,9 @@ return new class extends Migration $table->string('name')->nullable(); $table->string('description')->nullable(); $table->string('key')->nullable(); + $table->decimal('min_amount', 20, 2)->default(0); + $table->decimal('max_amount', 20, 2)->default(0); + $table->decimal('max_loan', 20, 2)->default(0); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_05_24_130646_create_deposit_histories_table.php b/database/migrations/2023_05_24_130646_create_deposit_histories_table.php index 4c822c4..ef676e5 100644 --- a/database/migrations/2023_05_24_130646_create_deposit_histories_table.php +++ b/database/migrations/2023_05_24_130646_create_deposit_histories_table.php @@ -20,6 +20,8 @@ return new class extends Migration $table->ulid('customer_id')->nullable(); $table->string('related_type')->nullable(); $table->string('related_id')->nullable(); + $table->smallInteger('is_valid')->default(0); + $table->string('image_prove')->nullable(); $table->timestamps(); $table->softDeletes(); diff --git a/database/migrations/2023_05_24_182840_create_accounts_table.php b/database/migrations/2023_05_24_182840_create_accounts_table.php new file mode 100644 index 0000000..373c682 --- /dev/null +++ b/database/migrations/2023_05_24_182840_create_accounts_table.php @@ -0,0 +1,37 @@ +ulid('id')->primary(); + + $table->string('name')->nullable(); + $table->string('bank_name')->nullable(); + $table->string('holder_name')->nullable(); + $table->string('account_number')->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('accounts'); + } +}; diff --git a/database/migrations/2023_05_24_183208_create_infos_table.php b/database/migrations/2023_05_24_183208_create_infos_table.php new file mode 100644 index 0000000..59a2711 --- /dev/null +++ b/database/migrations/2023_05_24_183208_create_infos_table.php @@ -0,0 +1,37 @@ +ulid('id')->primary(); + + $table->string('title'); + $table->string('destination')->nullable(); + $table->string('type')->nullable(); + $table->smallInteger('is_publish')->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('infos'); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index f30d008..e00e7a7 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -14,13 +14,8 @@ class DatabaseSeeder extends Seeder */ public function run() { - // \App\Models\User::factory(10)->create(); - - // \App\Models\User::factory()->create([ - // 'name' => 'Test User', - // 'email' => 'test@example.com', - // ]); $this->call([ + InstallationSeed::class, PermissionSeeder::class, DummySeeder::class, ]); diff --git a/database/seeders/DummySeeder.php b/database/seeders/DummySeeder.php index e237efc..96dceb3 100644 --- a/database/seeders/DummySeeder.php +++ b/database/seeders/DummySeeder.php @@ -13,6 +13,5 @@ class DummySeeder extends Seeder */ public function run() { - // } } diff --git a/database/seeders/InstallationSeed.php b/database/seeders/InstallationSeed.php new file mode 100644 index 0000000..8bf8e82 --- /dev/null +++ b/database/seeders/InstallationSeed.php @@ -0,0 +1,51 @@ +settings(); + $this->customer_levels(); + } + + public function settings() + { + $settings = [ + ['key' => 'AFFILATE_ENABLE', 'value' => '0', 'type' => 'checkbox'], + ['key' => 'AFFILATE_AMOUNT', 'value' => '0', 'type' => 'text'], + + ['key' => 'MIDTRANS_SERVER_KEY', 'value' => 'SB-Mid-server-UA0LQbY4aALV0CfLLX1v7xs8', 'type' => 'text'], + ['key' => 'MIDTRANS_CLIENT_KEY', 'value' => 'SB-Mid-client-xqqkspzoZOM10iUG', 'type' => 'text'], + ['key' => 'MIDTRANS_MERCHANT_ID', 'value' => 'G561244367', 'type' => 'text'], + + // + ]; + + foreach ($settings as $setting) { + Setting::create($setting); + } + } + + public function customer_levels() + { + $levels = [ + ['name' => 'Basic', 'key' => 'basic'], + ['name' => 'Silver', 'key' => 'silver'], + ['name' => 'Gold', 'key' => 'gold'], + ['name' => 'Platinum', 'key' => 'platinum'], + ]; + + foreach ($levels as $level) { + CustomerLevel::create($level); + } + } +} diff --git a/database/seeders/PermissionSeeder.php b/database/seeders/PermissionSeeder.php index 50d22e9..fa3ac08 100644 --- a/database/seeders/PermissionSeeder.php +++ b/database/seeders/PermissionSeeder.php @@ -30,6 +30,54 @@ class PermissionSeeder extends Seeder ['id' => Str::ulid(), 'label' => 'Update Role', 'name' => 'update-role'], ['id' => Str::ulid(), 'label' => 'View Role', 'name' => 'view-role'], ['id' => Str::ulid(), 'label' => 'Delete Role', 'name' => 'delete-role'], + + ['id' => Str::ulid(), 'label' => 'Create Banner', 'name' => 'create-banner'], + ['id' => Str::ulid(), 'label' => 'Update Banner', 'name' => 'update-banner'], + ['id' => Str::ulid(), 'label' => 'View Banner', 'name' => 'view-banner'], + ['id' => Str::ulid(), 'label' => 'Delete Banner', 'name' => 'delete-banner'], + + ['id' => Str::ulid(), 'label' => 'Create Info', 'name' => 'create-info'], + ['id' => Str::ulid(), 'label' => 'Update Info', 'name' => 'update-info'], + ['id' => Str::ulid(), 'label' => 'View Info', 'name' => 'view-info'], + ['id' => Str::ulid(), 'label' => 'Delete Info', 'name' => 'delete-info'], + + ['id' => Str::ulid(), 'label' => 'Create Voucher', 'name' => 'create-voucher'], + ['id' => Str::ulid(), 'label' => 'Update Voucher', 'name' => 'update-voucher'], + ['id' => Str::ulid(), 'label' => 'View Voucher', 'name' => 'view-voucher'], + ['id' => Str::ulid(), 'label' => 'Delete Voucher', 'name' => 'delete-voucher'], + + ['id' => Str::ulid(), 'label' => 'Create Customer', 'name' => 'create-customer'], + ['id' => Str::ulid(), 'label' => 'Update Customer', 'name' => 'update-customer'], + ['id' => Str::ulid(), 'label' => 'View Customer', 'name' => 'view-customer'], + ['id' => Str::ulid(), 'label' => 'Delete Customer', 'name' => 'delete-customer'], + + ['id' => Str::ulid(), 'label' => 'Create Customer Level', 'name' => 'create-customer-level'], + ['id' => Str::ulid(), 'label' => 'Update Customer Level', 'name' => 'update-customer-level'], + ['id' => Str::ulid(), 'label' => 'View Customer Level', 'name' => 'view-customer-level'], + ['id' => Str::ulid(), 'label' => 'Delete Customer Level', 'name' => 'delete-customer-level'], + + ['id' => Str::ulid(), 'label' => 'Create Customer Verification', 'name' => 'create-customer-verification'], + ['id' => Str::ulid(), 'label' => 'Update Customer Verification', 'name' => 'update-customer-verification'], + ['id' => Str::ulid(), 'label' => 'View Customer Verification', 'name' => 'view-customer-verification'], + ['id' => Str::ulid(), 'label' => 'Delete Customer Verification', 'name' => 'delete-customer-verification'], + + ['id' => Str::ulid(), 'label' => 'View Setting', 'name' => 'view-setting'], + + ['id' => Str::ulid(), 'label' => 'View Deposit', 'name' => 'view-deposite'], + ['id' => Str::ulid(), 'label' => 'Update Deposit', 'name' => 'update-deposite'], + + ['id' => Str::ulid(), 'label' => 'View Coin', 'name' => 'view-coin'], + ['id' => Str::ulid(), 'label' => 'Update Coin', 'name' => 'update-coin'], + + ['id' => Str::ulid(), 'label' => 'Create Sale', 'name' => 'create-sale'], + ['id' => Str::ulid(), 'label' => 'Update Sale', 'name' => 'update-sale'], + ['id' => Str::ulid(), 'label' => 'View Sale', 'name' => 'view-sale'], + ['id' => Str::ulid(), 'label' => 'Delete Sale', 'name' => 'delete-sale'], + + ['id' => Str::ulid(), 'label' => 'Create Coin Reward', 'name' => 'create-coin-reward'], + ['id' => Str::ulid(), 'label' => 'Update Coin Reward', 'name' => 'update-coin-reward'], + ['id' => Str::ulid(), 'label' => 'View Coin Reward', 'name' => 'view-coin-reward'], + ['id' => Str::ulid(), 'label' => 'Delete Coin Reward', 'name' => 'delete-coin-reward'], ]; foreach ($permissions as $permission) { diff --git a/package.json b/package.json index 29df39c..0a2f7eb 100644 --- a/package.json +++ b/package.json @@ -32,4 +32,4 @@ "react-toastify": "^9.1.1", "react-use": "^17.4.0" } -} +} \ No newline at end of file diff --git a/public/sample/1.webp b/public/sample/1.webp new file mode 100644 index 0000000..d9436db Binary files /dev/null and b/public/sample/1.webp differ diff --git a/public/sample/2.webp b/public/sample/2.webp new file mode 100644 index 0000000..84012b8 Binary files /dev/null and b/public/sample/2.webp differ diff --git a/public/sample/3.webp b/public/sample/3.webp new file mode 100644 index 0000000..cc5f100 Binary files /dev/null and b/public/sample/3.webp differ diff --git a/public/sample/banner.jpg b/public/sample/banner.jpg new file mode 100644 index 0000000..7803386 Binary files /dev/null and b/public/sample/banner.jpg differ diff --git a/resources/js/Layouts/CustomerLayout.jsx b/resources/js/Layouts/CustomerLayout.jsx index a27c6fb..bedc004 100644 --- a/resources/js/Layouts/CustomerLayout.jsx +++ b/resources/js/Layouts/CustomerLayout.jsx @@ -1,18 +1,36 @@ import React from 'react' import ApplicationLogo from '@/Components/Defaults/ApplicationLogo' import { Link } from '@inertiajs/react' +import { HiHome, HiOutlineHome, HiOutlineUserCircle } from 'react-icons/hi' +import { + HiArrowPathRoundedSquare, + HiOutlineShoppingCart, +} from 'react-icons/hi2' export default function CustomerLayout({ children }) { return ( -