# This file is responsible for configuring your application # and its dependencies with the aid of the Config module. # # This configuration file is loaded before any dependency and # is restricted to this project. # General application configuration import Config config :da_product_app, DaProductApp.Repo, migration_primary_key: [name: :id, type: :bigserial] config :da_product_app, :env, Mix.env() config :da_product_app, ecto_repos: [DaProductApp.Repo], generators: [timestamp_type: :utc_datetime, binary_id: false] # Configures the DaProductApp endpoint (legacy - will be removed) config :da_product_app, DaProductAppWeb.Endpoint, url: [host: "localhost"], adapter: Bandit.PhoenixAdapter, render_errors: [ formats: [html: DaProductAppWeb.ErrorHTML, json: DaProductAppWeb.ErrorJSON], layout: false ], pubsub_server: DaProductApp.PubSub, live_view: [signing_salt: "Rs4sgrNR"] # Configures the PlatformWeb endpoint (new) config :platform_web, PlatformWeb.Endpoint, url: [host: "localhost"], adapter: Bandit.PhoenixAdapter, render_errors: [ formats: [html: PlatformWeb.ErrorHTML, json: PlatformWeb.ErrorJSON], layout: false ], pubsub_server: DaProductApp.PubSub, live_view: [signing_salt: "Rs4sgrNR"] # --------------------------------------------------------------------------- # Dynamic menu — set dynamic_menu: false to fall back to the static legacy menu # --------------------------------------------------------------------------- config :platform_web, dynamic_menu: true, menu_providers: [ DaProductApp.MenuProvider, SettlementCore.MenuProvider ] #config :oban, # name: Oban, # repo: DaProductApp.Repo, # engine: Oban.Engines.Basic, # Use Basic Engine instead of Postgres # queues: [default: 10], # Define your queues # notifier: Oban.Notifiers.Null, # Disable PostgreSQL-based notifier # peer: false # Configures the mailer # # By default it uses the "Local" adapter which stores the emails # locally. You can see the emails in your browser, at "/dev/mailbox". # # For production it's recommended to configure a different adapter # at the `config/runtime.exs`. # NOTE: SMTP configuration is in config/dev.exs for development config :da_product_app, DaProductApp.Mailer, adapter: Swoosh.Adapters.Local # Configure esbuild (the version is required) # Legacy da_product_app configuration config :esbuild, version: "0.17.11", da_product_app: [ args: ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), cd: Path.expand("../apps/da_product_app/assets", __DIR__), env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} ], platform_web: [ args: ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*), cd: Path.expand("../apps/platform_web/assets", __DIR__), env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} ] # Configure tailwind (the version is required) config :tailwind, version: "3.4.3", da_product_app: [ args: ~w( --config=tailwind.config.js --input=css/app.css --output=../priv/static/assets/app.css ), cd: Path.expand("../apps/da_product_app/assets", __DIR__) ], platform_web: [ args: ~w( --config=tailwind.config.js --input=css/app.css --output=../priv/static/assets/app.css ), cd: Path.expand("../apps/platform_web/assets", __DIR__) ] # Configures Elixir's Logger config :logger, :console, format: "$time $metadata[$level] $message\n", metadata: [:request_id] # Use Jason for JSON parsing in Phoenix config :phoenix, :json_library, Jason config :platform_core, Oban, name: Oban, repo: PlatformCore.Repo, engine: Oban.Engines.Dolphin, queues: [ default: 10, mailers: 20, high: 50, low: 5, file_download: 10, parameter_push: 10, app_package: 10, # Settlement & reconciliation pipeline queues settlements: 5, reconciliation: 3, payouts: 3 ], plugins: [ {Oban.Plugins.Pruner, max_age: (3600 * 24)}, {Oban.Plugins.Cron, crontab: [ # {"0 2 * * *", DaProductApp.Workers.DailyDigestWorker}, # {"@reboot", DaProductApp.Workers.StripeSyncWorker}, # {"0 2 * * *", DaProductApp.DailyReports.DailyReportWorker}, # Settlement pipeline — must run in order: MMS sync → SFTP fetch → Recon → MIS {"0 1 * * *", SettlementCore.Workers.MmsApprovalSyncWorker, args: %{"triggered_by" => "cron"}}, # YSP SFTP fetch runs at 03:00 AM via Ysp.Scheduler GenServer (registered in SettlementCore.Application). # The cron below is a safety net in case the GenServer misses a cycle (e.g. app restart near 03:00 AM). {"5 3 * * *", SettlementCore.Ysp.SftpFetcher, args: %{}}, # SLA monitor: 06:15 = recon done, 07:15 = MIS generated, 08:15 = MIS approved (Mon-Fri only) {"15 6,7,8 * * 1-5", SettlementCore.Workers.SlaMonitorWorker, args: %{}}, ]} ] # Legacy config - will be removed after migration config :da_product_app, Oban, repo: DaProductApp.Repo, engine: Oban.Engines.Dolphin, queues: [default: 10, mailers: 20, high: 50, low: 5, file_download: 10, parameter_push: 10, app_package: 10], plugins: [ {Oban.Plugins.Pruner, max_age: (3600 * 24)}, {Oban.Plugins.Cron, crontab: [ # {"0 2 * * *", DaProductApp.Workers.DailyDigestWorker}, # {"@reboot", DaProductApp.Workers.StripeSyncWorker}, # {"0 2 * * *", DaProductApp.DailyReports.DailyReportWorker}, ]} ] config :da_product_app, :qr_providers, %{ "alipay" => DaProductApp.QRProviders.Alipay, "wechat" => DaProductApp.QRProviders.WeChat, "aani" => DaProductApp.QRProviders.Aani } # Centralized MQTT client configuration. Override per environment in dev.exs/prod.exs config :da_product_app, mqtt_client_id: "phoenix_client_tms_nishant" # MQTT server configuration (host and port). Override per environment as needed. config :da_product_app, mqtt_host: "demo.ctrmv.com" config :da_product_app, mqtt_port: 1883 # RKI Key Management Configuration config :da_product_app, rki_endpoint: "http://localhost:8300/api/v1/getRki", ota_base_url: "http://demo.ctrmv.com:14019/ota", ota_storage_path: "priv/ota", rki_timeout: 10_000, mqtt_product_key: "pFppbioOCKlo5c8E" # Custom MIME types for file uploads config :mime, :types, %{ "application/vnd.android.package-archive" => ["apk"], "application/octet-stream" => ["bin"] } # Batch number configuration config :da_product_app, :batch_settings, provider_wise_batch_number_enabled: true # --------------------------------------------------------------------------- # Umbrella app configuration # --------------------------------------------------------------------------- # tms_core: Terminal Management System domain app # Set :enabled to false in a specific release to disable TMS functionality. config :tms_core, :enabled, true # PubSub server used by tms_core for device update events. # Matches the PubSub started by da_product_app during the extraction phase. config :tms_core, :pubsub_server, DaProductApp.PubSub # TmsCore.Terminal adapter: use the local adapter that delegates to # DaProductApp.TerminalManagement while the code is being extracted. config :tms_core, TmsCore.Terminal, adapter: DaProductApp.TmsAdapter # platform_core: shared infrastructure — PlatformCore.Repo connects to the same # single database as DaProductApp.Repo. Credentials are set per-environment below. # Future: move PubSub, MQTT, Oban config here. config :platform_core, :placeholder, true # platform_web: Phoenix web layer scaffold (no active config yet) # Future: move Endpoint, Router config here. config :platform_web, :placeholder, true # settlement_core: enabled by default; set to false for headless TMS releases. config :settlement_core, :enabled, true # YSP SFTP configuration — override with real credentials in runtime.exs / dev.exs / prod.exs. # Set host: nil to disable automatic SFTP fetching (manual upload only). config :settlement_core, :ysp_sftp, host: nil, port: 22, user: "mercury", password: nil, key_path: nil, base_dir: "/outbound", connect_timeout: 30_000 # Local storage directory for downloaded YSP dump files. # Defaults to System.tmp_dir!() if not set. config :settlement_core, :dump_storage_path, System.tmp_dir!() # risk_core: enabled by default; set to false for headless non-risk releases. # Configure the adapter for risk evaluation (local by default). config :risk_core, :enabled, true config :risk_core, :adapter, RiskCore.LocalAdapter config :risk_core, :pubsub_name, DaProductApp.PubSub # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{config_env()}.exs"