move on to mysql, change coin to poin

dev
Aji Kamaludin 1 year ago
parent 2431def267
commit eca09a6cd6
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -8,7 +8,12 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=voucher
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file

@ -1,48 +1 @@
# TODO
### Admin
- [x] CRUD Info
- [x] CRUD Banner
- [x] CRUD Rekening / Account
- [x] CRUD Customer
- [x] CRUD Lokasi
- [x] CRUD Voucher
- [x] Import Voucher
- [x] Setting Web (enable affilate, amount bonus affilate)
- [x] Setting Level Customer (view levels, edit name of level,minimal saldo, max amount saldo, max hutang)
- [x] Deposit Menu (view daftar histori deposit)
- [x] Manual Approve Deposit
- [x] List Customer Verification
- [x] Manual Approve Verification -> mendapatkan limit hutang
- [x] Setting Bonus Coin (memasukan amount bonus coin yang didapat dengan level dan harga voucher) - bonus coin
- [x] Voucher Sales (index: customer, total, jumlah voucher, detail: customer, list voucher, payment)
- [x] Dashboard (gafik hasil penjualan : disorting tanggal, lokasi dan customer)
- [x] Notification ([x]manual deposit, [x]deposit success, [x]stock voucher, [x]sale)
- [x] Voucher - harga per level , fixing detail transaksi
- [x] Voucher - harga coin
- [ ] View Customer Coin History
### Add
- hutang (paylater) adalah limit tiap customer jika deposit kurang dalam pembayaran voucher , setiap limit yang digunakan akan di potong / di lunasi ketika melakukan topup deposit
- tukar coin adalah dengan menambahkan harga coin di voucher dan menambahkan 1 fitur di customer untuk explorer voucher yang memiliki harga coin, disimpan menjadi sale biasa dengan cara 1 kali penukaran adalah 1 voucher
### Customer
- [x] Tampilan Depan Customer (banner, info, voucher, saldo, coin) - mobile page
- [x] Register Customer (wajib data lengkap)
- [x] Register Customer Gmail
- [x] Login Customer
- [x] Login Customer Gmail
- [x] Customer Edit Profile
- [x] Customer Deposit Manual
- [x] Customer Deposit Payment Gateway
- [x] Customer Purchase Voucher
- [x] Customer Share Buyed Voucher, via WA dll
- [x] Register Refferal
- [x] Customer View Coin History
- [x] Verified Akun
- [x] Paylater: index paylater, payment cart, deposite repay
- [x] Notification ([x] purchase success, [x] deposit success)
- [x] Coin Explorer: list voucher, modal voucher to excange

