d1516c3f5d
First business module of Phase 2 (LST-64, rodage). Strangler-style, additive move — no behavioural change to the public API or MCP tools. - New module App\Module\TimeTracking (TimeTrackingModule, id "time-tracking", declares time-tracking.entries.view/export permissions in the RBAC catalog; operation security left on ROLE_USER, not re-wired here). - Move TimeEntry entity, repository (now interface + Doctrine impl bound in services.yaml), ActiveTimeEntryProvider, export service/controller and the 4 MCP TimeEntry tools into the module. #[ApiResource] (operations, security, uriTemplates /time_entries/*), filters and serialization groups preserved. - Doctrine mapping "TimeTracking" added; table time_entry unchanged. - Sidebar item gated with module "time-tracking" (SidebarFilter disables the route when the module is inactive). - Timestampable/Blamable adopted (first adopter): additive migration adds created_at/updated_at/created_by/updated_by (nullable, FK SET NULL) + COMMENT ON COLUMN. Functional test confirms created_at on persist and updated_at refresh on update — the suspected preUpdate recompute issue does not occur (Doctrine ORM 3.6.2 recomputes change sets after preUpdate). 159 tests green, schema mapping valid, php-cs-fixer clean.
73 lines
2.7 KiB
YAML
73 lines
2.7 KiB
YAML
doctrine:
|
|
dbal:
|
|
default_connection: default
|
|
connections:
|
|
# ORM uses `default`; AuditLogWriter uses `audit` (same DSN, separate
|
|
# service) to write outside the ORM transaction so audit rows survive
|
|
# an application-side rollback and avoid transactional entanglement.
|
|
default:
|
|
url: '%env(resolve:DATABASE_URL)%'
|
|
profiling_collect_backtrace: '%kernel.debug%'
|
|
# audit_log has no ORM entity (written via raw DBAL). Exclude it
|
|
# from schema comparison so migrations:diff / schema:validate stay
|
|
# clean. Creation/teardown stay driven by migrations.
|
|
schema_filter: '~^(?!audit_log$).+~'
|
|
audit:
|
|
url: '%env(resolve:DATABASE_URL)%'
|
|
orm:
|
|
validate_xml_mapping: true
|
|
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
|
identity_generation_preferences:
|
|
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
|
auto_mapping: true
|
|
resolve_target_entities:
|
|
App\Shared\Domain\Contract\UserInterface: App\Module\Core\Domain\Entity\User
|
|
mappings:
|
|
App:
|
|
type: attribute
|
|
is_bundle: false
|
|
dir: '%kernel.project_dir%/src/Entity'
|
|
prefix: 'App\Entity'
|
|
alias: App
|
|
Core:
|
|
type: attribute
|
|
is_bundle: false
|
|
dir: '%kernel.project_dir%/src/Module/Core/Domain/Entity'
|
|
prefix: 'App\Module\Core\Domain\Entity'
|
|
TimeTracking:
|
|
type: attribute
|
|
is_bundle: false
|
|
dir: '%kernel.project_dir%/src/Module/TimeTracking/Domain/Entity'
|
|
prefix: 'App\Module\TimeTracking\Domain\Entity'
|
|
controller_resolver:
|
|
auto_mapping: false
|
|
|
|
when@test:
|
|
doctrine:
|
|
dbal:
|
|
# Propagate the _test suffix to BOTH connections: the audit
|
|
# connection must write to the test DB, not the dev DB.
|
|
connections:
|
|
default:
|
|
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
|
audit:
|
|
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
|
|
|
when@prod:
|
|
doctrine:
|
|
orm:
|
|
query_cache_driver:
|
|
type: pool
|
|
pool: doctrine.system_cache_pool
|
|
result_cache_driver:
|
|
type: pool
|
|
pool: doctrine.result_cache_pool
|
|
|
|
framework:
|
|
cache:
|
|
pools:
|
|
doctrine.result_cache_pool:
|
|
adapter: cache.app
|
|
doctrine.system_cache_pool:
|
|
adapter: cache.system
|