import { IrsBrokerPreconfigDto } from '@amc-udk/types' export const PreconfigUtils = { createPrimaryKey: (serviceType: string, customized: boolean, userName: string): string => { return `${serviceType}/${customized}/${userName}` }, setPrimaryKey: (dto: IrsBrokerPreconfigDto): IrsBrokerPreconfigDto => { dto.id = PreconfigUtils.createPrimaryKey(dto.serviceType, dto.customized, dto.voter) return dto }, parsePrimaryKey: (keyInString: string): any => { const [serviceType, customized, voter] = keyInString.split('/') return { serviceType, customized, voter, } }, }