From 6331785fda10edd87d1e888230fcf88063dca4b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Fr=C3=B6hlich?= Date: Fri, 7 Nov 2025 13:52:36 +0100 Subject: [PATCH] typo and design changes Frontend-Optimierung Powerpoint --- .DS_Store | Bin 10244 -> 12292 bytes .cursor/mcp.json | 2 +- .mcp.json | 2 +- AGENTS.md | 606 ++++++++++ composer.json | 1 + composer.lock | 160 ++- resources/views/dashboard.blade.php | 23 +- .../livewire/companies/transactions.blade.php | 1032 ++++++++--------- .../views/livewire/company-search.blade.php | 266 +++-- .../livewire/transaction-review.blade.php | 613 +++++----- storage/debugbar/.gitignore | 2 + 11 files changed, 1733 insertions(+), 974 deletions(-) create mode 100644 storage/debugbar/.gitignore diff --git a/.DS_Store b/.DS_Store index d4f24ce535c5023c48492be9ce7f20cdb52f8c8b..0e3bd8ccac3f46a05e883dbb2cd492c643ef8656 100644 GIT binary patch delta 219 zcmZn(Xh~3DU|?W$DortDV2}VZIe-{M3vdI8HUntb`BN}Mz+o65);@bR%A=E z0u=#)1ju+-WNS7SzGt4yucFHdGUfmfGfcMOk!At%I3{PP%-sAygq<1WI1u2N%p>rN gkzq5tAS)whT1s(pQht68BgpE_JVJhK8%uiG0qJlhW&i*H delta 154 zcmZokXbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~3gIoUvlMH0wo-~(btpg2QPd2vBf zPJR-QzhiTwMl<`w2MU|nIaoLt`6lxy{9%&y4FxLH%lk8R>)+08rx6W9frK_&nV o<^~e3Aj3Ca{LVa?Uq+XaVX_I2G6xgHVvWfuGBY>JsWLMI0Ihi)X#fBK diff --git a/.cursor/mcp.json b/.cursor/mcp.json index 01738d7..b1916bd 100644 --- a/.cursor/mcp.json +++ b/.cursor/mcp.json @@ -13,7 +13,7 @@ "/Applications/Herd.app/Contents/Resources/herd-mcp.phar" ], "env": { - "SITE_PATH": "/Users/bobmolitor/Herd/trusted_ai" + "SITE_PATH": "/Users/sebastianfrohlich/Herd/frontend" } } } diff --git a/.mcp.json b/.mcp.json index 01738d7..b1916bd 100644 --- a/.mcp.json +++ b/.mcp.json @@ -13,7 +13,7 @@ "/Applications/Herd.app/Contents/Resources/herd-mcp.phar" ], "env": { - "SITE_PATH": "/Users/bobmolitor/Herd/trusted_ai" + "SITE_PATH": "/Users/sebastianfrohlich/Herd/frontend" } } } diff --git a/AGENTS.md b/AGENTS.md index a52ffd5..ffba798 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,3 +14,609 @@ Write tests with Pest v4, mirroring the structure under `tests/Feature` for HTTP ## Commit & Pull Request Guidelines Commits are short, present-tense summaries (for example, `add billing address migration`). Bundle related changes together and include schema updates with their factories and tests. Pull requests should describe the change, list validation steps (commands run, screenshots for UI), and link to any tracked issue. Flag follow-up work clearly so reviewers can plan next steps. + +=== + + +=== foundation rules === + +# Laravel Boost Guidelines + +The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications. + +## Foundational Context +This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions. + +- php - 8.4.14 +- laravel/fortify (FORTIFY) - v1 +- laravel/framework (LARAVEL) - v12 +- laravel/prompts (PROMPTS) - v0 +- livewire/flux (FLUXUI_FREE) - v2 +- livewire/livewire (LIVEWIRE) - v3 +- livewire/volt (VOLT) - v1 +- laravel/mcp (MCP) - v0 +- laravel/pint (PINT) - v1 +- laravel/sail (SAIL) - v1 +- pestphp/pest (PEST) - v4 +- phpunit/phpunit (PHPUNIT) - v12 +- tailwindcss (TAILWINDCSS) - v4 + +## Conventions +- You must follow all existing code conventions used in this application. When creating or editing a file, check sibling files for the correct structure, approach, naming. +- Use descriptive names for variables and methods. For example, `isRegisteredForDiscounts`, not `discount()`. +- Check for existing components to reuse before writing a new one. + +## Verification Scripts +- Do not create verification scripts or tinker when tests cover that functionality and prove it works. Unit and feature tests are more important. + +## Application Structure & Architecture +- Stick to existing directory structure - don't create new base folders without approval. +- Do not change the application's dependencies without approval. + +## Frontend Bundling +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. + +## Replies +- Be concise in your explanations - focus on what's important rather than explaining obvious details. + +## Documentation Files +- You must only create documentation files if explicitly requested by the user. + + +=== boost rules === + +## Laravel Boost +- Laravel Boost is an MCP server that comes with powerful tools designed specifically for this application. Use them. + +## Artisan +- Use the `list-artisan-commands` tool when you need to call an Artisan command to double check the available parameters. + +## URLs +- Whenever you share a project URL with the user you should use the `get-absolute-url` tool to ensure you're using the correct scheme, domain / IP, and port. + +## Tinker / Debugging +- You should use the `tinker` tool when you need to execute PHP to debug code or query Eloquent models directly. +- Use the `database-query` tool when you only need to read from the database. + +## Reading Browser Logs With the `browser-logs` Tool +- You can read browser logs, errors, and exceptions using the `browser-logs` tool from Boost. +- Only recent browser logs will be useful - ignore old logs. + +## Searching Documentation (Critically Important) +- Boost comes with a powerful `search-docs` tool you should use before any other approaches. This tool automatically passes a list of installed packages and their versions to the remote Boost API, so it returns only version-specific documentation specific for the user's circumstance. You should pass an array of packages to filter on if you know you need docs for particular packages. +- The 'search-docs' tool is perfect for all Laravel related packages, including Laravel, Inertia, Livewire, Filament, Tailwind, Pest, Nova, Nightwatch, etc. +- You must use this tool to search for Laravel-ecosystem documentation before falling back to other approaches. +- Search the documentation before making code changes to ensure we are taking the correct approach. +- Use multiple, broad, simple, topic based queries to start. For example: `['rate limiting', 'routing rate limiting', 'routing']`. +- Do not add package names to queries - package information is already shared. For example, use `test resource table`, not `filament 4 test resource table`. + +### Available Search Syntax +- You can and should pass multiple queries at once. The most relevant results will be returned first. + +1. Simple Word Searches with auto-stemming - query=authentication - finds 'authenticate' and 'auth' +2. Multiple Words (AND Logic) - query=rate limit - finds knowledge containing both "rate" AND "limit" +3. Quoted Phrases (Exact Position) - query="infinite scroll" - Words must be adjacent and in that order +4. Mixed Queries - query=middleware "rate limit" - "middleware" AND exact phrase "rate limit" +5. Multiple Queries - queries=["authentication", "middleware"] - ANY of these terms + + +=== php rules === + +## PHP + +- Always use curly braces for control structures, even if it has one line. + +### Constructors +- Use PHP 8 constructor property promotion in `__construct()`. + - public function __construct(public GitHub $github) { } +- Do not allow empty `__construct()` methods with zero parameters. + +### Type Declarations +- Always use explicit return type declarations for methods and functions. +- Use appropriate PHP type hints for method parameters. + + +protected function isAccessible(User $user, ?string $path = null): bool +{ + ... +} + + +## Comments +- Prefer PHPDoc blocks over comments. Never use comments within the code itself unless there is something _very_ complex going on. + +## PHPDoc Blocks +- Add useful array shape type definitions for arrays when appropriate. + +## Enums +- Typically, keys in an Enum should be TitleCase. For example: `FavoritePerson`, `BestLake`, `Monthly`. + + +=== laravel/core rules === + +## Do Things the Laravel Way + +- Use `php artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using the `list-artisan-commands` tool. +- If you're creating a generic PHP class, use `artisan make:class`. +- Pass `--no-interaction` to all Artisan commands to ensure they work without user input. You should also pass the correct `--options` to ensure correct behavior. + +### Database +- Always use proper Eloquent relationship methods with return type hints. Prefer relationship methods over raw queries or manual joins. +- Use Eloquent models and relationships before suggesting raw database queries +- Avoid `DB::`; prefer `Model::query()`. Generate code that leverages Laravel's ORM capabilities rather than bypassing them. +- Generate code that prevents N+1 query problems by using eager loading. +- Use Laravel's query builder for very complex database operations. + +### Model Creation +- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `list-artisan-commands` to check the available options to `php artisan make:model`. + +### APIs & Eloquent Resources +- For APIs, default to using Eloquent API Resources and API versioning unless existing API routes do not, then you should follow existing application convention. + +### Controllers & Validation +- Always create Form Request classes for validation rather than inline validation in controllers. Include both validation rules and custom error messages. +- Check sibling Form Requests to see if the application uses array or string based validation rules. + +### Queues +- Use queued jobs for time-consuming operations with the `ShouldQueue` interface. + +### Authentication & Authorization +- Use Laravel's built-in authentication and authorization features (gates, policies, Sanctum, etc.). + +### URL Generation +- When generating links to other pages, prefer named routes and the `route()` function. + +### Configuration +- Use environment variables only in configuration files - never use the `env()` function directly outside of config files. Always use `config('app.name')`, not `env('APP_NAME')`. + +### Testing +- When creating models for tests, use the factories for the models. Check if the factory has custom states that can be used before manually setting up the model. +- Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. +- When creating tests, make use of `php artisan make:test [options] ` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. + +### Vite Error +- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`. + + +=== laravel/v12 rules === + +## Laravel 12 + +- Use the `search-docs` tool to get version specific documentation. +- Since Laravel 11, Laravel has a new streamlined file structure which this project uses. + +### Laravel 12 Structure +- No middleware files in `app/Http/Middleware/`. +- `bootstrap/app.php` is the file to register middleware, exceptions, and routing files. +- `bootstrap/providers.php` contains application specific service providers. +- **No app\Console\Kernel.php** - use `bootstrap/app.php` or `routes/console.php` for console configuration. +- **Commands auto-register** - files in `app/Console/Commands/` are automatically available and do not require manual registration. + +### Database +- When modifying a column, the migration must include all of the attributes that were previously defined on the column. Otherwise, they will be dropped and lost. +- Laravel 11 allows limiting eagerly loaded records natively, without external packages: `$query->latest()->limit(10);`. + +### Models +- Casts can and likely should be set in a `casts()` method on a model rather than the `$casts` property. Follow existing conventions from other models. + + +=== fluxui-free/core rules === + +## Flux UI Free + +- This project is using the free edition of Flux UI. It has full access to the free components and variants, but does not have access to the Pro components. +- Flux UI is a component library for Livewire. Flux is a robust, hand-crafted, UI component library for your Livewire applications. It's built using Tailwind CSS and provides a set of components that are easy to use and customize. +- You should use Flux UI components when available. +- Fallback to standard Blade components if Flux is unavailable. +- If available, use Laravel Boost's `search-docs` tool to get the exact documentation and code snippets available for this project. +- Flux UI components look like this: + + + + + + +### Available Components +This is correct as of Boost installation, but there may be additional components within the codebase. + + +avatar, badge, brand, breadcrumbs, button, callout, checkbox, dropdown, field, heading, icon, input, modal, navbar, profile, radio, select, separator, switch, text, textarea, tooltip + + + +=== livewire/core rules === + +## Livewire Core +- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests. +- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components +- State should live on the server, with the UI reflecting it. +- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions. + +## Livewire Best Practices +- Livewire components require a single root element. +- Use `wire:loading` and `wire:dirty` for delightful loading states. +- Add `wire:key` in loops: + + ```blade + @foreach ($items as $item) +
+ {{ $item->name }} +
+ @endforeach + ``` + +- Prefer lifecycle hooks like `mount()`, `updatedFoo()` for initialization and reactive side effects: + + + public function mount(User $user) { $this->user = $user; } + public function updatedSearch() { $this->resetPage(); } + + + +## Testing Livewire + + + Livewire::test(Counter::class) + ->assertSet('count', 0) + ->call('increment') + ->assertSet('count', 1) + ->assertSee(1) + ->assertStatus(200); + + + + + $this->get('/posts/create') + ->assertSeeLivewire(CreatePost::class); + + + +=== livewire/v3 rules === + +## Livewire 3 + +### Key Changes From Livewire 2 +- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions. + - Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default. + - Components now use the `App\Livewire` namespace (not `App\Http\Livewire`). + - Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`). + - Use the `components.layouts.app` view as the typical layout path (not `layouts.app`). + +### New Directives +- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples. + +### Alpine +- Alpine is now included with Livewire, don't manually include Alpine.js. +- Plugins included with Alpine: persist, intersect, collapse, and focus. + +### Lifecycle Hooks +- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring: + + +document.addEventListener('livewire:init', function () { + Livewire.hook('request', ({ fail }) => { + if (fail && fail.status === 419) { + alert('Your session expired'); + } + }); + + Livewire.hook('message.failed', (message, component) => { + console.error(message); + }); +}); + + + +=== volt/core rules === + +## Livewire Volt + +- This project uses Livewire Volt for interactivity within its pages. New pages requiring interactivity must also use Livewire Volt. There is documentation available for it. +- Make new Volt components using `php artisan make:volt [name] [--test] [--pest]` +- Volt is a **class-based** and **functional** API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to co-exist in the same file +- Livewire Volt allows PHP logic and Blade templates in one file. Components use the `@livewire("volt-anonymous-fragment-eyJuYW1lIjoidm9sdC1hbm9ueW1vdXMtZnJhZ21lbnQtYmQ5YWJiNTE3YWMyMTgwOTA1ZmUxMzAxODk0MGJiZmIiLCJwYXRoIjoic3RvcmFnZVwvZnJhbWV3b3JrXC92aWV3c1wvMTUxYWRjZWRjMzBhMzllOWIxNzQ0ZDRiMWRjY2FjYWIuYmxhZGUucGhwIn0=", Livewire\Volt\Precompilers\ExtractFragments::componentArguments([...get_defined_vars(), ...array ( +)])) + + + +### Volt Class Based Component Example +To get started, define an anonymous class that extends Livewire\Volt\Component. Within the class, you may utilize all of the features of Livewire using traditional Livewire syntax: + + + +use Livewire\Volt\Component; + +new class extends Component { + public $count = 0; + + public function increment() + { + $this->count++; + } +} ?> + +
+