@ -73,7 +73,7 @@ class AuthController extends Controller
'fullname' => $user->name,
'name' => $user->nickname,
'email' => $user->email,
'username' => Str::slug($user->name.'_'.Str::random(5), '_'),
'username' => Str::slug($user->name . '_' . Str::random(5), '_'),
'google_id' => $user->id,
'google_oauth_response' => json_encode($user),
]);
@ -98,7 +98,7 @@ class AuthController extends Controller
'fullname' => 'required|string',
'name' => 'required|string',
'address' => 'required|string',
'phone' => 'required|numeric',
'phone' => 'required|numeric|regex:/^([0-9\s\-\+\(\)]*)$/|min:9|max:16',
'username' => 'required|string|min:5|alpha_dash|unique:customers,username',
'password' => 'required|string|min:8|confirmed',
'referral_code' => 'nullable|exists:customers,referral_code',
@ -123,13 +123,13 @@ class AuthController extends Controller
$affilateEnabled = Setting::getByKey('AFFILATE_ENABLED');
if ($affilateEnabled == 1) {
$bonusCoin = Setting::getByKey('AFFILATE_COIN_AMOUNT');
$coin = $refferal->coins()->create([
'debit' => $bonusCoin,
'description' => 'Bonus Refferal #'.Str::random(5),
$bonuspoin = Setting::getByKey('AFFILATE_poin_AMOUNT');
$poin = $refferal->poins()->create([
'debit' => $bonuspoin,
'description' => 'Bonus Refferal #' . Str::random(5),
]);
$coin->update_customer_balance();
$poin->update_customer_balance();
}
}
@ -143,7 +143,7 @@ class AuthController extends Controller
public function destroy()
{
session()->remove('carts');
Auth::logout();
return redirect()->route('customer.login')

@ -3,7 +3,7 @@
namespace App\Http\Controllers\Customer;
use App\Http\Controllers\Controller;
use App\Models\CoinReward;
use App\Models\PoinReward;
use App\Models\Customer;
use App\Models\DepositHistory;
use App\Models\Sale;
@ -17,7 +17,7 @@ class CartController extends Controller
/**
* show list of item in cart
* has payed button
* show payment method -> deposit, coin, paylater
* show payment method -> deposit, poin, paylater
*/
public function index()
{
@ -159,20 +159,20 @@ class CartController extends Controller
}
$sale->create_notification();
$bonus = CoinReward::where('customer_level_id', $customer->customer_level_id)
$bonus = PoinReward::where('customer_level_id', $customer->customer_level_id)
->where('amount_buy', '<=', $total)
->orderBy('bonus_coin', 'desc')->first();
->orderBy('bonus_poin', 'desc')->first();
if ($bonus != null) {
$coin = $customer->coins()->create([
'debit' => $bonus->bonus_coin,
'description' => 'Bonus Pembelian #'.$sale->code,
$poin = $customer->poins()->create([
'debit' => $bonus->bonus_poin,
'description' => 'Bonus Pembelian #' . $sale->code,
]);
$coin->update_customer_balance();
$poin->update_customer_balance();
}
$description = 'Pembayaran #'.$sale->code;
$description = 'Pembayaran #' . $sale->code;
if ($customer->deposit_balance < $total) {
if ($customer->deposit_balance > 0) {

@ -1,26 +0,0 @@
<?php
namespace App\Http\Controllers\Customer;
use App\Http\Controllers\Controller;
use App\Models\CoinHistory;
class CoinController extends Controller
{
public function index()
{
$coins = CoinHistory::where('customer_id', auth()->id())
->orderBy('updated_at', 'desc');
return inertia('Coin/Index', [
'coins' => $coins->paginate(20),
]);
}
public function show(CoinHistory $coin)
{
return inertia('Coin/Detail', [
'coin' => $coin,
]);
}
}

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers\Customer;
use App\Http\Controllers\Controller;
use App\Models\poinHistory;
class PoinController extends Controller
{
public function index()
{
$poins = PoinHistory::where('customer_id', auth()->id())
->orderBy('updated_at', 'desc');
return inertia('Poin/Index', [
'poins' => $poins->paginate(20),
]);
}
public function show(poinHistory $poin)
{
return inertia('Poin/Detail', [
'poin' => $poin,
]);
}
}

@ -10,15 +10,15 @@ use App\Models\Voucher;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class CoinExchangeController extends Controller
class PoinExchangeController extends Controller
{
public function index(Request $request)
{
$locations = Location::get();
$vouchers = Voucher::with(['location'])
->where(function ($q) {
$q->where('price_coin', '!=', 0)
->where('price_coin', '!=', null);
$q->where('price_poin', '!=', 0)
->where('price_poin', '!=', null);
})
->where('is_sold', Voucher::UNSOLD)
->groupBy('batch_id')
@ -28,7 +28,7 @@ class CoinExchangeController extends Controller
$vouchers->where('location_id', $request->location_id);
}
return inertia('Coin/Exchange', [
return inertia('Poin/Exchange', [
'locations' => $locations,
'vouchers' => tap($vouchers->paginate(10))->setHidden(['username', 'password']),
'_location_id' => $request->location_id ?? '',
@ -39,30 +39,30 @@ class CoinExchangeController extends Controller
{
$batchCount = $voucher->count_unsold();
if ($batchCount < 1) {
return redirect()->route('customer.coin.exchange')
return redirect()->route('customer.poin.exchange')
->with('message', ['type' => 'error', 'message' => 'transaksi gagal, voucher sedang tidak tersedia']);
}
$customer = Customer::find(auth()->id());
if ($customer->coin_balance < $voucher->price_coin) {
return redirect()->route('customer.coin.exchange')
if ($customer->poin_balance < $voucher->price_poin) {
return redirect()->route('customer.poin.exchange')
->with('message', ['type' => 'error', 'message' => 'koin kamu tidak cukup untuk ditukar voucher ini']);
}
DB::beginTransaction();
$sale = $customer->sales()->create([
'code' => 'Tukar Coin '.str()->upper(str()->random(5)),
'code' => 'Tukar poin ' . str()->upper(str()->random(5)),
'date_time' => now(),
'amount' => 0,
'payed_with' => Sale::PAYED_WITH_COIN,
'payed_with' => Sale::PAYED_WITH_poin,
]);
$voucher = $voucher->shuffle_unsold();
$sale->items()->create([
'entity_type' => $voucher::class,
'entity_id' => $voucher->id,
'price' => $voucher->price_coin,
'price' => $voucher->price_poin,
'quantity' => 1,
'additional_info_json' => json_encode([
'id' => $voucher->id,
@ -76,12 +76,12 @@ class CoinExchangeController extends Controller
$sale->create_notification();
$coin = $customer->coins()->create([
'credit' => $voucher->price_coin,
$poin = $customer->poins()->create([
'credit' => $voucher->price_poin,
'description' => $sale->code,
]);
$coin->update_customer_balance();
$poin->update_customer_balance();
DB::commit();
return redirect()->route('transactions.show', $sale)

@ -24,9 +24,9 @@ class GeneralController extends Controller
$month = now()->locale('id')->translatedFormat('F');
$startOfMonth = now()->startOfMonth()->format('m/d/Y');
$endOfMonth = now()->endOfMonth()->format('m/d/Y');
$total_voucher_sale_this_month = SaleItem::whereBetween(DB::raw("strftime('%m/%d/%Y', created_at)"), [$startOfMonth, $endOfMonth])
$total_voucher_sale_this_month = SaleItem::whereBetween("created_at", [$startOfMonth, $endOfMonth])
->sum('price');
$count_voucher_sale_this_month = SaleItem::whereBetween(DB::raw("strftime('%m/%d/%Y', created_at)"), [$startOfMonth, $endOfMonth])
$count_voucher_sale_this_month = SaleItem::whereBetween("created_at", [$startOfMonth, $endOfMonth])
->sum('quantity');
$total_voucher_sale_this_day = SaleItem::whereDate('created_at', now()->format('Y-m-d'))
->sum('price');
@ -61,10 +61,10 @@ class GeneralController extends Controller
if ($request->end_date != '') {
$endDate = Carbon::parse($request->end_date)->format('m/d/Y');
}
$charts = Sale::selectRaw("SUM(amount) as sale_total, strftime('%d/%m/%Y', date_time) as date")
->whereBetween(DB::raw("strftime('%m/%d/%Y', date_time)"), [$startDate, $endDate])
$charts = Sale::selectRaw('SUM(amount) as sale_total, date_time')
->whereBetween('date_time', [$startDate, $endDate])
->orderBy('date_time', 'asc')
->groupBy(DB::raw("strftime('%m/%d/%Y', date_time)"));
->groupBy('date_time');
// filter lokasi
if ($request->location_id != '') {

@ -2,18 +2,18 @@
namespace App\Http\Controllers;
use App\Models\CoinReward;
use App\Models\PoinReward;
use App\Models\CustomerLevel;
use Illuminate\Http\Request;
class CoinRewardController extends Controller
class PoinRewardController extends Controller
{
public function index()
{
$query = CoinReward::with(['level'])
$query = PoinReward::with(['level'])
->orderBy('updated_at', 'desc');
return inertia('CoinReward/Index', [
return inertia('PoinReward/Index', [
'query' => $query->paginate(),
'levels' => CustomerLevel::all(),
]);
@ -23,37 +23,37 @@ class CoinRewardController extends Controller
{
$request->validate([
'amount_buy' => 'required|numeric',
'bonus_coin' => 'required|numeric',
'bonus_poin' => 'required|numeric',
'customer_level_id' => 'required|exists:customer_levels,id',
]);
CoinReward::create([
PoinReward::create([
'amount_buy' => $request->amount_buy,
'bonus_coin' => $request->bonus_coin,
'bonus_poin' => $request->bonus_poin,
'customer_level_id' => $request->customer_level_id,
]);
session()->flash('message', ['type' => 'success', 'message' => 'Item has beed saved']);
}
public function update(Request $request, CoinReward $reward)
public function update(Request $request, PoinReward $reward)
{
$request->validate([
'amount_buy' => 'required|numeric',
'bonus_coin' => 'required|numeric',
'bonus_poin' => 'required|numeric',
'customer_level_id' => 'required|exists:customer_levels,id',
]);
$reward->update([
'amount_buy' => $request->amount_buy,
'bonus_coin' => $request->bonus_coin,
'bonus_poin' => $request->bonus_poin,
'customer_level_id' => $request->customer_level_id,
]);
session()->flash('message', ['type' => 'success', 'message' => 'Item has beed updated']);
}
public function destroy(CoinReward $reward)
public function destroy(PoinReward $reward)
{
$reward->delete();

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Setting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class SettingController extends Controller
@ -21,9 +22,10 @@ class SettingController extends Controller
public function update(Request $request)
{
$request->validate([
'OPEN_WEBSITE_NAME' => 'required|string',
'VOUCHER_STOCK_NOTIFICATION' => 'required|numeric',
'AFFILATE_ENABLED' => 'required|in:0,1',
'AFFILATE_COIN_AMOUNT' => 'required|numeric',
'AFFILATE_POIN_AMOUNT' => 'required|numeric',
'MIDTRANS_SERVER_KEY' => 'required|string',
'MIDTRANS_CLIENT_KEY' => 'required|string',
'MIDTRANS_MERCHANT_ID' => 'required|string',
@ -42,6 +44,8 @@ class SettingController extends Controller
Setting::where('key', 'MIDTRANS_LOGO')->update(['value' => $file->hashName('uploads')]);
}
Cache::flush();
DB::commit();
session()->flash('message', ['type' => 'success', 'message' => 'Setting has beed saved']);

@ -47,7 +47,7 @@ class VoucherController extends Controller
'password' => 'required|string',
'discount' => 'required|numeric',
'display_price' => 'required|numeric',
'price_coin' => 'nullable|numeric',
'price_poin' => 'nullable|numeric',
'quota' => 'required|string',
'profile' => 'required|string',
'comment' => 'required|string',
@ -67,7 +67,7 @@ class VoucherController extends Controller
'password' => $request->password,
'discount' => $request->discount,
'display_price' => $request->display_price,
'price_coin' => $request->price_coin,
'price_poin' => $request->price_poin,
'quota' => $request->quota,
'profile' => $request->profile,
'comment' => $request->comment,
@ -110,7 +110,7 @@ class VoucherController extends Controller
'password' => 'required|string',
'discount' => 'required|numeric',
'display_price' => 'required|numeric',
'price_coin' => 'nullable|numeric',
'price_poin' => 'nullable|numeric',
'quota' => 'required|string',
'profile' => 'required|string',
'comment' => 'required|string',
@ -135,7 +135,7 @@ class VoucherController extends Controller
'location_id' => $request->location_id,
'discount' => $request->discount,
'display_price' => $request->display_price,
'price_coin' => $request->price_coin,
'price_poin' => $request->price_poin,
'quota' => $request->quota,
'profile' => $request->profile,
'comment' => $request->comment,
@ -184,7 +184,7 @@ class VoucherController extends Controller
'location_id' => 'required|exists:locations,id',
'discount' => 'required|numeric',
'display_price' => 'required|numeric',
'price_coin' => 'nullable|numeric',
'price_poin' => 'nullable|numeric',
'expired' => 'required|numeric',
'expired_unit' => 'required|string',
'prices' => 'nullable|array',
@ -203,7 +203,7 @@ class VoucherController extends Controller
'password' => $voucher['password'],
'discount' => $request->discount,
'display_price' => $request->display_price,
'price_coin' => $request->price_coin,
'price_poin' => $request->price_poin,
'quota' => $voucher['quota'],
'profile' => $voucher['profile'],
'comment' => $voucher['comment'],

@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use App\Models\Notification;
use App\Models\Setting;
use Illuminate\Http\Request;
use Inertia\Middleware;
@ -45,6 +46,7 @@ class HandleInertiaCustomerRequests extends Middleware
return array_merge(parent::share($request), [
'app_name' => env('APP_NAME', 'App Name'),
'setting' => Setting::getSettings(),
'auth' => [
'user' => auth('customer')->user()?->load(['level', 'paylater']),
],
@ -53,6 +55,7 @@ class HandleInertiaCustomerRequests extends Middleware
],
'notification_count' => $notification_count,
'cart_count' => $cart_count,
]);
}
}

@ -5,7 +5,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Support\Carbon;
class CoinHistory extends Model
class poinHistory extends Model
{
protected $fillable = [
'debit',
@ -55,6 +55,6 @@ class CoinHistory extends Model
public function update_customer_balance()
{
$customer = Customer::find($this->customer_id);
$customer->update(['coin_balance' => $customer->coin_balance + $this->debit - $this->credit]);
$customer->update(['poin_balance' => $customer->poin_balance + $this->debit - $this->credit]);
}
}

@ -32,7 +32,7 @@ class Customer extends Authenticatable
'referral_code',
'google_id',
'deposit_balance',
'coin_balance',
'poin_balance',
'identity_verified',
'identity_image',
'customer_level_id',
@ -48,7 +48,7 @@ class Customer extends Authenticatable
'image_url',
'identity_image_url',
'display_deposit',
'display_coin',
'display_poin',
'display_phone',
'paylater_limit',
'is_allow_paylater',
@ -126,7 +126,7 @@ class Customer extends Authenticatable
return ' - ';
}
return '+62'.$this->phone;
return '+62' . $this->phone;
});
}
@ -137,10 +137,10 @@ class Customer extends Authenticatable
});
}
public function displayCoin(): Attribute
public function displayPoin(): Attribute
{
return Attribute::make(get: function () {
return number_format($this->coin_balance, is_float($this->coin_balance) ? 2 : 0, ',', '.');
return number_format($this->poin_balance, is_float($this->poin_balance) ? 2 : 0, ',', '.');
});
}
@ -188,9 +188,9 @@ class Customer extends Authenticatable
return $this->hasMany(DepositHistory::class);
}
public function coins()
public function poins()
{
return $this->hasMany(CoinHistory::class);
return $this->hasMany(PoinHistory::class);
}
public function paylater()
@ -234,7 +234,7 @@ class Customer extends Authenticatable
$paylater = $this->paylaterHistories()->create([
'credit' => $cut,
'description' => $deposit->description.' (Pengembalian)',
'description' => $deposit->description . ' (Pengembalian)',
]);
$paylater->update_customer_paylater();

@ -0,0 +1,60 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Support\Carbon;
class PoinHistory extends Model
{
protected $fillable = [
'debit',
'credit',
'description',
'customer_id',
'related_type',
'related_id',
];
protected $appends = [
'amount',
'format_human_created_at',
'format_created_at',
];
public function formatHumanCreatedAt(): Attribute
{
return Attribute::make(get: function () {
return Carbon::parse($this->created_at)->locale('id')->translatedFormat('d F Y');
});
}
public function formatCreatedAt(): Attribute
{
return Attribute::make(get: function () {
return Carbon::parse($this->created_at)->locale('id')->translatedFormat('d F Y H:i:s');
});
}
public function amount(): Attribute
{
return Attribute::make(get: function () {
if ($this->credit == 0) {
return number_format($this->debit, is_float($this->debit) ? 2 : 0, ',', '.');
}
return number_format($this->credit, is_float($this->credit) ? 2 : 0, ',', '.');
});
}
public function customer()
{
return $this->belongsTo(Customer::class);
}
public function update_customer_balance()
{
$customer = Customer::find($this->customer_id);
$customer->update(['poin_balance' => $customer->poin_balance + $this->debit - $this->credit]);
}
}

@ -2,11 +2,11 @@
namespace App\Models;
class CoinReward extends Model
class PoinReward extends Model
{
protected $fillable = [
'amount_buy',
'bonus_coin',
'bonus_poin',
'customer_level_id',
];

@ -15,7 +15,7 @@ class Sale extends Model
const PAYED_WITH_PAYLATER = 'paylater';
const PAYED_WITH_COIN = 'coin';
const PAYED_WITH_poin = 'poin';
protected $fillable = [
'code',
@ -63,21 +63,21 @@ 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, ',', '.');
});
}
public function create_notification()
{
if ($this->payed_with == self::PAYED_WITH_COIN) {
if ($this->payed_with == self::PAYED_WITH_poin) {
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname.' melakukan penukaran '.$this->items()->count().' voucher sebesar '.$this->items->value('price').' coin',
'description' => $this->customer->fullname . ' melakukan penukaran ' . $this->items()->count() . ' voucher sebesar ' . $this->items->value('price') . ' poin',
]);
Notification::create([
'entity_id' => auth()->id(),
'description' => 'Transaksi '.$this->code.' berhasil',
'description' => 'Transaksi ' . $this->code . ' berhasil',
]);
return;
@ -85,12 +85,12 @@ class Sale extends Model
Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname.' melakukan pembelian '.$this->items()->count().' voucher sebesar '.$this->display_amount,
'description' => $this->customer->fullname . ' melakukan pembelian ' . $this->items()->count() . ' voucher sebesar ' . $this->display_amount,
]);
Notification::create([
'entity_id' => auth()->id(),
'description' => 'Transaksi pembelian anda #'.$this->code.' sebesar '.$this->display_amount.' berhasil',
'description' => 'Transaksi pembelian anda #' . $this->code . ' sebesar ' . $this->display_amount . ' berhasil',
]);
}
}

@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Cache;
class Setting extends Model
{
@ -43,4 +44,18 @@ class Setting extends Model
{
return Setting::where('key', $key)->value('value');
}
public static function getSettings()
{
$data = Cache::get('settings');
if ($data == null) {
$settings = Setting::where('key', 'like', 'OPEN%')->get();
foreach ($settings as $setting) {
$data[$setting->key] = $setting->value;
}
Cache::put('settings', $data, now()->addDay());
}
return $data;
}
}

@ -17,7 +17,7 @@ class Voucher extends Model
'location_id',
'username',
'password',
'price_coin', // harga voucher untuk ditukarkan dengan coin
'price_poin', // harga voucher untuk ditukarkan dengan poin
'price', // harga jual
'discount',
'display_price', //yang di input user
@ -63,14 +63,14 @@ class Voucher extends Model
public function displayQuota(): Attribute
{
return Attribute::make(get: function () {
return round($this->quota / (1024 * 1024 * 1024), 2).' GB';
return round($this->quota / (1024 * 1024 * 1024), 2) . ' GB';
});
}
public function displayExpired(): Attribute
{
return Attribute::make(get: function () {
return $this->expired.' '.$this->expired_unit;
return $this->expired . ' ' . $this->expired_unit;
});
}
@ -146,7 +146,7 @@ class Voucher extends Model
if ($count <= $treshold) {
Notification::create([
'entity_type' => User::class,
'description' => 'stok voucher '.$this->location->name.' ( '.$this->profile.' ) '.'tersisa : '.$count,
'description' => 'stok voucher ' . $this->location->name . ' ( ' . $this->profile . ' ) ' . 'tersisa : ' . $count,
]);
}
}

@ -70,7 +70,7 @@ class GeneralService
public static function getCartEnablePayment()
{
// deposit
// coin
// poin
// paylater
}
}

@ -61,6 +61,15 @@ return [
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
'modes' => [
// 'ONLY_FULL_GROUP_BY', // Disable this to allow grouping by one column
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_AUTO_CREATE_USER',
'NO_ENGINE_SUBSTITUTION',
],
],
'pgsql' => [

@ -19,7 +19,7 @@ return new class extends Migration
$table->ulid('location_id')->nullable();
$table->string('username')->nullable();
$table->string('password')->nullable();
$table->decimal('price_coin', 20, 2)->default(0);
$table->decimal('price_poin', 20, 2)->default(0);
$table->decimal('price', 20, 2)->default(0);
$table->decimal('discount', 20, 0)->default(0);
$table->decimal('display_price', 20, 2)->default(0);

@ -25,7 +25,7 @@ return new class extends Migration
$table->string('referral_code')->nullable();
$table->string('google_id')->nullable();
$table->decimal('deposit_balance', 20, 2)->default(0);
$table->decimal('coin_balance', 20, 2)->default(0);
$table->decimal('poin_balance', 20, 2)->default(0);
$table->smallInteger('identity_verified')->default(0);
$table->string('identity_image')->nullable();
$table->ulid('customer_level_id')->nullable();

@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('coin_histories', function (Blueprint $table) {
Schema::create('poin_histories', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->decimal('debit', 20, 2)->default(0);
@ -34,6 +34,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('coin_histories');
Schema::dropIfExists('poin_histories');
}
};

@ -11,11 +11,11 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('coin_rewards', function (Blueprint $table) {
Schema::create('poin_rewards', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->decimal('amount_buy', 20, 2)->default(0);
$table->decimal('bonus_coin', 20, 2)->default(0);
$table->decimal('bonus_poin', 20, 2)->default(0);
$table->ulid('customer_level_id')->nullable();
$table->timestamps();
@ -31,6 +31,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('coin_rewards');
Schema::dropIfExists('poin_rewards');
}
};

@ -41,8 +41,8 @@ class DummySeeder extends Seeder
$images = ['1.webp', '2.webp', '3.webp'];
foreach ($images as $index => $image) {
Banner::create([
'title' => 'Banner '.$index,
'image' => 'sample/'.$image,
'title' => 'Banner ' . $index,
'image' => 'sample/' . $image,
'description' => '<h1>Banner </h1>',
]);
}
@ -87,7 +87,7 @@ class DummySeeder extends Seeder
$batchId = Str::ulid();
$location = Location::get()[$loop];
$price_coin = $loop == 3 ? 10 : 0;
$price_poin = $loop == 3 ? 10 : 0;
foreach ($vouchers as $voucher) {
Voucher::create([
@ -96,7 +96,7 @@ class DummySeeder extends Seeder
'password' => $voucher['password'],
'discount' => $loop == 1 ? 10 : 0,
'display_price' => $loop == 1 ? 100000 : 99000,
'price_coin' => $price_coin,
'price_poin' => $price_poin,
'quota' => $voucher['quota'],
'profile' => $voucher['profile'],
'comment' => $voucher['comment'],

@ -20,8 +20,10 @@ class InstallationSeed extends Seeder
public function settings()
{
$settings = [
['key' => 'OPEN_WEBSITE_NAME', 'value' => 'Welcome to Voucher App', 'type' => 'text'],
['key' => 'AFFILATE_ENABLED', 'value' => '0', 'type' => 'checkbox'],
['key' => 'AFFILATE_COIN_AMOUNT', 'value' => '0', 'type' => 'text'],
['key' => 'AFFILATE_POIN_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'],

@ -61,18 +61,18 @@ class PermissionSeeder extends Seeder
['id' => Str::ulid(), 'label' => 'View Deposit', 'name' => 'view-deposit'],
['id' => Str::ulid(), 'label' => 'Update Deposit', 'name' => 'update-deposit'],
['id' => Str::ulid(), 'label' => 'View Coin', 'name' => 'view-coin'],
['id' => Str::ulid(), 'label' => 'Update Coin', 'name' => 'update-coin'],
['id' => Str::ulid(), 'label' => 'View poin', 'name' => 'view-poin'],
['id' => Str::ulid(), 'label' => 'Update poin', 'name' => 'update-poin'],
// ['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'],
['id' => Str::ulid(), 'label' => 'Create poin Reward', 'name' => 'create-poin-reward'],
['id' => Str::ulid(), 'label' => 'Update poin Reward', 'name' => 'update-poin-reward'],
['id' => Str::ulid(), 'label' => 'View poin Reward', 'name' => 'view-poin-reward'],
['id' => Str::ulid(), 'label' => 'Delete poin Reward', 'name' => 'delete-poin-reward'],
['id' => Str::ulid(), 'label' => 'Create Bank Account', 'name' => 'create-account'],
['id' => Str::ulid(), 'label' => 'Update Bank Account', 'name' => 'update-account'],

@ -47,6 +47,30 @@ services:
cpus: 0.5
networks:
- voucher
mariadb:
image: mariadb:latest
container_name: voucher-mariadb
restart: always
ports:
- 3306:3306
volumes:
- mariadb:/var/lib/mysql
- ./database:/database
environment:
MARIADB_DATABASE: voucher
MARIADB_USER: aji
MARIADB_PASSWORD: eta
MARIADB_ROOT_PASSWORD: eta
mem_limit: 512m
mem_reservation: 128M
cpus: 1
networks:
voucher:
ipv4_address: 10.25.10.99
volumes:
mariadb:
driver: local
networks:
voucher:

@ -17,7 +17,7 @@ export default function BalanceBanner({ user }) {
</div>
<div className="font-bold">Rp {user.display_deposit}</div>
<div className="text-xs flex flex-row items-center space-x-1 text-gray-400">
<div>Coin {user.display_coin}</div>
<div>poin {user.display_poin}</div>
</div>
</div>
<div className="flex flex-col border-l-2 pl-5 pr-5">

@ -8,14 +8,14 @@ import VoucherCard from './VoucherCard'
const GuestBanner = () => {
const {
props: { app_name },
props: { setting },
} = usePage()
return (
<div>
{/* user */}
<div className="flex flex-row justify-between items-center px-5 py-6 text-lg bg-blue-600">
<div className="flex flex-col text-white">
<div className="font-bold">Welcome to {app_name}</div>
<div className="font-bold">{setting.OPEN_WEBSITE_NAME}</div>
</div>
<div className="flex flex-row">
<HiOutlineBell className="text-white w-7 h-7" />
@ -93,7 +93,6 @@ export default function Index(props) {
<Head title="Home" />
<div className="flex flex-col min-h-[calc(95dvh)]">
{user !== null ? <UserBanner user={user} /> : <GuestBanner />}
<div id="nprogress" style={{ opacity: 1 }}></div>
{/* banner */}
<div className="w-full">
<div className="flex flex-row overflow-y-scroll space-x-2 py-3 px-2">

@ -7,7 +7,7 @@ export default function Index({
auth: { user },
notification: { data, next_page_url },
}) {
const [_notification, setCoins] = useState(data)
const [_notification, setpoins] = useState(data)
const handleNextPage = () => {
router.get(
@ -18,7 +18,7 @@ export default function Index({
preserveState: true,
only: ['notification'],
onSuccess: (res) => {
setCoins(_notification.concat(res.props.notification.data))
setpoins(_notification.concat(res.props.notification.data))
},
}
)
@ -26,7 +26,7 @@ export default function Index({
return (
<CustomerLayout>
<Head title="Coin" />
<Head title="poin" />
<div className="flex flex-col w-full min-h-[calc(90dvh)]">
<div
className="w-full px-5 py-5"

@ -7,7 +7,7 @@ import CustomerLayout from '@/Layouts/CustomerLayout'
export default function Detail({ paylater }) {
return (
<CustomerLayout>
<Head title="Coin" />
<Head title="poin" />
<div className="flex flex-col min-h-[calc(95dvh)]">
<div
className="w-full px-5 py-5"

@ -4,15 +4,15 @@ import { HiChevronLeft } from 'react-icons/hi2'
import CustomerLayout from '@/Layouts/CustomerLayout'
export default function Detail({ coin }) {
export default function Detail({ poin }) {
return (
<CustomerLayout>
<Head title="Coin" />
<Head title="poin" />
<div className="flex flex-col min-h-[calc(95dvh)]">
<div
className="w-full px-5 py-5"
onClick={() => {
router.get(route('customer.coin.index'))
router.get(route('customer.poin.index'))
}}
>
<HiChevronLeft className="font-bold h-5 w-5" />
@ -22,11 +22,11 @@ export default function Detail({ coin }) {
<div className="flex flex-row justify-between items-center pb-5 border-b px-5">
<div>
<div className="font-semibold text-xl text-gray-400">
{coin.description}
{poin.description}
</div>
<div className="font-bold text-3xl">{coin.amount}</div>
<div className="font-bold text-3xl">{poin.amount}</div>
<div className="text-gray-400">
{coin.format_created_at}
{poin.format_created_at}
</div>
</div>
</div>

@ -9,7 +9,7 @@ const EmptyHere = () => {
<div className="w-full px-5 text-center flex flex-col my-auto">
<div className="font-bold text-xl">Voucher segera tersedia</div>
<div className="text-gray-400">
Yuk, share referral kamu untuk tingkatkan coinnya
Yuk, share referral kamu untuk tingkatkan poinnya
</div>
</div>
)
@ -68,11 +68,11 @@ export default function Exhange(props) {
return (
<CustomerLayout>
<Head title="Coin" />
<Head title="poin" />
<div className="flex flex-col min-h-[calc(95dvh)]">
<div className="pt-5 text-2xl px-5 font-bold">Tukar Coin</div>
<div className="pt-5 text-2xl px-5 font-bold">Tukar poin</div>
<div className="px-5 text-gray-400 text-sm">
tukarkan coin anda dengan voucher manarik
tukarkan poin anda dengan voucher manarik
</div>
{v.length <= 0 ? (

@ -4,9 +4,9 @@ import CustomerLayout from '@/Layouts/CustomerLayout'
export default function Index({
auth: { user },
coins: { data, next_page_url },
poins: { data, next_page_url },
}) {
const [_coins, setCoins] = useState(data)
const [_poins, setpoins] = useState(data)
const handleNextPage = () => {
router.get(
@ -15,9 +15,9 @@ export default function Index({
{
replace: true,
preserveState: true,
only: ['coins'],
only: ['poins'],
onSuccess: (res) => {
setCoins(_coins.concat(res.props.coins.data))
setpoins(_poins.concat(res.props.poins.data))
},
}
)
@ -25,7 +25,7 @@ export default function Index({
return (
<CustomerLayout>
<Head title="Coin" />
<Head title="poin" />
<div className="flex flex-col w-full min-h-[calc(90dvh)]">
<div className="w-full pt-10 px-5">
<div className="text-base">{user.fullname}</div>
@ -33,36 +33,36 @@ export default function Index({
<div className="flex flex-row justify-between items-center pb-10 border-b px-5">
<div>
<div className="font-semibold text-xl text-gray-400">
Coin
poin
</div>
<div className="font-bold text-3xl">
{user.display_coin}
{user.display_poin}
</div>
</div>
</div>
<div className="w-full">
<div className="flex flex-col py-10 space-y-5 px-5">
{_coins.map((coin) => (
{_poins.map((poin) => (
<div
key={coin.id}
key={poin.id}
className="flex flex-row pb-2 items-center justify-between border-b"
onClick={() =>
router.get(
route('customer.coin.show', coin.id)
route('customer.poin.show', poin.id)
)
}
>
<div className="flex flex-col">
<div className="font-bold">
{coin.format_human_created_at}
{poin.format_human_created_at}
</div>
<div className="font-thin">
{coin.description}
{poin.description}
</div>
</div>
<div className="flex flex-col items-end">
<div className="font-bold text-lg">
{coin.amount}
{poin.amount}
</div>
</div>
</div>

@ -25,7 +25,7 @@ const ExchangeModal = ({ show, voucher, setShow }) => {
{voucher.profile}
</div>
<div className="text-xl font-bold">
{formatIDR(voucher.price_coin)} Coin
{formatIDR(voucher.price_poin)} poin
</div>
</div>
<div className="flex flex-col justify-end text-right">
@ -44,7 +44,7 @@ const ExchangeModal = ({ show, voucher, setShow }) => {
onClick={() =>
router.get(
route(
'customer.coin.exchange.process',
'customer.poin.exchange.process',
voucher
)
)
@ -80,7 +80,7 @@ export default function VoucherCard({ voucher }) {
{voucher.profile}
</div>
<div className="text-xl font-bold">
{formatIDR(voucher.price_coin)} Coin
{formatIDR(voucher.price_poin)} poin
</div>
</div>
<div className="flex flex-col justify-end text-right">

@ -122,9 +122,9 @@ export default function Index({ auth: { user }, notification_count }) {
</div>
<div
className="flex flex-row justify-between items-center px-2 py-4 w-full border-b border-gray-400 hover:bg-gray-100"
onClick={() => router.get(route('customer.coin.index'))}
onClick={() => router.get(route('customer.poin.index'))}
>
<div>Riwayat Coin</div>
<div>Riwayat poin</div>
<HiChevronRight className="h-5 w-5" />
</div>
<div

@ -70,14 +70,14 @@ export default function CustomerLayout({ children }) {
</div>
<div
className={`pb-1 pt-2 hover:bg-blue-200 flex flex-col items-center w-full ${isActive(
'customer.coin.exchange'
'customer.poin.exchange'
)}`}
onClick={() => handleOnClick('customer.coin.exchange')}
onClick={() => handleOnClick('customer.poin.exchange')}
>
<div className="flex flex-row">
<HiOutlineGift className="h-6 w-6" />
</div>
<div className="text-xs">Coin</div>
<div className="text-xs">Poin</div>
</div>
<div
className={`pb-1 pt-2 hover:bg-blue-200 flex flex-col items-center w-full ${isActive(

@ -69,12 +69,12 @@ export default [
permission: 'view-deposit',
},
{
name: 'Bonus Coin',
name: 'Bonus Poin',
show: true,
icon: HiOutlineCurrencyDollar,
route: route('coin-reward.index'),
active: 'coin-reward.*',
permission: 'view-coin-reward',
route: route('poin-reward.index'),
active: 'poin-reward.*',
permission: 'view-poin-reward',
},
{
name: 'Front Home',

@ -105,7 +105,7 @@ export default function Customer(props) {
scope="col"
className="py-3 px-6"
>
Coin
poin
</th>
<th
scope="col"
@ -147,7 +147,7 @@ export default function Customer(props) {
scope="row"
className="py-4 px-6"
>
{customer.display_coin}
{customer.display_poin}
</td>
<td
scope="row"

@ -15,7 +15,7 @@ export default function FormModal(props) {
const { data, setData, post, put, processing, errors, reset, clearErrors } =
useForm({
amount_buy: 0,
bonus_coin: 0,
bonus_poin: 0,
customer_level_id: null,
})
@ -44,12 +44,12 @@ export default function FormModal(props) {
const handleSubmit = () => {
const reward = modalState.data
if (reward !== null) {
put(route('coin-reward.update', reward), {
put(route('poin-reward.update', reward), {
onSuccess: () => handleClose(),
})
return
}
post(route('coin-reward.store'), {
post(route('poin-reward.store'), {
onSuccess: () => handleClose(),
})
}
@ -59,7 +59,7 @@ export default function FormModal(props) {
if (isEmpty(reward) === false) {
setData({
amount_buy: reward.amount_buy,
bonus_coin: reward.bonus_coin,
bonus_poin: reward.bonus_poin,
customer_level_id: reward.customer_level_id,
})
return
@ -70,7 +70,7 @@ export default function FormModal(props) {
<Modal
isOpen={modalState.isOpen}
toggle={handleClose}
title={'Bonus Coin'}
title={'Bonus Poin'}
>
<FormInput
type="number"
@ -103,11 +103,11 @@ export default function FormModal(props) {
</div>
<FormInput
type="number"
name="bonus_coin"
value={data.bonus_coin}
name="bonus_poin"
value={data.bonus_poin}
onChange={handleOnChange}
label="Bonus Coin"
error={errors.bonus_coin}
label="Bonus Poin"
error={errors.bonus_poin}
/>
<div className="flex items-center">
<Button onClick={handleSubmit} processing={processing}>

@ -32,23 +32,23 @@ export default function Info(props) {
const onDelete = () => {
if (confirmModal.data !== null) {
router.delete(route('coin-reward.destroy', confirmModal.data.id))
router.delete(route('poin-reward.destroy', confirmModal.data.id))
}
}
const canCreate = hasPermission(auth, 'create-coin-reward')
const canUpdate = hasPermission(auth, 'update-coin-reward')
const canDelete = hasPermission(auth, 'delete-coin-reward')
const canCreate = hasPermission(auth, 'create-poin-reward')
const canUpdate = hasPermission(auth, 'update-poin-reward')
const canDelete = hasPermission(auth, 'delete-poin-reward')
return (
<AuthenticatedLayout
auth={props.auth}
errors={props.errors}
flash={props.flash}
page={'Bonus Coin'}
page={'Bonus Poin'}
action={''}
>
<Head title="Bonus Coin" />
<Head title="Bonus Poin" />
<div>
<div className="mx-auto sm:px-6 lg:px-8 ">
@ -84,7 +84,7 @@ export default function Info(props) {
scope="col"
className="py-3 px-6"
>
Coin
poin
</th>
<th
scope="col"
@ -111,7 +111,7 @@ export default function Info(props) {
</td>
<td className="py-4 px-6">
{formatIDR(
reward.bonus_coin
reward.bonus_poin
)}
</td>
<td className="py-4 px-6 flex justify-end">

@ -12,12 +12,13 @@ import { extractValue } from './utils'
export default function General(props) {
const { setting, midtrans_notification_url } = props
const { data, setData, post, reset, processing, errors } = useForm({
OPEN_WEBSITE_NAME: extractValue(setting, 'OPEN_WEBSITE_NAME'),
VOUCHER_STOCK_NOTIFICATION: extractValue(
setting,
'VOUCHER_STOCK_NOTIFICATION'
),
AFFILATE_ENABLED: extractValue(setting, 'AFFILATE_ENABLED'),
AFFILATE_COIN_AMOUNT: extractValue(setting, 'AFFILATE_COIN_AMOUNT'),
AFFILATE_POIN_AMOUNT: extractValue(setting, 'AFFILATE_POIN_AMOUNT'),
MIDTRANS_SERVER_KEY: extractValue(setting, 'MIDTRANS_SERVER_KEY'),
MIDTRANS_CLIENT_KEY: extractValue(setting, 'MIDTRANS_CLIENT_KEY'),
MIDTRANS_MERCHANT_ID: extractValue(setting, 'MIDTRANS_MERCHANT_ID'),
@ -61,6 +62,16 @@ export default function General(props) {
<div className="overflow-hidden p-4 shadow-sm sm:rounded-lg bg-white dark:bg-gray-800 flex flex-col">
<div className="text-xl font-bold mb-4">Setting</div>
<div className="p-2 border rounded-xl">
<div className="font-bold mb-2">General</div>
<FormInput
name="OPEN_WEBSITE_NAME"
value={data.OPEN_WEBSITE_NAME}
onChange={handleOnChange}
label="Nama Website"
error={errors.OPEN_WEBSITE_NAME}
/>
</div>
<div className="p-2 border rounded-xl mt-2">
<div className="font-bold mb-2">Notification</div>
<FormInput
type={'number'}
@ -76,11 +87,11 @@ export default function General(props) {
<div className="font-bold mb-2">Affilate</div>
<FormInput
type={'number'}
name="AFFILATE_COIN_AMOUNT"
value={data.AFFILATE_COIN_AMOUNT}
name="AFFILATE_POIN_AMOUNT"
value={data.AFFILATE_POIN_AMOUNT}
onChange={handleOnChange}
label="Jumlah Bonus Koin"
error={errors.AFFILATE_COIN_AMOUNT}
label="Jumlah Bonus Poin"
error={errors.AFFILATE_POIN_AMOUNT}
/>
<Checkbox
label="Enable"

@ -18,7 +18,7 @@ export default function Form(props) {
password: '',
discount: 0,
display_price: 0,
price_coin: 0,
price_poin: 0,
quota: '',
profile: '',
comment: '',
@ -96,7 +96,7 @@ export default function Form(props) {
password: voucher.password,
discount: voucher.discount,
display_price: voucher.display_price,
price_coin: voucher.price_coin,
price_poin: voucher.price_poin,
quota: voucher.quota,
profile: voucher.profile,
comment: voucher.comment,
@ -165,11 +165,11 @@ export default function Form(props) {
/>
<FormInput
type="number"
name="price_coin"
value={data.price_coin}
name="price_poin"
value={data.price_poin}
onChange={handleOnChange}
label="Harga Coin (untuk penukaran)"
error={errors.price_coin}
label="Harga poin (untuk penukaran)"
error={errors.price_poin}
/>
<FormInput
type="number"

@ -17,7 +17,7 @@ export default function Import(props) {
script: '',
discount: 0,
display_price: 0,
price_coin: 0,
price_poin: 0,
expired: '',
expired_unit: 'Hari',
location_id: null,
@ -112,11 +112,11 @@ export default function Import(props) {
/>
<FormInput
type="number"
name="price_coin"
value={data.price_coin}
name="price_poin"
value={data.price_poin}
onChange={handleOnChange}
label="Harga Coin (untuk penukaran)"
error={errors.price_coin}
label="Harga poin (untuk penukaran)"
error={errors.price_poin}
/>
<div>
<label className="block text-sm font-medium text-gray-900 dark:text-white">

@ -3,7 +3,7 @@
use App\Http\Controllers\AccountController;
use App\Http\Controllers\Auth\AuthenticatedSessionController;
use App\Http\Controllers\BannerController;
use App\Http\Controllers\CoinRewardController;
use App\Http\Controllers\PoinRewardController;
use App\Http\Controllers\CustomerController;
use App\Http\Controllers\CustomerLevelController;
use App\Http\Controllers\DepositController;
@ -119,11 +119,11 @@ Route::middleware(['http_secure_aware', 'inertia.admin'])
Route::get('/deposites', [DepositController::class, 'index'])->name('deposit.index');
Route::post('/deposites/{deposit}', [DepositController::class, 'update'])->name('deposit.update');
// coin rewared
Route::get('/bonus-coin', [CoinRewardController::class, 'index'])->name('coin-reward.index');
Route::post('/bonus-coin', [CoinRewardController::class, 'store'])->name('coin-reward.store');
Route::put('/bonus-coin/{reward}', [CoinRewardController::class, 'update'])->name('coin-reward.update');
Route::delete('/bonus-coin/{reward}', [CoinRewardController::class, 'destroy'])->name('coin-reward.destroy');
// poin rewared
Route::get('/bonus-poin', [PoinRewardController::class, 'index'])->name('poin-reward.index');
Route::post('/bonus-poin', [PoinRewardController::class, 'store'])->name('poin-reward.store');
Route::put('/bonus-poin/{reward}', [PoinRewardController::class, 'update'])->name('poin-reward.update');
Route::delete('/bonus-poin/{reward}', [PoinRewardController::class, 'destroy'])->name('poin-reward.destroy');
// sale
Route::get('/sales', [SaleController::class, 'index'])->name('sale.index');

@ -2,8 +2,8 @@
use App\Http\Controllers\Customer\AuthController;
use App\Http\Controllers\Customer\CartController;
use App\Http\Controllers\Customer\CoinController;
use App\Http\Controllers\Customer\CoinExchangeController;
use App\Http\Controllers\Customer\PoinController;
use App\Http\Controllers\Customer\PoinExchangeController;
use App\Http\Controllers\Customer\DepositController;
use App\Http\Controllers\Customer\HomeController;
use App\Http\Controllers\Customer\PaylaterController;
@ -52,11 +52,11 @@ Route::middleware(['http_secure_aware', 'guard_should_customer', 'inertia.custom
Route::get('deposit/trx/{deposit}', [DepositController::class, 'show'])->name('customer.deposit.show');
Route::post('deposit/trx/{deposit}', [DepositController::class, 'update'])->name('customer.deposit.update');
// coin
Route::get('coin/exchanges', [CoinExchangeController::class, 'index'])->name('customer.coin.exchange');
Route::get('coin/exchanges/{voucher}', [CoinExchangeController::class, 'exchange'])->name('customer.coin.exchange.process');
Route::get('coin', [CoinController::class, 'index'])->name('customer.coin.index');
Route::get('coin/{coin}', [CoinController::class, 'show'])->name('customer.coin.show');
// poin
Route::get('poin/exchanges', [PoinExchangeController::class, 'index'])->name('customer.poin.exchange');
Route::get('poin/exchanges/{voucher}', [PoinExchangeController::class, 'exchange'])->name('customer.poin.exchange.process');
Route::get('poin', [PoinController::class, 'index'])->name('customer.poin.index');
Route::get('poin/{poin}', [PoinController::class, 'show'])->name('customer.poin.show');
// cart
Route::get('cart', [CartController::class, 'index'])->name('cart.index');

Loading…
Cancel
Save