diff --git a/TODO.md b/TODO.md index f2f0740..91ad66d 100644 --- a/TODO.md +++ b/TODO.md @@ -2,25 +2,25 @@ ## Note -Kerjakan dulu semua yang terkait penjualan normal, deposit normal dan bonus poin transaksi dan downline -baru setelah itu yang berhubungan dengan mitrawbb dan hutang -setelah itu baru penukaran voucher +[x] Kerjakan dulu semua yang terkait penjualan normal, deposit normal dan bonus poin transaksi dan downline +[ ] baru setelah itu yang berhubungan dengan mitrawbb dan hutang +[ ] setelah itu baru penukaran voucher ## Front -- [ ] transaksi pembelian -- [ ] transaksi pembelian + dapat poin downline -- [ ] [BUG] pembelian voucher lebih dari 1 mendapat kode yang sama +- [x] transaksi pembelian +- [x] transaksi pembelian + dapat poin downline +- [x] [BUG] pembelian voucher lebih dari 1 mendapat kode yang sama - [ ] penuakaran voucher -- [ ] tambah metode topup deposit dengan setor tunai kantor wbb +- [x] tambah metode topup deposit dengan setor tunai kantor wbb - [x] mengubah metode pembayaran deposit dengan daftar bank seperti deposit dan tampil logo bank - [x] tampilan keranjang jadi lebih seperti tokped dengan metode pembayaran deposit atau hutang jika tersedia - [x] tampilan transaksi deposit, hutang (mitra wbb), dan poin jadi satu tampilan - [x] tambah screen untuk daftar setor tunai kantor wbb - [x] halaman untuk menampilkan level customer -- [ ] expired time 2jam di deposit manual maupun kantor wbb -- [ ] ubah username dan password di detail transaksi dengan kode voucher saja -- [ ] format nomor transaksi di deposit , transaksi dan poin +- [x] expired time 2jam di deposit manual maupun kantor wbb +- [x] ubah username dan password di detail transaksi dengan kode voucher saja +- [x] format nomor transaksi di deposit , transaksi dan poin # Back Office diff --git a/app/Http/Controllers/Admin/SettingController.php b/app/Http/Controllers/Admin/SettingController.php index 0228a53..c53fdf1 100644 --- a/app/Http/Controllers/Admin/SettingController.php +++ b/app/Http/Controllers/Admin/SettingController.php @@ -121,7 +121,15 @@ class SettingController extends Controller Setting::where('key', $key)->update(['value' => $value]); } - $allowedLevel = collect($request->AFFILATE_ALLOWED_LEVELS)->toArray(); + $allowedLevel = collect($request->AFFILATE_ALLOWED_LEVELS) + ->map(function ($item) { + return [ + 'id' => $item['id'], + 'key' => $item['key'], + 'name' => $item['name'], + ]; + }) + ->toArray(); Setting::where('key', 'AFFILATE_ALLOWED_LEVELS')->update([ 'value' => json_encode($allowedLevel) diff --git a/app/Http/Controllers/Admin/VoucherController.php b/app/Http/Controllers/Admin/VoucherController.php index adf02ee..596f571 100644 --- a/app/Http/Controllers/Admin/VoucherController.php +++ b/app/Http/Controllers/Admin/VoucherController.php @@ -109,7 +109,7 @@ class VoucherController extends Controller public function edit(Voucher $voucher) { return inertia('Voucher/Form', [ - 'voucher' => $voucher->load(['prices.level']), + 'voucher' => $voucher->load(['locationProfile']), 'levels' => CustomerLevel::all(), ]); } diff --git a/app/Http/Controllers/Api/LocationProfileController.php b/app/Http/Controllers/Api/LocationProfileController.php index 6846036..efce319 100644 --- a/app/Http/Controllers/Api/LocationProfileController.php +++ b/app/Http/Controllers/Api/LocationProfileController.php @@ -10,7 +10,8 @@ class LocationProfileController extends Controller { public function index(Request $request) { - $query = LocationProfile::with(['location'])->orderBy('updated_at', 'desc'); + $query = LocationProfile::with(['location']) + ->orderBy('updated_at', 'desc'); if ($request->q != '') { $query->where('name', 'like', "%$request->q%") diff --git a/app/Http/Controllers/Customer/AuthController.php b/app/Http/Controllers/Customer/AuthController.php index 8bc2860..6876ed8 100644 --- a/app/Http/Controllers/Customer/AuthController.php +++ b/app/Http/Controllers/Customer/AuthController.php @@ -7,6 +7,7 @@ use App\Mail\CustomerVerification; use App\Models\Customer; use App\Models\Setting; use App\Services\AsyncService; +use App\Services\GeneralService; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; @@ -133,7 +134,7 @@ class AuthController extends Controller session()->put('referral_code', $request->referral_code); $code = $request->referral_code; } else { - $code = session('referral_code', ' '); + $code = session('referral_code', ''); } return inertia('Auth/Register', [ @@ -209,17 +210,20 @@ class AuthController extends Controller session()->forget('referral_code'); return; } + $refferal->customerRefferals()->create([ 'refferal_id' => $customer->id, 'customer_code' => $refferal->referral_code, ]); $affilateEnabled = Setting::getByKey('AFFILATE_ENABLED'); - if ($affilateEnabled == 1) { - $bonuspoin = Setting::getByKey('AFFILATE_poin_AMOUNT'); + $isAllowAffilate = GeneralService::isAllowAffilate($refferal->level->key); + if ($affilateEnabled == 1 && $isAllowAffilate) { + $bonuspoin = Setting::getByKey('AFFILATE_POIN_AMOUNT'); $poin = $refferal->poins()->create([ 'debit' => $bonuspoin, - 'description' => 'Bonus Refferal #' . Str::random(5), + 'description' => GeneralService::generateBonusPoinCode(), + 'narration' => 'Bonus Poin Affilate (Register)' ]); $poin->update_customer_balance(); diff --git a/app/Http/Controllers/Customer/CartController.php b/app/Http/Controllers/Customer/CartController.php index b27e435..6525787 100644 --- a/app/Http/Controllers/Customer/CartController.php +++ b/app/Http/Controllers/Customer/CartController.php @@ -7,6 +7,7 @@ use App\Models\Customer; use App\Models\DepositHistory; use App\Models\PoinReward; use App\Models\Sale; +use App\Models\Setting; use App\Models\Voucher; use App\Services\GeneralService; use Illuminate\Http\Request; @@ -100,7 +101,6 @@ class CartController extends Controller ], ]); - DB::beginTransaction(); $customer = $request->user('customer'); $carts = $customer->carts->load(['voucher.locationProfile.location']); @@ -126,6 +126,7 @@ class CartController extends Controller return $item->quantity * $item->voucher->validate_price; }); + DB::beginTransaction(); // create sale $sale = $customer->sales()->create([ 'date_time' => now(), @@ -148,50 +149,17 @@ class CartController extends Controller ]); $voucher->update(['is_sold' => Voucher::SOLD]); + $voucher->check_stock_notification(); + + $voucher->create_bonus_poin($customer); } } - // create sale notification + $sale->create_payment(); $sale->create_notification(); - - // payed with deposit - if ($sale->payed_with == Sale::PAYED_WITH_DEPOSIT) { - $deposit = $customer->deposites()->create([ - 'credit' => $total, - 'description' => $sale->code, - 'related_type' => Sale::class, - 'related_id' => $sale->id, - 'is_valid' => DepositHistory::STATUS_VALID, - ]); - $deposit->update_customer_balance(); - } - - // payed with paylater - if ($sale->payed_with == Sale::PAYED_WITH_PAYLATER) { - $paylater = $customer->paylaterHistories()->create([ - 'debit' => $total, - 'description' => $sale->code, - ]); - $paylater->update_customer_paylater(); - } - - // bonus poin by reward - $bonus = PoinReward::where('customer_level_id', $customer->customer_level_id) - ->where('amount_buy', '<=', $total) - ->orderBy('bonus_poin', 'desc') - ->first(); - - if ($bonus != null) { - $poin = $customer->poins()->create([ - 'debit' => $bonus->bonus_poin, - 'description' => 'Bonus Pembelian #' . $sale->code, - ]); - - $poin->update_customer_balance(); - } - - // TODO : bonus poin by downline + $sale->create_poin_reward(); + $sale->create_poin_affilate(); // remove carts $customer->carts()->delete(); diff --git a/app/Http/Controllers/Customer/PoinController.php b/app/Http/Controllers/Customer/PoinController.php index 62ede3f..02fecf4 100644 --- a/app/Http/Controllers/Customer/PoinController.php +++ b/app/Http/Controllers/Customer/PoinController.php @@ -12,6 +12,7 @@ class PoinController extends Controller public function index(Request $request) { $poins = PoinHistory::where('customer_id', auth()->id()) + ->orderBy('description', 'desc') ->orderBy('updated_at', 'desc'); $start_date = now()->startOfMonth(); diff --git a/app/Http/Controllers/Customer/PoinExchangeController.php b/app/Http/Controllers/Customer/PoinExchangeController.php index 26c7895..85c2c28 100644 --- a/app/Http/Controllers/Customer/PoinExchangeController.php +++ b/app/Http/Controllers/Customer/PoinExchangeController.php @@ -15,7 +15,7 @@ class PoinExchangeController extends Controller public function index(Request $request) { $locations = Location::get(); - $vouchers = Voucher::with(['locationProfile']) + $vouchers = Voucher::with(['locationProfile.location']) ->whereHas('locationProfile', function ($q) { $q->where('price_poin', '!=', 0) ->where('price_poin', '!=', null); @@ -58,7 +58,7 @@ class PoinExchangeController extends Controller 'payed_with' => Sale::PAYED_WITH_POIN, ]); - $voucher = $voucher->shuffle_unsold(); + $voucher = $voucher->shuffle_unsold(1); $sale->items()->create([ 'entity_type' => $voucher::class, 'entity_id' => $voucher->id, diff --git a/app/Jobs/ExpiredCustomerPoinJob.php b/app/Jobs/ExpiredCustomerPoinJob.php new file mode 100644 index 0000000..5d84f09 --- /dev/null +++ b/app/Jobs/ExpiredCustomerPoinJob.php @@ -0,0 +1,31 @@ +belongsTo(Customer::class); } - public function update_customer_balance() + public function update_customer_balance($updateExpired = false) { $customer = Customer::find($this->customer_id); - $customer->update(['poin_balance' => $customer->poin_balance + $this->debit - $this->credit]); + $maxExpired = Setting::getByKey('MAX_POINT_EXPIRED'); + + if ($customer->poin_expired_at == null || $updateExpired) { + $customer->poin_expired_at = now()->addDays($maxExpired); + } + + $customer->update([ + 'poin_balance' => $customer->poin_balance + $this->debit - $this->credit, + 'poin_expired_at' => $customer->poin_expired_at + ]); } } diff --git a/app/Models/Sale.php b/app/Models/Sale.php index d0f3a8f..7cb1f4b 100644 --- a/app/Models/Sale.php +++ b/app/Models/Sale.php @@ -73,7 +73,7 @@ class Sale extends Model public function displayAmount(): Attribute { return Attribute::make(get: function () { - return 'Rp' . number_format($this->amount, is_float($this->amount) ? 2 : 0, ',', '.'); + return 'Rp ' . number_format($this->amount, is_float($this->amount) ? 2 : 0, ',', '.'); }); } @@ -103,4 +103,67 @@ class Sale extends Model 'description' => 'Transaksi pembelian anda ' . $this->code . ' sebesar ' . $this->display_amount . ' berhasil', ]); } + + public function create_payment() + { + // payed with deposit + if ($this->payed_with == Sale::PAYED_WITH_DEPOSIT) { + $deposit = $this->customer->deposites()->create([ + 'credit' => $this->amount, + 'description' => $this->code, + 'related_type' => self::class, + 'related_id' => $this->id, + 'is_valid' => DepositHistory::STATUS_VALID, + ]); + $deposit->update_customer_balance(); + } + + // payed with paylater + if ($this->payed_with == Sale::PAYED_WITH_PAYLATER) { + $paylater = $this->customer->paylaterHistories()->create([ + 'debit' => $this->amount, + 'description' => $this->code, + ]); + $paylater->update_customer_paylater(); + } + } + + public function create_poin_reward() + { + $bonus = PoinReward::where('customer_level_id', $this->customer->customer_level_id) + ->where('amount_buy', '<=', $this->amount) + ->orderBy('bonus_poin', 'desc') + ->first(); + + if ($bonus != null) { + $poin = $this->customer->poins()->create([ + 'debit' => $bonus->bonus_poin, + 'description' => GeneralService::generateBonusPoinCode(), + 'narration' => 'Bonus Poin Reward' + ]); + + $poin->update_customer_balance(); + } + } + + public function create_poin_affilate() + { + $affilateEnabled = Setting::getByKey('AFFILATE_ENABLED'); + $isAllowAffilate = GeneralService::isAllowAffilate($this->customer->level->key); + if ($affilateEnabled == 1 && $isAllowAffilate) { + $bonus = Setting::getByKey('AFFILATE_DOWNLINE_POIN_AMOUNT'); + if ($bonus > 0) { + $code = CustomerRefferal::where('refferal_id', $this->customer_id)->value('customer_code'); + $customer = Customer::where('referral_code', $code)->first(); + + $poin = $customer->poins()->create([ + 'debit' => $bonus, + 'description' => GeneralService::generateBonusPoinCode(), + 'narration' => 'Bonus Poin Affilate (Downline)' + ]); + + $poin->update_customer_balance(); + } + } + } } diff --git a/app/Models/Voucher.php b/app/Models/Voucher.php index ca870d3..6890a48 100644 --- a/app/Models/Voucher.php +++ b/app/Models/Voucher.php @@ -2,6 +2,7 @@ namespace App\Models; +use App\Services\GeneralService; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Support\Facades\Auth; @@ -26,6 +27,8 @@ class Voucher extends Model protected $appends = [ 'validate_price', 'validate_display_price', + 'validate_price_poin', + 'validate_bonus_poin', 'discount', 'status', 'created_at_formated' @@ -81,6 +84,38 @@ class Voucher extends Model }); } + public function validateBonusPoin(): Attribute + { + return Attribute::make(get: function () { + if ($this->locationProfile->prices->count() > 0) { + $price = $this->locationProfile->prices; + if (auth()->guard('customer')->check()) { + $customer = self::getInstance()['customer']; + return $price->where('customer_level_id', $customer->customer_level_id) + ->value('bonus_poin'); + } + return $price->max('bonus_poin'); + } + return $this->locationProfile->bonus_poin; + }); + } + + public function validatePricePoin(): Attribute + { + return Attribute::make(get: function () { + if ($this->locationProfile->prices->count() > 0) { + $price = $this->locationProfile->prices; + if (auth()->guard('customer')->check()) { + $customer = self::getInstance()['customer']; + return $price->where('customer_level_id', $customer->customer_level_id) + ->value('price_poin'); + } + return $price->max('price_poin'); + } + return $this->locationProfile->price_poin; + }); + } + public function discount(): Attribute { return Attribute::make(get: function () { @@ -190,4 +225,20 @@ class Voucher extends Model 'sum_voucher_unsold' => $sum_voucher_unsold, ]; } + + public function create_bonus_poin(Customer $customer) + { + $bonus = $this->validate_bonus_poin; + + if ($bonus > 0) { + $customer = Customer::find($customer->id); + $poin = $customer->poins()->create([ + 'debit' => $bonus, + 'description' => GeneralService::generateBonusPoinCode(), + 'narration' => 'Bonus Poin Pembelian Voucher' + ]); + + $poin->update_customer_balance(); + } + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7a92ae8..40fb000 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,17 +26,17 @@ class AppServiceProvider extends ServiceProvider public function boot() { // for optimize in development log every query - if (app()->isProduction() == false) { - DB::listen(function ($query) { - Log::info( - $query->sql, - [ - 'bindings' => $query->bindings, - 'time' => $query->time, - 'connectionName' => $query->connectionName, - ] - ); - }); - } + // if (app()->isProduction() == false) { + // DB::listen(function ($query) { + // Log::info( + // $query->sql, + // [ + // 'bindings' => $query->bindings, + // 'time' => $query->time, + // 'connectionName' => $query->connectionName, + // ] + // ); + // }); + // } } } diff --git a/app/Services/GeneralService.php b/app/Services/GeneralService.php index e50442d..d322eee 100644 --- a/app/Services/GeneralService.php +++ b/app/Services/GeneralService.php @@ -5,6 +5,7 @@ namespace App\Services; use App\Models\Customer; use App\Models\DepositHistory; use App\Models\DepositLocation; +use App\Models\PoinHistory; use App\Models\Sale; use App\Models\Setting; use Illuminate\Support\Carbon; @@ -164,6 +165,13 @@ class GeneralService return 'Invoice #VCR' . now()->format('dmy') . GeneralService::formatNumberCode($code); } + public static function generateBonusPoinCode() + { + $code = PoinHistory::whereDate('created_at', now())->count() + 1; + + return 'Invoice #BPN' . now()->format('dmy') . GeneralService::formatNumberCode($code); + } + public static function formatNumberCode($number) { if ($number < 10) { @@ -177,4 +185,16 @@ class GeneralService } return $number; } + + public static function isAllowAffilate($key) + { + $isAllow = false; + $levels = json_decode(Setting::getByKey('AFFILATE_ALLOWED_LEVELS')); + foreach($levels as $level) { + if ($key == $level->key) { + $isAllow = true; + } + } + return $isAllow; + } } diff --git a/database/migrations/2023_06_16_045835_create_poin_histories_table.php b/database/migrations/2023_06_16_045835_create_poin_histories_table.php index 9689342..a3515c8 100644 --- a/database/migrations/2023_06_16_045835_create_poin_histories_table.php +++ b/database/migrations/2023_06_16_045835_create_poin_histories_table.php @@ -16,7 +16,8 @@ return new class extends Migration $table->decimal('debit', 20, 2)->default(0); $table->decimal('credit', 20, 2)->default(0); - $table->text('description')->nullable(); + $table->string('description')->nullable(); + $table->text('narration')->nullable(); $table->ulid('customer_id')->nullable(); $table->string('related_type')->nullable(); $table->string('related_id')->nullable(); diff --git a/database/seeders/DummySeeder.php b/database/seeders/DummySeeder.php index d2d33c3..fe53e80 100644 --- a/database/seeders/DummySeeder.php +++ b/database/seeders/DummySeeder.php @@ -121,7 +121,7 @@ class DummySeeder extends Seeder 'display_price' => $disply_price, 'discount' => $discount, 'price_poin' => $price, - 'bonus_poin' => 0, + 'bonus_poin' => $count == 1 ? 10 : 0, ]); if ($count == 3) { @@ -133,6 +133,7 @@ class DummySeeder extends Seeder foreach (CustomerLevel::LEVELS as $index => $level) { if ($index != 0) { $disc += 5; + $bp += 5; } $p = $dp - ($dp * ($disc / 100)); @@ -175,10 +176,10 @@ class DummySeeder extends Seeder { DepositLocation::create([ 'name' => 'Location 1', - 'address' => 'Address Lengkap Alamat', + 'address' => 'Gedung Sebaguna Kota Alele, Jl. Address Lengkap No.20 Kota Kabupaten', 'phone' => '83840745543', 'gmap_url' => 'https://goo.gl/maps/iyJ8nq32pJ2BbfUf6', - 'image' => 'sample/banner.jpg', + 'image' => 'sample/location.png', 'description' => '

