# SyRF Service Identifiers
# This file is the source of truth for all service naming conventions
# Last updated: 2025-11-30

services:
  # Core Application Services
  api:
    displayName: API
    description: Main REST API for systematic reviews
    type: dotnet

    paths:
      monorepo: src/services/api/
      chart: src/services/api/.chart
      dockerfile: src/services/api/SyRF.API.Endpoint/Dockerfile

    dotnet:
      project: SyRF.API.Endpoint
      solution_filter: src/services/api/api.slnf

    versioning:
      tag_prefix: api-v
      current_version: "9.2.1"

    docker:
      image_name: syrf-api
      repository: ghcr.io/camaradesuk/syrf-api
      registry: ghcr.io

    urls:
      staging: api.staging.syrf.org.uk
      production: api.syrf.org.uk
      preview_pattern: api.pr-{N}.syrf.org.uk

    rename_status: null  # No rename in progress

  project-management:
    displayName: Project Management
    description: Project and study management service
    type: dotnet

    paths:
      monorepo: src/services/project-management/
      chart: src/services/project-management/.chart
      dockerfile: src/services/project-management/SyRF.ProjectManagement.Endpoint/Dockerfile

    dotnet:
      project: SyRF.ProjectManagement.Endpoint
      solution_filter: src/services/project-management/project-management.slnf

    versioning:
      tag_prefix: project-management-v
      current_version: "11.3.1"
      previous_prefix: pm-v  # Old naming convention (deprecated)

    docker:
      image_name: syrf-project-management
      repository: ghcr.io/camaradesuk/syrf-project-management
      registry: ghcr.io

    urls:
      staging: project-management.staging.syrf.org.uk
      production: project-management.syrf.org.uk
      preview_pattern: project-management.pr-{N}.syrf.org.uk

    rename_status:
      in_progress: false
      completed_date: "2025-11-18"
      old_names:
        service_id: pm
        image_name: syrf-pm
        tag_prefix: pm-v
      new_names:
        service_id: project-management
        image_name: syrf-project-management
        tag_prefix: project-management-v
      notes: |
        Rename completed on 2025-11-18 with tag project-management-v11.3.1.
        All references now use the new naming convention.

  quartz:
    displayName: Quartz
    description: Background job scheduling and processing
    type: dotnet

    paths:
      monorepo: src/services/quartz/
      chart: src/services/quartz/.chart
      dockerfile: src/services/quartz/SyRF.Quartz/Dockerfile

    dotnet:
      project: SyRF.Quartz
      solution_filter: src/services/quartz/quartz.slnf

    versioning:
      tag_prefix: quartz-v
      current_version: "0.5.0"

    docker:
      image_name: syrf-quartz
      repository: ghcr.io/camaradesuk/syrf-quartz
      registry: ghcr.io

    urls:
      staging: quartz.staging.syrf.org.uk
      production: quartz.syrf.org.uk
      preview_pattern: quartz.pr-{N}.syrf.org.uk

    rename_status: null

  web:
    displayName: Web
    description: Angular frontend application
    type: angular

    paths:
      monorepo: src/services/web/
      chart: src/services/web/.chart
      dockerfile: src/services/web/Dockerfile.ci

    angular:
      version: "18.2.0"
      node_version: "20"

    versioning:
      tag_prefix: web-v
      current_version: "5.4.1"

    docker:
      image_name: syrf-web
      repository: ghcr.io/camaradesuk/syrf-web
      registry: ghcr.io

    urls:
      staging: staging.syrf.org.uk
      production: prod.syrf.org.uk  # Temporary until legacy switchover, then syrf.org.uk
      preview_pattern: pr-{N}.syrf.org.uk

    rename_status: null

  # Documentation Services
  user-guide:
    displayName: User Guide
    description: End-user documentation (Jekyll)
    type: static-site

    paths:
      monorepo: user-guide/
      chart: user-guide/.chart
      dockerfile: user-guide/Dockerfile

    framework:
      name: Jekyll
      theme: just-the-docs

    versioning:
      tag_prefix: user-guide-v
      current_version: "1.1.0"

    docker:
      image_name: syrf-user-guide
      repository: ghcr.io/camaradesuk/syrf-user-guide
      registry: ghcr.io

    urls:
      staging: help.staging.syrf.org.uk
      production: help.syrf.org.uk
      preview_pattern: help.pr-{N}.syrf.org.uk

    rename_status: null

  docs:
    displayName: Team Docs
    description: Internal developer documentation (MkDocs)
    type: static-site

    paths:
      monorepo: docs/
      chart: docs/.chart
      dockerfile: docs/Dockerfile.ci

    framework:
      name: MkDocs
      theme: material

    versioning:
      tag_prefix: docs-v
      current_version: "1.6.3"

    docker:
      image_name: syrf-docs
      repository: ghcr.io/camaradesuk/syrf-docs
      registry: ghcr.io

    urls:
      staging: docs.staging.syrf.org.uk
      production: docs.syrf.org.uk
      preview_pattern: docs.pr-{N}.syrf.org.uk

    rename_status: null

  # Lambda Service
  s3-notifier:
    displayName: S3 Notifier
    description: S3 event processing and RabbitMQ notification
    type: lambda

    paths:
      monorepo: src/services/s3-notifier/
      # No chart - deployed to Lambda

    dotnet:
      project: SyRF.S3FileSavedNotifier.Endpoint
      solution_filter: src/services/s3-notifier/s3-notifier.slnf

    versioning:
      tag_prefix: s3-notifier-v
      current_version: "1.0.0"

    lambda:
      function_name: syrfAppUploadS3Notifier
      region: eu-west-1
      runtime: dotnet10

    urls: null  # Lambda function - no URL

    rename_status: null

# Kubernetes namespace mappings
namespaces:
  staging: syrf-staging
  production: syrf-production

# Environment domains
domains:
  staging:
    primary: staging.syrf.org.uk
  production:
    primary: syrf.org.uk
    temporary_web: prod.syrf.org.uk  # Until legacy switchover
  preview:
    pattern: pr-{N}.syrf.org.uk
  infrastructure:
    argocd: argocd.camarades.net
    rabbitmq: rabbitmq.syrf.org.uk

# Container registry
registry:
  url: ghcr.io
  organization: camaradesuk
  image_prefix: syrf-
