import { translatableModel } from 'store/appModels';

const roomListModel = {
  _id: true,
  createdAt: true,
  getAccounts: {
    _id: true,
    lastName: true,
    firstName: true,
    profilePicture: {
      small: true,
    },
  },
  stats: {
    unreadCounts: {
      accountId: true,
      count: true,
    },
  },
};

const roomModel = {
  ...roomListModel,
  getMessages: {
    _id: true,
    createdAt: true,
    roomId: true,
    message: true,
    file: {
      large: true,
    },
    sentBy: true,
    readBy: {
      readAt: true,
      accountId: true,
    },
  },
};

const messageModel = {
  _id: true,
  createdAt: true,
  roomId: true,
  message: true,
  file: {
    large: true,
  },
  sentBy: true,
  readBy: {
    readAt: true,
    accountId: true,
  },
};

export { messageModel, roomListModel, roomModel };
