openapi: 3.1.0
info:
  title: Tango Space HR Outbound — File
  version: "0.7"
  description: |
    SFTP file-based outbound. Tango writes a pipe-delimited file of active
    Person/HR records with their space/area/floor/building/property
    assignments to its SFTP server. Client picks up the file and processes
    it in their HR / IDM system.

    Only Active personnel records are written. People not assigned to a
    space are still included (location columns blank).
  x-direction: outbound
  x-source: Tango
  x-destination: Client System
  x-transport: sftp
  x-file-format: pipe-delimited text (.txt)
  x-file-naming-convention: "{ClientName}_HR_OUT_MMDDYYYYHHMMSS.txt"
servers:
  - url: sftp://sftp.tangoanalytics.com
    description: Production SFTP
    x-environment: production
    x-path: /outbound/hr
  - url: sftp://sftpdev.tangoanalytics.com
    description: Test SFTP (SIT/UAT)
    x-environment: test
    x-path: /outbound/hr
tags: [{name: HR Outbound File}]
paths:
  /outbound/hr:
    post:
      summary: Drop HR outbound file at SFTP path
      operationId: deliverHrOutboundFile
      tags: [HR Outbound File]
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
              x-record-schema:
                $ref: "#/components/schemas/HrOutboundRow"
      responses:
        "200":
          description: File delivered.
components:
  securitySchemes:
    sftpUserPassword:
      type: http
      scheme: basic
      description: "User `tango_dev` per source; password TBD."
  schemas:
    HrOutboundRow:
      type: object
      properties:
        PERSON_ID: { type: number }
        FIRST_NAME: { type: string }
        LAST_NAME: { type: string }
        PERSON_NUMBER: { type: string }
        EMPLOYEE_TYPE: { type: string }
        ALLOCATION_IS_PRIMARY:
          type: string
          description: |
            "Primary Allocation" — indicates whether the listed location is the
            person's primary assignment. Y/N.
        PROPERTY_NUMBER: { type: string }
        PROPERTY_NAME: { type: string }
        STORE_NUMBER: { type: string }
        STORE_NAME: { type: string }
        FLOOR_NUMBER: { type: string }
        FLOOR_NAME: { type: string }
        SPACE_NUMBER: { type: string }
        SPACE_NAME: { type: string }
        SPACE_TYPE: { type: string }
        SPACE_USE: { type: string }
        IS_SHIFT_SPACE: { type: string, enum: [Y, N] }
        AREA_TYPE: { type: string }
        AREA_NUMBER: { type: string }
        AREA_NAME: { type: string }
        IS_FLEXIBLE_SEATING: { type: string, enum: [Y, N] }
        DISPLAY_NAME: { type: string }
        ALLOCATION_TYPE: { type: string }
        DEPARTMENT_NAME: { type: string }
        SEATING_TYPE: { type: string }
        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 }
        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 }
        N_EXT_ATTR6: { type: number }
        N_EXT_ATTR7: { type: number }
        N_EXT_ATTR8: { type: number }
        N_EXT_ATTR9: { type: number }
        N_EXT_ATTR10: { type: number }
        D_EXT_ATTR1: { type: string, description: "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." }
        D_EXT_ATTR6: { type: string, description: "DATE." }
        D_EXT_ATTR7: { type: string, description: "DATE." }
        D_EXT_ATTR8: { type: string, description: "DATE." }
        D_EXT_ATTR9: { type: string, description: "DATE." }
        D_EXT_ATTR10: { type: string, description: "DATE." }
        C_EXT_LOV1: { type: string }
        C_EXT_LOV2: { type: string }
        C_EXT_LOV3: { type: string }
        C_EXT_LOV4: { type: string }
security:
  - sftpUserPassword: []