lokasi favoorite

', 'open_hour' => '00:00', 'close_hour' => '23:59', @@ -187,10 +188,10 @@ class DummySeeder extends Seeder DepositLocation::create([ 'name' => 'Location 2', - 'address' => 'Address Lengkap Alamat', + 'address' => 'Jl. Address Lengkap No.20 Kota Kabupaten', 'phone' => '83840745543', 'gmap_url' => 'https://goo.gl/maps/iyJ8nq32pJ2BbfUf6', - 'image' => 'sample/banner.jpg', + 'image' => 'sample/location.png', 'description' => '

lokasi favoorite

', 'open_hour' => '14:00', 'close_hour' => '18:59', diff --git a/public/sample/banner.jpg b/public/sample/banner.jpg deleted file mode 100644 index 7803386..0000000 Binary files a/public/sample/banner.jpg and /dev/null differ diff --git a/public/sample/location.png b/public/sample/location.png new file mode 100644 index 0000000..4483d5f Binary files /dev/null and b/public/sample/location.png differ diff --git a/resources/js/Customer/CustomerLevel/Index.jsx b/resources/js/Customer/CustomerLevel/Index.jsx index 6e9aea7..27be652 100644 --- a/resources/js/Customer/CustomerLevel/Index.jsx +++ b/resources/js/Customer/CustomerLevel/Index.jsx @@ -43,7 +43,10 @@ export default function Index(props) {
- +
diff --git a/resources/js/Customer/Deposit/DetailPartials/FormUploadCashDeposit.jsx b/resources/js/Customer/Deposit/DetailPartials/FormUploadCashDeposit.jsx index 75877c0..c9e3246 100644 --- a/resources/js/Customer/Deposit/DetailPartials/FormUploadCashDeposit.jsx +++ b/resources/js/Customer/Deposit/DetailPartials/FormUploadCashDeposit.jsx @@ -64,6 +64,7 @@ export const FormUploadCashDeposit = () => {
Bukti Pembayaran
bukti Pembayaran @@ -97,6 +98,7 @@ export const FormUploadCashDeposit = () => { image location
@@ -137,6 +139,7 @@ export const FormUploadCashDeposit = () => { image location
@@ -252,6 +255,7 @@ export const FormUploadCashDeposit = () => { {isEmpty(data.image_url) == false && ( bukti Pembayaran diff --git a/resources/js/Customer/Deposit/DetailPartials/FormUploadManual.jsx b/resources/js/Customer/Deposit/DetailPartials/FormUploadManual.jsx index 7bf053e..6f202f3 100644 --- a/resources/js/Customer/Deposit/DetailPartials/FormUploadManual.jsx +++ b/resources/js/Customer/Deposit/DetailPartials/FormUploadManual.jsx @@ -64,6 +64,7 @@ export const FormUploadManual = () => {
Bukti Transfer
bukti transfer @@ -98,6 +99,7 @@ export const FormUploadManual = () => { src={account.logo_url} alt="logo bank" className="h-10" + loading="lazy" />
@@ -124,6 +126,7 @@ export const FormUploadManual = () => { src={account.logo_url} alt="logo bank" className="h-10" + loading="lazy" />
@@ -231,6 +234,7 @@ export const FormUploadManual = () => { src={`${data.image_url}`} className="w-full h-52 mb-1" alt="bukti transfer" + loading="lazy" /> )}
diff --git a/resources/js/Customer/Deposit/Topup.jsx b/resources/js/Customer/Deposit/Topup.jsx index 6fdf620..719b059 100644 --- a/resources/js/Customer/Deposit/Topup.jsx +++ b/resources/js/Customer/Deposit/Topup.jsx @@ -124,6 +124,7 @@ export default function Topup({ payments }) { )} {+payment.admin_fee !== 0 && ( diff --git a/resources/js/Customer/DepositLocation/Index.jsx b/resources/js/Customer/DepositLocation/Index.jsx index d747c8a..ddbbca1 100644 --- a/resources/js/Customer/DepositLocation/Index.jsx +++ b/resources/js/Customer/DepositLocation/Index.jsx @@ -48,6 +48,7 @@ export default function Index({ locations: { data, next_page_url } }) {
{location.name}
diff --git a/resources/js/Customer/Index/Banner.jsx b/resources/js/Customer/Index/Banner.jsx index b5ad9e6..1bd5217 100644 --- a/resources/js/Customer/Index/Banner.jsx +++ b/resources/js/Customer/Index/Banner.jsx @@ -19,6 +19,7 @@ export default function Banner({ banner }) {
{banner.title} diff --git a/resources/js/Customer/Poin/Detail.jsx b/resources/js/Customer/Poin/Detail.jsx index 361ece9..26253e6 100644 --- a/resources/js/Customer/Poin/Detail.jsx +++ b/resources/js/Customer/Poin/Detail.jsx @@ -30,6 +30,13 @@ export default function Detail({ poin }) {
+
+
+
+ {poin.narration} +
+
+
) diff --git a/resources/js/Customer/Poin/Exchange.jsx b/resources/js/Customer/Poin/Exchange.jsx index 9dacae8..ccb0d21 100644 --- a/resources/js/Customer/Poin/Exchange.jsx +++ b/resources/js/Customer/Poin/Exchange.jsx @@ -68,7 +68,7 @@ export default function Exhange(props) { return ( - +
Tukar poin
diff --git a/resources/js/Customer/Poin/Index.jsx b/resources/js/Customer/Poin/Index.jsx index 0c0989c..42a9fdb 100644 --- a/resources/js/Customer/Poin/Index.jsx +++ b/resources/js/Customer/Poin/Index.jsx @@ -69,7 +69,7 @@ export default function Index(props) { return ( - +
{_poins.length <= 0 && } diff --git a/resources/js/Customer/Poin/VoucherCard.jsx b/resources/js/Customer/Poin/VoucherCard.jsx index d09d0a8..3e1ad2d 100644 --- a/resources/js/Customer/Poin/VoucherCard.jsx +++ b/resources/js/Customer/Poin/VoucherCard.jsx @@ -64,7 +64,7 @@ export default function VoucherCard({ voucher }) { onClick={() => setShow(true)} >
- {voucher.location_profile.name} + {voucher.location_profile.location.name}
@@ -73,8 +73,7 @@ export default function VoucherCard({ voucher }) { {voucher.location_profile.display_note}
- {formatIDR(voucher.location_profile.price_poin)}{' '} - poin + {formatIDR(voucher.validate_price_poin)} poin
@@ -82,7 +81,7 @@ export default function VoucherCard({ voucher }) { {voucher.location_profile.quota}
- {voucher.location_profile.display_expired} + {voucher.location_profile.diplay_expired}
diff --git a/resources/js/Customer/Profile/Form.jsx b/resources/js/Customer/Profile/Form.jsx index 388d37c..a2cfbf3 100644 --- a/resources/js/Customer/Profile/Form.jsx +++ b/resources/js/Customer/Profile/Form.jsx @@ -156,6 +156,7 @@ export default function Index({ auth: { user }, flash }) { src={`${data.image_url}`} className="w-20 h-20 mb-1 rounded-full" alt="profile image" + loading="lazy" /> } /> diff --git a/resources/js/Customer/Profile/Index.jsx b/resources/js/Customer/Profile/Index.jsx index 19855a7..89b1033 100644 --- a/resources/js/Customer/Profile/Index.jsx +++ b/resources/js/Customer/Profile/Index.jsx @@ -50,6 +50,7 @@ export default function Index({ src={user.image_url} alt="profile image" className="rounded-full object-cover h-14 w-14" + loading="lazy" /> ) : ( diff --git a/resources/js/Customer/Verification/Index.jsx b/resources/js/Customer/Verification/Index.jsx index 6e98d37..6ae785b 100644 --- a/resources/js/Customer/Verification/Index.jsx +++ b/resources/js/Customer/Verification/Index.jsx @@ -45,6 +45,7 @@ const VerificationForm = () => { src={`${user.identity_image_url}`} className="w-full object-fill h-48 mb-1 " alt="ktp image" + loading="lazy" /> } /> diff --git a/resources/js/Layouts/AuthenticatedLayout.jsx b/resources/js/Layouts/AuthenticatedLayout.jsx index b1690d4..9c2349b 100644 --- a/resources/js/Layouts/AuthenticatedLayout.jsx +++ b/resources/js/Layouts/AuthenticatedLayout.jsx @@ -119,6 +119,7 @@ export default function Authenticated({ src={auth.user.photo_url} alt="user profile image" className="h-10 rounded-full border border-gray-100" + loading="lazy" /> {auth.user.name} diff --git a/resources/js/Pages/Account/Form.jsx b/resources/js/Pages/Account/Form.jsx index 1a36a16..4ea698b 100644 --- a/resources/js/Pages/Account/Form.jsx +++ b/resources/js/Pages/Account/Form.jsx @@ -99,6 +99,7 @@ export default function Form(props) { src={data.logo_url} className="mb-1 h-24 object-cover" alt="preview" + loading="lazy" /> ) } diff --git a/resources/js/Pages/Account/Index.jsx b/resources/js/Pages/Account/Index.jsx index 1806600..a9c9dba 100644 --- a/resources/js/Pages/Account/Index.jsx +++ b/resources/js/Pages/Account/Index.jsx @@ -104,6 +104,7 @@ export default function Account(props) { src={account.logo_url} alt="bank logo alt" className="h-5" + loading="lazy" /> diff --git a/resources/js/Pages/Banner/Form.jsx b/resources/js/Pages/Banner/Form.jsx index fec694c..52df707 100644 --- a/resources/js/Pages/Banner/Form.jsx +++ b/resources/js/Pages/Banner/Form.jsx @@ -74,6 +74,7 @@ export default function Form(props) { src={data.image_url} className="mb-1 h-24 w-full object-cover" alt="preview" + loading="lazy" /> ) } diff --git a/resources/js/Pages/Customer/Form.jsx b/resources/js/Pages/Customer/Form.jsx index b4c0080..31e0741 100644 --- a/resources/js/Pages/Customer/Form.jsx +++ b/resources/js/Pages/Customer/Form.jsx @@ -134,6 +134,7 @@ const Profile = () => { src={data.image_url} className="mb-1 h-24 w-24 object-cover rounded-full" alt="preview" + loading="lazy" /> ) } @@ -164,6 +165,7 @@ const Identity = () => { alt="identity" src={customer?.identity_image_url} className="w-full object-fill h-96" + loading="lazy" /> ) diff --git a/resources/js/Pages/CustomerLevel/Form.jsx b/resources/js/Pages/CustomerLevel/Form.jsx index 78d2910..c380eae 100644 --- a/resources/js/Pages/CustomerLevel/Form.jsx +++ b/resources/js/Pages/CustomerLevel/Form.jsx @@ -76,6 +76,7 @@ export default function Form(props) { src={data.logo_url} className="mb-1 h-24 object-cover" alt="preview" + loading="lazy" /> ) } diff --git a/resources/js/Pages/CustomerLevel/Index.jsx b/resources/js/Pages/CustomerLevel/Index.jsx index a30518d..52d66ca 100644 --- a/resources/js/Pages/CustomerLevel/Index.jsx +++ b/resources/js/Pages/CustomerLevel/Index.jsx @@ -62,6 +62,7 @@ export default function Info(props) { src={level.logo_url} className="h-20" alt="logo alt" + loading="lazy" /> diff --git a/resources/js/Pages/DepositHistory/FormModal.jsx b/resources/js/Pages/DepositHistory/FormModal.jsx index a512ce5..8b9a606 100644 --- a/resources/js/Pages/DepositHistory/FormModal.jsx +++ b/resources/js/Pages/DepositHistory/FormModal.jsx @@ -150,6 +150,7 @@ export default function FormModal(props) { diff --git a/resources/js/Pages/DepositLocation/Form.jsx b/resources/js/Pages/DepositLocation/Form.jsx index 5d15a39..a9fe6cb 100644 --- a/resources/js/Pages/DepositLocation/Form.jsx +++ b/resources/js/Pages/DepositLocation/Form.jsx @@ -148,6 +148,7 @@ export default function Form(props) { src={data.image_url} className="mb-1 h-24 object-cover " alt="preview" + loading="lazy" /> ) } diff --git a/resources/js/Pages/Setting/Payment.jsx b/resources/js/Pages/Setting/Payment.jsx index 630f6c1..ad26721 100644 --- a/resources/js/Pages/Setting/Payment.jsx +++ b/resources/js/Pages/Setting/Payment.jsx @@ -93,6 +93,7 @@ export default function General(props) { src={`${data.MIDTRANS_LOGO_URL}`} className="w-40 mb-1" alt="site logo" + loading="lazy" /> } /> diff --git a/resources/js/Pages/User/Form.jsx b/resources/js/Pages/User/Form.jsx index 9e0df19..5f376e8 100644 --- a/resources/js/Pages/User/Form.jsx +++ b/resources/js/Pages/User/Form.jsx @@ -132,6 +132,7 @@ export default function Form(props) { src={data.photo_url} className="mb-1 h-24 w-24 object-cover rounded-full" alt="preview" + loading="lazy" /> ) } diff --git a/resources/js/Pages/User/Index.jsx b/resources/js/Pages/User/Index.jsx index 7cd198c..b7d5ee3 100644 --- a/resources/js/Pages/User/Index.jsx +++ b/resources/js/Pages/User/Index.jsx @@ -131,6 +131,7 @@ export default function User(props) { photo profile diff --git a/resources/js/Pages/Verification/Form.jsx b/resources/js/Pages/Verification/Form.jsx index faa8725..d2517e2 100644 --- a/resources/js/Pages/Verification/Form.jsx +++ b/resources/js/Pages/Verification/Form.jsx @@ -77,6 +77,7 @@ export default function Form(props) { diff --git a/resources/js/Pages/Voucher/Form.jsx b/resources/js/Pages/Voucher/Form.jsx index 08c6ef1..06b2f9c 100644 --- a/resources/js/Pages/Voucher/Form.jsx +++ b/resources/js/Pages/Voucher/Form.jsx @@ -38,7 +38,7 @@ export default function Form(props) { if (isEmpty(voucher) === false) { setData({ username: voucher.username, - location_profile_id: voucher.location_id, + location_profile_id: voucher.location_profile_id, }) } }, [voucher])