-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Api): add confidence criteria fields to generic business partner…
… model - add confidence criteria fields to generic API DTOs - added persistence for the confidence criteria in the Gate - changed test and test values accordingly - made adjustments to the common base DTO interfaces for better integration
- Loading branch information
Showing
24 changed files
with
305 additions
and
58 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
44 changes: 44 additions & 0 deletions
44
...-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/ConfidenceCriteria.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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 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.gate.entity.generic | ||
|
||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.Table | ||
import org.eclipse.tractusx.bpdm.common.model.BaseEntity | ||
import java.time.LocalDateTime | ||
|
||
|
||
@Entity | ||
@Table(name = "confidence_criteria") | ||
class ConfidenceCriteria( | ||
@Column(name = "shared_by_owner", nullable = false) | ||
val sharedByOwner: Boolean, | ||
@Column(name = "checked_by_external_data_source", nullable = false) | ||
val checkedByExternalDataSource: Boolean, | ||
@Column(name = "number_of_business_partners", nullable = false) | ||
val numberOfBusinessPartners: Int, | ||
@Column(name = "last_confidence_check_at", nullable = false) | ||
val lastConfidenceCheckAt: LocalDateTime, | ||
@Column(name = "next_confidence_check_at", nullable = false) | ||
val nextConfidenceCheckAt: LocalDateTime, | ||
@Column(name = "confidence_level", nullable = false) | ||
val confidenceLevel: Int, | ||
) : BaseEntity() |
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
28 changes: 28 additions & 0 deletions
28
bpdm-gate/src/main/resources/db/migration/V5_0_0_2__create_confidence_criteria.sql
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,28 @@ | ||
CREATE TABLE confidence_criteria( | ||
id BIGINT NOT NULL, | ||
created_at TIMESTAMP WITH time zone NOT NULL, | ||
updated_at TIMESTAMP WITH time zone NOT NULL, | ||
uuid UUID NOT NULL, | ||
shared_by_owner boolean NOT NULL, | ||
checked_by_external_data_source boolean NOT NULL, | ||
number_of_business_partners INT NOT NULL, | ||
last_confidence_check_at TIMESTAMP NOT NULL, | ||
next_confidence_check_at TIMESTAMP NOT NULL, | ||
confidence_level INT NOT NULL, | ||
CONSTRAINT pk_confidence_criteria PRIMARY KEY (id) | ||
); | ||
|
||
ALTER TABLE business_partners | ||
ADD COLUMN legal_entity_confidence_id BIGINT, | ||
ADD COLUMN site_confidence_id BIGINT, | ||
ADD COLUMN address_confidence_id BIGINT; | ||
|
||
ALTER TABLE business_partners | ||
ADD CONSTRAINT fk_business_partners_confidence_l FOREIGN KEY (legal_entity_confidence_id) REFERENCES confidence_criteria (id), | ||
ADD CONSTRAINT fk_business_partners_confidence_s FOREIGN KEY (site_confidence_id) REFERENCES confidence_criteria (id), | ||
ADD CONSTRAINT fk_business_partners_confidence_a FOREIGN KEY (address_confidence_id) REFERENCES confidence_criteria (id); | ||
|
||
|
||
|
||
|
||
|
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
Oops, something went wrong.