> ## 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.

# Co outbound

# Tango CO Outbound

> Generated from `Tango CO Outbound Integration Design Specification V0.5.docx` in SharePoint folder `04 Projects Integrations`.
> OAS spec: [`co-outbound.yaml`](./co-outbound.yaml)

## Overview

One-way SFTP file-based outbound integration. Tango writes a pipe-delimited text file containing approved Change Order (CO) header and line-item rows to its SFTP server; the client reads the file from that location and loads it into their target system.

**Owner:** Tango Analytics (Solution / Technical / Functional Lead roles listed as TANGO; client roles unfilled in source).
**Spec version:** 0.5
**Status:** Draft (auto-generated from design doc — needs review)

## Transport

| Attribute | Value | |
| - | - | - |
| Direction | Outbound (Tango → Client) | |
| Mechanism | SFTP file drop | |
| File format | Pipe-delimited (\` | `) text, `.txt\` extension |
| File naming | `{ClientName}_coout_MMDDYYYYHHMMSS.txt` | |
| Production host | `sftp.tangoanalytics.com` | |
| Test host | `sftpdev.tangoanalytics.com` (SIT/UAT) | |
| Path | `/outbound/CO` | |
| Auth | SFTP user/password (credentials TBD) | |
| Frequency | Pre-agreed batch schedule (TBD) | |

Before each write, Tango moves the prior file to a `Processed` subfolder with a timestamp suffix. No file is written when there is no data.

## Authentication

SFTP user + password, provisioned per environment. Concrete values not in the design doc — request from the Tango integration team before testing.

## Integration logic

* Tango selects all Change Orders with status `Approved` and produces the outbound file.
* Zero-dollar lines are **excluded** from the file.
* Negative COs **are included**.
* `CO_NUMBER` is the unique reconciliation key — the client must round-trip it back via CO Inbound.
* The file has both Header and Detail rows.
* After file generation, all exported COs are flagged with status `Exported` in Tango.
* If no approved COs exist, no file is produced.

## Data fields

| Field | Type | Required | Description |
| - | - | - | - |
| `CO_ID` | NUMBER | ⚠ unknown | Tango unique ID |
| `CO_NUMBER` | VARCHAR | ⚠ unknown | Unique CO number; reconciliation key |
| `PO_NUMBER` | VARCHAR | ⚠ unknown | |
| `PROJECT_NUMBER` | VARCHAR | ⚠ unknown | |
| `CHANGE_REASON` | VARCHAR | ⚠ unknown | |
| `CHANGE_ORDER_DATE` | DATE (MM/DD/YYYY) | ⚠ unknown | |
| `APPROVED_DATE` | DATE (MM/DD/YYYY) | ⚠ unknown | |
| `APPROVED_BY` | VARCHAR | ⚠ unknown | |
| `RETAINAGE_PCT` | NUMBER | ⚠ unknown | |
| `CO_AMOUNT` | NUMBER | ⚠ unknown | |
| `ITEM_NUMBER` | NUMBER | ⚠ unknown | |
| `CO_QUANTITY` | NUMBER | ⚠ unknown | |
| `CO_RATE` | NUMBER | ⚠ unknown | |
| `LINE_AMOUNT` | NUMBER | ⚠ unknown | |
| `UOM` | VARCHAR | ⚠ unknown | |
| `ACCOUNT_CODE` | VARCHAR | ⚠ unknown | |
| `SEGMENT1` – `SEGMENT6` | VARCHAR | ⚠ unknown | Budget segments; blank when NA |
| `LINE_COMMENTS` | VARCHAR | ⚠ unknown | CO line-level comments |

## Validations

* Zero-dollar COs are NOT exported (negative COs ARE).
* Only `Status = Approved` COs are exported.
* The file always contains Header, Detail, and Trailer information.

## Open Questions / Assumptions

> Each item below was either unstated, ambiguous, or `<TBD>` in the source document.

* [ ] **Required-field annotation is missing for every column.** The source doc's "Required?" column was empty for all 22 fields; the spec leaves `required[]` empty rather than guess. Confirm which fields a downstream system must always receive.
* [ ] **SFTP credentials are `<TBD>`** in the doc — confirm user/password (and whether key-based auth is in fact the standard).
* [ ] **`Timing and Frequency` section is `<TBD>`** — confirm the cron/schedule.
* [ ] **Sample data column is empty** for every field — capture at least one realistic example row in the next revision.
* [ ] **Header / Trailer row formats not defined** in the source — assumed the data mapping table describes Detail rows only.
* [ ] **No Glossary entries** — verify the meaning of fields that share names with PO/AP integrations (e.g. `LINE_AMOUNT`, `SEGMENT1..6`) actually match.

## Changelog (from source doc)

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1 | 06/21/2021 | Initial Draft | Alpna Bansal |
| 0.2 | 08/09/2022 | Updated integration logic | Alpna Bansal |
| 0.3 | 08/23/2022 | Updated segment fields in data mapping | Alpna Bansal |
| 0.4 | 09/14/2022 | Updated formatting | Jasmin Thasleem |
| 0.5 | 10/24/2023 | Reformatting various sections | Jasmin Thasleem |
