import {
  propertyLocationAggregateResponse,
  PropertyType,
} from './individualProperties.interface';

export const transformGroupByResult = (
  result: propertyLocationAggregateResponse[],
) =>
  result.map((item) => ({
    area: item._id[0].locality,
    count: item.count,
  }));

// Convert to label/value array
export const propertyTypeOptions = Object.values(PropertyType).map((value) => ({
  label: value.charAt(0).toUpperCase() + value.slice(1), // Capitalize
  value,
}));
