# Models

## The JobRequest object

```json
{"openapi":"3.0.0","info":{"title":"Invoice Service","version":"1.0.0"},"components":{"schemas":{"JobRequest":{"type":"object","properties":{"orderIds":{"type":"array","description":"A list of order IDs for which the invoices should be created.","items":{"type":"string"}},"jobType":{"enum":["AUTOMATIC","MANUAL"],"type":"string","description":"A job type determines if the orders are searched automatically based on parameters configured in configuration service or are manually provided in orderIds array."}},"required":["jobType"]}}}}
```

## The JobCreationResponse object

```json
{"openapi":"3.0.0","info":{"title":"Invoice Service","version":"1.0.0"},"components":{"schemas":{"JobCreationResponse":{"type":"object","properties":{"jobId":{"type":"string","description":"The created job ID."}}}}}}
```

## The JobStatusResponse object

```json
{"openapi":"3.0.0","info":{"title":"Invoice Service","version":"1.0.0"},"components":{"schemas":{"JobStatusResponse":{"type":"object","properties":{"jobStatus":{"description":"Status of the processed job. Possible values: `DONE`,` IN_PROGRESS`","enum":["DONE","IN_PROGRESS"],"type":"string"},"jobType":{"description":"Job type determines if the orders are provided manually or searched by a parametrized query.","enum":["AUTOMATIC","MANUAL"],"type":"string"},"orders":{"type":"array","items":{"type":"object","properties":{"orderId":{"description":"The ID of the processed order.","type":"string"},"orderStatus":{"description":"Status determining if the order was processed successfully.","enum":["SUCCESS","FAILURE","PENDING"],"type":"string"},"message":{"description":"Information about the result of order processing.","type":"string"},"downloadLink":{"description":"URL to the generated invoice PDF.","type":"string"},"invoiceNumber":{"description":"Number of the generated invoice.","type":"string"}}}}}}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.0.0","info":{"title":"Invoice Service","version":"1.0.0"},"components":{"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string","description":"A descriptive error message for debugging."},"code":{"type":"string","description":"Original HTTP error code. It should be consistent with the HTTP response code."},"detailInfo":{"type":"string","description":"More details about the error (if available)."}}}}}}
```
