openapi: 3.1.0
info:
  title: Tango Store Financials Inbound — File
  version: "0.3"
  description: |
    SFTP file-based inbound. Client drops a pipe-delimited file of per-period
    store-sales rows. Tango processes the file and updates Store Financials
    in the Locations / Stores module.
  x-direction: inbound
  x-source: Client System
  x-destination: Tango
  x-transport: sftp
  x-file-format: pipe-delimited text (.txt)
  x-file-naming-convention: "{ClientCode}_sales_MMDDYYYYHHMMSS.txt"
servers:
  - url: sftp://sftp.tangoanalytics.com
    description: Production SFTP
    x-environment: production
    x-path: /inbound/store_sales
  - url: sftp://sftpdev.tangoanalytics.com
    description: Test SFTP (SIT/UAT)
    x-environment: test
    x-path: /inbound/store_sales
tags:
  - name: Store Financials File
paths:
  /inbound/store_sales:
    post:
      summary: Drop store financials file at SFTP path
      operationId: deliverStoreFinancialsFile
      tags: [Store Financials File]
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
              x-record-schema:
                $ref: "#/components/schemas/StoreFinancialsRow"
      responses:
        "200":
          description: File received and queued for processing.
components:
  securitySchemes:
    sftpUserPassword:
      type: http
      scheme: basic
  schemas:
    StoreFinancialsRow:
      type: object
      required:
        - CLIENT_ID
        - STORE_NUMBER
        - CURRENCY_TYPE
        - CY_ANNUAL_SALES
      properties:
        CLIENT_ID:
          type: number
          description: Tango client identifier.
        STORE_NUMBER:
          type: string
          description: Store number; must exist in Tango.
        CURRENCY_TYPE:
          type: string
          description: e.g., functional / reporting currency type.
        CURRENCY:
          type: string
          description: ISO 4217 3-letter code (e.g., `USD`).
        PERIOD_ENDING:
          type: number
          description: Period-ending indicator (source types as Number; format unspecified).
        CY_ANNUAL_SALES:
          type: number
          description: Current-year annual sales.
        CY_TRL_12_MO_SALES:
          type: number
          description: Current-year trailing-12-month sales (Client Label "CY WPSA").
        PY_TRL_12_MO_SALES:
          type: number
          description: Prior-year trailing-12-month sales.
        PCT_DIFF_SALES: { type: number }
        CY_EBITDA: { type: number }
        PY_EBITDA: { type: number }
        PCT_DIFF_EBITDA: { type: number }
        N_SALES_EXT_ATTR01: { type: number }
        N_SALES_EXT_ATTR02: { type: number }
        N_SALES_EXT_ATTR03: { type: number }
        N_SALES_EXT_ATTR04: { type: number }
        N_SALES_EXT_ATTR05: { type: number }
        N_SALES_EXT_ATTR06: { type: number }
        N_SALES_EXT_ATTR07: { type: number }
        N_SALES_EXT_ATTR08: { type: number }
        N_SALES_EXT_ATTR09: { type: number }
        N_SALES_EXT_ATTR10: { type: number }
        N_SALES_EXT_ATTR11: { type: number }
        N_SALES_EXT_ATTR12: { type: number }
        N_SALES_EXT_ATTR13: { type: number }
        N_SALES_EXT_ATTR14: { type: number }
        N_SALES_EXT_ATTR15: { type: number }
        N_SALES_EXT_ATTR16: { type: number }
        N_SALES_EXT_ATTR17: { type: number }
        N_SALES_EXT_ATTR18: { type: number }
        N_SALES_EXT_ATTR19: { type: number }
        N_SALES_EXT_ATTR20: { type: number }
        N_SALES_EXT_ATTR21: { type: number }
        N_SALES_EXT_ATTR22: { type: number }
        N_SALES_EXT_ATTR23: { type: number }
        N_SALES_EXT_ATTR24: { type: number }
        N_SALES_EXT_ATTR25: { type: number }
        N_SALES_EXT_ATTR26: { type: number }
        N_SALES_EXT_ATTR27: { type: number }
        N_SALES_EXT_ATTR28: { type: number }
        N_SALES_EXT_ATTR29: { type: number }
        N_SALES_EXT_ATTR30: { type: number }
        N_SALES_EXT_ATTR31: { type: number }
        N_SALES_EXT_ATTR32: { type: number }
        N_SALES_EXT_ATTR33: { type: number }
        N_SALES_EXT_ATTR34: { type: number }
        N_SALES_EXT_ATTR35: { type: number }
        N_SALES_EXT_ATTR36: { type: number }
        N_SALES_EXT_ATTR37: { type: number }
        N_SALES_EXT_ATTR38: { type: number }
        N_SALES_EXT_ATTR39: { type: number }
        N_SALES_EXT_ATTR40: { type: number }
        N_SALES_EXT_ATTR41: { type: number }
        N_SALES_EXT_ATTR42: { type: number }
        N_SALES_EXT_ATTR43: { type: number }
        N_SALES_EXT_ATTR44: { type: number }
        N_SALES_EXT_ATTR45: { type: number }
        N_SALES_EXT_ATTR46: { type: number }
        N_SALES_EXT_ATTR47: { type: number }
        N_SALES_EXT_ATTR48: { type: number }
        N_SALES_EXT_ATTR49: { type: number }
        N_SALES_EXT_ATTR50: { type: number }
        C_SALES_EXT_ATTR1: { type: string }
        C_SALES_EXT_ATTR2: { type: string }
        C_SALES_EXT_ATTR3: { type: string }
        C_SALES_EXT_ATTR4: { type: string }
        C_SALES_EXT_ATTR5: { type: string }
security:
  - sftpUserPassword: []
