private OperatingContextRM CreateOperatingContextForCustomer(Commands.V1.OperatingContext.CreateForCustomer cmd)
        {
            OperatingContext operatingContext = new OperatingContext(_operatingContexts++, OperatingContextTypeLookup.OperatingContextTypes[cmd.OperatingContextType],
                                                                     cmd.FacilityId, cmd.ThirdPartySupplierId, ExternalAssociateTypeLookup.ActingAssociateTypes[cmd.ActingBATypeID],
                                                                     cmd.CertificationId, cmd.IsDeactivating, cmd.LegacyId, cmd.PrimaryAddressId,
                                                                     cmd.PrimaryEmailId, cmd.PrimaryPhoneId, cmd.ProviderType, cmd.StartDate, StatusCodeLookup.StatusCodes[cmd.Status]);

            if (_repository.OperatingContextExistsForCustomer(operatingContext, cmd.CustomerId))
            {
                throw new InvalidOperationException($"Operating context already exists for Customer {cmd.CustomerId}");
            }

            _repository.AddOperatingContextForCustomer(operatingContext, cmd.CustomerId);

            return(Conversions.GetOperatingContextRM(operatingContext));
        }