```plantuml
actor client
client -> omi : send documents
alt current version
omi -> client : sent
alt @async 30s+
omi -> document : document merging instruction[]
document-> omi : merged pdfs[]
alt for each unit/pdf
omi -> messages : create messages with pdf URL
end
end
end
alt NEXT alt 2
alt for each unit its merging instructions
omi -> messages : create messages with document merging instructions []
alt @async
messages -> document : create merged pdf
document -> messages : merged pdf
end
end
omi -> client : sent
end
```
# Document merging instruction
## Supports
1. simple URL (does nothing)
2. render template with data
3. render template/data + watermark
4. MERGING
## Examples from OMI (owners meeting invitation)
1. Cover letter (template+watermark+data)
2. Agenda Items (template+data)
3. OPTIONAL: Add HGA documents per unit (with url)
5. OPTIONAL: Add EP documents per unit (with url)
6. OPTIONAL: Add HGA annex document (template+data)
7. OPTIONAL: All unit additional document (with url)
8. OPTIONAL: Specific unit additional document (with url)
# P&L Report requirements
1. Generate 1 report that would apply to multiple people
2. Send out the 1 report to multiple contacts
# Questions
1. DocumentMergingDto data field save?
2. separate name?
3. Save each sub document?
4. Casavi send multiple documents at once?