# Release-specific deployment configuration
# This file is packaged with each release in database/deploy-config.ps1
# Jenkins copies this file into the release zip during build

$deployConfig = @{
    # Site
    SiteName            = "RBD-MILL"
    AppSubfolder        = "app"
    
    # Database (connection string comes from shared/appsettings.json)
    TargetDatabaseName  = "rbd-mill"
    
    # Notifications
    GoogleChatEndpoint  = "https://chat.googleapis.com/v1/spaces/AAQAigu7zpI/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=vo7s61lya9Kh1xK_baro-va5uboPIbsaX8u6hKc1qOY"
    N8nWebhook          = "https://n8n.2.dev.dexteel.com/webhook/logs"
    N8nSpaceId          = "019b1409-360c-7906-8d82-eda8764cd5d5"
    N8nParentPageId     = "019c0f91-b51e-778d-a163-a3cab8215fbc"
    
    # DACPACs to deploy (in order, based on schema dependencies)
    # Format: @{Name="dacpac-name"; TargetDB="database"; EnvVars=@("/v:var=value")}
    # Dependency chain: mesf-core -> del -> mill -> forms -> kpi -> sal -> rolls -> rbd
    Dacpacs = @(
        @{Name="historian-sql"; TargetDB="historian"; EnvVars=@()},
        @{Name="mesf-core-sql-sql140"; TargetDB="rbd-mill"; EnvVars=@()},
        @{Name="del-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:MILL_SERVER_LEGACY=MillMES", "/v:RFAC_LEGACY=R-FactorSystem")},
        @{Name="mill-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:historian=historian", "/v:RFAC_LEGACY=R-FactorSystem", "/v:MILL_SERVER_LEGACY=MillMES", "/v:VRM_SERVER=VRM-SQL", "/v:L2MILL=L2Mill", "/v:Axiom=Axiom", "/v:DOCS_SERVER=RBD-SQL", "/v:DOCS_DB=docs_cmms")},
        @{Name="forms-sql"; TargetDB="rbd-mill"; EnvVars=@()},
        @{Name="kpi-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:Axiom=Axiom")},
        @{Name="sal-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:MILL_SERVER_LEGACY=MillMES", "/v:RFAC_LEGACY=R-FactorSystem")},
        @{Name="rolls-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:historian=historian", "/v:MILL_SERVER_LEGACY=MillMES", "/v:RFAC_LEGACY=R-FactorSystem", "/v:ROLLSHOP_SERVER=RBD-PROD\PRODSQLSERVER", "/v:ROLLSHOP_DB=RollShop")},
        @{Name="rbd-sql"; TargetDB="rbd-mill"; EnvVars=@("/v:historian=historian", "/v:LOGBOOK=LOGBOOK", "/v:RFAC_LEGACY=R-FactorSystem", "/v:MILL_SERVER_LEGACY=MillMES", "/v:IHBOX_SYSTEM=IHBoxSystem")}
    )
}
