import { ResponseDataEntity, smaproFetch } from './index';

export enum ServiceTypeParams {
  wechatPublicV = 1,
  wechatAppV = 2,
  aliPublicV = 3,
  aliAppV = 4,
}

export type ServiceParams = {
  areaId: number;
  type: ServiceTypeParams;
};
export type Service = {
  serviceId: number;
  serviceName: string;
};

export const fetchAreaService = (
  data: ServiceParams,
): Promise<ResponseDataEntity<Service[]>> =>
  smaproFetch({
    url: `/smpro/areaServiceConfigs/${data.areaId}/${data.type}`,
  });
