feat: generate recipients and fields based on recipients

This commit is contained in:
Ephraim Atta-Duncan
2025-11-17 01:44:22 +00:00
parent 9e0f07f806
commit dbed8b362e
15 changed files with 1539 additions and 241 deletions

View File

@ -27,7 +27,7 @@ if (loggingFilePath) {
}
export const logger = pino({
level: 'info',
level: env('LOG_LEVEL') || 'info',
transport:
transports.length > 0
? {

View File

@ -4,6 +4,8 @@ import { type Field, type Recipient, RecipientRole, SigningStatus } from '@prism
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
import { extractLegacyIds } from '../universal/id';
const UNKNOWN_RECIPIENT_NAME_PLACEHOLDER = '<UNKNOWN>';
export const formatSigningLink = (token: string) => `${NEXT_PUBLIC_WEBAPP_URL()}/sign/${token}`;
/**
@ -58,3 +60,21 @@ export const mapRecipientToLegacyRecipient = (
...legacyId,
};
};
export const sanitizeRecipientName = (name?: string | null) => {
if (!name) {
return '';
}
const trimmedName = name.trim();
if (!trimmedName) {
return '';
}
if (trimmedName.toUpperCase() === UNKNOWN_RECIPIENT_NAME_PLACEHOLDER) {
return '';
}
return trimmedName;
};