-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Orchestrator): add persistence layer
- add jpa entity model - adapted tests to use entity model where appropriate and setup a test database - added a postgres dependency to the Orchestrator chart
- Loading branch information
Showing
36 changed files
with
1,630 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...hestrator/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/entity/BpnReferenceDb.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.entity | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Embeddable | ||
import jakarta.persistence.EnumType | ||
import jakarta.persistence.Enumerated | ||
import org.eclipse.tractusx.orchestrator.api.model.BpnReferenceType | ||
|
||
@Embeddable | ||
data class BpnReferenceDb( | ||
@Column(name = "value") | ||
val referenceValue: String?, | ||
@Column(name = "desired_bpn") | ||
val desiredBpn: String?, | ||
@Enumerated(EnumType.STRING) | ||
@Column(name = "type") | ||
val referenceType: BpnReferenceType? | ||
) { | ||
enum class Scope { | ||
LegalEntity, | ||
Site, | ||
LegalAddress, | ||
SiteMainAddress, | ||
AdditionalAddress, | ||
UncategorizedAddress | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...estrator/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/entity/BusinessStateDb.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.entity | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Embeddable | ||
import jakarta.persistence.EnumType | ||
import jakarta.persistence.Enumerated | ||
import org.eclipse.tractusx.bpdm.common.model.BusinessStateType | ||
import java.sql.Timestamp | ||
|
||
@Embeddable | ||
data class BusinessStateDb( | ||
@Column(name = "valid_from") | ||
val validFrom: Timestamp?, | ||
@Column(name = "valid_to") | ||
val validTo: Timestamp?, | ||
@Enumerated(EnumType.STRING) | ||
@Column(name = "type") | ||
val type: BusinessStateType?, | ||
@Enumerated(EnumType.STRING) | ||
@Column(name = "scope", nullable = false) | ||
val scope: Scope | ||
) { | ||
enum class Scope { | ||
LegalEntity, | ||
Site, | ||
Uncategorized, | ||
LegalAddress, | ||
SiteMainAddress, | ||
AdditionalAddress, | ||
UncategorizedAddress | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...tor/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/entity/ConfidenceCriteriaDb.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.entity | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Embeddable | ||
import java.sql.Timestamp | ||
|
||
@Embeddable | ||
data class ConfidenceCriteriaDb( | ||
@Column(name = "shared_by_owner") | ||
val sharedByOwner: Boolean?, | ||
@Column(name = "checked_by_external_datasource") | ||
val checkedByExternalDataSource: Boolean?, | ||
@Column(name = "number_of_sharing_members") | ||
val numberOfSharingMembers: Int?, | ||
@Column(name = "last_confidence_check") | ||
val lastConfidenceCheckAt: Timestamp?, | ||
@Column(name = "next_confidence_check") | ||
val nextConfidenceCheckAt: Timestamp?, | ||
@Column(name = "confidence_level") | ||
val confidenceLevel: Int? | ||
) { | ||
enum class Scope { | ||
LegalEntity, | ||
Site, | ||
LegalAddress, | ||
SiteMainAddress, | ||
AdditionalAddress, | ||
UncategorizedAddress | ||
} | ||
} |
Oops, something went wrong.