/** * Standard in-app EOI (Letter of Intent) template. * * Rendered in-app via pdfme (HTML → PDF pipeline) for ports that prefer the * in-app PDF generation path over the Documenso template flow. * * Merge tokens use the {{section.field}} convention and match the * `EoiContext` shape produced by `buildEoiContext` in * `src/lib/services/eoi-context.ts`. The tokens are resolved by * `resolveTemplate` (Task 11.4 wires the expanded resolver). * * Related: * - Field mapping: docs/eoi-documenso-field-mapping.md * - Context builder: src/lib/services/eoi-context.ts * - Schema: document_templates (src/lib/db/schema/documents.ts) */ export const STANDARD_EOI_MERGE_FIELDS: string[] = [ 'date.today', 'date.year', 'port.name', 'port.defaultCurrency', 'client.fullName', 'client.nationality', 'client.primaryEmail', 'client.primaryPhone', 'client.address.street', 'client.address.city', 'client.address.country', 'yacht.name', 'yacht.hullNumber', 'yacht.flag', 'yacht.yearBuilt', 'yacht.lengthFt', 'yacht.widthFt', 'yacht.draftFt', 'yacht.lengthM', 'yacht.widthM', 'yacht.draftM', 'company.name', 'company.legalName', 'company.taxId', 'company.billingAddress', 'owner.type', 'owner.name', 'owner.legalName', 'berth.mooringNumber', 'berth.area', 'berth.lengthFt', 'berth.price', 'berth.priceCurrency', 'berth.tenureType', 'interest.stage', 'interest.leadCategory', 'interest.dateFirstContact', 'interest.notes', ]; export function getStandardEoiTemplateHtml(): string { return `
This Expression of Interest (the “EOI”) is entered into between {{port.name}} and the Applicant named below, and records the Applicant’s non-binding intent to proceed toward a berth acquisition at the port. It is subject to subsequent definitive documentation.
| Full name | {{client.fullName}} |
| Nationality | {{client.nationality}} |
| {{client.primaryEmail}} | |
| Phone | {{client.primaryPhone}} |
| Address |
{{client.address.street}} {{client.address.city}} {{client.address.country}} |
| Name | {{yacht.name}} |
| Hull number | {{yacht.hullNumber}} |
| Flag | {{yacht.flag}} |
| Year built | {{yacht.yearBuilt}} |
| Length (ft / m) | {{yacht.lengthFt}} ft / {{yacht.lengthM}} m |
| Beam (ft / m) | {{yacht.widthFt}} ft / {{yacht.widthM}} m |
| Draft (ft / m) | {{yacht.draftFt}} ft / {{yacht.draftM}} m |
Owner type: {{owner.type}}
Owner name: {{owner.name}}
(legal: {{owner.legalName}})
| Company name | {{company.name}} |
| Legal name | {{company.legalName}} |
| Tax ID | {{company.taxId}} |
| Billing address | {{company.billingAddress}} |
The company block is populated only where the yacht is company-owned; for client-owned yachts these fields render empty.
| Mooring number | {{berth.mooringNumber}} |
| Area | {{berth.area}} |
| Length | {{berth.lengthFt}} ft |
| Price | {{berth.price}} {{berth.priceCurrency}} |
| Tenure type | {{berth.tenureType}} |
| Pipeline stage | {{interest.stage}} |
| Lead category | {{interest.leadCategory}} |
| First contact | {{interest.dateFirstContact}} |
| Notes | {{interest.notes}} |