Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion config/modules/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ services:
Inventory\Presentation\:
resource: '../../src/Inventory/Presentation'

# Pure query helpers and repository-owned locks are outside service discovery.
# The lock receives only the repository's explicitly wired main connection.
Inventory\Infrastructure\Persistence\Doctrine\Repository\InventoryRepository:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'
$connection: '@doctrine.dbal.main_connection'

Inventory\Application\Port\Outbound\InventoryStorePort:
alias: Inventory\Infrastructure\Persistence\Doctrine\Repository\InventoryRepository
Expand Down
3 changes: 3 additions & 0 deletions config/modules/maintenance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ services:
Maintenance\Application\Port\Outbound\Plan\MaintenancePlanStorePort:
alias: Maintenance\Infrastructure\Persistence\Doctrine\Repository\MaintenancePlanRepository

Maintenance\Application\Port\Outbound\Plan\MaintenanceLegacyPlanPort:
alias: Maintenance\Application\Service\MaintenanceLegacyPlanService

Maintenance\Infrastructure\Persistence\Doctrine\Repository\MaintenancePlanRepository:
arguments:
$connection: '@doctrine.dbal.main_connection'
Expand Down
1 change: 1 addition & 0 deletions config/modules/maintenance_cost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:

MaintenanceCost\Application\Service\:
resource: '../../src/MaintenanceCost/Application/Service'
exclude: '../../src/MaintenanceCost/Application/Service/MaintenanceEconomicAggregation.php'

MaintenanceCost\Domain\Service\:
resource: '../../src/MaintenanceCost/Domain/Service'
Expand Down
2 changes: 1 addition & 1 deletion src/Customer/Application/Service/CustomerAccessGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(private OrganizationAuthorizationPort $authorization

public function assertAccess(string $actorId, string $organizationId, bool $write): void
{
new Uuid($organizationId);
Uuid::assertValid($organizationId);
$decision = $this->authorization->resolveAccess($actorId, $organizationId, $write ? 'organization.customers.manage' : 'organization.customers.read');
if ($decision->isOutsideScope()) {
throw CustomerException::notFound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Customer\Application\Service\CustomerAccessGuard;
use Customer\Domain\Event\CustomerChangedEvent;
use Customer\Domain\Model\Customer\Customer;
use Customer\Domain\ValueObject\CustomerDetails;
use Shared\Application\Message\CommandHandler;
use Shared\Application\Port\Outbound\{ClockPort, EventDispatcherPort, TransactionManagerPort, UuidGeneratorPort};

Expand All @@ -24,7 +25,7 @@ public function __invoke(CreateCustomerCommand $command): CreateCustomerResult
$this->access->assertAccess($command->actorId, $command->organizationId, true);

return $this->transactions->transactional(function () use ($command): CreateCustomerResult {
$customer = Customer::create($this->ids->generate(), $command->organizationId, $command->name, $command->code, $command->email, $command->phone, $command->contacts, $this->clock->now());
$customer = Customer::create($this->ids->generate(), $command->organizationId, new CustomerDetails($command->name, $command->code, $command->email, $command->phone, $command->contacts), $this->clock->now());
$this->customers->save($customer);
$this->events->dispatch(new CustomerChangedEvent($customer->organizationId, $customer->id, 'created', $customer->revision, $customer->updatedAt));

Expand Down
Loading
Loading