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,21 @@
import { z } from "zod";
import { EntityTable } from 'Dexie';
import { RoomType } from "src/app/core/chat/entity/group";
export const RoomTableSchema = z.object({
id: z.string(),
roomName: z.string(),
createdBy: z.object({
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string().email(),
userPhoto: z.string().nullable().optional()// api check
}),
createdAt: z.any(),
expirationDate: z.any().nullable(),
roomType: z.nativeEnum(RoomType)
})
export type RoomTable = z.infer<typeof RoomTableSchema>
export type DexieRoomsTable = EntityTable<RoomTable, 'id'>;
export const RoomTableColumn = 'id, createdBy, roomName, roomType, expirationDate, lastMessage'