move database to infra

This commit is contained in:
Peter Maquiran
2024-08-27 10:15:00 +01:00
parent 7a85f8f1c5
commit c59abb7e04
25 changed files with 38 additions and 39 deletions
@@ -0,0 +1,24 @@
import { z } from "zod";
import { EntityTable } from 'Dexie';
import { zodDataUrlSchema } from "src/app/utils/zod";
import { MessageAttachmentFileType, MessageAttachmentSource } from "src/app/module/chat/data/dto/message/messageOutputDTO";
export const AttachmentTableSchema = z.object({
$id: z.number().optional(), // local id
$messageId: z.number(),
attachmentId: z.string().optional(),
file: zodDataUrlSchema,
//
fileType: z.nativeEnum(MessageAttachmentFileType),
source: z.nativeEnum(MessageAttachmentSource),
fileName: z.string().optional(),
applicationId: z.number().optional(),
docId: z.string().optional(),
mimeType: z.string().optional(),
id: z.string().optional(),
description: z.string().optional()
})
export type AttachmentTable = z.infer<typeof AttachmentTableSchema>
export type DexieAttachmentsTableSchema = EntityTable<AttachmentTable, '$id'>;
export const AttachmentTableColumn = '++$id, id, $messageId, messageId, file'