Skip to content

Commit

Permalink
feat(Gate) - Removed placeholder values
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsilva-CGI committed Oct 19, 2023
1 parent 5985aa5 commit b2dd91b
Showing 1 changed file with 1 addition and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,15 @@

package org.eclipse.tractusx.bpdm.orchestrator.controller

import com.neovisionaries.i18n.CountryCode
import org.eclipse.tractusx.bpdm.common.dto.*
import org.eclipse.tractusx.bpdm.common.exception.BpdmUpsertLimitException
import org.eclipse.tractusx.bpdm.common.model.BusinessStateType
import org.eclipse.tractusx.bpdm.common.model.ClassificationType
import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType
import org.eclipse.tractusx.bpdm.orchestrator.config.ApiConfigProperties
import org.eclipse.tractusx.bpdm.orchestrator.service.GoldenRecordTaskService
import org.eclipse.tractusx.orchestrator.api.GoldenRecordTaskApi
import org.eclipse.tractusx.orchestrator.api.model.*
import org.eclipse.tractusx.orchestrator.api.model.AlternativePostalAddressDto
import org.eclipse.tractusx.orchestrator.api.model.PhysicalPostalAddressDto
import org.eclipse.tractusx.orchestrator.api.model.StreetDto
import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.ResponseStatus
import org.springframework.web.bind.annotation.RestController
import java.time.Instant
import java.time.LocalDateTime
import java.util.*

@RestController
Expand Down Expand Up @@ -68,119 +59,7 @@ class GoldenRecordTaskController(
}

override fun searchTaskStates(stateRequest: TaskStateRequest): TaskStateResponse {

val generic = BusinessPartnerGenericDto(
nameParts = listOf("NamePart1", "NamePart2"),
shortName = "shortname",
identifiers = listOf(
BusinessPartnerIdentifierDto(
type = "identifier-type-1",
value = "identifier-value-1",
issuingBody = "issuingBody-1"
),
BusinessPartnerIdentifierDto(
type = "identifier-type-2",
value = "identifier-value-2",
issuingBody = "issuingBody-2"
),
),
legalForm = "legal-form",
states = listOf(
BusinessPartnerStateDto(
validFrom = LocalDateTime.of(2020, 9, 22, 15, 50),
validTo = LocalDateTime.of(2023, 10, 23, 16, 40),
type = BusinessStateType.INACTIVE,
description = "business-state-description-1"
),
BusinessPartnerStateDto(
validFrom = LocalDateTime.of(2000, 8, 21, 14, 30),
validTo = LocalDateTime.of(2020, 9, 22, 15, 50),
type = BusinessStateType.ACTIVE,
description = "business-state-description-2"
)
),
classifications = listOf(
ClassificationDto(
type = ClassificationType.NACE,
code = "code-1",
value = "value-1"
),
ClassificationDto(
type = ClassificationType.NAF,
code = "code-2",
value = "value-2"
),
),
roles = listOf(
BusinessPartnerRole.CUSTOMER,
BusinessPartnerRole.SUPPLIER
),
postalAddress = PostalAddressDto(
addressType = AddressType.AdditionalAddress,
physicalPostalAddress = PhysicalPostalAddressDto(
geographicCoordinates = GeoCoordinateDto(0.5f, 0.5f, 0.5f),
country = CountryCode.DE,
administrativeAreaLevel1 = "DE-BW",
administrativeAreaLevel2 = "bw-admin-level-2",
administrativeAreaLevel3 = "bw-admin-level-3",
postalCode = "phys-postal-code",
city = "city",
district = "district",
street = StreetDto(
name = "name",
houseNumber = "house-number",
milestone = "milestone",
direction = "direction",
namePrefix = "name-prefix",
additionalNamePrefix = "add-name-prefix",
nameSuffix = "name-suffix",
additionalNameSuffix = "add-name-suffix"

),
companyPostalCode = "comp-postal-code",
industrialZone = "industrial-zone",
building = "building",
floor = "floor",
door = "door"
),
alternativePostalAddress = AlternativePostalAddressDto(
geographicCoordinates = GeoCoordinateDto(0.6f, 0.6f, 0.6f),
country = CountryCode.DE,
administrativeAreaLevel1 = "DE-BY",
postalCode = "alt-post-code",
city = "alt-city",
deliveryServiceNumber = "delivery-service-number",
deliveryServiceQualifier = "delivery-service-qualifier",
deliveryServiceType = DeliveryServiceType.PO_BOX
)
),
ownerBpnL = "BPNL_OWNER_TEST_1",
bpnL = "BPNLTEST",
bpnS = "BPNSTEST",
bpnA = "BPNATEST"
)


val valor = listOf(
TaskClientStateDto(
taskId = "12345",
businessPartnerResult = generic,
processingState = TaskProcessingStateDto(
resultState = ResultState.Success,
step = TaskStep.Clean,
stepState = StepState.Success,
errors = emptyList(),
createdAt = Instant.now(),
modifiedAt = Instant.now(),
timeout = Instant.now(),
)
)
)

return TaskStateResponse(valor)


//goldenRecordTaskService.searchTaskStates(stateRequest)
return goldenRecordTaskService.searchTaskStates(stateRequest)
}

}

0 comments on commit b2dd91b

Please sign in to comment.