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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Fireguard API

Symfony/API Platform backend for Fireguard identity, organization access,
field operations and collaboration. The [web application](https://github.com/DevSkyLex/fireguard-web)
Symfony/API Platform backend for FireGuard fire-equipment park management,
organization access, controls, maintenance and field interventions. The [web application](https://github.com/DevSkyLex/fireguard-web)
is a separate repository. Dependency versions live in [composer.json](composer.json)
and its lockfile.

Expand All @@ -23,7 +23,10 @@ The API uses four-layer modules and two independent PostgreSQL databases:
## Features

Identity, OAuth/OIDC, organizations and billing, facilities and equipment,
inspections, maintenance, interventions, workload, messaging, notifications,
internal customers, inspections, independent preventive operations, traceable
replacement, repair requests, interventions, quantitative parts, procurement,
private costs and economic reports, versioned maintenance exports, workload,
messaging, notifications,
assistant, calendar, approvals, automation, imports and webhooks. The
[documentation index](docs/README.md) links every module contract.

Expand Down Expand Up @@ -58,7 +61,17 @@ See [Organization](src/Organization/MODULE.md) and [Billing](src/Billing/MODULE.

See [Facility](src/Facility/MODULE.md), [Equipment](src/Equipment/MODULE.md),
[Inspection](src/Inspection/MODULE.md), [Maintenance](src/Maintenance/MODULE.md)
and [Compliance](src/Compliance/MODULE.md).
and [Compliance](src/Compliance/MODULE.md). Internal customers and optional site
ownership are described by [Customer](src/Customer/MODULE.md).

### Maintenance resources and economic reporting

See [ServiceRequest](src/ServiceRequest/MODULE.md), [Inventory](src/Inventory/MODULE.md),
[Procurement](src/Procurement/MODULE.md), [MaintenanceCost](src/MaintenanceCost/MODULE.md)
and [MaintenanceExport](src/MaintenanceExport/MODULE.md). Internal financial facts
require dedicated permissions and stay outside ordinary customer reports. Retained
exports distinguish generation from confirmed import; corrections append linked
adjustments. Commercial invoicing remains in the external ERP.

### Interventions, approval and automation

Expand Down
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"ext-bcmath": "*",
"php": ">=8.4",
"ext-ctype": "*",
"ext-iconv": "*",
Expand Down Expand Up @@ -97,7 +98,13 @@
"Approval\\": "src/Approval/",
"Assistant\\": "src/Assistant/",
"Calendar\\": "src/Calendar/",
"Workload\\": "src/Workload/"
"Workload\\": "src/Workload/",
"Customer\\": "src/Customer/",
"ServiceRequest\\": "src/ServiceRequest/",
"Inventory\\": "src/Inventory/",
"Procurement\\": "src/Procurement/",
"MaintenanceCost\\": "src/MaintenanceCost/",
"MaintenanceExport\\": "src/MaintenanceExport/"
},
"classmap": [
"src/Kernel.php"
Expand Down
3 changes: 2 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions config/modules/customer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
services:
_defaults:
autowire: true
autoconfigure: true

Customer\Presentation\:
resource: '../../src/Customer/Presentation'

Customer\Application\Service\CustomerAccessGuard: ~

Customer\Infrastructure\Persistence\Doctrine\Repository\CustomerRepository:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Customer\Application\Port\Outbound\CustomerRepositoryPort:
alias: Customer\Infrastructure\Persistence\Doctrine\Repository\CustomerRepository

Customer\Infrastructure\Adapter\Directory\CustomerLookupAdapter: ~

Customer\Infrastructure\Adapter\Facility\FacilityCustomerValidationAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Customer\Application\Port\Inbound\CustomerLookupPort:
alias: Customer\Infrastructure\Adapter\Directory\CustomerLookupAdapter

customer.main_transaction_manager:
class: Shared\Infrastructure\Symfony\Adapter\Outbound\DoctrineTransactionManagerAdapter
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Customer\Application\UseCase\Command\CreateCustomer\CreateCustomerHandler:
arguments:
$transactions: '@customer.main_transaction_manager'
$events: '@Shared\Infrastructure\Messaging\Outbox\MainTransactionEventDispatcher'
tags: ['messenger.message_handler']

Customer\Application\UseCase\Command\ChangeCustomer\ChangeCustomerHandler:
arguments:
$transactions: '@customer.main_transaction_manager'
$events: '@Shared\Infrastructure\Messaging\Outbox\MainTransactionEventDispatcher'
tags: ['messenger.message_handler']

Customer\Application\UseCase\Query\GetCustomer\GetCustomerHandler:
tags: ['messenger.message_handler']

Customer\Application\UseCase\Query\ListCustomers\ListCustomersHandler:
tags: ['messenger.message_handler']

Customer\Infrastructure\Adapter\MaintenanceExport\MaintenanceExportCustomerIdentityAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'
tags: ['maintenance_export.identity_validator']
71 changes: 71 additions & 0 deletions config/modules/equipment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ services:
autowire: true
autoconfigure: true

Equipment\Infrastructure\Adapter\Intervention\InterventionEquipmentSnapshotAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Intervention\Application\Port\Outbound\InterventionEquipmentSnapshotPort:
alias: Equipment\Infrastructure\Adapter\Intervention\InterventionEquipmentSnapshotAdapter

Equipment\Infrastructure\Adapter\ServiceRequest\ServiceRequestEquipmentTargetAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Equipment\Application\Service\EquipmentReserveReceiptService:
arguments:
$transactions: '@equipment.main_transaction_manager'
Equipment\Application\Port\Inbound\EquipmentReserveReceiptPort:
alias: Equipment\Application\Service\EquipmentReserveReceiptService

Equipment\Presentation\:
resource: '../../src/Equipment/Presentation'

Expand Down Expand Up @@ -306,3 +323,57 @@ services:
Equipment\Infrastructure\EventSubscriber\EquipmentPlanAuditListener:
arguments:
$events: '@Shared\Infrastructure\Messaging\Outbox\TransactionalEventDispatcher'

Equipment\Infrastructure\Persistence\Doctrine\Repository\EquipmentTypeCatalogRepository:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Equipment\Application\Port\Outbound\EquipmentTypeCatalogPort:
alias: Equipment\Infrastructure\Persistence\Doctrine\Repository\EquipmentTypeCatalogRepository

Equipment\Application\UseCase\Query\EquipmentTypeCatalog\ListEquipmentTypes\ListEquipmentTypesHandler:
tags: ['messenger.message_handler']

Equipment\Application\UseCase\Command\EquipmentTypeCatalog\CreateEquipmentType\CreateEquipmentTypeHandler:
tags: ['messenger.message_handler']

Equipment\Application\UseCase\Command\EquipmentTypeCatalog\PatchEquipmentType\PatchEquipmentTypeHandler:
tags: ['messenger.message_handler']

Equipment\Infrastructure\Persistence\Doctrine\Repository\EquipmentReplacementRepository:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Equipment\Application\Port\Outbound\EquipmentReplacementRepositoryPort:
alias: Equipment\Infrastructure\Persistence\Doctrine\Repository\EquipmentReplacementRepository

Equipment\Application\UseCase\Command\Equipment\ReplaceEquipment\ReplaceEquipmentHandler:
arguments:
$transactionManager: '@equipment.main_transaction_manager'
tags: ['messenger.message_handler']

Equipment\Application\Service\EquipmentSelectionScopeResolver: ~

Equipment\Application\UseCase\Query\Equipment\GetOrganizationEquipmentSummary\GetOrganizationEquipmentSummaryHandler:
tags: ['messenger.message_handler']

Equipment\Infrastructure\Adapter\Inspection\EquipmentParkScopeAdapter: ~

Equipment\Application\Port\Inbound\EquipmentParkScopePort:
alias: Equipment\Infrastructure\Adapter\Inspection\EquipmentParkScopeAdapter

Equipment\Infrastructure\Adapter\Intervention\EquipmentReplacementLookupAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Equipment\Application\Port\Outbound\FacilityCustomerScopePort:
alias: Facility\Infrastructure\Adapter\Equipment\FacilityCustomerScopeAdapter

Facility\Infrastructure\Adapter\Equipment\FacilityCustomerScopeAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Equipment\Infrastructure\Adapter\MaintenanceExport\MaintenanceExportEquipmentIdentityAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'
tags: ['maintenance_export.identity_validator']
30 changes: 30 additions & 0 deletions config/modules/facility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,34 @@ services:
autowire: true
autoconfigure: true

Facility\Infrastructure\Adapter\Intervention\InterventionEconomicScopeAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Intervention\Application\Port\Outbound\InterventionEconomicScopePort:
alias: Facility\Infrastructure\Adapter\Intervention\InterventionEconomicScopeAdapter

Facility\Presentation\:
resource: '../../src/Facility/Presentation'

Facility\Infrastructure\Adapter\ServiceRequest\ServiceRequestSiteTargetAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Facility\Application\Port\Outbound\FacilityCustomerValidationPort:
alias: Customer\Infrastructure\Adapter\Facility\FacilityCustomerValidationAdapter

Facility\Infrastructure\Adapter\Intervention\InterventionSiteCustomerSnapshotAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Intervention\Application\Port\Outbound\InterventionSiteCustomerSnapshotPort:
alias: Facility\Infrastructure\Adapter\Intervention\InterventionSiteCustomerSnapshotAdapter

Facility\Infrastructure\Adapter\Maintenance\FacilityMaintenanceLifecycleAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Facility\Presentation\Api\Provider\Facility\CanonicalFacilityProvider:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'
Expand Down Expand Up @@ -366,3 +391,8 @@ services:
Facility\Infrastructure\EventSubscriber\FacilityPlanAuditListener:
arguments:
$events: '@Shared\Infrastructure\Messaging\Outbox\TransactionalEventDispatcher'

Facility\Infrastructure\Adapter\MaintenanceExport\MaintenanceExportSiteIdentityAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'
tags: ['maintenance_export.identity_validator']
39 changes: 39 additions & 0 deletions config/modules/inspection.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
services:
Inspection\Infrastructure\Adapter\ServiceRequest\ServiceRequestOriginAdapter:
arguments:
$connection: '@doctrine.dbal.main_connection'

ServiceRequest\Application\Port\Outbound\ServiceRequestOriginPort:
alias: Inspection\Infrastructure\Adapter\ServiceRequest\ServiceRequestOriginAdapter

Inspection\Infrastructure\Adapter\Maintenance\InspectionMaintenanceHistoryAdapter:
arguments:
$connection: '@doctrine.dbal.main_connection'
Expand Down Expand Up @@ -30,6 +37,25 @@ services:
# InspectionResponseProvider names no entity manager either: both of its
# reads went to Application\UseCase\Query\Response\.

# Repositories
Inspection\Infrastructure\Adapter\Equipment\EquipmentInspectionSummaryAdapter:
arguments:
$connection: '@doctrine.dbal.main_connection'

Inspection\Application\Port\Outbound\EquipmentInspectionSummaryPort:
alias: Inspection\Infrastructure\Adapter\Equipment\EquipmentInspectionSummaryAdapter

Inspection\Application\UseCase\Query\Equipment\GetEquipmentInspectionSummary\GetEquipmentInspectionSummaryHandler:
tags: ['messenger.message_handler']

# Repositories
Inspection\Infrastructure\Adapter\Intervention\InterventionInspectionResultAdapter:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Intervention\Application\Port\Outbound\InterventionInspectionResultPort:
alias: Inspection\Infrastructure\Adapter\Intervention\InterventionInspectionResultAdapter

# Repositories
Inspection\Infrastructure\Persistence\Doctrine\Repository\InspectionRepository:
arguments:
Expand Down Expand Up @@ -380,3 +406,16 @@ services:
Inspection\Infrastructure\Adapter\Checklist\ChecklistLockAdapter:
arguments:
$connection: '@doctrine.dbal.main_connection'

Inspection\Infrastructure\Persistence\Doctrine\Repository\ParkAnomalyRepository:
arguments:
$entityManager: '@doctrine.orm.main_entity_manager'

Inspection\Application\Port\Outbound\ParkAnomalyGatewayPort:
alias: Inspection\Infrastructure\Persistence\Doctrine\Repository\ParkAnomalyRepository

Inspection\Application\UseCase\Query\Park\ListParkAnomalies\ListParkAnomaliesHandler:
tags: ['messenger.message_handler']

Inspection\Application\UseCase\Query\Park\GetParkAnomaliesSummary\GetParkAnomaliesSummaryHandler:
tags: ['messenger.message_handler']
Loading
Loading