# lambda-sme-ext-meta

This project contains lambdas used for the creation of DDEX extended metadata.

## Setup

### Prerequisites
* **OA_USER** environment variable must be set
* **AWS credentials** configured (for runtime environment)
* [Docker](https://docs.docker.com/get-docker/) installed

### Docker-based Development (Recommended)
* Clone this repository
* Navigate to the lambda you want to work on in `lambda/`
* Ensure OA_USER is set in your environment

### Local Development
* Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
* Clone this repository
* Navigate to `lambda/sme_ext_meta_generate_ddex/`
* Install dependencies: `uv sync`

## Running

### Start Container
```
$ make run
```

### Calling the lambda
Using Postman or your favourite HTTP request method, invoke the following:

```
http://localhost:9000/2015-03-31/functions/function/invocations
```

Include a POST body, such as:
```
{
  "upc": "886445897142"
}
```

## Linting and Testing

Run the full test suite with linting:
```
$ make test
```

Run only tests (skip linting):
```
$ make dev_test
```

Run only linting:
```
$ make dev_lint
```

Auto-fix linting issues and format code:
```
$ make fix
```

Format code only:
```
$ make format
```
