- Created a new TDocumentEnvelope base type for shared document properties - Refactored TLetterEnvelope to extend from TDocumentEnvelope - Refactored TContractEnvelope to extend from TDocumentEnvelope - Centralized common fields like version tracking, date, and formatting
65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
import * as business from "./index.js";
|
|
import * as finance from "../finance/index.js";
|
|
|
|
/**
|
|
* Letter-specific envelope extending the base document type
|
|
*/
|
|
export type TLetterEnvelope<TYPE extends string, FIELDS> = business.TDocumentEnvelope<
|
|
TYPE,
|
|
{
|
|
/**
|
|
* The incident or case ID this letter relates to
|
|
*/
|
|
incidenceId: string;
|
|
|
|
/**
|
|
* The sender of the letter
|
|
*/
|
|
from: business.TContact;
|
|
|
|
/**
|
|
* The recipient of the letter
|
|
*/
|
|
to: business.TContact;
|
|
|
|
/**
|
|
* The legal contact is the contact that is responsible for the letter
|
|
* this is often the same as the from contact, but not always
|
|
*/
|
|
legalContact?: business.TContact;
|
|
|
|
/**
|
|
* Subject line of the letter
|
|
*/
|
|
subject: string;
|
|
|
|
/**
|
|
* Cover sheet configuration for the letter
|
|
*/
|
|
coverSheet?: {
|
|
enabled: boolean;
|
|
coverSheetText: string;
|
|
/**
|
|
* if true, the cover sheet will be marked as confidential
|
|
* hinting that only authorized persons should handle the letter
|
|
*/
|
|
confidential: boolean;
|
|
};
|
|
} & FIELDS
|
|
>;
|
|
|
|
export type TLetterSimple = TLetterEnvelope<"simple", {}>;
|
|
|
|
|
|
export type TLetter = TLetterSimple;
|
|
|
|
// type: "invoice" | "notice" | "warning" | "verification" | "contract";
|
|
/* content: {
|
|
textData: string[];
|
|
invoiceData?: finance.IInvoice;
|
|
contractData?: {
|
|
id: string;
|
|
contractDate: number;
|
|
};
|
|
timesheetData: string;
|
|
}; */ |