mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
Improves the existing document rejection process by actually marking a document as completed cancelling further actions. ## Related Issue N/A ## Changes Made - Added a new rejection status for documents - Updated a million areas that check for document completion - Updated email sending, so rejection is confirmed for the rejecting recipient while other recipients are notified that the document is now cancelled. ## Testing Performed - Ran the testing suite to ensure there are no regressions. - Performed manual testing of current core flows.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import type { MessageDescriptor } from '@lingui/core';
|
|
import { msg } from '@lingui/core/macro';
|
|
import { DocumentDistributionMethod, DocumentStatus } from '@prisma/client';
|
|
|
|
export const DOCUMENT_STATUS: {
|
|
[status in DocumentStatus]: { description: MessageDescriptor };
|
|
} = {
|
|
[DocumentStatus.COMPLETED]: {
|
|
description: msg`Completed`,
|
|
},
|
|
[DocumentStatus.REJECTED]: {
|
|
description: msg`Rejected`,
|
|
},
|
|
[DocumentStatus.DRAFT]: {
|
|
description: msg`Draft`,
|
|
},
|
|
[DocumentStatus.PENDING]: {
|
|
description: msg`Pending`,
|
|
},
|
|
};
|
|
|
|
type DocumentDistributionMethodTypeData = {
|
|
value: DocumentDistributionMethod;
|
|
description: MessageDescriptor;
|
|
};
|
|
|
|
export const DOCUMENT_DISTRIBUTION_METHODS: Record<string, DocumentDistributionMethodTypeData> = {
|
|
[DocumentDistributionMethod.EMAIL]: {
|
|
value: DocumentDistributionMethod.EMAIL,
|
|
description: msg`Email`,
|
|
},
|
|
[DocumentDistributionMethod.NONE]: {
|
|
value: DocumentDistributionMethod.NONE,
|
|
description: msg`None`,
|
|
},
|
|
} satisfies Record<DocumentDistributionMethod, DocumentDistributionMethodTypeData>;
|