- 統合した拠点や組織に対し、帝国データバンク情報などを付与する事 - エンリッチ⽤のデータソースは社内の別チームが管理している - Data Hub はそれを API で受け取っている エンリッチ処理群 Data Hubチーム エンリッチ⽤ データソース 別チームの管轄 REST API API A API C API B API D
= await _apiClient.GetBusinessLocationsByOrganizationId.ExecuteAsync(organizationId, cancellationToken); if (result.IsErrorResult()) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(result.Errors); var organization = result.Data?.Organization; if (organization is null) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(new List<BusinessLocation>()); return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(organization.BusinessLocations.Edges.Select(x => { var n = x.Node; return new BusinessLocation { BusinessLocationId = n.BusinessLocationId, OrganizationId = n.OrganizationId, Name = n.Name, Address = n.Address }; }).ToList());
await _apiClient.GetBusinessLocationsByOrganizationId.ExecuteAsync(organizationId, cancellationToken); if (result.IsErrorResult()) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(result.Errors); var organization = result.Data?.Organization; if (organization is null) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(new List<BusinessLocation>()); return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(organization.BusinessLocations.Edges.Select(x => { var n = x.Node; return new BusinessLocation { BusinessLocationId = n.BusinessLocationId, OrganizationId = n.OrganizationId, Name = n.Name, Address = n.Address }; }).ToList());
await _apiClient.GetBusinessLocationsByOrganizationId.ExecuteAsync(organizationId, cancellationToken); if (result.IsErrorResult()) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(result.Errors); var organization = result.Data?.Organization; if (organization is null) return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(new List<BusinessLocation>()); return new ApiClient.Models.Response<IReadOnlyList<BusinessLocation>>(organization.BusinessLocations.Edges.Select(x => { var n = x.Node; return new BusinessLocation { BusinessLocationId = n.BusinessLocationId, OrganizationId = n.OrganizationId, Name = n.Name, Address = n.Address }; }).ToList());
new GetBusinessLocationsByOrganizationId_Organization_Organization(“organization_id”, new GetBusinessLocationsBySoc_Organization_BusinessLocations_BusinessLocationConnection( new List<IGetBusinessLocationsBySoc_Organization_BusinessLocations_Edges> { new GetBusinessLocationsBySoc_Organization_BusinessLocations_Edges_BusinessLocationEdge( new GetBusinessLocationsByOrganizationId_Organization_BusinessLocations_Edges_Node_BusinessLocation(“organization _id”, "business_location_id", "business_location_name", “test_address”))), })); var mockApiClient = new Mock<IApiClient>(); var mockResponse = new Mock<IOperationResult<IGetBusinessLocationsByOrganizationIdResult>>(); mockResponse.Setup(x => x.Errors).Returns(Array.Empty<IClientError>()); mockResponse.Setup(x => x.Data).Returns( new GetBusinessLocationsBySocResult(response)); mockApiClient .Setup(x => x.GetBusinessLocationsByOrganizationId.ExecuteAsync(“organization_id”, It.IsAny<CancellationToken>())) .ReturnsAsync(mockResponse.Object);
new GetBusinessLocationsByOrganizationId_Organization_Organization(“organization_id”, new GetBusinessLocationsBySoc_Organization_BusinessLocations_BusinessLocationConnection( new List<IGetBusinessLocationsBySoc_Organization_BusinessLocations_Edges> { new GetBusinessLocationsBySoc_Organization_BusinessLocations_Edges_BusinessLocationEdge( new GetBusinessLocationsByOrganizationId_Organization_BusinessLocations_Edges_Node_BusinessLocation(“organization _id”, "business_location_id", "business_location_name", “test_address”))), })); var mockApiClient = new Mock<IApiClient>(); var mockResponse = new Mock<IOperationResult<IGetBusinessLocationsByOrganizationIdResult>>(); mockResponse.Setup(x => x.Errors).Returns(Array.Empty<IClientError>()); mockResponse.Setup(x => x.Data).Returns( new GetBusinessLocationsBySocResult(response)); mockApiClient .Setup(x => x.GetBusinessLocationsByOrganizationId.ExecuteAsync(“organization_id”, It.IsAny<CancellationToken>())) .ReturnsAsync(mockResponse.Object);