wip on mfs

This commit is contained in:
2024-09-08 19:17:34 +05:00
parent 34b463370d
commit b46dad2183
5 changed files with 191 additions and 16 deletions

View File

@@ -0,0 +1,154 @@
<?php
namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\VisaMasterPaymentOrderFileFields;
use App\Nova\Resources\Branch\Branch;
use App\Repos\Order\OrderRepo;
use App\Repos\System\Nova\NovaRepo;
use App\Repos\System\Settings\Legal\PassportRepo;
use App\Repos\System\Settings\Location\RegionRepo;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\Hidden;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Panel;
use Nurmuhammet\NovaInputmask\NovaInputmask;
use Outl1ne\NovaSimpleRepeatable\SimpleRepeatable;
class VisaMasterPaymentOrderFieldsForDetail
{
/**
* Get fields for detail view
*
* @return array
*/
public static function make($resource): array
{
return [
new Panel(__('Status'), [
ID::make()
->hideFromDetail(),
Hidden::make('user_id')
->default(auth()->id())
->hideWhenUpdating(),
Text::make(__('ID'), 'unique_id')
->exceptOnForms(),
Select::make(__('Status'), 'status')
->displayUsingLabels()
->searchable()
->options(OrderRepo::statusValues())
->default(OrderRepo::defaultStatus())
->fullWidth()
->hideFromDetail()
->rules('required')
->canSeeWhen('systemUser', $resource),
Badge::make(__('Status'), 'status')
->map(OrderRepo::statusClasses())
->addTypes([
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
])
->labels(OrderRepo::statusValues())
->withIcons()
->icons(OrderRepo::statusIcons()),
Text::make(__('Note'), 'notes')
->fullWidth()
->canSeeWhen('systemUser', $resource),
]),
new Panel(__('Application type'), [
Select::make(__('Application type'), 'type')
->fullWidth()
->searchable()
->rules('required')
->displayUsingLabels()
->options(VisaMasterPaymentOrder::applicationTypes()),
]),
new Panel(__('Location'), [
Select::make(__('Region'), 'region')
->fullWidth()
->displayUsingLabels()
->searchable()
->options(RegionRepo::values())
->default(RegionRepo::default())
->rules('required')
->sortable(),
BelongsTo::make(__('Branch'), 'branch', Branch::class),
]),
new Panel(__('Personal data'), [
Text::make(__('Passport name'), 'passport_name')
->fullWidth()
->rules('required', 'string', 'max:255'),
Text::make(__('Passport surname'), 'passport_surname')
->fullWidth()
->rules('required', 'string', 'max:255'),
NovaInputmask::make(__('Phone'), 'phone')
->fullWidth()
->phonenumber('TM')
->rules('required', 'max:255')
->hideFromIndex(),
Text::make(__('Email'), 'email')
->fullWidth()
->rules('nullable', 'max:255', 'email')
->hideFromIndex(),
Text::make(__('Current Residence'), 'address')
->fullWidth()
->rules('required', 'string', 'max:255')
->hideFromIndex(),
]),
new Panel(__('Payment'), [
SimpleRepeatable::make(__('Payment sender data'), 'sender_datas', [
Select::make(__('Passport serie'), 'passport_serie')
->displayUsingLabels()
->searchable()
->options(PassportRepo::values())
->rules('required')
->sortable(),
NovaInputmask::make(__('Passport number'), 'passport_number')
->mask('999999')
->rules('required', 'max:255'),
Text::make(
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
attribute: 'full_name'
)
->rules('required', 'max:255'),
])->minRows(1)->rules('required'),
SimpleRepeatable::make(__('Payee information'), 'payment_reciever', [
Select::make(__('Passport serie'), 'passport_serie')
->displayUsingLabels()
->searchable()
->options(PassportRepo::values())
->rules('required')
->sortable(),
NovaInputmask::make(__('Passport number'), 'passport_number')
->mask('999999')
->rules('required', 'max:255'),
Text::make(
name: sprintf('%s %s %s', __('Name'), __('Surname'), __('Patronic name')),
attribute: 'full_name'
)->rules('required', 'max:255'),
])->maxRows(1)->minRows(1)->rules('required'),
]),
new Panel(__('Reciver files'), VisaMasterPaymentOrderFileFields::reciverFiles()),
new Panel(__('Sender files'), VisaMasterPaymentOrderFileFields::senderFiles()),
];
}
}

View File

