Various little things
This commit is contained in:
parent
913a4477a7
commit
3c98de929e
@ -35,7 +35,7 @@ public function getIcon(): ?string
|
|||||||
return match ($this) {
|
return match ($this) {
|
||||||
self::DRAFT => 'lucide-pencil',
|
self::DRAFT => 'lucide-pencil',
|
||||||
self::APPROVED => 'lucide-check-check',
|
self::APPROVED => 'lucide-check-check',
|
||||||
self::PRODUCTION => 'lucide-iteration-ccw',
|
self::PRODUCTION => 'lucide-refresh-cw',
|
||||||
self::SHIPPED => 'lucide-send',
|
self::SHIPPED => 'lucide-send',
|
||||||
self::INVOICED => 'lucide-credit-card',
|
self::INVOICED => 'lucide-credit-card',
|
||||||
};
|
};
|
||||||
|
@ -4,10 +4,12 @@
|
|||||||
|
|
||||||
use App\Filament\Resources\CustomerResource\Pages;
|
use App\Filament\Resources\CustomerResource\Pages;
|
||||||
use App\Filament\Resources\CustomerResource\RelationManagers\ContactsRelationManager;
|
use App\Filament\Resources\CustomerResource\RelationManagers\ContactsRelationManager;
|
||||||
|
use App\Filament\Resources\CustomerResource\RelationManagers\ShippingEntriesRelationManager;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use Filament\Forms\Components\Section;
|
use Filament\Forms\Components\Section;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationGroup;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
@ -21,7 +23,7 @@ class CustomerResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationGroup = 'Management';
|
protected static ?string $navigationGroup = 'Management';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 4;
|
protected static ?int $navigationSort = 1;
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
@ -60,7 +62,10 @@ public static function table(Table $table): Table
|
|||||||
public static function getRelations(): array
|
public static function getRelations(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
RelationGroup::make('Relations', [
|
||||||
ContactsRelationManager::class,
|
ContactsRelationManager::class,
|
||||||
|
ShippingEntriesRelationManager::class,
|
||||||
|
]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,7 @@ public function table(Table $table): Table
|
|||||||
return $table
|
return $table
|
||||||
->recordTitleAttribute('id')
|
->recordTitleAttribute('id')
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('first_name'),
|
TextColumn::make('full_name'),
|
||||||
TextColumn::make('last_name'),
|
|
||||||
TextColumn::make('email'),
|
TextColumn::make('email'),
|
||||||
TextColumn::make('phone'),
|
TextColumn::make('phone'),
|
||||||
TextColumn::make('notes'),
|
TextColumn::make('notes'),
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\CustomerResource\RelationManagers;
|
||||||
|
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\RelationManagers\RelationManager;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class ShippingEntriesRelationManager extends RelationManager
|
||||||
|
{
|
||||||
|
protected static string $relationship = 'ShippingEntries';
|
||||||
|
|
||||||
|
public function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Forms\Components\TextInput::make('id')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('courier'),
|
||||||
|
Tables\Columns\TextColumn::make('account_title'),
|
||||||
|
Tables\Columns\TextColumn::make('account_username')
|
||||||
|
->label('Username'),
|
||||||
|
Tables\Columns\TextColumn::make('account_password')
|
||||||
|
->label('Password'),
|
||||||
|
Tables\Columns\TextColumn::make('info_needed'),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->headerActions([
|
||||||
|
Tables\Actions\CreateAction::make(),
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
Tables\Actions\DeleteAction::make(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -19,6 +19,8 @@
|
|||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Components\ToggleButtons;
|
use Filament\Forms\Components\ToggleButtons;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Forms\Set;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
@ -157,11 +159,28 @@ public static function form(Form $form): Form
|
|||||||
|
|
||||||
TextInput::make('amount')
|
TextInput::make('amount')
|
||||||
->label('Quantity')
|
->label('Quantity')
|
||||||
|
->live()
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, Get $get, Set $set) {
|
||||||
|
$set('total_price', ($get('amount_price') * $state ?? 0));
|
||||||
|
})
|
||||||
|
->afterStateHydrated(function ($state, Get $get, Set $set) {
|
||||||
|
$set('total_price', ($get('amount_price') * $state ?? 0));
|
||||||
|
})
|
||||||
->prefix('#')
|
->prefix('#')
|
||||||
->columnSpan(2),
|
->columnSpan(2),
|
||||||
|
|
||||||
TextInput::make('amount_price')
|
TextInput::make('amount_price')
|
||||||
->prefix('$')
|
->prefix('$')
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function ($state, Get $get, Set $set) {
|
||||||
|
$set('total_price', ($get('amount') * $state ?? 0));
|
||||||
|
})
|
||||||
|
->afterStateHydrated(function ($state, Get $get, Set $set) {
|
||||||
|
$set('total_price', ($get('amount') * $state ?? 0));
|
||||||
|
})
|
||||||
->columnSpan(2),
|
->columnSpan(2),
|
||||||
|
|
||||||
TextInput::make('total_price')
|
TextInput::make('total_price')
|
||||||
->prefix('$')
|
->prefix('$')
|
||||||
->readOnly()
|
->readOnly()
|
||||||
@ -206,7 +225,10 @@ public static function table(Table $table): Table
|
|||||||
->weight('bold')
|
->weight('bold')
|
||||||
->color('code')
|
->color('code')
|
||||||
->searchable()
|
->searchable()
|
||||||
->sortable(),
|
->sortable()
|
||||||
|
->extraHeaderAttributes([
|
||||||
|
'class' => 'w-8',
|
||||||
|
]),
|
||||||
TextColumn::make('order_date')
|
TextColumn::make('order_date')
|
||||||
->searchable()
|
->searchable()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
@ -24,6 +24,8 @@ class PackingSlipResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationGroup = 'Management';
|
protected static ?string $navigationGroup = 'Management';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
|
@ -54,21 +54,29 @@ public static function table(Table $table): Table
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('order.customer.company_name'),
|
Tables\Columns\TextColumn::make('order.customer.company_name')
|
||||||
Tables\Columns\TextColumn::make('order.customer_po'),
|
->searchable(),
|
||||||
|
Tables\Columns\TextColumn::make('order.customer_po')
|
||||||
|
->searchable()
|
||||||
|
->weight('bold')
|
||||||
|
->color('code'),
|
||||||
Tables\Columns\TextColumn::make('body')
|
Tables\Columns\TextColumn::make('body')
|
||||||
|
->searchable()
|
||||||
->limit(100),
|
->limit(100),
|
||||||
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
|
->date('Y-m-d')
|
||||||
|
->sortable(),
|
||||||
|
])
|
||||||
|
->defaultSort('created_at', 'desc')
|
||||||
|
->groups([
|
||||||
|
'order.customer.company_name',
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
//
|
|
||||||
])
|
])
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
])
|
])
|
||||||
->bulkActions([
|
->bulkActions([
|
||||||
Tables\Actions\BulkActionGroup::make([
|
|
||||||
Tables\Actions\DeleteBulkAction::make(),
|
|
||||||
]),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
64
app/Filament/Resources/ShippingEntryResource.php
Normal file
64
app/Filament/Resources/ShippingEntryResource.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ShippingEntryResource\Pages;
|
||||||
|
use App\Models\ShippingEntry;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class ShippingEntryResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = ShippingEntry::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'lucide-truck';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Management';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
//
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListShippingEntries::route('/'),
|
||||||
|
'create' => Pages\CreateShippingEntry::route('/create'),
|
||||||
|
'edit' => Pages\EditShippingEntry::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ShippingEntryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ShippingEntryResource;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateShippingEntry extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = ShippingEntryResource::class;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ShippingEntryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ShippingEntryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditShippingEntry extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = ShippingEntryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\ShippingEntryResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\ShippingEntryResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListShippingEntries extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = ShippingEntryResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
11
app/Models/Invoice.php
Normal file
11
app/Models/Invoice.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Invoice extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
}
|
@ -37,10 +37,7 @@ public function panel(Panel $panel): Panel
|
|||||||
Pages\Dashboard::class,
|
Pages\Dashboard::class,
|
||||||
])
|
])
|
||||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
||||||
->widgets([
|
->widgets([])
|
||||||
// Widgets\AccountWidget::class,
|
|
||||||
// Widgets\FilamentInfoWidget::class,
|
|
||||||
])
|
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
AddQueuedCookiesToResponse::class,
|
AddQueuedCookiesToResponse::class,
|
||||||
@ -55,6 +52,6 @@ public function panel(Panel $panel): Panel
|
|||||||
->authMiddleware([
|
->authMiddleware([
|
||||||
Authenticate::class,
|
Authenticate::class,
|
||||||
])
|
])
|
||||||
->sidebarWidth('12rem');
|
->sidebarWidth('13rem');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
database/factories/InvoiceFactory.php
Normal file
22
database/factories/InvoiceFactory.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
|
class InvoiceFactory extends Factory
|
||||||
|
{
|
||||||
|
protected $model = Invoice::class;
|
||||||
|
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'created_at' => Carbon::now(),
|
||||||
|
'gst' => true,
|
||||||
|
'pst' => $this->faker->boolean(25),
|
||||||
|
'updated_at' => Carbon::now(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('invoices', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
|
||||||
|
$table->foreignId('order_id')->nullable();
|
||||||
|
$table->boolean('gst')->default(0);
|
||||||
|
$table->boolean('pst')->default(0);
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('invoices');
|
||||||
|
}
|
||||||
|
};
|
@ -13,14 +13,6 @@ public function run(): void
|
|||||||
Customer::factory(['company_name' => 'Genumark'])->create();
|
Customer::factory(['company_name' => 'Genumark'])->create();
|
||||||
|
|
||||||
// ->has(ShippingEntry::factory([
|
// ->has(ShippingEntry::factory([
|
||||||
// 'account_title' => 'Genumark',
|
|
||||||
// 'courier' => 'UPS CampusShip',
|
|
||||||
// 'contact' => 'https://www.ups.com/lasso/login',
|
|
||||||
// 'account_username' => 'GenumarkTopNotch',
|
|
||||||
// 'account_password' => 'TopNotch@13579',
|
|
||||||
// 'info_needed' => 'Put PO on box',
|
|
||||||
// 'notify' => 'Various reps, CC Kathlyn Wood',
|
|
||||||
// 'notes' => 'For Save On Foods orders, see Genumark SOF',
|
|
||||||
// ]))
|
// ]))
|
||||||
// ->has(ShippingEntry::factory([
|
// ->has(ShippingEntry::factory([
|
||||||
// 'account_title' => 'Genumark Save-On-Foods',
|
// 'account_title' => 'Genumark Save-On-Foods',
|
||||||
|
@ -24,6 +24,7 @@ public function run(): void
|
|||||||
ProductServiceSeeder::class,
|
ProductServiceSeeder::class,
|
||||||
ServiceFileSeeder::class,
|
ServiceFileSeeder::class,
|
||||||
QuoteSeeder::class,
|
QuoteSeeder::class,
|
||||||
|
InvoiceSeeder::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
|
21
database/seeders/InvoiceSeeder.php
Normal file
21
database/seeders/InvoiceSeeder.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Enums\OrderStatus;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Order;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class InvoiceSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
foreach (Order::where('status', OrderStatus::INVOICED) as $order) {
|
||||||
|
Invoice::factory()->for($order)->create();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,9 @@ public function run(): void
|
|||||||
{
|
{
|
||||||
foreach (Order::all() as $order) {
|
foreach (Order::all() as $order) {
|
||||||
if (rand(0, 3) >= 1) {
|
if (rand(0, 3) >= 1) {
|
||||||
Quote::factory()->for($order)->create();
|
Quote::factory([
|
||||||
|
'created_at' => $order->order_date,
|
||||||
|
])->for($order)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,31 @@ class ShippingEntrySeeder extends Seeder
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
foreach (Customer::all() as $customer) {
|
foreach (Customer::all() as $customer) {
|
||||||
ShippingEntry::factory(5, ['customer_id' => $customer->id])->create();
|
if ($customer->company_name === 'Genumark') {
|
||||||
|
ShippingEntry::factory([
|
||||||
|
'account_title' => 'Genumark',
|
||||||
|
'courier' => 'UPS CampusShip',
|
||||||
|
'contact' => 'https://www.ups.com/lasso/login',
|
||||||
|
'account_username' => 'GenumarkTopNotch',
|
||||||
|
'account_password' => 'TopNotch@13579',
|
||||||
|
'info_needed' => 'Put PO on box',
|
||||||
|
'notify' => 'Various reps, CC Kathlyn Wood',
|
||||||
|
'notes' => 'For Save On Foods orders, see Genumark SOF',
|
||||||
|
])->for($customer)->create();
|
||||||
|
|
||||||
|
ShippingEntry::factory([
|
||||||
|
'account_title' => 'Genumark Save-On-Foods',
|
||||||
|
'courier' => 'UPS CampusShip',
|
||||||
|
'contact' => 'https://www.ups.com/lasso/login',
|
||||||
|
'account_username' => 'GenumarkTopNotch',
|
||||||
|
'account_password' => 'TopNotch@13579',
|
||||||
|
'info_needed' => 'Put PO on box',
|
||||||
|
'notify' => 'Jane Wellman',
|
||||||
|
'notes' => 'Don\'t CC Kathlyn for SOF orders',
|
||||||
|
])->for($customer)->create();
|
||||||
|
} else {
|
||||||
|
ShippingEntry::factory(rand(0, 2), ['customer_id' => $customer->id])->create();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user