chore: code changes based of review

This commit is contained in:
Ephraim Atta-Duncan
2024-11-21 21:21:42 +00:00
parent 31dc403500
commit 2b1b042097
10 changed files with 61 additions and 54 deletions
@@ -15,7 +15,7 @@ export const ZAddSignerSchema = z.object({
.min(1),
name: z.string(),
role: z.nativeEnum(RecipientRole),
expiry: z.date().optional(),
expiry: z.date().min(new Date(), { message: 'Expiry date must be in the future' }).optional(),
signingOrder: z.number().optional(),
actionAuth: ZMapNegativeOneToUndefinedSchema.pipe(ZRecipientActionAuthTypesSchema.optional()),
});
@@ -164,6 +164,8 @@ export function DocumentExpiryDialog({
case 'months':
expiryDate = addMonths(now, values.amount);
break;
default:
throw new Error(`Invalid unit: ${values.unit}`);
}
}
@@ -173,10 +175,10 @@ export function DocumentExpiryDialog({
expiry: expiryDate,
});
// TODO: Implement logic to update expiry when resending document
// TODO: Duncan => Implement logic to update expiry when resending document
// This should be handled on the server-side when a document is resent
// TODO: Implement logic to mark recipients as expired
// TODO: Duncan => Implement logic to mark recipients as expired
// This should be a scheduled task or part of the completion process on the server
};