Skip to content

Commit

Permalink
doc: Finish CSV documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
flozf committed May 27, 2024
1 parent 42703b5 commit 40b64d0
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions documentation/CSV File Format.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,38 @@ https://business-partners.int.demo.catena-x.net/companies/test-company/ui/swagge
- There is a special mechanism for arrays of objects like they are in the JSON API

## Header line and fields
- The field names are derived from the JSON API at
https://business-partners.int.demo.catena-x.net/companies/test-company/ui/swagger-ui/index.html#/business-partner-controller/upsertBusinessPartnersInput
- The field names are derived from the JSON API (see link above)
- The field names for nested objects are created by separating the individual names by a dot
- For example: The `addressBpn` field in the `address` top level entry will be named `address.addressBpn`
- There are a few special rules:
- The top-level `nameParts` element is created using the field names `name1`, `name2`, ... `name9`
- The name `physicalPostalAddress` is abbreviated to `physical`
- The name `alternativePostalAddress` is abbreviated to `alternate`
- There is a special notation for arrays of objects (see below)
- The minimum neccessary fields are
- `externalId`
- `name1`
- `isOwnCompanyData`

## Arrays
The following elements of a record are arrays in the REST API:
- `identifiers.*`
- `states.*`
- `roles`
- `legalEntity.states.*`
- `site.states.*`
- `address.states.*`

Each time, a new `externalId` is encountered, this line will become the main data source from which
all data fields for the REST API are populated. If values are provided for fields that can be arrays
in the CSV file, the first array element will be populated with the data from the main line.
In order to add more elements to an array, it is possible to add lines containing further array elements
immediately the main line. These follow-up-lines must contain the same `externalId` again and data
for exactly one array.

For example, if you want to add a second `identifiers` element, create a second line where only
the following fields are set:
- `extenalId` (same as in the main line)
- `identifiers.type`
- `identifiers.value`
- `identifiers.issuingBody`
If you also want to provide a second element for `site.states`, do *not* set those fields
in the same line. Instead, create a third line with the respective values.

0 comments on commit 40b64d0

Please sign in to comment.