Add account hierarchy framework with migrations, RLS policies, and UI components
This commit is contained in:
@@ -20,7 +20,7 @@ export function createDocumentGeneratorApi() {
|
||||
// Dynamic import to avoid bundle bloat in SSR
|
||||
// Actual implementation will use @react-pdf/renderer
|
||||
throw new Error(
|
||||
'PDF generation requires @react-pdf/renderer. Install it and implement the renderer in pdf-generator.service.ts'
|
||||
'PDF generation requires @react-pdf/renderer. Install it and implement the renderer in pdf-generator.service.ts',
|
||||
);
|
||||
},
|
||||
|
||||
@@ -37,7 +37,7 @@ export function createDocumentGeneratorApi() {
|
||||
}>;
|
||||
}): Promise<Uint8Array> {
|
||||
throw new Error(
|
||||
'Excel generation requires exceljs. Install it and implement in excel-generator.service.ts'
|
||||
'Excel generation requires exceljs. Install it and implement in excel-generator.service.ts',
|
||||
);
|
||||
},
|
||||
|
||||
@@ -51,7 +51,7 @@ export function createDocumentGeneratorApi() {
|
||||
mergeFields: Record<string, string>;
|
||||
}): Promise<Uint8Array> {
|
||||
throw new Error(
|
||||
'Word generation requires docx. Install it and implement in word-generator.service.ts'
|
||||
'Word generation requires docx. Install it and implement in word-generator.service.ts',
|
||||
);
|
||||
},
|
||||
|
||||
@@ -61,7 +61,12 @@ export function createDocumentGeneratorApi() {
|
||||
*/
|
||||
generateLabelsHtml(params: {
|
||||
labelFormat: string;
|
||||
records: Array<{ line1: string; line2?: string; line3?: string; line4?: string }>;
|
||||
records: Array<{
|
||||
line1: string;
|
||||
line2?: string;
|
||||
line3?: string;
|
||||
line4?: string;
|
||||
}>;
|
||||
}): string {
|
||||
const { records } = params;
|
||||
|
||||
@@ -71,14 +76,18 @@ export function createDocumentGeneratorApi() {
|
||||
|
||||
for (let i = 0; i < records.length; i += labelsPerPage) {
|
||||
const pageRecords = records.slice(i, i + labelsPerPage);
|
||||
const labels = pageRecords.map((r) => `
|
||||
const labels = pageRecords
|
||||
.map(
|
||||
(r) => `
|
||||
<div style="width:99.1mm;height:38.1mm;padding:4mm;box-sizing:border-box;overflow:hidden;font-size:10pt;font-family:Arial,sans-serif;">
|
||||
<div>${r.line1}</div>
|
||||
${r.line2 ? `<div>${r.line2}</div>` : ''}
|
||||
${r.line3 ? `<div>${r.line3}</div>` : ''}
|
||||
${r.line4 ? `<div>${r.line4}</div>` : ''}
|
||||
</div>
|
||||
`).join('');
|
||||
`,
|
||||
)
|
||||
.join('');
|
||||
|
||||
pages.push(`
|
||||
<div style="width:210mm;display:grid;grid-template-columns:1fr 1fr;gap:0;page-break-after:always;">
|
||||
|
||||
Reference in New Issue
Block a user