feat: add multi-page support, improve template creation logic, and refine rank resolution in certificate designer

This commit is contained in:
estifanos
2026-09-02 10:43:26 +00:00
parent 92f2f16b80
commit 984dec0d6d
11 changed files with 224 additions and 48 deletions

View File

@@ -871,8 +871,15 @@ export const licensingApi = baseApi
providesTags: () => [listTag('LicenseTemplate')],
}),
getTemplateVariables: builder.query<TemplateVariable[], void>({
query: () => ({ url: '/license-templates/variables' }),
/**
* With a licence type, the palette also carries that type's own form
* answers (`form.<section>.<field>`), which issuance hands every design.
*/
getTemplateVariables: builder.query<TemplateVariable[], { licenseTypeId?: string } | void>({
query: (args) => ({
url: '/license-templates/variables',
params: args?.licenseTypeId ? { licenseTypeId: args.licenseTypeId } : {},
}),
}),
getBuiltInTemplate: builder.query<{ hbsSource: string }, void>({
@@ -902,8 +909,9 @@ export const licensingApi = baseApi
name?: string;
hbsSource?: string;
pageOptions?: TemplatePageOptions;
backgroundUrl?: string;
logoUrl?: string;
/** Null removes the artwork; undefined leaves it as stored. */
backgroundUrl?: string | null;
logoUrl?: string | null;
logoPlacement?: TemplateLogoPlacement;
fieldPlacements?: TemplateFieldPlacement[];
}

View File

@@ -727,6 +727,12 @@ export interface TemplateFieldPlacement {
text?: string;
/** Renders as `<img>` when "image" — see TemplateVariable.kind. */
type?: "text" | "image";
/**
* Zero-based page the block sits on. Absent means the first page, which is
* what every single-page design already says by saying nothing. A booklet
* (the Seaman Book) places its blocks across several.
*/
page?: number;
xPct: number;
yPct: number;
widthPct: number;