ifnex/04_Laravel/resources/views/filament/pages/ifnex-settings.blade.php
Kazem Alghasi d6e04d53fa feat(core): integrate Kavenegar SMS notifications and audit logging
Implement a comprehensive notification system using Kavenegar SMS
gateway and enhance system traceability through audit logging and
detailed shipment status history.

- SMS Integration:
  - Add Kavenegar SMS service with configurable API keys and sender
    numbers via system settings.
  - Implement automated SMS notifications for shipment approval,
    rejection, successful payments, and tracking updates.
  - Add administrative UI in Filament to manage SMS gateway settings
    and toggle specific notification types.
- Audit & Tracking:
  - Apply `Auditable` trait to core models (User, Shipment, Wallet,
    etc.) to track changes.
  - Refactor `ShipmentStatusHistory` to include status transitions
    (`from_status` to `to_status`) and specific reasons for changes.
  - Implement `ShipmentObserver` to automate notification triggers
    on status changes.
- Database & Config:
  - Add migrations for enhanced shipment status history tracking.
  - Update `.env.example` and `config/ifnex.php` with Kavenegar
    configuration parameters.
2026-09-10 00:52:18 +03:30

87 lines
5.1 KiB
PHP

<x-filament::page>
<div class="space-y-6">
<x-filament::card>
<h2 class="text-lg font-medium text-gray-900 mb-4">تنظیمات مالی</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
<div>
<label class="block text-sm font-medium text-gray-700">VAT Rate</label>
<input type="number" step="0.01" wire:model="vat_rate" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
<p class="mt-1 text-sm text-gray-500">Example: 0.09 for 9%</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Default Packing Cost (IRR)</label>
<input type="number" wire:model="packing_cost_default" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Profit Margin</label>
<input type="number" step="0.01" wire:model="profit_margin" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
<p class="mt-1 text-sm text-gray-500">Example: 1.25 for 25% margin</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">AED to IRR</label>
<input type="number" wire:model="aed_to_irr" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">USD to IRR</label>
<input type="number" wire:model="usd_to_irr" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">CNY to IRR</label>
<input type="number" wire:model="cny_to_irr" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">EUR to IRR</label>
<input type="number" wire:model="eur_to_irr" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
</div>
</x-filament::card>
<x-filament::card>
<h2 class="text-lg font-medium text-gray-900 mb-4">تنظیمات SMS (کاوه‌نگار)</h2>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
<div>
<label class="block text-sm font-medium text-gray-700">API Key</label>
<input type="text" wire:model="kavenegar_api_key" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Sender Number</label>
<input type="text" wire:model="kavenegar_sender" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm">
</div>
<div class="flex items-center gap-2">
<input type="checkbox" wire:model="kavenegar_send_shipment_approved" id="kavenegar_send_shipment_approved" class="rounded border-gray-300">
<label for="kavenegar_send_shipment_approved" class="text-sm font-medium text-gray-700">ارسال SMS هنگام تأیید سفارش</label>
</div>
<div class="flex items-center gap-2">
<input type="checkbox" wire:model="kavenegar_send_shipment_rejected" id="kavenegar_send_shipment_rejected" class="rounded border-gray-300">
<label for="kavenegar_send_shipment_rejected" class="text-sm font-medium text-gray-700">ارسال SMS هنگام رد سفارش</label>
</div>
<div class="flex items-center gap-2">
<input type="checkbox" wire:model="kavenegar_send_payment_success" id="kavenegar_send_payment_success" class="rounded border-gray-300">
<label for="kavenegar_send_payment_success" class="text-sm font-medium text-gray-700">ارسال SMS هنگام پرداخت موفق</label>
</div>
<div class="flex items-center gap-2">
<input type="checkbox" wire:model="kavenegar_send_tracking_update" id="kavenegar_send_tracking_update" class="rounded border-gray-300">
<label for="kavenegar_send_tracking_update" class="text-sm font-medium text-gray-700">ارسال SMS هنگام به‌روزرسانی رهگیری</label>
</div>
</div>
</x-filament::card>
<div class="mt-6">
<button type="button" wire:click="save" class="filament-button filament-button-size-md inline-flex items-center justify-center py-2 px-4 rounded-md text-sm font-medium text-white bg-primary-600 hover:bg-primary-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
Save Settings
</button>
</div>
</div>
</x-filament::page>