import type { messaging } from "@folo-services/drizzle"
import type { InferSelectModel } from "drizzle-orm"

import type { EmptyResponse, SerializedModel, SuccessResponse } from "../../types"

// Database types
type MessagingToken = SerializedModel<InferSelectModel<typeof messaging>>

// Channel enum
export type MessagingChannel =
  | "macos" |
  "windows" |
  "linux" |
  "ios" |
  "android" |
  "web" |
  "desktop"

// Request types
export interface CreateMessagingTokenRequest {
  token: string
  channel: MessagingChannel
}

export interface DeleteMessagingTokenRequest {
  channel: MessagingChannel
}

export interface TestMessagingRequest {
  channel?: string
}

// Response types
export type GetMessagingTokensResponse = SuccessResponse<MessagingToken[]>
export type CreateMessagingTokenResponse = EmptyResponse
export type DeleteMessagingTokenResponse = EmptyResponse
export type TestMessagingResponse = EmptyResponse
