# Mappings

URL: /code/file-conventions/mappings · Id: `page:code/file-conventions/mappings`

> A file in mappings/ maps one Source's shape into the Startup's Nouns and Verbs.

A file in `mappings/` maps one [Source](/business/nouns/source)'s shape into the [Startup](/business/nouns/startup)'s [Nouns](/business/nouns/noun): an [Integration](/business/nouns/integration)'s records, or a [Dataset](/business/nouns/dataset)'s input.

```text
mappings/
└── rent-roll.ts      a property manager's rent roll, into Lease
```

## Reference
TypeScript with one default export.

| Export | Type | Holds |
| --- | --- | --- |
| `default` | `mapping({ from, to, fields })` | The [Mapping](/business/nouns/mapping) |
| `from` | string | The Source or Integration |
| `to` | Noun name | The Noun its records become |
| `fields` | map | Target property to source field, or to a function of the row |

## Examples
### Minimal
```ts title="mappings/rent-roll.ts"
import { mapping } from 'startup-builder'

export default mapping({ from: 'csv', to: 'Lease', fields: { unit: 'Unit' } })
```

### Leaseline
Leaseline declares a `Lease` Noun and imports each customer's rent roll.

```ts title="mappings/rent-roll.ts"
import { mapping } from 'startup-builder'

export default mapping({
  from: 'csv',
  to: 'Lease',
  fields: {
    unit: 'Unit',
    endsOn: (row) => new Date(row['Lease End']).toISOString().slice(0, 10),
    rent: (row) => ({ amount: Number(row['Monthly Rent']), currency: 'USD' }),
  },
})
```

## What it builds
The [SoftwareBuilder](/code/builders/software) compiles the file into one Mapping.

- a `Mapping` from the Source's fields to the Noun's properties
- each imported row resolves with `Thing.resolve`, so a re-import updates and never duplicates
- an Integration's actions arrive as [Verbs](/business/nouns/verb) through it

## Good to know
- A row that fails a type is set aside with its reason, never dropped.
- [Integrations](/systems) lists what each [System](/business/nouns/system) connects to.