{{ $count }}

+ +
+
+ + +### Testing Volt & Volt Components +- Use the existing directory for tests if it already exists. Otherwise, fallback to `tests/Feature/Volt`. + + +use Livewire\Volt\Volt; + +test('counter increments', function () { + Volt::test('counter') + ->assertSee('Count: 0') + ->call('increment') + ->assertSee('Count: 1'); +}); + + + + +declare(strict_types=1); + +use App\Models\{User, Product}; +use Livewire\Volt\Volt; + +test('product form creates product', function () { + $user = User::factory()->create(); + + Volt::test('pages.products.create') + ->actingAs($user) + ->set('form.name', 'Test Product') + ->set('form.description', 'Test Description') + ->set('form.price', 99.99) + ->call('create') + ->assertHasNoErrors(); + + expect(Product::where('name', 'Test Product')->exists())->toBeTrue(); +}); + + + +### Common Patterns + + + + null, 'search' => '']); + +$products = computed(fn() => Product::when($this->search, + fn($q) => $q->where('name', 'like', "%{$this->search}%") +)->get()); + +$edit = fn(Product $product) => $this->editing = $product->id; +$delete = fn(Product $product) => $product->delete(); + +?> + + + + + + + + + + + Save + Saving... + + + + +=== pint/core rules === + +## Laravel Pint Code Formatter + +- You must run `vendor/bin/pint --dirty` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/pint --test`, simply run `vendor/bin/pint` to fix any formatting issues. + + +=== pest/core rules === + +## Pest + +### Testing +- If you need to verify a feature is working, write or update a Unit / Feature test. + +### Pest Tests +- All tests must be written using Pest. Use `php artisan make:test --pest `. +- You must not remove any tests or test files from the tests directory without approval. These are not temporary or helper files - these are core to the application. +- Tests should test all of the happy paths, failure paths, and weird paths. +- Tests live in the `tests/Feature` and `tests/Unit` directories. +- Pest tests look and behave like this: + +it('is true', function () { + expect(true)->toBeTrue(); +}); + + +### Running Tests +- Run the minimal number of tests using an appropriate filter before finalizing code edits. +- To run all tests: `php artisan test`. +- To run all tests in a file: `php artisan test tests/Feature/ExampleTest.php`. +- To filter on a particular test name: `php artisan test --filter=testName` (recommended after making a change to a related file). +- When the tests relating to your changes are passing, ask the user if they would like to run the entire test suite to ensure everything is still passing. + +### Pest Assertions +- When asserting status codes on a response, use the specific method like `assertForbidden` and `assertNotFound` instead of using `assertStatus(403)` or similar, e.g.: + +it('returns all', function () { + $response = $this->postJson('/api/docs', []); + + $response->assertSuccessful(); +}); + + +### Mocking +- Mocking can be very helpful when appropriate. +- When mocking, you can use the `Pest\Laravel\mock` Pest function, but always import it via `use function Pest\Laravel\mock;` before using it. Alternatively, you can use `$this->mock()` if existing tests do. +- You can also create partial mocks using the same import or self method. + +### Datasets +- Use datasets in Pest to simplify tests which have a lot of duplicated data. This is often the case when testing validation rules, so consider going with this solution when writing tests for validation rules. + + +it('has emails', function (string $email) { + expect($email)->not->toBeEmpty(); +})->with([ + 'james' => 'james@laravel.com', + 'taylor' => 'taylor@laravel.com', +]); + + + +=== pest/v4 rules === + +## Pest 4 + +- Pest v4 is a huge upgrade to Pest and offers: browser testing, smoke testing, visual regression testing, test sharding, and faster type coverage. +- Browser testing is incredibly powerful and useful for this project. +- Browser tests should live in `tests/Browser/`. +- Use the `search-docs` tool for detailed guidance on utilizing these features. + +### Browser Testing +- You can use Laravel features like `Event::fake()`, `assertAuthenticated()`, and model factories within Pest v4 browser tests, as well as `RefreshDatabase` (when needed) to ensure a clean state for each test. +- Interact with the page (click, type, scroll, select, submit, drag-and-drop, touch gestures, etc.) when appropriate to complete the test. +- If requested, test on multiple browsers (Chrome, Firefox, Safari). +- If requested, test on different devices and viewports (like iPhone 14 Pro, tablets, or custom breakpoints). +- Switch color schemes (light/dark mode) when appropriate. +- Take screenshots or pause tests for debugging when appropriate. + +### Example Tests + + +it('may reset the password', function () { + Notification::fake(); + + $this->actingAs(User::factory()->create()); + + $page = visit('/sign-in'); // Visit on a real browser... + + $page->assertSee('Sign In') + ->assertNoJavascriptErrors() // or ->assertNoConsoleLogs() + ->click('Forgot Password?') + ->fill('email', 'nuno@laravel.com') + ->click('Send Reset Link') + ->assertSee('We have emailed your password reset link!') + + Notification::assertSent(ResetPassword::class); +}); + + + +$pages = visit(['/', '/about', '/contact']); + +$pages->assertNoJavascriptErrors()->assertNoConsoleLogs(); + + + +=== tailwindcss/core rules === + +## Tailwind Core + +- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own. +- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..) +- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically +- You can use the `search-docs` tool to get exact examples from the official documentation when needed. + +### Spacing +- When listing items, use gap utilities for spacing, don't use margins. + + +
+
Superior
+
Michigan
+
Erie
+
+
+ + +### Dark Mode +- If existing pages and components support dark mode, new pages and components must support dark mode in a similar way, typically using `dark:`. + + +=== tailwindcss/v4 rules === + +## Tailwind 4 + +- Always use Tailwind CSS v4 - do not use the deprecated utilities. +- `corePlugins` is not supported in Tailwind v4. +- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3: + + + - @tailwind base; + - @tailwind components; + - @tailwind utilities; + + @import "tailwindcss"; + + + +### Replaced Utilities +- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement. +- Opacity values are still numeric. + +| Deprecated | Replacement | +|------------+--------------| +| bg-opacity-* | bg-black/* | +| text-opacity-* | text-black/* | +| border-opacity-* | border-black/* | +| divide-opacity-* | divide-black/* | +| ring-opacity-* | ring-black/* | +| placeholder-opacity-* | placeholder-black/* | +| flex-shrink-* | shrink-* | +| flex-grow-* | grow-* | +| overflow-ellipsis | text-ellipsis | +| decoration-slice | box-decoration-slice | +| decoration-clone | box-decoration-clone | + + +=== tests rules === + +## Test Enforcement + +- Every change must be programmatically tested. Write a new test or update an existing test, then run the affected tests to make sure they pass. +- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test` with a specific filename or filter. + + +=== laravel/fortify rules === + +## Laravel Fortify + +Fortify is a headless authentication backend that provides authentication routes and controllers for Laravel applications. + +**Before implementing any authentication features, use the `search-docs` tool to get the latest docs for that specific feature.** + +### Configuration & Setup +- Check `config/fortify.php` to see what's enabled. Use `search-docs` for detailed information on specific features. +- Enable features by adding them to the `'features' => []` array: `Features::registration()`, `Features::resetPasswords()`, etc. +- To see the all Fortify registered routes, use the `list-routes` tool with the `only_vendor: true` and `action: "Fortify"` parameters. +- Fortify includes view routes by default (login, register). Set `'views' => false` in the configuration file to disable them if you're handling views yourself. + +### Customization +- Views can be customized in `FortifyServiceProvider`'s `boot()` method using `Fortify::loginView()`, `Fortify::registerView()`, etc. +- Customize authentication logic with `Fortify::authenticateUsing()` for custom user retrieval / validation. +- Actions in `app/Actions/Fortify/` handle business logic (user creation, password reset, etc.). They're fully customizable, so you can modify them to change feature behavior. + +## Available Features +- `Features::registration()` for user registration. +- `Features::emailVerification()` to verify new user emails. +- `Features::twoFactorAuthentication()` for 2FA with QR codes and recovery codes. + - Add options: `['confirmPassword' => true, 'confirm' => true]` to require password confirmation and OTP confirmation before enabling 2FA. +- `Features::updateProfileInformation()` to let users update their profile. +- `Features::updatePasswords()` to let users change their passwords. +- `Features::resetPasswords()` for password reset via email. +
diff --git a/composer.json b/composer.json index 717f221..746e819 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "livewire/volt": "^1.7.0" }, "require-dev": { + "barryvdh/laravel-debugbar": "^3.16", "fakerphp/faker": "^1.23", "laravel/boost": "^1.4", "laravel/pail": "^1.2.2", diff --git a/composer.lock b/composer.lock index 3dfa38f..1e5f0e4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bc6d1d658f2a9253e140afd6f2829a79", + "content-hash": "d2c4036d408b704fbf0c84bb39ea980c", "packages": [ { "name": "bacon/bacon-qr-code", @@ -6534,6 +6534,91 @@ } ], "packages-dev": [ + { + "name": "barryvdh/laravel-debugbar", + "version": "v3.16.0", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-debugbar.git", + "reference": "f265cf5e38577d42311f1a90d619bcd3740bea23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/f265cf5e38577d42311f1a90d619bcd3740bea23", + "reference": "f265cf5e38577d42311f1a90d619bcd3740bea23", + "shasum": "" + }, + "require": { + "illuminate/routing": "^9|^10|^11|^12", + "illuminate/session": "^9|^10|^11|^12", + "illuminate/support": "^9|^10|^11|^12", + "php": "^8.1", + "php-debugbar/php-debugbar": "~2.2.0", + "symfony/finder": "^6|^7" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "orchestra/testbench-dusk": "^7|^8|^9|^10", + "phpunit/phpunit": "^9.5.10|^10|^11", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar" + }, + "providers": [ + "Barryvdh\\Debugbar\\ServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.16-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Barryvdh\\Debugbar\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "PHP Debugbar integration for Laravel", + "keywords": [ + "debug", + "debugbar", + "dev", + "laravel", + "profiler", + "webprofiler" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-debugbar/issues", + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.16.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-07-14T11:56:43+00:00" + }, { "name": "brianium/paratest", "version": "v7.14.2", @@ -8211,6 +8296,79 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "php-debugbar/php-debugbar", + "version": "v2.2.4", + "source": { + "type": "git", + "url": "https://github.com/php-debugbar/php-debugbar.git", + "reference": "3146d04671f51f69ffec2a4207ac3bdcf13a9f35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/3146d04671f51f69ffec2a4207ac3bdcf13a9f35", + "reference": "3146d04671f51f69ffec2a4207ac3bdcf13a9f35", + "shasum": "" + }, + "require": { + "php": "^8", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4|^5|^6|^7" + }, + "replace": { + "maximebf/debugbar": "self.version" + }, + "require-dev": { + "dbrekelmans/bdi": "^1", + "phpunit/phpunit": "^8|^9", + "symfony/panther": "^1|^2.1", + "twig/twig": "^1.38|^2.7|^3.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "DebugBar\\": "src/DebugBar/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + }, + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/php-debugbar/php-debugbar", + "keywords": [ + "debug", + "debug bar", + "debugbar", + "dev" + ], + "support": { + "issues": "https://github.com/php-debugbar/php-debugbar/issues", + "source": "https://github.com/php-debugbar/php-debugbar/tree/v2.2.4" + }, + "time": "2025-07-22T14:01:30+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 3862da7..dc5e6a6 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -45,7 +45,7 @@ 'avg_risk' => (int) round($group->avg('risk_score')), ]) ->sortByDesc('alerts') - ->take(3); + ->take(5); @endphp
@@ -55,11 +55,11 @@

- Advanced AI-Powered AFC + Anti Financial Crime - Dashboard

-

Qualifizierung der Verdachtsfälle juristischer Personen o.Ä.​

+

Qualifizierung der Verdachtsfälle juristischer Personen​

- KI-gestützte Detection Engines, Wissensgraphen und Analyst:innen bilden ein gemeinsames Lagebild. Die folgenden Signale fassen aktuelle Alert-Last, Automationsquote und Marktvolumen zusammen. + Übersicht für AML-Verantwortliche für die Kapazitätssteuerung

@@ -83,14 +83,11 @@
-
+
-

Realtime Alert Intelligence

-

- KI priorisiert {{ $formatNumber($activeAlerts->count()) }} offene Vorgänge anhand von Netzwerk-, Verhaltens- und Sanktionssignalen. -

+

Risikolassen und Automatisierungsscore​

Automationspräzision {{ $precisionRate }}% @@ -118,7 +115,7 @@
-
+ -
+
diff --git a/resources/views/livewire/companies/transactions.blade.php b/resources/views/livewire/companies/transactions.blade.php index 771b7d5..2ad5018 100644 --- a/resources/views/livewire/companies/transactions.blade.php +++ b/resources/views/livewire/companies/transactions.blade.php @@ -152,7 +152,7 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione ->selectRaw('status, COUNT(*) as total, COALESCE(SUM(amount), 0) as volume') ->groupBy('status') ->get() - ->mapWithKeys(fn ($row) => [ + ->mapWithKeys(fn($row) => [ $row->status => [ 'count' => (int) $row->total, 'amount' => (float) $row->volume, @@ -261,8 +261,8 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione protected function filteredQuery(): Builder { return $this->baseQuery() - ->when($this->status !== 'all', fn (Builder $query) => $query->where('status', $this->status)) - ->when($this->channel !== 'all', fn (Builder $query) => $query->where('channel', $this->channel)); + ->when($this->status !== 'all', fn(Builder $query) => $query->where('status', $this->status)) + ->when($this->channel !== 'all', fn(Builder $query) => $query->where('channel', $this->channel)); } protected function baseQuery(): Builder @@ -273,32 +273,32 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione ?> @php - /** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $transactions */ - $transactions = $this->transactions; - /** @var \App\Models\Transaction|null $selected */ - $selected = $this->selectedTransaction; - $metrics = $this->metrics; - $statusOptions = $this->statusOptions; - $channelOptions = $this->channelOptions; - $counterpartyHistory = $this->counterpartyHistory; - $recentAlerts = $this->recentAlerts; - $actionChecklist = $this->actionChecklist; - $checklistIntro = __('Fokusbereiche für diesen Fall'); +/** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $transactions */ +$transactions = $this->transactions; +/** @var \App\Models\Transaction|null $selected */ +$selected = $this->selectedTransaction; +$metrics = $this->metrics; +$statusOptions = $this->statusOptions; +$channelOptions = $this->channelOptions; +$counterpartyHistory = $this->counterpartyHistory; +$recentAlerts = $this->recentAlerts; +$actionChecklist = $this->actionChecklist; +$checklistIntro = __('Fokusbereiche für diesen Fall'); - $formatCurrency = static fn (float $value): string => number_format($value, 2, ',', '.') . ' €'; - $formatAmount = static fn (float $value, string $currency): string => number_format($value, 2, ',', '.') . ' ' . $currency; +$formatCurrency = static fn (float $value): string => number_format($value, 2, ',', '.') . ' €'; +$formatAmount = static fn (float $value, string $currency): string => number_format($value, 2, ',', '.') . ' ' . $currency; - $statusStyles = [ - Transaction::STATUS_TRUE_POSITIVE => 'bg-gradient-to-r from-rose-500/25 via-rose-500/10 to-rose-400/20 text-rose-700 dark:text-rose-200 border border-rose-500/30 shadow-[0_0_25px_-14px_rgba(244,63,94,0.85)]', - Transaction::STATUS_FALSE_POSITIVE => 'bg-gradient-to-r from-amber-400/25 via-amber-400/10 to-amber-300/20 text-amber-700 dark:text-amber-200 border border-amber-400/30 shadow-[0_0_25px_-14px_rgba(251,191,36,0.85)]', - Transaction::STATUS_CLEARED => 'bg-gradient-to-r from-emerald-400/25 via-emerald-400/10 to-emerald-300/20 text-emerald-700 dark:text-emerald-200 border border-emerald-400/30 shadow-[0_0_25px_-14px_rgba(52,211,153,0.85)]', - ]; +$statusStyles = [ +Transaction::STATUS_TRUE_POSITIVE => 'bg-gradient-to-r from-rose-500/25 via-rose-500/10 to-rose-400/20 text-rose-700 dark:text-rose-200 border border-rose-500/30 shadow-[0_0_25px_-14px_rgba(244,63,94,0.85)]', +Transaction::STATUS_FALSE_POSITIVE => 'bg-gradient-to-r from-amber-400/25 via-amber-400/10 to-amber-300/20 text-amber-700 dark:text-amber-200 border border-amber-400/30 shadow-[0_0_25px_-14px_rgba(251,191,36,0.85)]', +Transaction::STATUS_CLEARED => 'bg-gradient-to-r from-emerald-400/25 via-emerald-400/10 to-emerald-300/20 text-emerald-700 dark:text-emerald-200 border border-emerald-400/30 shadow-[0_0_25px_-14px_rgba(52,211,153,0.85)]', +]; - $statusCopy = [ - Transaction::STATUS_TRUE_POSITIVE => __('Ein schwerwiegender Verdacht liegt vor. Priorisieren Sie die Eskalation und bereiten Sie eine Verdachtsmeldung vor.'), - Transaction::STATUS_FALSE_POSITIVE => __('Alarm konnte entkräftet werden. Dokumentieren Sie die Begründung und schließen Sie den Fall.'), - Transaction::STATUS_CLEARED => __('Keine Auffälligkeiten. Dokumentieren und archivieren Sie den Prüfschritt.'), - ]; +$statusCopy = [ +Transaction::STATUS_TRUE_POSITIVE => __('Ein schwerwiegender Verdacht liegt vor. Priorisieren Sie die Eskalation und bereiten Sie eine Verdachtsmeldung vor.'), +Transaction::STATUS_FALSE_POSITIVE => __('Alarm konnte entkräftet werden. Dokumentieren Sie die Begründung und schließen Sie den Fall.'), +Transaction::STATUS_CLEARED => __('Keine Auffälligkeiten. Dokumentieren und archivieren Sie den Prüfschritt.'), +]; @endphp
@@ -348,9 +348,9 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione
- + -@if (! empty($actionChecklist)) + @if (! empty($actionChecklist))
@@ -370,23 +370,23 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione
    @foreach ($actionChecklist as $index => $item) -
  1. - - {{ sprintf('%02d', $index + 1) }} - -
    -

    {{ $item['title'] }}

    -

    {{ $item['description'] }}

    -
    -
  2. +
  3. + + {{ sprintf('%02d', $index + 1) }} + +
    +

    {{ $item['title'] }}

    +

    {{ $item['description'] }}

    +
    +
  4. @endforeach
-@endif + @endif -
-
+
+
@@ -401,91 +401,88 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione
@foreach ($statusOptions as $value => $label) - + @endforeach @foreach ($channelOptions as $value => $label) - + @endforeach
@forelse ($transactions as $transaction) - - @empty -
- {{ __('Keine Transaktionen für die aktuellen Filter gefunden.') }}
+
+ + Risiko {{ $transaction->risk_score }} + + {{ $transaction->channel }} + + {{ $transaction->reference }} + + {{ __('Fallansicht öffnen') }} + + +
+ + @empty +
+ {{ __('Keine Transaktionen für die aktuellen Filter gefunden.') }} +
@endforelse
@if ($transactions->hasPages()) -
- - - {{ __('Seite') }} {{ $transactions->currentPage() }} {{ __('von') }} {{ $transactions->lastPage() }} - - + + {{ __('Seite') }} {{ $transactions->currentPage() }} {{ __('von') }} {{ $transactions->lastPage() }} + + -
+ {{ __('Weiter') }} › + +
@endif
@@ -493,19 +490,19 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione

{{ __('Neueste Alerts') }}

    @forelse ($recentAlerts as $alert) -
  • -
    -

    {{ $alert->counterparty }}

    -

    {{ $alert->executed_at?->format('d.m.Y H:i') }} • {{ $alert->channel }}

    -
    - - {{ $alert->statusLabel() }} - -
  • +
  • +
    +

    {{ $alert->counterparty }}

    +

    {{ $alert->executed_at?->format('d.m.Y H:i') }} • {{ $alert->channel }}

    +
    + + {{ $alert->statusLabel() }} + +
  • @empty -
  • - {{ __('Aktuell liegen keine offenen Alerts vor.') }} -
  • +
  • + {{ __('Aktuell liegen keine offenen Alerts vor.') }} +
  • @endforelse
@@ -513,338 +510,337 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione
@if ($selected) - @php - $badgeStyle = $statusStyles[$selected->status] ?? 'bg-zinc-500/10 text-zinc-600 border border-zinc-500/20'; - $riskLevel = match (true) { - $selected->risk_score >= 80 => __('Hoch'), - $selected->risk_score >= 60 => __('Erhöht'), - $selected->risk_score >= 40 => __('Moderat'), - default => __('Niedrig'), - }; - $riskNarrative = match (true) { - $selected->risk_score >= 80 => __('Die Einstufung über 80 Punkten signalisiert einen erhöhten AML-Prüffokus. Eskalation und enges Monitoring sind angeraten.'), - $selected->risk_score >= 60 => __('Das Risiko liegt im oberen Mittelfeld. Prüfen Sie Plausibilitäten und dokumentieren Sie Gegenmaßnahmen.'), - $selected->risk_score >= 40 => __('Die Einstufung erscheint moderat. Stellen Sie sicher, dass grundlegende Prüfungen vollständig dokumentiert sind.'), - default => __('Der Score deutet auf ein geringes AML-Risiko hin. Ein strukturierter Nachweis der Prüfung ist dennoch erforderlich.'), - }; - $statusGuidance = $statusCopy[$selected->status] ?? __('Review abschließen und Audit-Trail ergänzen.'); - $executedDate = $selected->executed_at?->format('d.m.Y'); - $executedTime = $selected->executed_at?->format('H:i'); - $amountValue = $formatAmount($selected->amount, $selected->currency); - $companyName = $company->legal_name ?? $company->name; - $companyCountryLabel = $company->country ?? __('Jurisdiktion offen'); - $counterpartyCountryLabel = $selected->counterparty_country ?? __('Jurisdiktion offen'); - $referenceLabel = $selected->reference ?: __('Keine Referenz angegeben'); - $flaggedReasonLabel = $selected->flagged_reason ?: __('Nicht dokumentiert'); - $domesticFlow = $company->country && $selected->counterparty_country && strcasecmp($company->country, $selected->counterparty_country) === 0; - $purposeDescription = __('Die Zahlung nutzt den Referenztext ":reference" und wurde mit dem Flag ":reason" markiert. Prüfen Sie Rechnungs- und Liefernachweise, um den wirtschaftlichen Anlass zu bestätigen.', [ - 'reference' => $referenceLabel, - 'reason' => $flaggedReasonLabel, - ]); - $countryNotes = []; - if ($domesticFlow) { - $countryNotes[] = __('Transparency International – CPI 2024: 75/100 (Rang 15).'); - } else { - $countryNotes[] = __('Ermitteln Sie länderspezifische Restrisiken (Sanktionen, Exportkontrolle, Devisenauflagen).'); - } - if (! $company->country || ! $selected->counterparty_country) { - $countryNotes[] = __('Länderangaben unvollständig – KYC-Stammdaten aktualisieren.'); - } - $analysisSections = [ - [ - 'title' => __('Verwendungszweck'), - 'description' => $purposeDescription, - 'notes' => [ - __('Rechnungskopie inkl. HR-/VAT-/IBAN-Angaben anfordern.'), - __('3-Way-Match (PO–GR–Invoice) vollständig dokumentieren.'), - ], - ], - [ - 'title' => __('LEI'), - 'description' => __('Für :company und :counterparty liegt kein verifizierter LEI im Datensatz vor. Ein Direktabruf im GLEIF-Register wird empfohlen.', [ - 'company' => $companyName, - 'counterparty' => $selected->counterparty, - ]), - 'notes' => [ - __('Status: not verified.'), - __('Bankinterne LEI-Prüfung vor Freigabe abschließen.'), - ], - ], - [ - 'title' => __('Länderanalyse'), - 'description' => $domesticFlow - ? __('Vorliegende Daten deuten auf eine Inlandszahlung (:from → :to) hin. Das systemische Korruptionsrisiko gilt als niedrig.', [ - 'from' => $companyCountryLabel, - 'to' => $counterpartyCountryLabel, - ]) - : __('Transaktion verläuft von :from nach :to. Prüfen Sie Export-/Importauflagen sowie mögliche Hochrisikofaktoren.', [ - 'from' => $companyCountryLabel, - 'to' => $counterpartyCountryLabel, - ]), - 'notes' => $countryNotes, - ], - [ - 'title' => __('PEP-Exposure'), - 'description' => __('Es liegen keine Hinweise auf PEP-Einfluss in den Stammdaten vor. Screening der wirtschaftlich Berechtigten bleibt fortzuführen.'), - 'notes' => [ - __('Manuelles Screening der Management- und Eigentümerebene abschließen (Status: not verified).'), - ], - ], - [ - 'title' => __('AML Exposure (transaktionsbezogen)'), - 'description' => __('Klarer Leistungszweck und etablierte Gegenparteien wirken risikomindernd. Restrisiko besteht in der eindeutigen Identifikation der Rechnungseinheit und des Zahlungswegs.'), - 'notes' => [ - __('Kontoinhaber und IBAN mit der Rechnungseinheit matchen.'), - __('Preis- und Mengenabweichungen gegen Bestellung analysieren.'), - ], - ], - [ - 'title' => __('Sanktions-Exposure'), - 'description' => __('Bisherige Namenstests ergaben keine Treffer. Automatisierte Listenprüfungen sind auf den finalen Rechtsträger erneut auszuführen.'), - 'notes' => [ - __('EU-/OFAC-Abgleich sowie interne Sanktionslisten auf finaler Rechnungseinheit bestätigen.'), - ], - ], - [ - 'title' => __('Korruptions-/Bestechungs-Exposure'), - 'description' => __('Makrorisiko im deutschen Markt ist gering. Beschaffungsrisiken (Kick-backs, Scheinrechnungen) bleiben bei Großvolumina bestehen.'), - 'notes' => [ - __('Zahlungen ausschließlich an bestätigte Gesellschaftskonten leisten.'), - __('Vier-Augen-Prinzip und Liefernachweise dokumentieren.'), - ], - ], - [ - 'title' => __('Adverse Media Scanning (≤ 12 Monate)'), - 'description' => __('In den letzten 12 Monaten wurden keine AML-relevanten Negativmeldungen identifiziert. Restrisiko: laufende Restrukturierungs- und Compliance-News beobachten.'), - 'notes' => [ - __('Interne Newsfeeds und Watchlists weiterführen.'), - ], - ], - [ - 'title' => __('KYC/EDD Feststellungen'), - 'description' => __('KYC-Dossier aktualisieren: rechtliche Einheit, wirtschaftlich Berechtigte und Zahlungsweg eindeutig dokumentieren.'), - 'notes' => [ - __('IBAN/BIC sowie Steuerkennzeichen im Dossier hinterlegen.'), - __('Rechnungskopie, Liefernachweis und Vertragsgrundlage einholen.'), - ], - ], - [ - 'title' => __('Gesamtbeurteilung (AML-Sicht)'), - 'description' => __('Die Transaktion über :amount zwischen :company und :counterparty wirkt branchenüblich. Freigabe ist möglich, sobald Rechnungseinheit, Zahlungsweg und Screening final bestätigt sind.', [ - 'amount' => $amountValue, - 'company' => $companyName, - 'counterparty' => $selected->counterparty, - ]), - 'notes' => [ - __('Votum: Freigabefähig unter Auflagen (Rechnung, 3-Way-Match, Screening, Exportkontrolle).'), - ], - ], - ]; - $combineNotes = static function (array $sections): array { - $notes = []; + @php + $badgeStyle = $statusStyles[$selected->status] ?? 'bg-zinc-500/10 text-zinc-600 border border-zinc-500/20'; + $riskLevel = match (true) { + $selected->risk_score >= 80 => __('Hoch'), + $selected->risk_score >= 60 => __('Erhöht'), + $selected->risk_score >= 40 => __('Moderat'), + default => __('Niedrig'), + }; + $riskNarrative = match (true) { + $selected->risk_score >= 80 => __('Die Einstufung über 80 Punkten signalisiert einen erhöhten AML-Prüffokus. Eskalation und enges Monitoring sind angeraten.'), + $selected->risk_score >= 60 => __('Das Risiko liegt im oberen Mittelfeld. Prüfen Sie Plausibilitäten und dokumentieren Sie Gegenmaßnahmen.'), + $selected->risk_score >= 40 => __('Die Einstufung erscheint moderat. Stellen Sie sicher, dass grundlegende Prüfungen vollständig dokumentiert sind.'), + default => __('Der Score deutet auf ein geringes AML-Risiko hin. Ein strukturierter Nachweis der Prüfung ist dennoch erforderlich.'), + }; + $statusGuidance = $statusCopy[$selected->status] ?? __('Review abschließen und Audit-Trail ergänzen.'); + $executedDate = $selected->executed_at?->format('d.m.Y'); + $executedTime = $selected->executed_at?->format('H:i'); + $amountValue = $formatAmount($selected->amount, $selected->currency); + $companyName = $company->legal_name ?? $company->name; + $companyCountryLabel = $company->country ?? __('Jurisdiktion offen'); + $counterpartyCountryLabel = $selected->counterparty_country ?? __('Jurisdiktion offen'); + $referenceLabel = $selected->reference ?: __('Keine Referenz angegeben'); + $flaggedReasonLabel = $selected->flagged_reason ?: __('Nicht dokumentiert'); + $domesticFlow = $company->country && $selected->counterparty_country && strcasecmp($company->country, $selected->counterparty_country) === 0; + $purposeDescription = __('Die Zahlung nutzt den Referenztext ":reference" und wurde mit dem Flag ":reason" markiert. Prüfen Sie Rechnungs- und Liefernachweise, um den wirtschaftlichen Anlass zu bestätigen.', [ + 'reference' => $referenceLabel, + 'reason' => $flaggedReasonLabel, + ]); + $countryNotes = []; + if ($domesticFlow) { + $countryNotes[] = __('Transparency International – CPI 2024: 75/100 (Rang 15).'); + } else { + $countryNotes[] = __('Ermitteln Sie länderspezifische Restrisiken (Sanktionen, Exportkontrolle, Devisenauflagen).'); + } + if (! $company->country || ! $selected->counterparty_country) { + $countryNotes[] = __('Länderangaben unvollständig – KYC-Stammdaten aktualisieren.'); + } + $analysisSections = [ + [ + 'title' => __('Verwendungszweck'), + 'description' => $purposeDescription, + 'notes' => [ + __('Rechnungskopie inkl. HR-/VAT-/IBAN-Angaben anfordern.'), + __('3-Way-Match (PO–GR–Invoice) vollständig dokumentieren.'), + ], + ], + [ + 'title' => __('LEI'), + 'description' => __('Für :company und :counterparty liegt kein verifizierter LEI im Datensatz vor. Ein Direktabruf im GLEIF-Register wird empfohlen.', [ + 'company' => $companyName, + 'counterparty' => $selected->counterparty, + ]), + 'notes' => [ + __('Status: not verified.'), + __('Bankinterne LEI-Prüfung vor Freigabe abschließen.'), + ], + ], + [ + 'title' => __('Länderanalyse'), + 'description' => $domesticFlow + ? __('Vorliegende Daten deuten auf eine Inlandszahlung (:from → :to) hin. Das systemische Korruptionsrisiko gilt als niedrig.', [ + 'from' => $companyCountryLabel, + 'to' => $counterpartyCountryLabel, + ]) + : __('Transaktion verläuft von :from nach :to. Prüfen Sie Export-/Importauflagen sowie mögliche Hochrisikofaktoren.', [ + 'from' => $companyCountryLabel, + 'to' => $counterpartyCountryLabel, + ]), + 'notes' => $countryNotes, + ], + [ + 'title' => __('PEP-Exposure'), + 'description' => __('Es liegen keine Hinweise auf PEP-Einfluss in den Stammdaten vor. Screening der wirtschaftlich Berechtigten bleibt fortzuführen.'), + 'notes' => [ + __('Manuelles Screening der Management- und Eigentümerebene abschließen (Status: not verified).'), + ], + ], + [ + 'title' => __('AML Exposure (transaktionsbezogen)'), + 'description' => __('Klarer Leistungszweck und etablierte Gegenparteien wirken risikomindernd. Restrisiko besteht in der eindeutigen Identifikation der Rechnungseinheit und des Zahlungswegs.'), + 'notes' => [ + __('Kontoinhaber und IBAN mit der Rechnungseinheit matchen.'), + __('Preis- und Mengenabweichungen gegen Bestellung analysieren.'), + ], + ], + [ + 'title' => __('Sanktions-Exposure'), + 'description' => __('Bisherige Namenstests ergaben keine Treffer. Automatisierte Listenprüfungen sind auf den finalen Rechtsträger erneut auszuführen.'), + 'notes' => [ + __('EU-/OFAC-Abgleich sowie interne Sanktionslisten auf finaler Rechnungseinheit bestätigen.'), + ], + ], + [ + 'title' => __('Korruptions-/Bestechungs-Exposure'), + 'description' => __('Makrorisiko im deutschen Markt ist gering. Beschaffungsrisiken (Kick-backs, Scheinrechnungen) bleiben bei Großvolumina bestehen.'), + 'notes' => [ + __('Zahlungen ausschließlich an bestätigte Gesellschaftskonten leisten.'), + __('Vier-Augen-Prinzip und Liefernachweise dokumentieren.'), + ], + ], + [ + 'title' => __('Adverse Media Scanning (≤ 12 Monate)'), + 'description' => __('In den letzten 12 Monaten wurden keine AML-relevanten Negativmeldungen identifiziert. Restrisiko: laufende Restrukturierungs- und Compliance-News beobachten.'), + 'notes' => [ + __('Interne Newsfeeds und Watchlists weiterführen.'), + ], + ], + [ + 'title' => __('KYC/EDD Feststellungen'), + 'description' => __('KYC-Dossier aktualisieren: rechtliche Einheit, wirtschaftlich Berechtigte und Zahlungsweg eindeutig dokumentieren.'), + 'notes' => [ + __('IBAN/BIC sowie Steuerkennzeichen im Dossier hinterlegen.'), + __('Rechnungskopie, Liefernachweis und Vertragsgrundlage einholen.'), + ], + ], + [ + 'title' => __('Gesamtbeurteilung (AML-Sicht)'), + 'description' => __('Die Transaktion über :amount zwischen :company und :counterparty wirkt branchenüblich. Freigabe ist möglich, sobald Rechnungseinheit, Zahlungsweg und Screening final bestätigt sind.', [ + 'amount' => $amountValue, + 'company' => $companyName, + 'counterparty' => $selected->counterparty, + ]), + 'notes' => [ + __('Votum: Freigabefähig unter Auflagen (Rechnung, 3-Way-Match, Screening, Exportkontrolle).'), + ], + ], + ]; + $combineNotes = static function (array $sections): array { + $notes = []; - foreach ($sections as $section) { - $notes = array_merge($notes, $section['notes'] ?? []); - } + foreach ($sections as $section) { + $notes = array_merge($notes, $section['notes'] ?? []); + } - return $notes; - }; + return $notes; + }; - $clusterFactory = static function (string $title, array $sections) use ($combineNotes): array { - $leadSection = $sections[0] ?? null; - $contexts = array_slice($sections, 1); + $clusterFactory = static function (string $title, array $sections) use ($combineNotes): array { + $leadSection = $sections[0] ?? null; + $contexts = array_slice($sections, 1); - return [ - 'title' => $title, - 'lead_label' => $leadSection['title'] ?? null, - 'lead' => $leadSection['description'] ?? '', - 'contexts' => array_map( - static fn (array $section): array => [ - 'label' => $section['title'], - 'body' => $section['description'], - ], - $contexts - ), - 'actions' => $combineNotes($sections), - 'count' => count($sections), - ]; - }; + return [ + 'title' => $title, + 'lead_label' => $leadSection['title'] ?? null, + 'lead' => $leadSection['description'] ?? '', + 'contexts' => array_map( + static fn (array $section): array => [ + 'label' => $section['title'], + 'body' => $section['description'], + ], + $contexts + ), + 'actions' => $combineNotes($sections), + 'count' => count($sections), + ]; + }; - $transactionSections = array_slice($analysisSections, 0, 2); - $riskSections = array_slice($analysisSections, 2, 6); - $dueSections = array_slice($analysisSections, 8); + $transactionSections = array_slice($analysisSections, 0, 2); + $riskSections = array_slice($analysisSections, 2, 6); + $dueSections = array_slice($analysisSections, 8); - $analysisClusters = [ - $clusterFactory(__('Transaktion & Zweck'), $transactionSections), - $clusterFactory(__('Risikoperspektive'), $riskSections), - $clusterFactory(__('Due Diligence & Abschluss'), $dueSections), - ]; + $analysisClusters = [ + $clusterFactory(__('Transaktion & Zweck'), $transactionSections), + $clusterFactory(__('Risikoperspektive'), $riskSections), + $clusterFactory(__('Due Diligence & Abschluss'), $dueSections), + ]; - $analysisClusterCount = array_sum(array_map(static fn (array $cluster): int => $cluster['count'], $analysisClusters)); + $analysisClusterCount = array_sum(array_map(static fn (array $cluster): int => $cluster['count'], $analysisClusters)); - $caseBoxStyles = [ - Transaction::STATUS_TRUE_POSITIVE => 'border border-rose-300/60 bg-gradient-to-br from-rose-50 via-rose-100/80 to-white dark:border-rose-500/40 dark:from-rose-500/20 dark:via-rose-500/10 dark:to-slate-900/85', - Transaction::STATUS_FALSE_POSITIVE => 'border border-amber-300/60 bg-gradient-to-br from-amber-50 via-amber-100/80 to-white dark:border-amber-500/40 dark:from-amber-500/20 dark:via-amber-500/10 dark:to-slate-900/85', - Transaction::STATUS_CLEARED => 'border border-emerald-300/60 bg-gradient-to-br from-emerald-50 via-emerald-100/70 to-white dark:border-emerald-500/40 dark:from-emerald-500/15 dark:via-emerald-500/10 dark:to-slate-900/85', - ]; - $caseBoxClass = $caseBoxStyles[$selected->status] ?? 'border border-slate-200/70 bg-white/95 dark:border-slate-700/70 dark:bg-slate-900/90'; + $caseBoxStyles = [ + Transaction::STATUS_TRUE_POSITIVE => 'border border-rose-300/60 bg-gradient-to-br from-rose-50 via-rose-100/80 to-white dark:border-rose-500/40 dark:from-rose-500/20 dark:via-rose-500/10 dark:to-slate-900/85', + Transaction::STATUS_FALSE_POSITIVE => 'border border-amber-300/60 bg-gradient-to-br from-amber-50 via-amber-100/80 to-white dark:border-amber-500/40 dark:from-amber-500/20 dark:via-amber-500/10 dark:to-slate-900/85', + Transaction::STATUS_CLEARED => 'border border-emerald-300/60 bg-gradient-to-br from-emerald-50 via-emerald-100/70 to-white dark:border-emerald-500/40 dark:from-emerald-500/15 dark:via-emerald-500/10 dark:to-slate-900/85', + ]; + $caseBoxClass = $caseBoxStyles[$selected->status] ?? 'border border-slate-200/70 bg-white/95 dark:border-slate-700/70 dark:bg-slate-900/90'; - $sources = array_values(array_filter([ - $companyName ? __('Unternehmensprofil :company (:country) – interne KYC-Stammdaten.', [ - 'company' => $companyName, - 'country' => $companyCountryLabel, - ]) : null, - __('Transaktionsdatensatz #:id – Core Banking Export.', ['id' => $selected->id]), - $selected->reference ? __('Rechnungsreferenz ":reference" – Plausibilisierung steht aus.', ['reference' => $referenceLabel]) : null, - __('GLEIF – LEI Register (Direktabruf, Status: not verified).'), - __('Transparency International – CPI 2024 (Deutschland 75/100).'), - __('EU/OFAC Sanktionsportale – orientierender Namensabgleich (endgültige Prüfung intern).'), - ])); - @endphp + $sources = array_values(array_filter([ + $companyName ? __('Unternehmensprofil :company (:country) – interne KYC-Stammdaten.', [ + 'company' => $companyName, + 'country' => $companyCountryLabel, + ]) : null, + __('Transaktionsdatensatz #:id – Core Banking Export.', ['id' => $selected->id]), + $selected->reference ? __('Rechnungsreferenz ":reference" – Plausibilisierung steht aus.', ['reference' => $referenceLabel]) : null, + __('GLEIF – LEI Register (Direktabruf, Status: not verified).'), + __('Transparency International – CPI 2024 (Deutschland 75/100).'), + __('EU/OFAC Sanktionsportale – orientierender Namensabgleich (endgültige Prüfung intern).'), + ])); + @endphp -
-
+
-
-
- - {{ __('Case ID') }} {{ $selected->id }} - -

- {{ $selected->counterparty }} — {{ $amountValue }} -

-

- {{ __('Ausgeführt am') }} {{ $executedDate ?? __('Nicht verfügbar') }} - @if ($executedTime) - • {{ $executedTime }} - @endif - • {{ $selected->channel ?: __('Kanal offen') }} -

-
- -
- - {{ $selected->statusLabel() }} - - - {{ __('Risikowert') }} {{ $selected->risk_score }} ({{ $riskLevel }}) - -
+
+
+ + {{ __('Case ID') }} {{ $selected->id }} + +

+ {{ $selected->counterparty }} — {{ $amountValue }} +

+

+ {{ __('Ausgeführt am') }} {{ $executedDate ?? __('Nicht verfügbar') }} + @if ($executedTime) + • {{ $executedTime }} + @endif + • {{ $selected->channel ?: __('Kanal offen') }} +

-
-
-

{{ __('Stichtag') }}

-

{{ $executedDate ?? __('Nicht verfügbar') }}

-

{{ $executedTime ? __('Zeit') . ' ' . $executedTime : __('Zeitpunkt offen') }}

-
-
-

{{ __('Kanal & Referenz') }}

-

{{ $selected->channel ?: __('Unbekannt') }}

-

{{ $selected->reference ?: __('Keine Referenz hinterlegt') }}

-
-
-

{{ __('Flagging durch') }}

-

{{ $selected->flagged_by ?: __('Automatisiertes Monitoring') }}

-

{{ $selected->flagged_reason ?: __('Flagging-Grund nicht dokumentiert') }}

-
-
-

{{ __('Empfohlene Maßnahme') }}

-

{{ $statusGuidance }}

-
+
+ + {{ $selected->statusLabel() }} + + + {{ __('Risikowert') }} {{ $selected->risk_score }} ({{ $riskLevel }}) +
+
-
-

{{ __('Parteiprofile') }}

-
-
-
-

{{ __('Sending party') }}

- - {{ __('Unternehmensprofil') }} - +
+
+

{{ __('Stichtag') }}

+

{{ $executedDate ?? __('Nicht verfügbar') }}

+

{{ $executedTime ? __('Zeit') . ' ' . $executedTime : __('Zeitpunkt offen') }}

+
+
+

{{ __('Kanal & Referenz') }}

+

{{ $selected->channel ?: __('Unbekannt') }}

+

{{ $selected->reference ?: __('Keine Referenz hinterlegt') }}

+
+
+

{{ __('Flagging durch') }}

+

{{ $selected->flagged_by ?: __('Automatisiertes Monitoring') }}

+

{{ $selected->flagged_reason ?: __('Flagging-Grund nicht dokumentiert') }}

+
+
+

{{ __('Empfohlene Maßnahme') }}

+

{{ $statusGuidance }}

+
+
+ +
+

{{ __('Parteiprofile') }}

+
+
+
+

{{ __('Sending party') }}

+ + {{ __('Unternehmensprofil') }} + +
+

{{ $selected->company?->legal_name ?? $company->legal_name ?? $company->name }}

+
+
+
{{ __('Jurisdiktion') }}
+
{{ $company->country ?? __('Nicht verifiziert') }}
-

{{ $selected->company?->legal_name ?? $company->legal_name ?? $company->name }}

-
-
-
{{ __('Jurisdiktion') }}
-
{{ $company->country ?? __('Nicht verifiziert') }}
-
-
-
{{ __('Sitz') }}
-
{{ $company->headquarters ?? __('Nicht verifiziert') }}
-
-
-
{{ __('Sektor') }}
-
{{ $company->sector ?? __('Nicht verifiziert') }}
-
-
-
-
-
-

{{ __('Receiving party') }}

- - {{ __('Verifizierung offen') }} - +
+
{{ __('Sitz') }}
+
{{ $company->headquarters ?? __('Nicht verifiziert') }}
-

{{ $selected->counterparty }}

-
-
-
{{ __('Jurisdiktion') }}
-
{{ $selected->counterparty_country ?? __('Nicht verifiziert') }}
-
-
-
{{ __('Referenzhinweis') }}
-
{{ $selected->reference ?: __('Keine Angabe') }}
-
-
-
{{ __('Next step') }}
-
{{ __('IBAN/Beneficiary eindeutig zuordnen') }}
-
-
+
+
{{ __('Sektor') }}
+
{{ $company->sector ?? __('Nicht verifiziert') }}
+
+ +
+
+
+

{{ __('Receiving party') }}

+ + {{ __('Verifizierung offen') }} +
+

{{ $selected->counterparty }}

+
+
+
{{ __('Jurisdiktion') }}
+
{{ $selected->counterparty_country ?? __('Nicht verifiziert') }}
+
+
+
{{ __('Referenzhinweis') }}
+
{{ $selected->reference ?: __('Keine Angabe') }}
+
+
+
{{ __('Next step') }}
+
{{ __('IBAN/Beneficiary eindeutig zuordnen') }}
+
+
+
-
-
-

{{ __('Transaktionsbewertung') }}

-

{{ $riskNarrative }}

-
    -
  • • {{ __('Betrag') }} {{ $amountValue }}
  • -
  • • {{ __('Flagging-Grund') }}: {{ $selected->flagged_reason ?: __('nicht dokumentiert') }}
  • -
  • • {{ __('Kanal') }}: {{ $selected->channel ?: __('unbekannt') }}
  • -
-
- -
-

{{ __('Kontrollaufgaben (Zusammenfassung)') }}

-

- {{ __('Sicherstellen, dass Rechnungskopf, Beneficiary-Daten und 3-Way-Match (PO–GR–Invoice) dokumentiert sind. Interne Listenabgleiche (Sanktionen/PEP) auf den konkreten Rechtsträger erneut ausführen.') }} -

-
+
+
+

{{ __('Transaktionsbewertung') }}

+

{{ $riskNarrative }}

+
    +
  • • {{ __('Betrag') }} {{ $amountValue }}
  • +
  • • {{ __('Flagging-Grund') }}: {{ $selected->flagged_reason ?: __('nicht dokumentiert') }}
  • +
  • • {{ __('Kanal') }}: {{ $selected->channel ?: __('unbekannt') }}
  • +
- @if (! empty($selected->signals)) -
-

{{ __('Detektionssignale') }}

-
- @foreach ($selected->signals as $signal) - - - {{ data_get($signal, 'type') }} — {{ data_get($signal, 'value') }} - - @endforeach -
-
- @endif - -
-

{{ __('Narrative Zusammenfassung') }}

+
+

{{ __('Kontrollaufgaben (Zusammenfassung)') }}

- {{ __('Die Transaktion verbindet :company (:jurisdiction) mit :counterparty (:country). Der Betrag von :amount wurde über den Kanal :channel ausgeführt. Für die abschließende AML-Beurteilung ist der Nachweis der wirtschaftlich Berechtigten sowie ein Abgleich der Zahlungsempfänger-Daten erforderlich.', [ + {{ __('Sicherstellen, dass Rechnungskopf, Beneficiary-Daten und 3-Way-Match (PO–GR–Invoice) dokumentiert sind. Interne Listenabgleiche (Sanktionen/PEP) auf den konkreten Rechtsträger erneut ausführen.') }} +

+
+
+ + @if (! empty($selected->signals)) +
+

{{ __('Detektionssignale') }}

+
+ @foreach ($selected->signals as $signal) + + + {{ data_get($signal, 'type') }} — {{ data_get($signal, 'value') }} + + @endforeach +
+
+ @endif + +
+

{{ __('Narrative Zusammenfassung') }}

+

+ {{ __('Die Transaktion verbindet :company (:jurisdiction) mit :counterparty (:country). Der Betrag von :amount wurde über den Kanal :channel ausgeführt. Für die abschließende AML-Beurteilung ist der Nachweis der wirtschaftlich Berechtigten sowie ein Abgleich der Zahlungsempfänger-Daten erforderlich.', [ 'company' => $company->legal_name ?? $company->name, 'jurisdiction' => $company->country ?? __('Jurisdiktion offen'), 'counterparty' => $selected->counterparty, @@ -852,119 +848,119 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft Transaktione 'amount' => $amountValue, 'channel' => $selected->channel ?: __('unbekannt'), ]) }} -

-

- {{ __('Hinweis: Interne Quellen (ERP, KYC-Stammdaten, Screening) ergänzen, um den Verifizierungsstatus auf „abgeschlossen“ anzuheben.') }} +

+

+ {{ __('Hinweis: Interne Quellen (ERP, KYC-Stammdaten, Screening) ergänzen, um den Verifizierungsstatus auf „abgeschlossen“ anzuheben.') }} +

+
+ + @if (! empty($analysisClusters)) +
+
+
+

{{ __('Vertiefte Analysefelder') }}

+ + {{ $analysisClusterCount }} {{ __('Prüfpunkte') }} + +
+

+ {{ __('Verdichten Sie die Prüfung auf drei Themenblöcke. Jeder Block fasst die wesentlichen Anforderungen zusammen.') }}

- @if (! empty($analysisClusters)) -
-
-
-

{{ __('Vertiefte Analysefelder') }}

- - {{ $analysisClusterCount }} {{ __('Prüfpunkte') }} - -
-

- {{ __('Verdichten Sie die Prüfung auf drei Themenblöcke. Jeder Block fasst die wesentlichen Anforderungen zusammen.') }} + @foreach ($analysisClusters as $clusterIndex => $cluster) +

+
+
+ @if ($cluster['lead_label']) + + {{ $cluster['lead_label'] }} + + @endif +
+ {{ sprintf('%02d', $clusterIndex + 1) }} — {{ $cluster['title'] }} +
+

+ {{ $cluster['lead'] }}

+ + {{ $cluster['count'] }} {{ __('Teilfelder') }} + +
- @foreach ($analysisClusters as $clusterIndex => $cluster) -
-
-
- @if ($cluster['lead_label']) - - {{ $cluster['lead_label'] }} - - @endif -
- {{ sprintf('%02d', $clusterIndex + 1) }} — {{ $cluster['title'] }} -
-

- {{ $cluster['lead'] }} -

-
- - {{ $cluster['count'] }} {{ __('Teilfelder') }} - -
- - @if (! empty($cluster['contexts'])) -
- @foreach ($cluster['contexts'] as $context) -
-

{{ $context['label'] }}

-

{{ $context['body'] }}

-
- @endforeach -
- @endif - - @if (! empty($cluster['actions'])) -
-

{{ __('Schlüsselmaßnahmen') }}

-
    - @foreach ($cluster['actions'] as $action) -
  • - - {{ $action }} -
  • - @endforeach -
-
- @endif -
+ @if (! empty($cluster['contexts'])) +
+ @foreach ($cluster['contexts'] as $context) +
+

{{ $context['label'] }}

+

{{ $context['body'] }}

+
@endforeach
- @endif + @endif - @if (! empty($sources)) -
-
{{ __('Quellen & Verifizierungsstand (≤ 365 Tage)') }}
-
    - @foreach ($sources as $source) -
  • {{ $source }}
  • + @if (! empty($cluster['actions'])) +
    +

    {{ __('Schlüsselmaßnahmen') }}

    +
      + @foreach ($cluster['actions'] as $action) +
    • + + {{ $action }} +
    • @endforeach
    - @endif + @endif +
+ @endforeach
+ @endif -
-
-

{{ __('Historie mit dieser Gegenpartei') }}

-
- @forelse ($counterpartyHistory as $history) -
-
-

{{ $history->executed_at?->format('d.m.Y H:i') }}

-

{{ $history->channel }} • {{ $history->reference }}

-
-
- {{ $formatAmount($history->amount, $history->currency) }} - - {{ __('Risiko') }} {{ $history->risk_score }} - -
-
- @empty -
- {{ __('Keine weiteren Transaktionen mit dieser Gegenpartei gefunden.') }} -
- @endforelse + @if (! empty($sources)) +
+
{{ __('Quellen & Verifizierungsstand (≤ 365 Tage)') }}
+
    + @foreach ($sources as $source) +
  • {{ $source }}
  • + @endforeach +
+
+ @endif +
+ +
+
+

{{ __('Historie mit dieser Gegenpartei') }}

+
+ @forelse ($counterpartyHistory as $history) +
+
+

{{ $history->executed_at?->format('d.m.Y H:i') }}

+

{{ $history->channel }} • {{ $history->reference }}

+
+
+ {{ $formatAmount($history->amount, $history->currency) }} + + {{ __('Risiko') }} {{ $history->risk_score }} + +
+ @empty +
+ {{ __('Keine weiteren Transaktionen mit dieser Gegenpartei gefunden.') }} +
+ @endforelse
+
@else -
- {{ __('Wählen Sie links eine Transaktion aus, um die vollständige Fallansicht zu öffnen.') }} -
+
+ {{ __('Wählen Sie links eine Transaktion aus, um die vollständige Fallansicht zu öffnen.') }} +
@endif
-
+
\ No newline at end of file diff --git a/resources/views/livewire/company-search.blade.php b/resources/views/livewire/company-search.blade.php index 1aa5121..4945b2c 100644 --- a/resources/views/livewire/company-search.blade.php +++ b/resources/views/livewire/company-search.blade.php @@ -43,16 +43,16 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft')] class ext { $query = Company::query() ->withCount([ - 'transactions as alert_count' => fn ($transactions) => $transactions->where('requires_review', true), + 'transactions as alert_count' => fn($transactions) => $transactions->where('requires_review', true), ]) ->withSum([ - 'transactions as alert_volume' => fn ($transactions) => $transactions->where('requires_review', true), + 'transactions as alert_volume' => fn($transactions) => $transactions->where('requires_review', true), ], 'amount') ->withAvg([ - 'transactions as alert_risk' => fn ($transactions) => $transactions->where('requires_review', true), + 'transactions as alert_risk' => fn($transactions) => $transactions->where('requires_review', true), ], 'risk_score') ->with([ - 'transactions' => fn ($transactions) => $transactions->where('requires_review', true)->latest('executed_at')->limit(1), + 'transactions' => fn($transactions) => $transactions->where('requires_review', true)->latest('executed_at')->limit(1), ]) ->when( $this->search !== '', @@ -76,82 +76,77 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft')] class ext }; ?> @php - $overview = $this->overview; - /** @var \Illuminate\Support\Collection $companies */ +$overview = $this->overview; +/** @var \Illuminate\Support\Collection $companies */ $companies = $this->companies; $formatCurrency = static fn (float $value): string => number_format($value, 2, ',', '.') . ' €'; $formatNumber = static fn ($value): string => number_format((float) $value, 0, ',', '.'); -@endphp + @endphp -
-
-
-
- {{ __('Unternehmensauskunft') }} - {{ __('Suchen Sie nach Unternehmensinformationen') }} - - {{ __('KI-gestützte Einsichten zu DAX-Unternehmen: Screening-Ergebnisse, Risikostapel und alle offenen Alerts auf einen Blick.') }} - -
-
- -
-
- -
-
-

{{ __('Unternehmen im Screening') }}

-

{{ $formatNumber($overview['companies']) }}

-
-
-

{{ __('Offene Alerts') }}

-

{{ $formatNumber($overview['open_alerts']) }}

-

{{ __('Volumen') }} {{ $formatCurrency($overview['open_volume']) }}

-
-
-

{{ __('Ø Risikoscore offene Fälle') }}

-

{{ $overview['avg_risk'] }}

-

{{ __('Watchlist-Hits') }} {{ $formatNumber($overview['watchlist_hits']) }}

-
-
-

{{ __('Automationsquote') }}

-

{{ $overview['automation_share'] }}%

-

{{ __('Analyst:innen übernehmen nur komplexe Spezialfälle') }}

-
-
-
- -
-
-
-
-

{{ __('Screening-Portfolio') }}

-

- {{ __('Die relevantesten Unternehmen nach offenem Alert-Volumen — inklusive Risikokommentar und letztem Trigger.') }} -

+
+
+
+
+ {{ __('Unternehmensauskunft') }} + + {{ __('Einfache Suche für Unternehmensdaten und historische Cases') }} + +
+
+
- - {{ $companies->count() }} {{ __('Treffer') }} -
-
- @forelse ($companies as $company) + +
+ +
+
+
+
+

{{ __('Historische Cases') }}

+
+ + {{ $companies->count() }} {{ __('Treffer') }} + +
+ +
+ @forelse ($companies as $company) @php - $latestAlert = optional($company->transactions->first()); - $alertVolume = (float) ($company->alert_volume ?? 0); - $alertCount = (int) ($company->alert_count ?? 0); - $alertRisk = (int) round($company->alert_risk ?? 0); - $riskBadgeClasses = match (Str::lower($company->kyc_risk_level)) { - 'high', 'hoch' => 'bg-rose-500/10 text-rose-600 dark:text-rose-300 border border-rose-500/20', - 'low', 'niedrig' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-300 border border-emerald-500/20', - default => 'bg-amber-500/10 text-amber-600 dark:text-amber-300 border border-amber-500/20', - }; + $latestAlert = optional($company->transactions->first()); + $alertVolume = (float) ($company->alert_volume ?? 0); + $alertCount = (int) ($company->alert_count ?? 0); + $alertRisk = (int) round($company->alert_risk ?? 0); + $riskBadgeClasses = match (Str::lower($company->kyc_risk_level)) { + 'high', 'hoch' => 'bg-rose-500/10 text-rose-600 dark:text-rose-300 border border-rose-500/20', + 'low', 'niedrig' => 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-300 border border-emerald-500/20', + default => 'bg-amber-500/10 text-amber-600 dark:text-amber-300 border border-amber-500/20', + }; @endphp
@@ -160,17 +155,20 @@ new #[Layout('components.layouts.app'), Title('Unternehmensauskunft')] class ext

{{ $company->legal_name ?? $company->name }}

{{ $company->ticker }} · {{ $company->sector }}

- +

{{ $company->summary }}

-
- -
-
-

{{ __('Sofortmaßnahmen (PoC)') }}

-
    -
  • - {{ __('KYC Refresh initiiert') }} - {{ __('automatisiert') }} -
  • -
  • - {{ __('AI Investigations Summary') }} - {{ __('bereit in 12s') }} -
  • -
  • - {{ __('Case Handover an 2nd Line') }} - {{ __('3 Eskalationen') }} -
  • -
-
- -
-
+ + +
\ No newline at end of file diff --git a/resources/views/livewire/transaction-review.blade.php b/resources/views/livewire/transaction-review.blade.php index 2ce7f51..aaae9cb 100644 --- a/resources/views/livewire/transaction-review.blade.php +++ b/resources/views/livewire/transaction-review.blade.php @@ -226,302 +226,217 @@ Transaction::STATUS_CLEARED => [ $statusLegend = [ Transaction::STATUS_TRUE_POSITIVE => [ -'title' => 'Bestätigter Treffer', -'description' => 'Ermittlungsindikatoren bestätigen einen hinreichenden Verdacht. Fallverantwortliche Person informieren, Belege sichern und Maßnahmenplan starten.', +'title' => 'Gruppe mit hohem Risikoscore​ Scorewert > 66', +'description' => 'Wenn man draufklickt, werden alles diese Fälle angezeigt​', 'accent' => 'text-rose-500 dark:text-rose-300', ], Transaction::STATUS_FALSE_POSITIVE => [ -'title' => 'Fehlalarm', -'description' => 'Auslösung plausibel widerlegt (z. B. KYC-Daten, Geschäftslogik). Entscheidungsgrund dokumentieren und Regeloptimierung anstoßen.', +'title' => 'Gruppe mit mittlerem Risikoscore​ Scorewert 33- 65', +'description' => 'Wenn man draufklickt, werden alles diese Fälle angezeigt', 'accent' => 'text-amber-500 dark:text-amber-200', ], Transaction::STATUS_CLEARED => [ -'title' => 'Freigegeben', -'description' => 'Keine verdächtigen Auffälligkeiten. Abschluss mit Vier-Augen-Freigabe und revisionssicherer Ablage des Prüfpfads.', -'accent' => 'text-emerald-500 dark:text-emerald-300', -], -]; -$riskExplanation = 'Der Risikowert (0–100) fasst Monitoring-Regeln, KYC-Risiken, Negativmeldungen sowie Verhaltens- und Geodaten zu einer Priorität zusammen. Werte über 80 kennzeichnen Sofortmaßnahmen, 50–79 markieren erhöhte Aufmerksamkeit, alles darunter gilt als Routineprüfung.'; -@endphp +'title' => 'Gruppe mit niedrigem Risikoscore​ Scorewert < 33', 'description'=> 'Wenn man draufklickt, werden alles diese Fälle angezeigt', + 'accent' => 'text-emerald-500 dark:text-emerald-300', + ], + ]; + $riskExplanation = 'Der Risikowert (0–100) fasst Monitoring-Regeln, KYC-Risiken, Negativmeldungen sowie Verhaltens- und Geodaten zu einer Priorität zusammen. Werte über 80 kennzeichnen Sofortmaßnahmen, 50–79 markieren erhöhte Aufmerksamkeit, alles darunter gilt als Routineprüfung.'; + @endphp -
-
- - -
-
-

- AFC-Kontrollzentrum -

-

Verdachtsfall-Qualifizierungs-​Workbench

-

- Überwachen Sie verdächtige Transaktionen im DAX-Portfolio, priorisieren Sie Alarme und orchestrieren Sie das manuelle Review im Vier-Augen-Prozess. -

-
-
-
-

Gesamtfälle

-

{{ $total['count'] }}

-

Volumen: {{ $formatAmount($total['amount']) }}

+
+
+ + +
+
+

+ Anti Financial Crime - Cases​ +

+

Übersicht Verdachtsfälle nach Automatisierung- und Risikoscore

-
-

Bestätigte Treffer

-

{{ $confirmed['count'] }}

-

Volumen: {{ $formatAmount($confirmed['amount']) }}

-
-
-

Fehlalarme

-

{{ $falseAlarm['count'] }}

-

Volumen: {{ $formatAmount($falseAlarm['amount']) }}

-
-
-

Freigegeben

-

{{ $cleared['count'] }}

-

Volumen: {{ $formatAmount($cleared['amount']) }}

+
+
+

Gesamtfälle

+

{{ $total['count'] }}

+

Volumen: {{ $formatAmount($total['amount']) }}

+
+
+

Bestätigte Treffer

+

{{ $confirmed['count'] }}

+

Volumen: {{ $formatAmount($confirmed['amount']) }}

+
+
+

Fehlalarme

+

{{ $falseAlarm['count'] }}

+

Volumen: {{ $formatAmount($falseAlarm['amount']) }}

+
+
+

Freigegeben

+

{{ $cleared['count'] }}

+

Volumen: {{ $formatAmount($cleared['amount']) }}

+
-
-
- @foreach ($statusLegend as $key => $legend) -
-
- + @foreach ($statusLegend as $key => $legend) +
+
+ -

{{ $legend['title'] }}

-
-

- {{ $legend['description'] }} -

-
- @endforeach -
- -
-
-

Aktive Prüfwarteschlange

-

- Alle untenstehenden Meldungen benötigen eine finale Analystenentscheidung. -

-
-
- - @foreach ($this->statusOptions as $value => $label) - - @endforeach - - -
-
- -
-
- - -
- @forelse ($transactions as $transaction) - @php - $selectedState = $transaction->id === $this->selectedTransactionId; - $buttonClasses = [ - 'flex w-full flex-col gap-3 px-4 py-4 text-left transition duration-200 sm:grid sm:grid-cols-[1.6fr_1fr_0.7fr]', - 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/70', - ]; - - if ($selectedState) { - $buttonClasses[] = 'border-s-4 border-indigo-500/80 bg-indigo-500/10 shadow-lg shadow-indigo-500/20 ring-2 ring-indigo-400/70 ring-offset-2 ring-offset-white dark:bg-indigo-500/20 dark:ring-offset-zinc-900 scale-[1.01]'; - } else { - $buttonClasses[] = 'border-s-4 border-transparent hover:-translate-y-0.5 hover:border-indigo-400/70 hover:bg-zinc-50/70 hover:shadow-lg hover:shadow-zinc-900/20 dark:hover:bg-zinc-800/60'; - } - @endphp - - @empty -
- Keine Transaktionen für die aktuellen Filterkriterien gefunden. Bitte Seed-Daten neu laden oder Filter anpassen. +

{{ $legend['title'] }}

- @endforelse -
- - @if ($transactions->hasPages()) -
- - - Seite {{ $transactions->currentPage() }} von {{ $transactions->lastPage() }} - - -
- @endif -
- -
- @if ($selected) - @php - $summaryStyles = $statusSummaryBanner[$selected->status] ?? [ - 'classes' => 'border border-zinc-300/70 bg-zinc-100/80 text-zinc-700 dark:border-zinc-600/60 dark:bg-zinc-800/60 dark:text-zinc-200', - ]; - $summaryText = implode(' ', $statusSummaryPhrases[$selected->status] ?? ['Status gemäß aktuellem Prüfpfad.']); - @endphp - -
-
- Statuszusammenfassung - - {{ $selected->statusLabel() }} - -
-

- {{ $summaryText }} +

+ {{ $legend['description'] }}

+ @endforeach +
-
-
-
-

{{ $selected->company->legal_name }}

-

{{ $selected->company->summary }}

-
-
- - Prüfung erforderlich - - @php($detailStatusStyle = $statusStyles[$selected->status] ?? 'bg-zinc-500/10 text-zinc-600 border border-zinc-500/20') - - Status: {{ $selected->statusLabel() }} - - - {{ number_format($selected->amount, 2, ',', '.') }} {{ $selected->currency }} - -
- - - Risikoscore {{ $selected->risk_score }} - - - - {{ $selected->executed_at?->format('d.m.Y, H:i') }} -
-
+
+
+

Aktive Prüfwarteschlange

+

+ Alle untenstehenden Meldungen benötigen eine finale Analystenentscheidung. +

+
+
+ + @foreach ($this->statusOptions as $value => $label) + + @endforeach + + +
+
+ +
+
+ -
-
-
Statusbegründung
-
- {{ $statusSummary[$selected->status] ?? 'Status gemäß aktuellem Prüfpfad.' }} -
-
-
-
Gegenpartei
-
{{ $selected->counterparty }}
-
{{ $selected->counterparty_country }}
-
-
-
Zahlungskanal & Referenz
-
{{ $selected->channel }}
-
{{ $selected->reference }}
-
-
-
Flagging-Engine
-
{{ $selected->flagged_by }}
-
{{ $selected->flagged_reason }}
-
-
+
+ @forelse ($transactions as $transaction) + @php + $selectedState = $transaction->id === $this->selectedTransactionId; + $buttonClasses = [ + 'flex w-full flex-col gap-3 px-4 py-4 text-left transition duration-200 sm:grid sm:grid-cols-[1.6fr_1fr_0.7fr]', + 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/70', + ]; - @if (! empty($selected->signals)) -
-

Detektionssignale

-
- @foreach ($selected->signals as $signal) - - - {{ data_get($signal, 'type') }} · {{ data_get($signal, 'value') }} - - @endforeach + if ($selectedState) { + $buttonClasses[] = 'border-s-4 border-indigo-500/80 bg-indigo-500/10 shadow-lg shadow-indigo-500/20 ring-2 ring-indigo-400/70 ring-offset-2 ring-offset-white dark:bg-indigo-500/20 dark:ring-offset-zinc-900 scale-[1.01]'; + } else { + $buttonClasses[] = 'border-s-4 border-transparent hover:-translate-y-0.5 hover:border-indigo-400/70 hover:bg-zinc-50/70 hover:shadow-lg hover:shadow-zinc-900/20 dark:hover:bg-zinc-800/60'; + } + @endphp + + @empty +
+ Keine Transaktionen für die aktuellen Filterkriterien gefunden. Bitte Seed-Daten neu laden oder Filter anpassen.
+ @endforelse +
+ + @if ($transactions->hasPages()) +
+ + + Seite {{ $transactions->currentPage() }} von {{ $transactions->lastPage() }} + +
@endif +
-
-

Empfohlene Maßnahme

-

- {{ $statusCopy[$selected->status] ?? 'Review abschließen und vollständigen Audit-Trail dokumentieren.' }} +

+ @if ($selected) + @php + $summaryStyles = $statusSummaryBanner[$selected->status] ?? [ + 'classes' => 'border border-zinc-300/70 bg-zinc-100/80 text-zinc-700 dark:border-zinc-600/60 dark:bg-zinc-800/60 dark:text-zinc-200', + ]; + $summaryText = implode(' ', $statusSummaryPhrases[$selected->status] ?? ['Status gemäß aktuellem Prüfpfad.']); + @endphp + +
+
+ Analyseergebnisse Summary​ +
+

+ {{ $summaryText }}

-
- -
+
+ Status: {{ $selected->statusLabel() }} + + + {{ number_format($selected->amount, 2, ',', '.') }} {{ $selected->currency }} + +
+ + + Risikoscore {{ $selected->risk_score }} + + + + {{ $selected->executed_at?->format('d.m.Y, H:i') }} +
+
+
+ +
+ +
+
Gegenpartei
+
{{ $selected->counterparty }}
+
{{ $selected->counterparty_country }}
+
+
+
Transaktionstyp & Referenznummer
+
{{ $selected->channel }}
+
{{ $selected->reference }}
+
+ +
+ + @if (! empty($selected->signals)) +
+

Detektionssignale aus dem AML-Vorsystem

+
+ @foreach ($selected->signals as $signal) + + + {{ data_get($signal, 'type') }} · {{ data_get($signal, 'value') }} + + @endforeach +
+
+ @endif + + + +
+ + {{ __('Fallansicht maximieren') }} + + +
+
+ +
+

Kerndaten Unternehmen​

+
    +
  • + Rechtlicher Name + {{ $selected->company->legal_name }} +
  • +
  • + Ticker + {{ $selected->company->ticker }} +
  • +
  • + Sektor + {{ $selected->company->sector }} +
  • +
  • + Hauptsitz + {{ $selected->company->headquarters }} +
  • +
  • + Land + {{ $selected->company->country }} +
  • + +
+
+ @else +
+ Wählen Sie links einen Alarm aus, um den vollständigen Prüfkontext einzusehen. +
+ @endif
- @else -
- Wählen Sie links einen Alarm aus, um den vollständigen Prüfkontext einzusehen. -
- @endif
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/storage/debugbar/.gitignore b/storage/debugbar/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/storage/debugbar/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore