export type MessageType = "text" | "offer" | "system";
export type OfferStatus = "pending" | "accepted" | "rejected" | "countered";
export type UserRole = "buyer" | "seller";
export type ListingStatus = "available" | "sold" | "reserved";

export interface OfferData {
  amount: number;
  originalPrice: number;
  status: OfferStatus;
  message?: string;
}

export interface Message {
  id: string;
  conversationId: string;
  senderId: string;
  type: MessageType;
  content: string;
  timestamp: string;
  readAt?: string;
  offer?: OfferData;
}

export interface Conversation {
  id: string;
  listingId: string;
  listingSlug: string;
  listingTitle: string;
  listingImage: string;
  listingPrice: number;
  listingCondition: string;
  listingCity: string;
  listingStatus: ListingStatus;
  otherUserId: string;
  otherUserName: string;
  otherUserAvatar: string;
  otherUserVerified: boolean;
  otherUserIsOnline: boolean;
  otherUserLastSeen?: string;
  myRole: UserRole;
  lastMessage: string;
  lastMessageTime: string;
  unreadCount: number;
  isPinned: boolean;
  isArchived: boolean;
  isBlocked: boolean;
  messages: Message[];
}
