@extends('layouts.app') @section('title', 'QuickSell AI Action Center') @section('content')

AI Action Center Plan โ†’ review โ†’ approve โ†’ execute

AI cannot directly change QuickSell. Every proposal is validated against your business, role and locations, then requires separate approval and execution.
@if(auth()->user()->can('superadmin') || auth()->user()->can('ai.propose_actions'))

Create proposal

@csrf
Be specific about contact, location, products, quantities and new prices.
@endif
@if($selected)

{{ ucwords(str_replace('_',' ',$selected->action_type)) }} {{ $selected->status }}

Original instruction
{{ $selected->instruction }}

1. Planned2. Approved3. Executed
Effect: {{ data_get($selected->preview,'effect') }}
@if(data_get($selected->preview,'contact'))
Contact

{{ data_get($selected->preview,'contact') }}

Location

{{ data_get($selected->preview,'location') }}

@endif @if(data_get($selected->preview,'lines'))
@foreach(data_get($selected->preview,'lines',[]) as $line)@endforeach
ProductSKUQuantityUnit price/costTotal
{{ $line['product'] }}
{{ $line['variation'] }}
{{ $line['sku'] }}{{ number_format($line['quantity'],2) }}{{ number_format($line['unit_price'],2) }}{{ number_format($line['line_total'],2) }}
Total{{ number_format(data_get($selected->preview,'total',0),2) }}
@endif @if(data_get($selected->preview,'items'))
@foreach(data_get($selected->preview,'items',[]) as $item)@endforeach
ProductSKUCurrent priceNew priceChange
{{ $item['product'] }}
{{ $item['variation'] }}
{{ $item['sku'] }}{{ number_format($item['old_price'],2) }}{{ number_format($item['new_price'],2) }}{{ $item['change_percent']>0?'+':'' }}{{ number_format($item['change_percent'],2) }}%
@endif @if($selected->error)
{{ $selected->error }}
@endif @if($selected->result)
Execution result
{{ json_encode($selected->result, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES) }}
@endif
@if($selected->status==='proposed' && (auth()->user()->can('superadmin') || auth()->user()->can('ai.approve_actions')))
@csrf
@endif @if($selected->status==='approved' && (auth()->user()->can('superadmin') || auth()->user()->can('ai.approve_actions')))
@csrf
@endif @if(in_array($selected->status,['proposed','approved']))
@csrf
@endif @if($selected->status==='executed' && $selected->action_type==='price_update' && (auth()->user()->can('superadmin') || auth()->user()->can('ai.approve_actions')))
@csrf
@endif

Requested by {{ trim(optional($selected->requester)->first_name.' '.optional($selected->requester)->last_name) }} on {{ $selected->created_at->format('d M Y, h:i A') }}. Proposal expires {{ optional($selected->expires_at)->diffForHumans() }}.

@else
Create or select an AI action proposal.
@endif
@endsection