@@ -4,6 +4,7 @@ namespace App\Modules\VisaMasterPaymentOrder\Nova\Resources;
use App\Models\Branch\Branch;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForDetail;
use App\Modules\VisaMasterPaymentOrder\Nova\Resources\Concerns\VisaMasterPaymentOrderFieldsForIndex;
use App\Nova\Resource;
use App\Repos\Order\Card\CardOrderRepo;
@@ -102,6 +103,14 @@ class NovaVisaMasterPaymentOrder extends Resource
return VisaMasterPaymentOrderFieldsForIndex::make($this);
}
/**
* Get the fields for detail
*/
public function fieldsForDetail(): array
{
return VisaMasterPaymentOrderFieldsForDetail::make($this);
}
/**
* Get the fields displayed by the resource.
*

30
composer.lock generated
View File

@@ -1355,12 +1355,12 @@
"source": {
"type": "git",
"url": "https://github.com/nurmuhammet-ali/nova-tabs.git",
"reference": "d706ee1fe66f6ee9fc0584c0e06ab47e41b03990"
"reference": "becb4fdf1b187e6726e7def5701b5747a66bbf8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nurmuhammet-ali/nova-tabs/zipball/d706ee1fe66f6ee9fc0584c0e06ab47e41b03990",
"reference": "d706ee1fe66f6ee9fc0584c0e06ab47e41b03990",
"url": "https://api.github.com/repos/nurmuhammet-ali/nova-tabs/zipball/becb4fdf1b187e6726e7def5701b5747a66bbf8d",
"reference": "becb4fdf1b187e6726e7def5701b5747a66bbf8d",
"shasum": ""
},
"require": {
@@ -1419,7 +1419,7 @@
"support": {
"source": "https://github.com/nurmuhammet-ali/nova-tabs/tree/master"
},
"time": "2024-09-07T00:11:10+00:00"
"time": "2024-09-07T18:18:29+00:00"
},
{
"name": "eolica/nova-locale-switcher",
@@ -9987,16 +9987,16 @@
},
{
"name": "dragon-code/support",
"version": "6.13.0",
"version": "6.15.0",
"source": {
"type": "git",
"url": "https://github.com/TheDragonCode/support.git",
"reference": "a6f0468e32581efbccb23190b6d5c880cc519747"
"reference": "087d7baaa963cdbb24e901dc27e10cdc31c2529c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TheDragonCode/support/zipball/a6f0468e32581efbccb23190b6d5c880cc519747",
"reference": "a6f0468e32581efbccb23190b6d5c880cc519747",
"url": "https://api.github.com/repos/TheDragonCode/support/zipball/087d7baaa963cdbb24e901dc27e10cdc31c2529c",
"reference": "087d7baaa963cdbb24e901dc27e10cdc31c2529c",
"shasum": ""
},
"require": {
@@ -10082,7 +10082,7 @@
"type": "yoomoney"
}
],
"time": "2024-03-12T20:45:00+00:00"
"time": "2024-09-07T13:27:37+00:00"
},
{
"name": "fakerphp/faker",
@@ -10373,16 +10373,16 @@
},
{
"name": "laravel-lang/actions",
"version": "1.8.4",
"version": "1.8.5",
"source": {
"type": "git",
"url": "https://github.com/Laravel-Lang/actions.git",
"reference": "1c88725b15a2fef11a2ed425eef40a31741e79c0"
"reference": "bc59d4a92e13d35d07a45265552a830c47fbe878"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Laravel-Lang/actions/zipball/1c88725b15a2fef11a2ed425eef40a31741e79c0",
"reference": "1c88725b15a2fef11a2ed425eef40a31741e79c0",
"url": "https://api.github.com/repos/Laravel-Lang/actions/zipball/bc59d4a92e13d35d07a45265552a830c47fbe878",
"reference": "bc59d4a92e13d35d07a45265552a830c47fbe878",
"shasum": ""
},
"require": {
@@ -10434,9 +10434,9 @@
],
"support": {
"issues": "https://github.com/Laravel-Lang/actions/issues",
"source": "https://github.com/Laravel-Lang/actions/tree/1.8.4"
"source": "https://github.com/Laravel-Lang/actions/tree/1.8.5"
},
"time": "2024-06-11T09:23:47+00:00"
"time": "2024-09-07T11:55:41+00:00"
},
{
"name": "laravel-lang/attributes",

View File

@@ -298,5 +298,6 @@
"Payment sender data": "Tölegi ugradyjynyň maglumatlar",
"Payee information": "Tölegi kabul edijiniň maglumatlary",
"Reciver files": "Kabul ediji talyp boýunça resminamalary",
"Sender files": "Ugradyjy boýunça resminamalary"
"Sender files": "Ugradyjy boýunça resminamalary",
"Next": "Indiki"
}

View File

@@ -10,6 +10,8 @@
@include('nova::partials.meta')
<style>.dots,.loader{display:inline-block}body{margin:0;padding:0;font-family:Arial,sans-serif}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;background:linear-gradient(135deg,#f8fafc 0,#e2e8f0 50%,#cbd5e1 100%);display:flex;justify-content:center;align-items:center;flex-direction:column}.loader{width:50px;height:50px;border:5px solid #64748b;border-bottom-color:transparent;border-radius:50%;box-sizing:border-box;animation:1s linear infinite rotation}.loader-section{margin-top:20px;color:#1e293b;font-size:18px}@keyframes rotation{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.dots{width:20px}@keyframes blink{0%,100%{opacity:.2}20%{opacity:1}}.dots span{animation-name:blink;animation-duration:1.4s;animation-iteration-count:infinite;animation-fill-mode:both}.dots span:nth-child(2){animation-delay:.2s}.dots span:nth-child(3){animation-delay:.4s}</style>
<!-- Styles -->
<link rel="stylesheet" href="{{ mix('app.css', 'vendor/nova') }}">
@@ -29,6 +31,13 @@
</script>
</head>
<body class="min-w-site text-sm font-medium min-h-full text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-900">
<div id="loader-wrapper">
<div class="loader"></div>
<div class="loader-section">
<p>Loading<span class="dots">...</span></p>
</div>
</div>
@inertia
<!-- Scripts -->
@@ -52,6 +61,8 @@
<!-- Start Nova -->
<script defer>
document.getElementById('loader-wrapper').style.display = 'none';
Nova.liftOff()
Nova.$emit('liftedOff')