> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://cla-demo.postmansolutions.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://cla-demo.postmansolutions.com/_mcp/server.

# Scope

## In Scope

| Responsibility                             | Detail                                                                                                                  |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| **Subscription to classified-file events** | Receives `FileClassifiedEvent` messages from the `classified-file` Azure Service Bus topic                              |
| **PDF downloading**                        | Fetches the original PDF from Azure Blob Storage using the URL provided in the event                                    |
| **Classification metadata downloading**    | Fetches the JSON classification output from Azure Blob Storage                                                          |
| **PDF page-range validation**              | Ensures classification data is internally consistent (page counts, range boundaries, overlaps)                          |
| **PDF splitting**                          | Uses `pdf-lib` to extract per-form page ranges into separate PDF buffers                                                |
| **Child-file uploading**                   | Uploads each split PDF to the file-intake service, which assigns each file a new `fileId` and stores it in blob storage |
| **split-file event publishing**            | Publishes one `FileSplitFileEvent` per split file to the `split-file` topic                                             |
| **Split manifest creation**                | Generates a JSON manifest listing all split files and uploads it to the `splits` blob container                         |
| **split-file-result event publishing**     | Publishes one `FileSplitFileResultEvent` (the manifest summary) to the `split-file-result` topic                        |
| **Error / problem event publishing**       | On any failure, publishes a `ProblemEvent` to the `problem` topic so the platform's status service can track failures   |
| **Job status tracking**                    | Records a job row in the SQL database with status `Started → Completed` (or `Failed`) and the manifest blob URL         |

---

## Out of Scope

| Not this service's job                                         | Handled by                                                 |
| -------------------------------------------------------------- | ---------------------------------------------------------- |
| Classifying documents (deciding what forms are on which pages) | Classifier service (upstream)                              |
| Storing or managing the original uploaded file                 | File Intake service                                        |
| Extracting data from split PDFs                                | Extractor services (downstream)                            |
| **Routing events to the correct extractor**                    | Extractor is **not yet** subscribe to **split-file** topic |