// adapters/responses/userProfile.adapter.js
const dealCardAdapter = require("./dealCard.adapter")
const dealCommentAdapter = require("./comment.adapter")
const publicUserAdapter = require("./publicUser.adapter") // yoksa yaz
const userProfileStatsAdapter = require("./userProfileStats.adapter")

function mapUserProfileToResponse({ user, deals, comments, stats }) {
  return {
    user: publicUserAdapter.mapUserToPublicUserDetailsResponse(user),
    stats: userProfileStatsAdapter.mapUserProfileStatsToResponse(stats),
    deals: deals.map(dealCardAdapter.mapDealToDealCardResponse),
    comments: comments.map(dealCommentAdapter.mapCommentToUserCommentResponse),
  }
}

module.exports = { mapUserProfileToResponse }
