> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tangoanalytics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Space department hierarchy inbound file

# Tango Space Department Hierarchy Inbound — File

> Generated from `Tango Space Department Hierarchy Inbound Integration Design Specification V0.5.docx` in SharePoint folder `03 Space Integrations`.
> OAS spec: [`space-department-hierarchy-inbound-file.yaml`](./space-department-hierarchy-inbound-file.yaml)

## Overview

SFTP file-based inbound. Client drops a pipe-delimited file of Department records; Tango creates/updates Departments under Building → Navigation → Department Hierarchy.

**Owner:** Tango Analytics
**Spec version:** 0.5
**Status:** Draft (auto-generated — needs review)

## Transport

| Attribute | Value | |
| - | - | - |
| Direction | Inbound (Client → Tango) | |
| Mechanism | SFTP file drop | |
| File format | Pipe-delimited (\` | `) text, `.txt\` |
| File naming | `{ClientName}_dept_MMDDYYYYHHMMSS.txt` | |
| Path | `/inbound/dept` | |
| User | `tango_dev` (per source — confirm if production differs) | |
| Frequency | TBD | |

## Integration logic

* Upsert key: `COST_CENTER`. Department Name must be unique.
* Add/update only — Tango never deletes Departments. Use STATUS to inactivate.
* Delta files: client sends only changed records.
* No-update day → no file. Empty/header-only file → `no data sent in the file` service-log entry.

## Data fields (required ✅)

| Field | Type | Req | Sample | Notes |
| - | - | - | - | - |
| `CLIENT_ID` | VARCHAR | ✅ | `97` | Tango client identifier |
| `COST_CENTER` | VARCHAR | ✅ | `0100000153` | Upsert key |
| `DEPARTMENT_NAME` | VARCHAR | ✅ | `0100000153-Marketing` | Must be unique |
| `TYPE` | VARCHAR | ✅ | | Lookup: `DEPARTMENT_TYPE` |
| `PARENT_COST_CENTER` | VARCHAR | – | `153` | |
| `PARENT_TYPE` | VARCHAR | ✅ | | |
| `STATUS` | VARCHAR | ✅ | `ACTIVE` | Lookup: `STATUS` |
| `C_EXT_ATTR1..10` | VARCHAR | – | | Custom strings |
| `C_EXT_LOV1..5` | VARCHAR | – | | Custom lookups |
| `D_EXT_ATTR1..5` | DATE | – | | |
| `N_EXT_ATTR1..5` | NUMBER | – | | |

## Validations

| Condition | Error message |
| - | - |
| `DEPARTMENT_NAME` missing | `Fatal Error: Department Name is not present` |
| `STATUS` missing/invalid | `Fatal Error: Status is not present/valid` |
| `TYPE` missing/invalid | `Fatal Error: Type is not present/valid` |
| `PARENT_COST_CENTER` missing | `Fatal Error: parent cost center is not available` |
| `COST_CENTER` missing/invalid | `Fatal Error: Cost center is not present/valid` |
| `PARENT_TYPE` invalid | `Fatal Error: Parent Type is not valid` |

## Open Questions / Assumptions

* [ ] **Production SFTP user**: source lists `tango_dev` (dev-sounding) for the production host. Confirm correct prod credential.
* [ ] **API counterpart** (`Tango Space Department Hierarchy Inbound API Integration Design Specification V0.8.docx`) is OneDrive cloud-only and didn't download — the API spec for this integration is not yet generated. Re-run extraction after the file is made available offline.
* [ ] **`PARENT_COST_CENTER` marked NOT required** in the data-mapping table but validations enforce it. Treated per validations (effectively required) but kept optional in schema following the mapping table.
* [ ] **`CLIENT_ID` typed VARCHAR but sample is `97`** (numeric); preserved per mapping.
* [ ] **Lookup codes** (`DEPARTMENT_TYPE`, `STATUS`) are `<TBD>` in Appendix.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1 | 10/20/2020 | Initial Draft | Alpna Bansal |
| 0.2 | 12/12/2020 | Added user defined fields | Alpna Bansal |
| 0.3 | 02/14/2022 | Updated Data Mapping | Michael Phoenix |
| 0.4 | 02/14/2022 | Updated Data Mapping | Olivia Aneye |
| 0.5 | 09/12/2022 | Data Mapping & formatting | Jasmin Thasleem |
| 0.6 | 11/20/2023 | Reformatted | Jasmin Thasleem |
