openapi: 3.1.0
info:
  title: Tango Space HR Inbound — File
  version: "2.2"
  description: |
    SFTP file-based inbound. Client drops a pipe-delimited file of Person/HR
    records on Tango's SFTP server. Tango processes the file and updates
    People in Space Management.

    Tilde-preservation convention: send `~` in any string field to indicate
    "retain the existing value" (do not overwrite). For date fields, send
    `01/01/1800`. For numeric fields, send `0.0001`. These sentinels prevent
    null-out updates.

    Upsert key: `PERSON_NUMBER`.
  x-direction: inbound
  x-source: Client System
  x-destination: Tango
  x-transport: sftp
  x-file-format: pipe-delimited text (.txt)
  x-file-naming-convention: "{ClientName}_HR_MMDDYYYYHHMMSS.txt"
  x-retention-sentinels:
    string: "~"
    date: "01/01/1800"
    number: "0.0001"
servers:
  - url: sftp://sftp.tangoanalytics.com
    description: Production SFTP
    x-environment: production
    x-path: /inbound/hr
  - url: sftp://sftpdev.tangoanalytics.com
    description: Test SFTP (SIT/UAT)
    x-environment: test
    x-path: /inbound/hr
tags: [{name: HR Inbound File}]
paths:
  /inbound/hr:
    post:
      summary: Drop HR file at SFTP path
      operationId: deliverHrInboundFile
      tags: [HR Inbound File]
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
              x-record-schema:
                $ref: "#/components/schemas/HrRow"
      responses:
        "200":
          description: File received.
components:
  securitySchemes:
    sftpUserPassword: { type: http, scheme: basic }
  schemas:
    HrRow:
      type: object
      required:
        - CLIENT_ID
        - BRAND_ID
        - PERSON_NUMBER
        - FIRST_NAME
        - LAST_NAME
        - STATUS
      properties:
        CLIENT_ID: { type: string, example: "290" }
        BRAND_ID: { type: string, example: "987" }
        COUNTRY: { type: string, example: "USA" }
        PERSON_NUMBER: { type: string, example: "0006575" }
        COST_CENTER:
          type: string
          description: |
            Optional initially; once assigned in Tango, cannot be cleared via
            this integration.
        PRIMARY_EMAIL: { type: string, format: email }
        EMPLOYEE_TYPE: { type: string, description: "Lookup." }
        HIRE_DATE: { type: string, description: "DATE MM/DD/YYYY. Send `01/01/1800` to retain existing." }
        END_DATE: { type: string, description: "DATE MM/DD/YYY (typo in source). Send `01/01/1800` to retain existing." }
        FIRST_NAME: { type: string }
        LAST_NAME: { type: string }
        MIDDLE_NAME: { type: string }
        OTHER_NAME: { type: string, description: "Client Label: Nickname." }
        BUILDING_ASSIGNED: { type: string }
        GRADE_LEVEL: { type: string, description: "Lookup." }
        TITLE: { type: string }
        MANAGER_ID: { type: string }
        SHIFT_WORKER: { type: string, enum: [Y, N] }
        WORK_FROM_HOME: { type: string, enum: [Y, N] }
        PRIMARY_PHONE: { type: string }
        MOBILE_NUMBER: { type: string }
        STATUS: { type: string, description: "Lookup. Sample: Active." }
        SEATING_TYPE: { type: string, description: "Lookup SEATING_TYPE." }
        C_EXT_ATTR1: { type: string }
        C_EXT_ATTR2: { type: string }
        C_EXT_ATTR3: { type: string }
        C_EXT_ATTR4: { type: string }
        C_EXT_ATTR5: { type: string }
        C_EXT_ATTR6: { type: string }
        C_EXT_ATTR7: { type: string }
        C_EXT_ATTR8: { type: string }
        C_EXT_ATTR9: { type: string }
        C_EXT_ATTR10: { type: string }
        C_EXT_LOV1: { type: string, description: "Lookup." }
        C_EXT_LOV2: { type: string, description: "Lookup." }
        C_EXT_LOV3: { type: string, description: "Lookup." }
        C_EXT_LOV4: { type: string, description: "Lookup." }
        C_EXT_LOV5: { type: string, description: "Lookup." }
        D_EXT_ATTR1:
          type: string
          description: |
            DATE. NOTE: source mapping types as VARCHAR for D_EXT_ATTR1 only —
            inconsistent with D_EXT_ATTR2..5 (DATE). Likely typo; treated as DATE.
        D_EXT_ATTR2: { type: string, description: "DATE." }
        D_EXT_ATTR3: { type: string, description: "DATE." }
        D_EXT_ATTR4: { type: string, description: "DATE." }
        D_EXT_ATTR5: { type: string, description: "DATE." }
        N_EXT_ATTR1: { type: number }
        N_EXT_ATTR2: { type: number }
        N_EXT_ATTR3: { type: number }
        N_EXT_ATTR4: { type: number }
        N_EXT_ATTR5: { type: number }
        ZIP: { type: string, description: "Zip Code." }
security:
  - sftpUserPassword: []
