Files
sign/packages/lib/constants/recipient-roles.ts

49 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-08-27 20:34:39 +09:00
import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/macro';
import { RecipientRole } from '@documenso/prisma/client';
2024-02-15 18:20:10 +11:00
export const RECIPIENT_ROLES_DESCRIPTION = {
[RecipientRole.APPROVER]: {
2024-08-27 20:34:39 +09:00
actionVerb: msg`Approve`,
actioned: msg`Approved`,
progressiveVerb: msg`Approving`,
roleName: msg`Approver`,
2024-11-08 00:33:48 +09:00
roleNamePlural: msg`Approvers`,
2024-08-27 20:34:39 +09:00
},
[RecipientRole.CC]: {
actionVerb: msg`CC`,
actioned: msg`CC'd`,
progressiveVerb: msg`CC`,
roleName: msg`Cc`,
2024-11-08 00:33:48 +09:00
roleNamePlural: msg`Ccers`,
2024-08-27 20:34:39 +09:00
},
[RecipientRole.SIGNER]: {
actionVerb: msg`Sign`,
actioned: msg`Signed`,
progressiveVerb: msg`Signing`,
roleName: msg`Signer`,
2024-11-08 00:33:48 +09:00
roleNamePlural: msg`Signers`,
2024-08-27 20:34:39 +09:00
},
[RecipientRole.VIEWER]: {
actionVerb: msg`View`,
actioned: msg`Viewed`,
progressiveVerb: msg`Viewing`,
roleName: msg`Viewer`,
roleNamePlural: msg`Viewers`,
},
2024-02-15 18:20:10 +11:00
} satisfies Record<keyof typeof RecipientRole, unknown>;
export const RECIPIENT_ROLE_TO_EMAIL_TYPE = {
[RecipientRole.SIGNER]: `SIGNING_REQUEST`,
[RecipientRole.VIEWER]: `VIEW_REQUEST`,
[RecipientRole.APPROVER]: `APPROVE_REQUEST`,
} as const;
export const RECIPIENT_ROLE_SIGNING_REASONS = {
2024-08-27 20:34:39 +09:00
[RecipientRole.SIGNER]: msg`I am a signer of this document`,
[RecipientRole.APPROVER]: msg`I am an approver of this document`,
2024-08-27 23:22:27 +09:00
[RecipientRole.CC]: msg`I am required to receive a copy of this document`,
2024-08-27 20:34:39 +09:00
[RecipientRole.VIEWER]: msg`I am a viewer of this document`,
} satisfies Record<keyof typeof RecipientRole, MessageDescriptor>;