import {
  assets,
  conversation_properties,
  conversations,
  Events,
  group_memberships,
  messages,
  reactions,
  users,
} from '@db/schema';
import {InferInsertModel, InferSelectModel} from 'drizzle-orm';

export type SelectMessage = InferSelectModel<typeof messages>;

export type SelectMessageWithAssets = SelectMessage & {
  assets?: SelectAsset[];
};

export type SelectMessageWithAssetsReactions = SelectMessageWithAssets & {
  reactions?: SelectReaction[];
};

export type InsertMessage = InferInsertModel<typeof messages>;

export type SelectAsset = InferSelectModel<typeof assets>;

export type InsertAsset = InferInsertModel<typeof assets>;

export type SelectConversation = InferSelectModel<typeof conversations>;

export type InsertConversation = InferInsertModel<typeof conversations>;

export type SelectConversationProperties = InferSelectModel<
  typeof conversation_properties
>;

export type InsertConversationProperties = InferInsertModel<
  typeof conversation_properties
>;

export type SelectUser = InferSelectModel<typeof users>;

export type InsertUser = InferInsertModel<typeof users>;

export type InsertGroupMembership = InferInsertModel<typeof group_memberships>;

export type SelectGroupMembership = InferSelectModel<typeof group_memberships>;

export type InsertReaction = InferInsertModel<typeof reactions>;

export type SelectReaction = InferSelectModel<typeof reactions>;

export type InsertEvent = InferInsertModel<typeof Events>;
