using AgriculturalPlatform.Api.Models; namespace AgriculturalPlatform.Api.Dtos; public record OrgDto( int Id, string Type, string Name, int? ParentId, string? ParentName, string ContactPerson, string Phone, string Address, string TaxNo, bool IsActive, DateTime CreatedAt); public record OrgSaveRequest( string Type, string Name, int? ParentId, string ContactPerson, string Phone, string Address, string TaxNo, bool IsActive = true); public static class OrgMappers { public static OrgDto ToDto(this Organization o) => new( o.Id, o.Type.ToString(), o.Name, o.ParentId, o.Parent?.Name, o.ContactPerson, o.Phone, o.Address, o.TaxNo, o.IsActive, o.CreatedAt); public static OrgDto[] ToDtos(this IEnumerable items) => items.Select(ToDto).ToArray(); }