mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
Merge branch 'feat/refresh' into feat/completed-share-link
This commit is contained in:
11
packages/prisma/guards/is-extended-document-status.ts
Normal file
11
packages/prisma/guards/is-extended-document-status.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { ExtendedDocumentStatus } from '../types/extended-document-status';
|
||||
|
||||
export const isExtendedDocumentStatus = (value: unknown): value is ExtendedDocumentStatus => {
|
||||
if (typeof value !== 'string') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We're using the assertion for a type-guard so it's safe to ignore the eslint warning
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
return Object.values(ExtendedDocumentStatus).includes(value as ExtendedDocumentStatus);
|
||||
};
|
||||
5
packages/prisma/tsconfig.json
Normal file
5
packages/prisma/tsconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "@documenso/tsconfig/react-library.json",
|
||||
"include": ["."],
|
||||
"exclude": ["dist", "build", "node_modules"]
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
import { Document, Recipient } from '@documenso/prisma/client';
|
||||
|
||||
export type DocumentWithReciepient = Document & {
|
||||
export type DocumentWithRecipient = Document & {
|
||||
Recipient: Recipient[];
|
||||
};
|
||||
|
||||
12
packages/prisma/types/document.ts
Normal file
12
packages/prisma/types/document.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { Document, Recipient } from '@documenso/prisma/client';
|
||||
|
||||
export type DocumentWithRecipientAndSender = Omit<Document, 'document'> & {
|
||||
recipient: Recipient;
|
||||
sender: {
|
||||
id: number;
|
||||
name: string | null;
|
||||
email: string;
|
||||
};
|
||||
subject: string;
|
||||
description: string;
|
||||
};
|
||||
10
packages/prisma/types/extended-document-status.ts
Normal file
10
packages/prisma/types/extended-document-status.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { DocumentStatus } from '@prisma/client';
|
||||
|
||||
export const ExtendedDocumentStatus = {
|
||||
...DocumentStatus,
|
||||
INBOX: 'INBOX',
|
||||
ALL: 'ALL',
|
||||
} as const;
|
||||
|
||||
export type ExtendedDocumentStatus =
|
||||
(typeof ExtendedDocumentStatus)[keyof typeof ExtendedDocumentStatus];
|
||||
Reference in New Issue
Block a user