'use strict';

function serializeTask(task) {
  return {
    ...task,
    completedAt: task.completedAt?.toISOString(),
    createdAt: task.createdAt.toISOString(),
    updatedAt: task.updatedAt.toISOString()
  };
}
function serializeColumn(col) {
  return {
    ...col,
    createdAt: col.createdAt.toISOString(),
    updatedAt: col.updatedAt.toISOString(),
    tasks: col.tasks.map(serializeTask)
  };
}
function serializeBoard(board) {
  return {
    ...board,
    createdAt: board.createdAt.toISOString(),
    updatedAt: board.updatedAt.toISOString(),
    columns: board.columns.map(serializeColumn)
  };
}

exports.serializeBoard = serializeBoard;
exports.serializeColumn = serializeColumn;
exports.serializeTask = serializeTask;
