Skip to content

Commit

Permalink
changed origin code to request origin
Browse files Browse the repository at this point in the history
  • Loading branch information
zygis0408 committed Dec 12, 2022
1 parent 6b67d74 commit 77596c7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,13 @@ private IEntityMetadata CreateCompanyMetadata(IExternalSearchQueryResult<Company
/// <returns>The origin entity code.</returns>
private EntityCode GetLocationOriginEntityCode(IExternalSearchQueryResult<LocationDetailsResponse> resultItem, IExternalSearchRequest request)
{
return new EntityCode(request.EntityMetaData.EntityType, this.GetCodeOrigin(), resultItem.Id);
return new EntityCode(request.EntityMetaData.EntityType, this.GetCodeOrigin(), request.EntityMetaData.OriginEntityCode.Value);
}

private EntityCode GetOrganizationOriginEntityCode(IExternalSearchQueryResult<CompanyDetailsResponse> resultItem)
private EntityCode GetOrganizationOriginEntityCode(IExternalSearchQueryResult<CompanyDetailsResponse> resultItem, IExternalSearchRequest request)
{

return new EntityCode(EntityType.Organization, this.GetCodeOrigin(), resultItem.Id);
return new EntityCode(request.EntityMetaData.EntityType, this.GetCodeOrigin(), request.EntityMetaData.OriginEntityCode.Value);
}

/// <summary>Gets the code origin.</summary>
Expand Down Expand Up @@ -536,7 +536,7 @@ private void PopulateLocationMetadata(IEntityMetadata metadata, IExternalSearchQ

private void PopulateCompanyMetadata(IEntityMetadata metadata, IExternalSearchQueryResult<CompanyDetailsResponse> resultItem, IExternalSearchRequest request)
{
var code = this.GetOrganizationOriginEntityCode(resultItem);
var code = this.GetOrganizationOriginEntityCode(resultItem, request);

metadata.EntityType = EntityType.Organization;
metadata.Name = request.EntityMetaData.Name;
Expand Down

0 comments on commit 77596c7

Please sign in to comment.