import { ServiceResponse , ServiceResult , ServiceException } from '@mds-core/mds-service-helpers' ; import logger from '@mds-core/mds-logger' ; import { RepositoryError } from '@mds-core/mds-repository' ; import { JurisdictionRepository } from '../repository' ; import { JurisdictionDomainModel , JurisdictionIdType } from '../../@types' ; export const deleteJurisdiction = async ( jurisdiction_id ) : Promise < ServiceResponse < Pick < JurisdictionDomainModel , 'jurisdiction_id' > > > => { try { const deleted = await JurisdictionRepository . deleteJurisdiction ( jurisdiction_id ) ; return ServiceResult ( deleted ) ; } catch ( error ) { const exception = ServiceException ( 'Error Deleting Jurisdiction' , RepositoryError ( error ) ) ; logger . error ( exception , error ) ; return exception ; } } ;