-
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.
Merge pull request #611 from catenax-ng/feat/Request_Cleaning_for_BPN…
…_Update feat(gate): Request Cleaning for BPN Update
- Loading branch information
Showing
15 changed files
with
426 additions
and
18 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
60 changes: 60 additions & 0 deletions
60
bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/SyncRecord.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,60 @@ | ||
/******************************************************************************* | ||
* 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 | ||
|
||
import jakarta.persistence.* | ||
import org.eclipse.tractusx.bpdm.common.model.BaseEntity | ||
import org.eclipse.tractusx.bpdm.common.model.BaseSyncRecord | ||
import org.eclipse.tractusx.bpdm.common.model.SyncStatus | ||
import java.time.Instant | ||
|
||
@Entity | ||
@Table(name = "sync_records") | ||
class SyncRecord( | ||
@Enumerated(EnumType.STRING) | ||
@Column(name = "type", nullable = false, unique = true) | ||
override var type: SyncType, | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "status", nullable = false) | ||
override var status: SyncStatus, | ||
|
||
@Column(name = "from_time", nullable = false) | ||
override var fromTime: Instant, | ||
|
||
@Column(name = "progress", nullable = false) | ||
override var progress: Float = 0f, | ||
|
||
@Column(name = "count", nullable = false) | ||
override var count: Int = 0, | ||
|
||
@Column(name = "status_details") | ||
override var errorDetails: String? = null, | ||
|
||
@Column(name = "save_state") | ||
override var errorSave: String? = null, | ||
|
||
@Column(name = "started_at") | ||
override var startedAt: Instant? = null, | ||
|
||
@Column(name = "finished_at") | ||
override var finishedAt: Instant? = null, | ||
|
||
) : BaseEntity(), BaseSyncRecord<SyncType> |
24 changes: 24 additions & 0 deletions
24
bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/SyncType.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,24 @@ | ||
/******************************************************************************* | ||
* 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 | ||
|
||
enum class SyncType { | ||
POOL_TO_GATE_OUTPUT | ||
} |
29 changes: 29 additions & 0 deletions
29
bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/repository/SyncRecordRepository.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,29 @@ | ||
/******************************************************************************* | ||
* 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.repository | ||
|
||
import org.eclipse.tractusx.bpdm.gate.entity.SyncRecord | ||
import org.eclipse.tractusx.bpdm.gate.entity.SyncType | ||
import org.springframework.data.repository.CrudRepository | ||
|
||
interface SyncRecordRepository : CrudRepository<SyncRecord, Long> { | ||
|
||
fun findByType(type: SyncType): SyncRecord? | ||
} |
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
Oops, something went wrong.