Skip to content

Commit

Permalink
feat: terminatedBy for contract termination API (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
ununhexium authored Jul 9, 2024
1 parent e3f28ff commit e2e41d6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 11 deletions.
29 changes: 18 additions & 11 deletions docs/api/sovity-edc-api-wrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1323,11 +1323,7 @@ components:
items:
$ref: '#/components/schemas/ContractAgreementTransferProcess'
terminationStatus:
type: string
description: Contract Agreement's Termination Status
enum:
- ONGOING
- TERMINATED
$ref: '#/components/schemas/ContractTerminationStatus'
terminationInformation:
$ref: '#/components/schemas/ContractAgreementTerminationInfo'
description: Contract Agreement for Contract Agreement Page
Expand All @@ -1353,6 +1349,7 @@ components:
- detail
- reason
- terminatedAt
- terminatedBy
type: object
properties:
terminatedAt:
Expand All @@ -1367,6 +1364,8 @@ components:
type: string
description: Detailed message from the terminating party about why the contract
was terminated.
terminatedBy:
$ref: '#/components/schemas/ContractTerminatedBy'
description: Contract's agreement metadata
ContractAgreementTransferProcess:
required:
Expand All @@ -1388,6 +1387,19 @@ components:
type: string
description: Error Message
description: A Contract Agreement's Transfer Process
ContractTerminatedBy:
type: string
description: Whether the contract termination was initiated by this EDC or a
counterparty EDC.
enum:
- SELF
- COUNTERPARTY
ContractTerminationStatus:
type: string
description: The contract termination status
enum:
- ONGOING
- TERMINATED
TransferProcessSimplifiedState:
type: string
description: Simplified Transfer Process State to be used in UI
Expand Down Expand Up @@ -1417,12 +1429,7 @@ components:
type: object
properties:
terminationStatus:
type: string
description: Optionally filter the resulting contract agreements by their
termination status.
enum:
- ONGOING
- TERMINATED
$ref: '#/components/schemas/ContractTerminationStatus'
description: Filters for querying a Contract Contract Agreement Page
ContractDefinitionEntry:
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ public class ContractAgreementTerminationInfo {
requiredMode = Schema.RequiredMode.REQUIRED
)
private String detail;

@Schema(
description = "Indicates whether the termination comes from this EDC or the counterparty EDC.",
requiredMode = Schema.RequiredMode.REQUIRED
)
private ContractTerminatedBy terminatedBy;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2024 sovity GmbH
*
* 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
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* sovity GmbH - initial API and implementation
*/

package de.sovity.edc.ext.wrapper.api.ui.model;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "Whether the contract termination was initiated by this EDC or a counterparty EDC.", enumAsRef = true)
public enum ContractTerminatedBy {
SELF,
COUNTERPARTY
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

package de.sovity.edc.ext.wrapper.api.ui.model;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "The contract termination status", enumAsRef = true)
public enum ContractTerminationStatus {
ONGOING,
TERMINATED
Expand Down

0 comments on commit e2e41d6

Please sign in to comment.