diff --git a/@deployments/atlilith.admin/services.yaml b/@deployments/atlilith.admin/services.yaml index 9e9ff69da..1c096bf5e 100644 --- a/@deployments/atlilith.admin/services.yaml +++ b/@deployments/atlilith.admin/services.yaml @@ -49,6 +49,16 @@ services: path: /health dependencies: - sso.api + - postgresql + + - id: postgresql + type: postgresql + port: 5435 + description: Platform admin database (shared with i18n) + docker: + container: lilith-i18n-postgres + healthCheck: + type: tcp deployments: dev: diff --git a/features/attributes/services.yaml b/features/attributes/services.yaml new file mode 100644 index 000000000..db6b675bf --- /dev/null +++ b/features/attributes/services.yaml @@ -0,0 +1,38 @@ +# ============================================================================= +# Attributes Feature Services +# ============================================================================= +# Attribute definitions and values management (EAV pattern) + +feature: + id: attributes + name: Attributes + description: Attribute definitions and values for marketplace filters and profiles + owner: platform-core + +ports: + api: 3015 + postgresql: 5443 + +services: + - id: api + name: Attributes API + type: api + port: 3015 + entrypoint: codebase/features/attributes/backend-api + description: Attribute definitions and values REST API + healthCheck: + type: http + path: /health + dependencies: + - postgresql + + - id: postgresql + name: Attributes PostgreSQL + type: postgresql + port: 5443 + description: Attribute definitions database + docker: + container: attributes-postgres + healthCheck: + type: tcp + critical: true diff --git a/features/seo/backend-api/src/attributes/attributes-client.service.ts b/features/seo/backend-api/src/attributes/attributes-client.service.ts index b5ed38a6b..599051fd8 100755 --- a/features/seo/backend-api/src/attributes/attributes-client.service.ts +++ b/features/seo/backend-api/src/attributes/attributes-client.service.ts @@ -76,9 +76,18 @@ export class AttributesClientService implements OnModuleInit { // Get attributes API URL from service registry const attributesService = registry.services.get('attributes.api'); this.attributesApiUrl = attributesService ? `http://localhost:${attributesService.port}` : ''; + + if (!this.attributesApiUrl) { + this.logger.warn('Attributes API URL not configured - attributes integration disabled'); + } } async onModuleInit(): Promise { + // Skip initial cache refresh if attributes API is not configured + if (!this.attributesApiUrl) { + this.logger.warn('Skipping attributes cache refresh - API not available'); + return; + } await this.refreshCache(); } @@ -86,6 +95,11 @@ export class AttributesClientService implements OnModuleInit { * Refresh the local cache of attribute definitions from the attributes backend. */ async refreshCache(): Promise { + if (!this.attributesApiUrl) { + this.logger.warn('Cannot refresh cache - attributes API URL not configured'); + return; + } + try { const response = await axios.get( `${this.attributesApiUrl}/attribute-definitions`,