Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db4c8cf40f | ||
|
|
54b3187656 | ||
|
|
a1222d0178 | ||
|
|
3863210146 | ||
|
|
ae7e5f75a1 | ||
|
|
79f52acaa3 | ||
|
|
be28c4feec |
@@ -1,16 +0,0 @@
|
|||||||
APP_URL=http://127.0.0.1:8000
|
|
||||||
SESSION_DRIVER=file
|
|
||||||
CACHE_STORE=array
|
|
||||||
|
|
||||||
APP_KEY=base64:O0djxuJapvByUFNx5avmY7od6Y6C05JYv3kAFNrlrMX=
|
|
||||||
DB_CONNECTION=pgsql
|
|
||||||
DB_HOST=127.0.0.1
|
|
||||||
DB_PORT=5432
|
|
||||||
DB_DATABASE=wms_dusk
|
|
||||||
DB_USERNAME=wms_user
|
|
||||||
DB_PASSWORD=987400Kmh
|
|
||||||
QUEUE_CONNECTION=sync
|
|
||||||
MAIL_MAILER=array
|
|
||||||
DEBUGBAR_ENABLED=false
|
|
||||||
|
|
||||||
TELESCOPE_ENABLED=false
|
|
||||||
@@ -39,4 +39,3 @@ composer.lock
|
|||||||
/storage/framework/
|
/storage/framework/
|
||||||
/storage/debugbar/
|
/storage/debugbar/
|
||||||
/phpunit.dusk.xml
|
/phpunit.dusk.xml
|
||||||
sonarqube-issues.csv
|
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
@@ -0,0 +1,5 @@
|
|||||||
|
# Analytics
|
||||||
|
|
||||||
|
Display KPIs, warehouse performance trends, executive summaries, and OTTC analysis.
|
||||||
|
|
||||||
|
Contains actual sample Blade views and placeholder service provider/routes only.
|
||||||
Executable → Regular
-1
@@ -64,7 +64,6 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover align-middle mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<caption class="sr-only">Data table</caption>
|
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Metric</th>
|
<th>Metric</th>
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,5 @@
|
|||||||
|
# Audit
|
||||||
|
|
||||||
|
Review activity logs, data changes, interface events, and administrative actions.
|
||||||
|
|
||||||
|
Contains actual sample Blade views and placeholder service provider/routes only.
|
||||||
Executable → Regular
-1
@@ -64,7 +64,6 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover align-middle mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<caption class="sr-only">Data table</caption>
|
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>When</th>
|
<th>When</th>
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+3
-1
@@ -63,7 +63,9 @@ class AuditTrailServiceProvider extends ServiceProvider
|
|||||||
$commandPath = __DIR__ . '/../Console';
|
$commandPath = __DIR__ . '/../Console';
|
||||||
$commands = collect(File::allFiles($commandPath))
|
$commands = collect(File::allFiles($commandPath))
|
||||||
->map(function ($file) {
|
->map(function ($file) {
|
||||||
return 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension();
|
$class = 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension();
|
||||||
|
|
||||||
|
return $class;
|
||||||
})
|
})
|
||||||
->filter(function ($class) {
|
->filter(function ($class) {
|
||||||
return class_exists($class);
|
return class_exists($class);
|
||||||
|
|||||||
Executable → Regular
+12
@@ -14,6 +14,18 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
protected $moduleNamespace = 'Modules\AuditTrail\Http\Controllers';
|
protected $moduleNamespace = 'Modules\AuditTrail\Http\Controllers';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before routes are registered.
|
||||||
|
*
|
||||||
|
* Register any model bindings or pattern based filters.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the routes for the application.
|
* Define the routes for the application.
|
||||||
*
|
*
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -0,0 +1,5 @@
|
|||||||
|
# Carrier Management
|
||||||
|
|
||||||
|
Maintain carriers, services, and shipment routing master data.
|
||||||
|
|
||||||
|
Contains actual sample Blade views and placeholder service provider/routes only.
|
||||||
Executable → Regular
-1
@@ -64,7 +64,6 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover align-middle mb-0">
|
<table class="table table-hover align-middle mb-0">
|
||||||
<caption class="sr-only">Data table</caption>
|
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Carrier</th>
|
<th>Carrier</th>
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+14
-11
@@ -26,29 +26,27 @@ class DeleteOpenAiFilesCommand extends Command
|
|||||||
return self::FAILURE;
|
return self::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$service = new OpenAiFileService((string) $setting->api_key);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $this->executeFor(new OpenAiFileService((string) $setting->api_key));
|
|
||||||
} catch (Throwable $exception) {
|
|
||||||
$this->error($exception->getMessage());
|
|
||||||
|
|
||||||
return self::FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function executeFor(OpenAiFileService $service): int
|
|
||||||
{
|
|
||||||
if ((bool) $this->option('dry-run')) {
|
if ((bool) $this->option('dry-run')) {
|
||||||
$files = $service->listFiles();
|
$files = $service->listFiles();
|
||||||
|
|
||||||
$this->info('Found ' . count($files) . ' OpenAI API file(s).');
|
$this->info('Found ' . count($files) . ' OpenAI API file(s).');
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
$this->line(sprintf('- %s %s', (string) ($file['id'] ?? 'unknown'), (string) ($file['filename'] ?? 'unnamed')));
|
$this->line(sprintf(
|
||||||
|
'- %s %s',
|
||||||
|
(string) ($file['id'] ?? 'unknown'),
|
||||||
|
(string) ($file['filename'] ?? 'unnamed'),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::SUCCESS;
|
return self::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $service->deleteAllFiles();
|
$result = $service->deleteAllFiles();
|
||||||
|
|
||||||
$this->info("Listed: {$result['listed']}");
|
$this->info("Listed: {$result['listed']}");
|
||||||
$this->info("Deleted: {$result['deleted']}");
|
$this->info("Deleted: {$result['deleted']}");
|
||||||
$this->info("Failed: {$result['failed']}");
|
$this->info("Failed: {$result['failed']}");
|
||||||
@@ -58,5 +56,10 @@ class DeleteOpenAiFilesCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $result['failed'] === 0 ? self::SUCCESS : self::FAILURE;
|
return $result['failed'] === 0 ? self::SUCCESS : self::FAILURE;
|
||||||
|
} catch (Throwable $exception) {
|
||||||
|
$this->error($exception->getMessage());
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+1
@@ -16,5 +16,6 @@ class ChatGPTDatabaseSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
|
||||||
|
// $this->call("OthersTableSeeder");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Executable → Regular
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Modules\ChatGPT\Exceptions;
|
|
||||||
|
|
||||||
use RuntimeException;
|
|
||||||
|
|
||||||
final class OpenAiFileException extends RuntimeException {}
|
|
||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+3
-1
@@ -79,7 +79,9 @@ class ChatGPTServiceProvider extends ServiceProvider
|
|||||||
$commandPath = __DIR__ . '/../Console';
|
$commandPath = __DIR__ . '/../Console';
|
||||||
$commands = collect(File::allFiles($commandPath))
|
$commands = collect(File::allFiles($commandPath))
|
||||||
->map(function ($file) {
|
->map(function ($file) {
|
||||||
return 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension();
|
$class = 'Modules\\' . $this->moduleName . '\\Console\\' . $file->getFilenameWithoutExtension();
|
||||||
|
|
||||||
|
return $class;
|
||||||
})
|
})
|
||||||
->filter(function ($class) {
|
->filter(function ($class) {
|
||||||
return class_exists($class);
|
return class_exists($class);
|
||||||
|
|||||||
Executable → Regular
+12
@@ -14,6 +14,18 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
protected $moduleNamespace = 'Modules\ChatGPT\Http\Controllers';
|
protected $moduleNamespace = 'Modules\ChatGPT\Http\Controllers';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before routes are registered.
|
||||||
|
*
|
||||||
|
* Register any model bindings or pattern based filters.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the routes for the application.
|
* Define the routes for the application.
|
||||||
*
|
*
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+3
-8
@@ -65,8 +65,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="inline-flex items-center gap-2 text-sm text-slate-700">
|
<label class="inline-flex items-center gap-2 text-sm text-slate-700">
|
||||||
<label for="sonar-input-a09f3b253f" class="visually-hidden">is active</label>
|
<input type="checkbox" name="is_active" value="1" checked class="rounded border-slate-300 text-blue-600 focus:ring-blue-500">
|
||||||
<input type="checkbox" name="is_active" value="1" checked class="rounded border-slate-300 text-blue-600 focus:ring-blue-500" id="sonar-input-a09f3b253f">
|
|
||||||
Make active key
|
Make active key
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -83,7 +82,6 @@
|
|||||||
|
|
||||||
<div class="mt-5 overflow-x-auto">
|
<div class="mt-5 overflow-x-auto">
|
||||||
<table class="min-w-full divide-y divide-slate-200 text-sm">
|
<table class="min-w-full divide-y divide-slate-200 text-sm">
|
||||||
<caption class="sr-only">Data table</caption>
|
|
||||||
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
|
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-4 py-3">Name</th>
|
<th class="px-4 py-3">Name</th>
|
||||||
@@ -101,15 +99,13 @@
|
|||||||
@csrf
|
@csrf
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
|
|
||||||
<label for="sonar-input-30f47d1294" class="visually-hidden">name</label>
|
|
||||||
<input
|
<input
|
||||||
name="name"
|
name="name"
|
||||||
type="text"
|
type="text"
|
||||||
value="{{ old('name', $setting->name) }}"
|
value="{{ old('name', $setting->name) }}"
|
||||||
class="w-full rounded-lg border-slate-300 text-sm shadow-sm focus:border-blue-500 focus:ring-blue-500"
|
class="w-full rounded-lg border-slate-300 text-sm shadow-sm focus:border-blue-500 focus:ring-blue-500"
|
||||||
id="name">
|
>
|
||||||
|
|
||||||
<label for="sonar-input-707eb8d2ba" class="visually-hidden">Leave blank to keep existing key</label>
|
|
||||||
<input
|
<input
|
||||||
name="api_key"
|
name="api_key"
|
||||||
type="password"
|
type="password"
|
||||||
@@ -117,10 +113,9 @@
|
|||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
placeholder="Leave blank to keep existing key"
|
placeholder="Leave blank to keep existing key"
|
||||||
class="w-full rounded-lg border-slate-300 text-sm shadow-sm focus:border-blue-500 focus:ring-blue-500"
|
class="w-full rounded-lg border-slate-300 text-sm shadow-sm focus:border-blue-500 focus:ring-blue-500"
|
||||||
id="sonar-input-707eb8d2ba">
|
>
|
||||||
|
|
||||||
<label class="inline-flex items-center gap-2 text-xs text-slate-600">
|
<label class="inline-flex items-center gap-2 text-xs text-slate-600">
|
||||||
<label for="sonar-input-da782f0360" class="visually-hidden">is active</label>
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name="is_active"
|
name="is_active"
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+4
-4
@@ -4,7 +4,7 @@ namespace Modules\ChatGPT\Services;
|
|||||||
|
|
||||||
use Illuminate\Http\Client\PendingRequest;
|
use Illuminate\Http\Client\PendingRequest;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Modules\ChatGPT\Exceptions\OpenAiFileException;
|
use RuntimeException;
|
||||||
|
|
||||||
class OpenAiFileService
|
class OpenAiFileService
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ class OpenAiFileService
|
|||||||
->get(self::BASE_URL . '/files', $query);
|
->get(self::BASE_URL . '/files', $query);
|
||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
throw new OpenAiFileException('OpenAI file list request failed: ' . $response->body());
|
throw new RuntimeException('OpenAI file list request failed: ' . $response->body());
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = $response->json();
|
$payload = $response->json();
|
||||||
@@ -63,7 +63,7 @@ class OpenAiFileService
|
|||||||
->delete(self::BASE_URL . '/files/' . rawurlencode($fileId));
|
->delete(self::BASE_URL . '/files/' . rawurlencode($fileId));
|
||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
throw new OpenAiFileException("OpenAI file delete request failed for {$fileId}: " . $response->body());
|
throw new RuntimeException("OpenAI file delete request failed for {$fileId}: " . $response->body());
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->json() ?? [];
|
return $response->json() ?? [];
|
||||||
@@ -90,7 +90,7 @@ class OpenAiFileService
|
|||||||
try {
|
try {
|
||||||
$this->deleteFile($fileId);
|
$this->deleteFile($fileId);
|
||||||
$deleted++;
|
$deleted++;
|
||||||
} catch (OpenAiFileException $exception) {
|
} catch (RuntimeException $exception) {
|
||||||
$failures[] = [
|
$failures[] = [
|
||||||
'file_id' => $fileId,
|
'file_id' => $fileId,
|
||||||
'error' => $exception->getMessage(),
|
'error' => $exception->getMessage(),
|
||||||
|
|||||||
Executable → Regular
Executable → Regular
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user