using WebApp.DTOs;
using WebApp.Entities;

namespace WebApp.Mapping
{
    public static class UserMapping
    {
        public static UserSummaryDto ToUserSummaryDto(this User user)
        {
            return new UserSummaryDto(
                user.UserId,
                user.Email,
                user.FirstName,
                user.LastName,
                user.CreatedAt,
                user.IsOrganisation
            );
        }

        public static UserSummaryWithOrgIdDto ToUserSummaryWithOrgIdDto(this User user, int OrganisationId)
        {
            return new UserSummaryWithOrgIdDto(
                user.UserId,
                user.Email,
                user.FirstName,
                user.LastName,
                user.CreatedAt,
                user.IsOrganisation,
                OrganisationId
            );
        }
    }
}
