@extends('layouts.admin') @section('title','Digital rewards') @section('admin-content')
EMAIL REWARDS

Digital rewards.

Upload purchased Touch ’n Go eWallet PINs. Winners receive their PIN only after receipt approval.

@foreach($prizes as $prize) @php($available=$service->available($prize->id))
@if($available===0 || $available<=$warningLevel)
!{{ $available===0?'Out of stock. Add purchased PINs before this prize can be won.':'Low stock: '.$available.' available. Add more purchased PINs.' }}
@endif

{{ $prize->name }}

{{ $available }} available · {{ DB::table('digital_reward_pins')->where('prize_id',$prize->id)->where('status','reserved')->count() }} reserved · {{ DB::table('digital_reward_pins')->where('prize_id',$prize->id)->where('status','issued')->count() }} issued · {{ DB::table('digital_reward_pins')->where('prize_id',$prize->id)->whereIn('status',['available','reserved','expired'])->where('expires_on','<=',today()->toDateString())->count() }} expired

@endforeach
Set up a reload PIN prize

First add a new prize in Prizes & odds. Choose an unused prize here; its stock will be managed by PIN inventory. Existing prize history cannot be converted.

@csrf

Add purchased PINs

Use genuine PINs bought from your authorised supplier. All PINs in one import must have the selected prize value and the same expiry. No PIN is generated or checked with TNG by this system.

@csrf
Up to 500 at once. PINs are encrypted and never shown in admin history. Keep a secure supplier record; keep the application encryption key backed up.

PIN inventory

Issued means assigned for email delivery. Email status is shown in Receipt verification. TNG redemption cannot be confirmed here. Expired and issued PINs are never reused. Resending a reward uses the same issued PIN.

Clear

{{ $pins->total() }} matching {{ $pins->total()===1?'PIN':'PINs' }}. Available means unused and unexpired.

@foreach(['reward'=>'Reward','pin'=>'PIN ending','status'=>'Status','expiry'=>'Use before','issued'=>'Issued'] as $key=>$heading) @endforeach@forelse($pins as $pin)@empty@endforelse
{{ $heading }} Action
{{ $pin->name }}•••• {{ $pin->hint }}{{ $pin->inventory_status==='void'?'Removed':ucfirst($pin->inventory_status) }}{{ $pin->expires_on }}{{ $pin->issued_at ?: '—' }}@if($pin->status==='available')
@csrf
@endif
No PINs match these filters.
@endsection