refactor: Extract certificate template to separate file with template selection
- Move HTML template to src/templates/certificates/AIcertifikat.html
- Add template rendering with {{variable}} and {{#if}} syntax
- Add CERTIFICATE_TEMPLATES registry for multiple templates
- Accept templateName parameter in generateCertificate
- Add hasCertificate check to prevent duplicate certificates
- Add hasCertificate field to getCombinedTableData query
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,7 @@ export const getCombinedTableData = async () => {
|
||||
poznamka: registracie.poznamka,
|
||||
createdAt: registracie.createdAt,
|
||||
dokumentyCount: sql`(SELECT COUNT(*) FROM prilohy WHERE registracia_id = ${registracie.id})::int`,
|
||||
hasCertificate: sql`(SELECT COUNT(*) > 0 FROM prilohy WHERE registracia_id = ${registracie.id} AND typ_prilohy = 'certifikat')::boolean`,
|
||||
})
|
||||
.from(registracie)
|
||||
.innerJoin(ucastnici, eq(registracie.ucastnikId, ucastnici.id))
|
||||
|
||||
Reference in New Issue
Block a user