using Microsoft.EntityFrameworkCore;
using WebApp.DTOs;
using WebApp.Entities;

namespace WebApp.Mapping;

public static class OrganizationMapping
{
    // obecnie zbędne
    //public static Organisation ToEntity(this OrganisationSummaryDto ODto)
    //{
    //    return new Organisation()
    //    {
    //        OrganisationId = ODto.OrganisationId!.Value,
    //    };
    //}

    public static OrganisationSummaryDto ToOrgSummaryDto(this Organisation org)
    {
        return new OrganisationSummaryDto(
            org.OrganisationId,
            org.Name,
            org.Description,
            org.Website
        );
    }
}
