diff --git a/pom.xml b/pom.xml index e38a41b319ba1bfbf6e4b684dbe8c5eb090c8280..55294c1d7f14e61cd048c6a504235c18c0a758cc 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,7 @@ <relativePath>../org.etsi.osl.main</relativePath> </parent> + <artifactId>org.etsi.osl.model.tmf</artifactId> <properties> @@ -17,6 +18,9 @@ <springdoc.version>${springdoc-version}</springdoc.version> <mapstruct.version>1.5.3.Final</mapstruct.version> </properties> + + <version>${org.etsi.osl.model.tmf.version}</version> + <repositories> <repository> diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java b/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java index d8e5aa9be3152cbf3da75e54f675d4fc5ae460f3..37607452e970a63ec7f05f878e645ef6c8e76913 100644 --- a/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/Product.java @@ -9,6 +9,7 @@ import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; import org.etsi.osl.tmf.po622.model.AgreementItemRef; import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java index 1fcf509429d891cb2971f12959a64715aab9cd7f..a9e2e368d8d2a2e7a274efb3fdbfb1358b312cfa 100644 --- a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductCreate.java @@ -9,6 +9,7 @@ import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; import org.etsi.osl.tmf.po622.model.AgreementItemRef; import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java index 47c37dd1c5289e25c354c32ce266be819f634e13..932f57130da8c7590de9fc68ab0a723cb0f571ee 100644 --- a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductRefOrValue.java @@ -9,6 +9,7 @@ import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; import org.etsi.osl.tmf.po622.model.AgreementItemRef; import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductSpecificationRef.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductSpecificationRef.java deleted file mode 100644 index 6139e53ddc272bd961006176c902afc6af32a4cf..0000000000000000000000000000000000000000 --- a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductSpecificationRef.java +++ /dev/null @@ -1,281 +0,0 @@ -package org.etsi.osl.tmf.pim637.model; - -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.springframework.validation.annotation.Validated; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; - -/** - * Product specification reference: A ProductSpecification is a detailed description of a tangible or intangible object made available externally in the form of a ProductOffering to customers or other parties playing a party role. - */ -@Schema(description = "Product specification reference: A ProductSpecification is a detailed description of a tangible or intangible object made available externally in the form of a ProductOffering to customers or other parties playing a party role.") -@Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-08-04T00:27:07.324017400+03:00[Europe/Athens]") - - -public class ProductSpecificationRef { - @JsonProperty("id") - private String id = null; - - @JsonProperty("href") - private String href = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("version") - private String version = null; - - @JsonProperty("targetProductSchema") - private TargetProductSchema targetProductSchema = null; - - @JsonProperty("@baseType") - private String _atBaseType = null; - - @JsonProperty("@schemaLocation") - private String _atSchemaLocation = null; - - @JsonProperty("@type") - private String _atType = null; - - @JsonProperty("@referredType") - private String _atReferredType = null; - - public ProductSpecificationRef id(String id) { - this.id = id; - return this; - } - - /** - * Unique identifier of a related entity. - * @return id - **/ - @Schema(required = true, description = "Unique identifier of a related entity.") - @NotNull - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public ProductSpecificationRef href(String href) { - this.href = href; - return this; - } - - /** - * Reference of the related entity. - * @return href - **/ - @Schema(description = "Reference of the related entity.") - @NotNull - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public ProductSpecificationRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - **/ - @Schema(description = "Name of the related entity.") - @NotNull - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public ProductSpecificationRef version(String version) { - this.version = version; - return this; - } - - /** - * Version of the product specification - * @return version - **/ - @Schema(description = "Version of the product specification") - @NotNull - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public ProductSpecificationRef targetProductSchema(TargetProductSchema targetProductSchema) { - this.targetProductSchema = targetProductSchema; - return this; - } - - /** - * Get targetProductSchema - * @return targetProductSchema - **/ - @Schema(description = "") - @NotNull - - @Valid - public TargetProductSchema getTargetProductSchema() { - return targetProductSchema; - } - - public void setTargetProductSchema(TargetProductSchema targetProductSchema) { - this.targetProductSchema = targetProductSchema; - } - - public ProductSpecificationRef _atBaseType(String _atBaseType) { - this._atBaseType = _atBaseType; - return this; - } - - /** - * When sub-classing, this defines the super-class - * @return _atBaseType - **/ - @Schema(description = "When sub-classing, this defines the super-class") - @NotNull - - public String getAtBaseType() { - return _atBaseType; - } - - public void setAtBaseType(String _atBaseType) { - this._atBaseType = _atBaseType; - } - - public ProductSpecificationRef _atSchemaLocation(String _atSchemaLocation) { - this._atSchemaLocation = _atSchemaLocation; - return this; - } - - /** - * A URI to a JSON-Schema file that defines additional attributes and relationships - * @return _atSchemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - @NotNull - - public String getAtSchemaLocation() { - return _atSchemaLocation; - } - - public void setAtSchemaLocation(String _atSchemaLocation) { - this._atSchemaLocation = _atSchemaLocation; - } - - public ProductSpecificationRef _atType(String _atType) { - this._atType = _atType; - return this; - } - - /** - * When sub-classing, this defines the sub-class entity name - * @return _atType - **/ - @Schema(description = "When sub-classing, this defines the sub-class entity name") - @NotNull - - public String getAtType() { - return _atType; - } - - public void setAtType(String _atType) { - this._atType = _atType; - } - - public ProductSpecificationRef _atReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return _atReferredType - **/ - @Schema(description = "The actual type of the target instance when needed for disambiguation.") - @NotNull - - public String getAtReferredType() { - return _atReferredType; - } - - public void setAtReferredType(String _atReferredType) { - this._atReferredType = _atReferredType; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProductSpecificationRef productSpecificationRef = (ProductSpecificationRef) o; - return Objects.equals(this.id, productSpecificationRef.id) && - Objects.equals(this.href, productSpecificationRef.href) && - Objects.equals(this.name, productSpecificationRef.name) && - Objects.equals(this.version, productSpecificationRef.version) && - Objects.equals(this.targetProductSchema, productSpecificationRef.targetProductSchema) && - Objects.equals(this._atBaseType, productSpecificationRef._atBaseType) && - Objects.equals(this._atSchemaLocation, productSpecificationRef._atSchemaLocation) && - Objects.equals(this._atType, productSpecificationRef._atType) && - Objects.equals(this._atReferredType, productSpecificationRef._atReferredType); - } - - @Override - public int hashCode() { - return Objects.hash(id, href, name, version, targetProductSchema, _atBaseType, _atSchemaLocation, _atType, _atReferredType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ProductSpecificationRef {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" targetProductSchema: ").append(toIndentedString(targetProductSchema)).append("\n"); - sb.append(" _atBaseType: ").append(toIndentedString(_atBaseType)).append("\n"); - sb.append(" _atSchemaLocation: ").append(toIndentedString(_atSchemaLocation)).append("\n"); - sb.append(" _atType: ").append(toIndentedString(_atType)).append("\n"); - sb.append(" _atReferredType: ").append(toIndentedString(_atReferredType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java index 49ee4c03ce9c832e0780533045e3189d5a09e275..aff9c7cb50fa722e19ef0dcd5dae6c05b1ad2023 100644 --- a/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java +++ b/src/main/java/org/etsi/osl/tmf/pim637/model/ProductUpdate.java @@ -9,6 +9,7 @@ import org.etsi.osl.tmf.common.model.service.Characteristic; import org.etsi.osl.tmf.common.model.service.ResourceRef; import org.etsi.osl.tmf.common.model.service.ServiceRef; import org.etsi.osl.tmf.pcm620.model.ProductOfferingRef; +import org.etsi.osl.tmf.pcm620.model.ProductSpecificationRef; import org.etsi.osl.tmf.po622.model.AgreementItemRef; import org.etsi.osl.tmf.po622.model.RelatedProductOrderItem; import org.etsi.osl.tmf.prm669.model.RelatedParty; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java index b8c4afcd5e699a3ffede0db25fc10a29ab12c692..3598dd460f4434dda6d85ec1f53230a12e23b72c 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrder.java @@ -20,14 +20,13 @@ package org.etsi.osl.tmf.po622.model; import java.time.OffsetDateTime; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Objects; import java.util.Set; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import org.etsi.osl.tmf.common.model.BaseRootEntity; +import org.etsi.osl.tmf.common.model.UserPartRoleType; import org.etsi.osl.tmf.common.model.service.Note; import org.etsi.osl.tmf.pim637.model.BillingAccountRef; import org.etsi.osl.tmf.prm669.model.RelatedParty; @@ -69,7 +68,7 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("category") private String category = null; - + private OffsetDateTime completionDate = null; @Lob @@ -77,7 +76,7 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("description") private String description = null;; - + private OffsetDateTime expectedCompletionDate = null; @JsonProperty("externalId") @@ -91,14 +90,14 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("priority") private String priority = null; - + private OffsetDateTime requestedCompletionDate = null; - + private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<AgreementRef> agreement = new HashSet<>(); @JsonProperty("billingAccount") @@ -108,53 +107,48 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("channel") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<RelatedChannel> channel = new HashSet<>(); @JsonProperty("note") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) - private Set<Note> note = new HashSet<>(); + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set<Note> note = new HashSet<>(); @JsonProperty("orderTotalPrice") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) - private Set<OrderPrice> orderTotalPrice = new HashSet<>(); + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set<OrderPrice> orderTotalPrice = new HashSet<>(); @JsonProperty("payment") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<PaymentRef> payment = new HashSet<>(); @JsonProperty("productOfferingQualification") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<ProductOfferingQualificationRef> productOfferingQualification = new HashSet<>(); @JsonProperty("productOrderItem") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<ProductOrderItem> productOrderItem = new HashSet<>(); @JsonProperty("quote") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) private Set<QuoteRef> quote = new HashSet<>(); @JsonProperty("relatedParty") @Valid - @OneToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }) - private Set<RelatedParty> relatedParty = new HashSet<>(); + @OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}) + private Set<RelatedParty> relatedParty = new HashSet<>(); @JsonProperty("state") - private ProductOrderStateType state = ProductOrderStateType.INITIAL ; + private ProductOrderStateType state = ProductOrderStateType.INITIAL; - - public ProductOrder id(String id) { - this.id = id; - return this; - } /** * ID created on repository side (OM system) @@ -164,12 +158,13 @@ public class ProductOrder extends BaseRootEntity { @Schema(description = "ID created on repository side (OM system)") public String getId() { - return id; + if ((id != null) && (uuid == null)) { // this check is good for external partners when no uuid + // exists + return id; + } + return uuid; } - public void setId(String id) { - this.id = id; - } public ProductOrder href(String href) { this.href = href; @@ -269,12 +264,12 @@ public class ProductOrder extends BaseRootEntity { @Valid @JsonProperty("completionDate") public String getCompletionDateString() { - if ( this.completionDate == null) { - return null; - } - return this.completionDate.toString(); + if (this.completionDate == null) { + return null; + } + return this.completionDate.toString(); } - + @Valid public OffsetDateTime getCompletionDate() { return completionDate; @@ -283,12 +278,12 @@ public class ProductOrder extends BaseRootEntity { public void setCompletionDate(OffsetDateTime completionDate) { this.completionDate = completionDate; } - + public void setCompletionDate(String completionDate) { - if (completionDate!=null) { - this.completionDate = OffsetDateTime.parse( completionDate ); + if (completionDate != null) { + this.completionDate = OffsetDateTime.parse(completionDate); } -} + } public ProductOrder description(String description) { @@ -326,12 +321,12 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("expectedCompletionDate") public String getExpectedCompletionDateString() { - if ( this.expectedCompletionDate == null) { - return null; - } - return this.expectedCompletionDate.toString(); + if (this.expectedCompletionDate == null) { + return null; + } + return this.expectedCompletionDate.toString(); } - + @Valid public OffsetDateTime getExpectedCompletionDate() { return expectedCompletionDate; @@ -340,13 +335,13 @@ public class ProductOrder extends BaseRootEntity { public void setExpectedCompletionDate(OffsetDateTime expectedCompletionDate) { this.expectedCompletionDate = expectedCompletionDate; } - + public void setExpectedCompletionDate(String expectedCompletionDate) { - if (expectedCompletionDate!=null) { - this.expectedCompletionDate = OffsetDateTime.parse( expectedCompletionDate ); - + if (expectedCompletionDate != null) { + this.expectedCompletionDate = OffsetDateTime.parse(expectedCompletionDate); + } -} + } public ProductOrder externalId(String externalId) { this.externalId = externalId; @@ -401,14 +396,14 @@ public class ProductOrder extends BaseRootEntity { * @return orderDate **/ @Schema(description = "Date when the order was created") - + @Valid @JsonProperty("orderDate") public String getOrderDateString() { - if ( this.orderDate == null) { - return null; - } - return this.orderDate.toString(); + if (this.orderDate == null) { + return null; + } + return this.orderDate.toString(); } @Valid @@ -419,14 +414,14 @@ public class ProductOrder extends BaseRootEntity { public void setOrderDate(OffsetDateTime orderDate) { this.orderDate = orderDate; } - + public void setOrderDate(String orderDate) { - if (orderDate!=null) { - this.orderDate = OffsetDateTime.parse( orderDate ); - + if (orderDate != null) { + this.orderDate = OffsetDateTime.parse(orderDate); + } -} + } public ProductOrder priority(String priority) { this.priority = priority; @@ -466,12 +461,12 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("requestedCompletionDate") public String getRequestedCompletionDateString() { - if ( this.requestedCompletionDate == null) { - return null; - } - return this.requestedCompletionDate.toString(); + if (this.requestedCompletionDate == null) { + return null; + } + return this.requestedCompletionDate.toString(); } - + @Valid public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; @@ -480,14 +475,14 @@ public class ProductOrder extends BaseRootEntity { public void setRequestedCompletionDate(OffsetDateTime requestedCompletionDate) { this.requestedCompletionDate = requestedCompletionDate; } - + public void setRequestedCompletionDate(String requestedCompletionDate) { - if (requestedCompletionDate!=null) { - this.requestedCompletionDate = OffsetDateTime.parse( requestedCompletionDate ); - + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + } -} + } public ProductOrder requestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; @@ -507,12 +502,12 @@ public class ProductOrder extends BaseRootEntity { @JsonProperty("requestedStartDate") public String getRequestedStartDateString() { - if ( this.requestedStartDate == null) { - return null; - } - return this.requestedStartDate.toString(); + if (this.requestedStartDate == null) { + return null; + } + return this.requestedStartDate.toString(); } - + @Valid public OffsetDateTime getRequestedStartDate() { return requestedStartDate; @@ -521,14 +516,14 @@ public class ProductOrder extends BaseRootEntity { public void setRequestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; } - - + + public void setRequestedStartDate(String requestedStartDate) { - if (requestedStartDate!=null) { - this.requestedStartDate = OffsetDateTime.parse( requestedStartDate ); - - } + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + + } } public ProductOrder agreement(Set<AgreementRef> agreement) { @@ -987,4 +982,25 @@ public class ProductOrder extends BaseRootEntity { } return o.toString().replace("\n", "\n "); } + + public ProductOrderItem findOrderItemById(String id) { + for (ProductOrderItem oi : this.productOrderItem) { + if (oi.getId().equals(id)) { + return oi; + } + } + return null; + } + + /** + * @return the PartyRole that made the request + */ + public RelatedParty getOrderRequester() { + for (RelatedParty rp : relatedParty) { + if (rp.getRole().equals(UserPartRoleType.REQUESTER.toString())) { + return rp; + } + } + return null; + } } diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java index 91b5fac072996972345ca8c0ea8edce69a82f25a..5098d220bf740595fee2263690964323ee01b013 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderCreate.java @@ -34,12 +34,17 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; /** - * A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state + * A Product Order is a type of order which can be used to place an order between a customer and a + * service provider or between a service provider and a partner and vice versa, Skipped properties: + * id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state */ -@Schema(description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state") +@Schema( + description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,completionDate,orderDate,state,expectedCompletionDate,productOrderItem.state") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrderCreate { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +public class ProductOrderCreate { + @JsonProperty("cancellationDate") private OffsetDateTime cancellationDate = null; @@ -61,10 +66,8 @@ public class ProductOrderCreate { @JsonProperty("priority") private String priority = null; - @JsonProperty("requestedCompletionDate") private OffsetDateTime requestedCompletionDate = null; - @JsonProperty("requestedStartDate") private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @@ -121,13 +124,14 @@ public class ProductOrderCreate { } /** - * Date when the order is cancelled. This is used when order is cancelled. + * Date when the order is cancelled. This is used when order is cancelled. + * * @return cancellationDate - **/ + **/ @Schema(description = "Date when the order is cancelled. This is used when order is cancelled. ") - - @Valid - public OffsetDateTime getCancellationDate() { + + @Valid + public OffsetDateTime getCancellationDate() { return cancellationDate; } @@ -141,12 +145,13 @@ public class ProductOrderCreate { } /** - * Reason why the order is cancelled. This is used when order is cancelled. + * Reason why the order is cancelled. This is used when order is cancelled. + * * @return cancellationReason - **/ + **/ @Schema(description = "Reason why the order is cancelled. This is used when order is cancelled. ") - - public String getCancellationReason() { + + public String getCancellationReason() { return cancellationReason; } @@ -160,12 +165,15 @@ public class ProductOrderCreate { } /** - * Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...) + * Used to categorize the order from a business perspective that can be useful for the OM system + * (e.g. \"enterprise\", \"residential\", ...) + * * @return category - **/ - @Schema(description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") - - public String getCategory() { + **/ + @Schema( + description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") + + public String getCategory() { return category; } @@ -180,11 +188,12 @@ public class ProductOrderCreate { /** * Description of the product order + * * @return description - **/ + **/ @Schema(description = "Description of the product order") - - public String getDescription() { + + public String getDescription() { return description; } @@ -199,11 +208,13 @@ public class ProductOrderCreate { /** * ID given by the consumer and only understandable by him (to facilitate his searches afterwards) + * * @return externalId - **/ - @Schema(description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") - - public String getExternalId() { + **/ + @Schema( + description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") + + public String getExternalId() { return externalId; } @@ -218,11 +229,13 @@ public class ProductOrderCreate { /** * Contact attached to the order to send back information regarding this order + * * @return notificationContact - **/ - @Schema(description = "Contact attached to the order to send back information regarding this order") - - public String getNotificationContact() { + **/ + @Schema( + description = "Contact attached to the order to send back information regarding this order") + + public String getNotificationContact() { return notificationContact; } @@ -236,12 +249,15 @@ public class ProductOrderCreate { } /** - * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest) + * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the + * highest priority, and 4 the lowest) + * * @return priority - **/ - @Schema(description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") - - public String getPriority() { + **/ + @Schema( + description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") + + public String getPriority() { return priority; } @@ -256,26 +272,37 @@ public class ProductOrderCreate { /** * Requested delivery date from the requestor perspective + * * @return requestedCompletionDate - **/ + **/ @Schema(description = "Requested delivery date from the requestor perspective") - - @Valid - public OffsetDateTime getRequestedCompletionDate() { + + @Valid + public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; } + @JsonProperty("requestedCompletionDate") + public String getRequestedCompletionDateStr() { + if (requestedCompletionDate != null) { + return requestedCompletionDate.toString(); + } else { + return null; + } + } + + public void setRequestedCompletionDate(OffsetDateTime requestedCompletionDate) { this.requestedCompletionDate = requestedCompletionDate; } - + public void setRequestedCompletionDate(String requestedCompletionDate) { - if (requestedCompletionDate!=null) { - this.requestedCompletionDate = OffsetDateTime.parse( requestedCompletionDate ); - + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + } -} + } public ProductOrderCreate requestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; @@ -283,27 +310,40 @@ public class ProductOrderCreate { } /** - * Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * Order fulfillment start date wished by the requestor. This is used when, for any reason, + * requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * * @return requestedStartDate - **/ - @Schema(description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") - - @Valid - public OffsetDateTime getRequestedStartDate() { + **/ + @Schema( + description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") + + @Valid + public OffsetDateTime getRequestedStartDate() { return requestedStartDate; } public void setRequestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; } - + public void setRequestedStartDate(String requestedStartDate) { - if (requestedStartDate!=null) { - this.requestedStartDate = OffsetDateTime.parse( requestedStartDate ); - + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + } -} + } + + @JsonProperty("requestedStartDate") + public String getRequestedStartDateStr() { + + if (requestedStartDate != null) { + return requestedStartDate.toString(); + } + + return null; + } public ProductOrderCreate agreement(List<AgreementRef> agreement) { this.agreement = agreement; @@ -320,11 +360,12 @@ public class ProductOrderCreate { /** * A reference to an agreement defined in the context of the product order + * * @return agreement - **/ + **/ @Schema(description = "A reference to an agreement defined in the context of the product order") - @Valid - public List<AgreementRef> getAgreement() { + @Valid + public List<AgreementRef> getAgreement() { return agreement; } @@ -339,12 +380,13 @@ public class ProductOrderCreate { /** * Get billingAccount + * * @return billingAccount - **/ + **/ @Schema(description = "") - - @Valid - public BillingAccountRef getBillingAccount() { + + @Valid + public BillingAccountRef getBillingAccount() { return billingAccount; } @@ -367,11 +409,12 @@ public class ProductOrderCreate { /** * Get channel + * * @return channel - **/ + **/ @Schema(description = "") - @Valid - public List<RelatedChannel> getChannel() { + @Valid + public List<RelatedChannel> getChannel() { return channel; } @@ -394,11 +437,12 @@ public class ProductOrderCreate { /** * Get note + * * @return note - **/ + **/ @Schema(description = "") - @Valid - public List<Note> getNote() { + @Valid + public List<Note> getNote() { return note; } @@ -421,11 +465,12 @@ public class ProductOrderCreate { /** * Get orderTotalPrice + * * @return orderTotalPrice - **/ + **/ @Schema(description = "") - @Valid - public List<OrderPrice> getOrderTotalPrice() { + @Valid + public List<OrderPrice> getOrderTotalPrice() { return orderTotalPrice; } @@ -448,11 +493,12 @@ public class ProductOrderCreate { /** * Get payment + * * @return payment - **/ + **/ @Schema(description = "") - @Valid - public List<PaymentRef> getPayment() { + @Valid + public List<PaymentRef> getPayment() { return payment; } @@ -460,12 +506,14 @@ public class ProductOrderCreate { this.payment = payment; } - public ProductOrderCreate productOfferingQualification(List<ProductOfferingQualificationRef> productOfferingQualification) { + public ProductOrderCreate productOfferingQualification( + List<ProductOfferingQualificationRef> productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; return this; } - public ProductOrderCreate addProductOfferingQualificationItem(ProductOfferingQualificationRef productOfferingQualificationItem) { + public ProductOrderCreate addProductOfferingQualificationItem( + ProductOfferingQualificationRef productOfferingQualificationItem) { if (this.productOfferingQualification == null) { this.productOfferingQualification = new ArrayList<>(); } @@ -475,15 +523,17 @@ public class ProductOrderCreate { /** * Get productOfferingQualification + * * @return productOfferingQualification - **/ + **/ @Schema(description = "") - @Valid - public List<ProductOfferingQualificationRef> getProductOfferingQualification() { + @Valid + public List<ProductOfferingQualificationRef> getProductOfferingQualification() { return productOfferingQualification; } - public void setProductOfferingQualification(List<ProductOfferingQualificationRef> productOfferingQualification) { + public void setProductOfferingQualification( + List<ProductOfferingQualificationRef> productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; } @@ -499,12 +549,14 @@ public class ProductOrderCreate { /** * Get productOrderItem + * * @return productOrderItem - **/ + **/ @Schema(description = "") - @NotNull - @Valid - @Size(min=1) public List<ProductOrderItem> getProductOrderItem() { + @NotNull + @Valid + @Size(min = 1) + public List<ProductOrderItem> getProductOrderItem() { return productOrderItem; } @@ -527,11 +579,12 @@ public class ProductOrderCreate { /** * Get quote + * * @return quote - **/ + **/ @Schema(description = "") - @Valid - public List<QuoteRef> getQuote() { + @Valid + public List<QuoteRef> getQuote() { return quote; } @@ -554,11 +607,12 @@ public class ProductOrderCreate { /** * Get relatedParty + * * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List<RelatedParty> getRelatedParty() { + @Valid + public List<RelatedParty> getRelatedParty() { return relatedParty; } @@ -573,11 +627,12 @@ public class ProductOrderCreate { /** * When sub-classing, this defines the super-class + * * @return baseType - **/ + **/ @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { + + public String getAtBaseType() { return baseType; } @@ -592,11 +647,13 @@ public class ProductOrderCreate { /** * A URI to a JSON-Schema file that defines additional attributes and relationships + * * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { + **/ + @Schema( + description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + + public String getAtSchemaLocation() { return schemaLocation; } @@ -611,11 +668,12 @@ public class ProductOrderCreate { /** * When sub-classing, this defines the sub-class entity name + * * @return type - **/ + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { + + public String getAtType() { return type; } @@ -633,48 +691,54 @@ public class ProductOrderCreate { return false; } ProductOrderCreate productOrderCreate = (ProductOrderCreate) o; - return Objects.equals(this.cancellationDate, productOrderCreate.cancellationDate) && - Objects.equals(this.cancellationReason, productOrderCreate.cancellationReason) && - Objects.equals(this.category, productOrderCreate.category) && - Objects.equals(this.description, productOrderCreate.description) && - Objects.equals(this.externalId, productOrderCreate.externalId) && - Objects.equals(this.notificationContact, productOrderCreate.notificationContact) && - Objects.equals(this.priority, productOrderCreate.priority) && - Objects.equals(this.requestedCompletionDate, productOrderCreate.requestedCompletionDate) && - Objects.equals(this.requestedStartDate, productOrderCreate.requestedStartDate) && - Objects.equals(this.agreement, productOrderCreate.agreement) && - Objects.equals(this.billingAccount, productOrderCreate.billingAccount) && - Objects.equals(this.channel, productOrderCreate.channel) && - Objects.equals(this.note, productOrderCreate.note) && - Objects.equals(this.orderTotalPrice, productOrderCreate.orderTotalPrice) && - Objects.equals(this.payment, productOrderCreate.payment) && - Objects.equals(this.productOfferingQualification, productOrderCreate.productOfferingQualification) && - Objects.equals(this.productOrderItem, productOrderCreate.productOrderItem) && - Objects.equals(this.quote, productOrderCreate.quote) && - Objects.equals(this.relatedParty, productOrderCreate.relatedParty) && - Objects.equals(this.baseType, productOrderCreate.baseType) && - Objects.equals(this.schemaLocation, productOrderCreate.schemaLocation) && - Objects.equals(this.type, productOrderCreate.type); + return Objects.equals(this.cancellationDate, productOrderCreate.cancellationDate) + && Objects.equals(this.cancellationReason, productOrderCreate.cancellationReason) + && Objects.equals(this.category, productOrderCreate.category) + && Objects.equals(this.description, productOrderCreate.description) + && Objects.equals(this.externalId, productOrderCreate.externalId) + && Objects.equals(this.notificationContact, productOrderCreate.notificationContact) + && Objects.equals(this.priority, productOrderCreate.priority) + && Objects.equals(this.requestedCompletionDate, productOrderCreate.requestedCompletionDate) + && Objects.equals(this.requestedStartDate, productOrderCreate.requestedStartDate) + && Objects.equals(this.agreement, productOrderCreate.agreement) + && Objects.equals(this.billingAccount, productOrderCreate.billingAccount) + && Objects.equals(this.channel, productOrderCreate.channel) + && Objects.equals(this.note, productOrderCreate.note) + && Objects.equals(this.orderTotalPrice, productOrderCreate.orderTotalPrice) + && Objects.equals(this.payment, productOrderCreate.payment) + && Objects.equals(this.productOfferingQualification, + productOrderCreate.productOfferingQualification) + && Objects.equals(this.productOrderItem, productOrderCreate.productOrderItem) + && Objects.equals(this.quote, productOrderCreate.quote) + && Objects.equals(this.relatedParty, productOrderCreate.relatedParty) + && Objects.equals(this.baseType, productOrderCreate.baseType) + && Objects.equals(this.schemaLocation, productOrderCreate.schemaLocation) + && Objects.equals(this.type, productOrderCreate.type); } @Override public int hashCode() { - return Objects.hash(cancellationDate, cancellationReason, category, description, externalId, notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, relatedParty, baseType, schemaLocation, type); + return Objects.hash(cancellationDate, cancellationReason, category, description, externalId, + notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, + billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, + productOrderItem, quote, relatedParty, baseType, schemaLocation, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProductOrderCreate {\n"); - + sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); sb.append(" cancellationReason: ").append(toIndentedString(cancellationReason)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); - sb.append(" notificationContact: ").append(toIndentedString(notificationContact)).append("\n"); + sb.append(" notificationContact: ").append(toIndentedString(notificationContact)) + .append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n"); + sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)) + .append("\n"); sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n"); sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); @@ -682,7 +746,8 @@ public class ProductOrderCreate { sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" orderTotalPrice: ").append(toIndentedString(orderTotalPrice)).append("\n"); sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); - sb.append(" productOfferingQualification: ").append(toIndentedString(productOfferingQualification)).append("\n"); + sb.append(" productOfferingQualification: ") + .append(toIndentedString(productOfferingQualification)).append("\n"); sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); @@ -694,8 +759,7 @@ public class ProductOrderCreate { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java index 96757731ce54fbf3a7ca1cd106f8a5cea7fbce8f..527891293ba50c9c9862d49a6bf5d20107ae92ca 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderItem.java @@ -137,12 +137,9 @@ public class ProductOrderItem extends BaseRootEntity { @NotNull public String getId() { - return id; + return uuid; } - public void setId(String id) { - this.id = id; - } public ProductOrderItem quantity(Integer quantity) { this.quantity = quantity; diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..1271c87607bc1257803b4d892e9b4a84954b2365 --- /dev/null +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderMapper.java @@ -0,0 +1,90 @@ +package org.etsi.osl.tmf.po622.model; + +import java.util.List; +import java.util.Set; +import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.prm669.model.RelatedParty; +import org.mapstruct.BeanMapping; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; +import org.mapstruct.NullValueCheckStrategy; +import org.mapstruct.NullValueMappingStrategy; +import org.mapstruct.NullValuePropertyMappingStrategy; + +@Mapper( + nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT, + nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS ) +public interface ProductOrderMapper { + + @Mapping(target = "uuid", ignore = true) + @Mapping(target = "baseType", ignore = true) + @Mapping(target = "href", ignore = true) + @Mapping(target = "schemaLocation", ignore = true) + @Mapping(target = "type", ignore = true) + ProductOrder fromProductOrderUpdate( ProductOrderUpdate rpdto ); + + + + @Mapping(target = "baseType", ignore = true) + @Mapping(target = "schemaLocation", ignore = true) + @Mapping(target = "href", ignore = true) + @Mapping(target = "type", ignore = true) + @Mapping(target = "uuid", ignore = true) + @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) + @Mapping(target = "productOrderItem", expression = "java(updateProductOrderItem(entity, updateEntity))") + @Mapping(target = "note", expression = "java(updateNote(entity, updateEntity))") + @Mapping(target = "relatedParty", expression = "java(updateRelatedParty(entity, updateEntity))") + ProductOrder updateProductOrder(@MappingTarget ProductOrder entity, ProductOrderUpdate updateEntity); + + default Set<ProductOrderItem> updateProductOrderItem( ProductOrder so, ProductOrderUpdate updateEntity ){ + if ( updateEntity.getProductOrderItem() != null ) { + for (ProductOrderItem soiUpd : updateEntity.getProductOrderItem()) { + ProductOrderItem soiOrigin = so.findOrderItemById( soiUpd.getId() ); + if (soiOrigin!=null) { + //updateOrderItem(soiOrigin, soiUpd); + if ( soiUpd.getAction()!=null) { + soiOrigin.setAction( soiUpd.getAction() ); + } + /** + * When we patch the order and see a MODIFY or DELETE action, we set the state to ACKNOWLEDGED + */ + if ( soiOrigin.getAction().equals( OrderItemActionType.MODIFY ) || + soiOrigin.getAction().equals( OrderItemActionType.DELETE )) { + soiOrigin.setState( ProductOrderItemStateType.ACKNOWLEDGED ); + so.setState( ProductOrderStateType.ACKNOWLEDGED ); + + + } + + } + } + } + return so.getProductOrderItem(); + } + + + default Set<Note> updateNote( ProductOrder so, ProductOrderUpdate updateEntity ){ + if (updateEntity.getNote() != null) { + for (Note n : updateEntity.getNote()) { + if (n.getUuid() == null) { + so.addNoteItem(n); + } + } + + } + return so.getNote(); + } + + default Set<RelatedParty> updateRelatedParty( ProductOrder so, ProductOrderUpdate updateEntity ){ + if (updateEntity.getRelatedParty() != null) { + for (RelatedParty n : updateEntity.getRelatedParty()) { + if (n.getUuid() == null) { + so.addRelatedPartyItem(n); + } + } + } + return so.getRelatedParty(); + } + +} diff --git a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java index 2de1e005ae2f44e7ea158fae2d23f63a4237acc1..e705a5ac48d91435435e97a24fb37c80963eb071 100644 --- a/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java +++ b/src/main/java/org/etsi/osl/tmf/po622/model/ProductOrderUpdate.java @@ -34,12 +34,16 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; /** - * A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate + * A Product Order is a type of order which can be used to place an order between a customer and a + * service provider or between a service provider and a partner and vice versa, Skipped properties: + * id,href,orderDate */ -@Schema(description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate") +@Schema( + description = "A Product Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa, Skipped properties: id,href,orderDate") @Validated -@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") -public class ProductOrderUpdate { +@jakarta.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", + date = "2020-10-30T10:29:21.184964400+02:00[Europe/Athens]") +public class ProductOrderUpdate { @JsonProperty("cancellationDate") private OffsetDateTime cancellationDate = null; @@ -49,13 +53,12 @@ public class ProductOrderUpdate { @JsonProperty("category") private String category = null; - @JsonProperty("completionDate") + private OffsetDateTime completionDate = null; @JsonProperty("description") private String description = null; - @JsonProperty("expectedCompletionDate") private OffsetDateTime expectedCompletionDate = null; @JsonProperty("externalId") @@ -67,10 +70,8 @@ public class ProductOrderUpdate { @JsonProperty("priority") private String priority = null; - @JsonProperty("requestedCompletionDate") private OffsetDateTime requestedCompletionDate = null; - @JsonProperty("requestedStartDate") private OffsetDateTime requestedStartDate = null; @JsonProperty("agreement") @@ -130,13 +131,14 @@ public class ProductOrderUpdate { } /** - * Date when the order is cancelled. This is used when order is cancelled. + * Date when the order is cancelled. This is used when order is cancelled. + * * @return cancellationDate - **/ + **/ @Schema(description = "Date when the order is cancelled. This is used when order is cancelled. ") - - @Valid - public OffsetDateTime getCancellationDate() { + + @Valid + public OffsetDateTime getCancellationDate() { return cancellationDate; } @@ -150,12 +152,13 @@ public class ProductOrderUpdate { } /** - * Reason why the order is cancelled. This is used when order is cancelled. + * Reason why the order is cancelled. This is used when order is cancelled. + * * @return cancellationReason - **/ + **/ @Schema(description = "Reason why the order is cancelled. This is used when order is cancelled. ") - - public String getCancellationReason() { + + public String getCancellationReason() { return cancellationReason; } @@ -169,12 +172,15 @@ public class ProductOrderUpdate { } /** - * Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...) + * Used to categorize the order from a business perspective that can be useful for the OM system + * (e.g. \"enterprise\", \"residential\", ...) + * * @return category - **/ - @Schema(description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") - - public String getCategory() { + **/ + @Schema( + description = "Used to categorize the order from a business perspective that can be useful for the OM system (e.g. \"enterprise\", \"residential\", ...)") + + public String getCategory() { return category; } @@ -189,12 +195,13 @@ public class ProductOrderUpdate { /** * Date when the order was completed + * * @return completionDate - **/ + **/ @Schema(description = "Date when the order was completed") - - @Valid - public OffsetDateTime getCompletionDate() { + + @Valid + public OffsetDateTime getCompletionDate() { return completionDate; } @@ -207,13 +214,33 @@ public class ProductOrderUpdate { return this; } + @JsonProperty("completionDate") + + public String getCompletionDateStr() { + if (completionDate != null) { + return completionDate.toString(); + } else { + return null; + } + } + + public void setCompletionDate(String completionDate) { + + if (completionDate != null) { + this.completionDate = OffsetDateTime.parse(completionDate); + + } + } + + /** * Description of the product order + * * @return description - **/ + **/ @Schema(description = "Description of the product order") - - public String getDescription() { + + public String getDescription() { return description; } @@ -228,19 +255,37 @@ public class ProductOrderUpdate { /** * Expected delivery date amended by the provider + * * @return expectedCompletionDate - **/ + **/ @Schema(description = "Expected delivery date amended by the provider") - - @Valid - public OffsetDateTime getExpectedCompletionDate() { + + @Valid + public OffsetDateTime getExpectedCompletionDate() { return expectedCompletionDate; } + @JsonProperty("expectedCompletionDate") + public String getExpectedCompletionDateStr() { + if (expectedCompletionDate != null) { + return expectedCompletionDate.toString(); + } else { + return null; + } + } + public void setExpectedCompletionDate(OffsetDateTime expectedCompletionDate) { this.expectedCompletionDate = expectedCompletionDate; } + public void setExpectedCompletionDate(String expectedCompletionDate) { + + if (expectedCompletionDate != null) { + this.expectedCompletionDate = OffsetDateTime.parse(expectedCompletionDate); + + } + } + public ProductOrderUpdate externalId(String externalId) { this.externalId = externalId; return this; @@ -248,11 +293,13 @@ public class ProductOrderUpdate { /** * ID given by the consumer and only understandable by him (to facilitate his searches afterwards) + * * @return externalId - **/ - @Schema(description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") - - public String getExternalId() { + **/ + @Schema( + description = "ID given by the consumer and only understandable by him (to facilitate his searches afterwards)") + + public String getExternalId() { return externalId; } @@ -267,11 +314,13 @@ public class ProductOrderUpdate { /** * Contact attached to the order to send back information regarding this order + * * @return notificationContact - **/ - @Schema(description = "Contact attached to the order to send back information regarding this order") - - public String getNotificationContact() { + **/ + @Schema( + description = "Contact attached to the order to send back information regarding this order") + + public String getNotificationContact() { return notificationContact; } @@ -285,12 +334,15 @@ public class ProductOrderUpdate { } /** - * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest) + * A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the + * highest priority, and 4 the lowest) + * * @return priority - **/ - @Schema(description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") - - public String getPriority() { + **/ + @Schema( + description = "A way that can be used by consumers to prioritize orders in OM system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)") + + public String getPriority() { return priority; } @@ -303,14 +355,32 @@ public class ProductOrderUpdate { return this; } + @JsonProperty("requestedCompletionDate") + public String getRequestedCompletionDateStr() { + if (requestedCompletionDate != null) { + return requestedCompletionDate.toString(); + } else { + return null; + } + } + + public void setRequestedCompletionDate(String requestedCompletionDate) { + + if (requestedCompletionDate != null) { + this.requestedCompletionDate = OffsetDateTime.parse(requestedCompletionDate); + + } + } + /** * Requested delivery date from the requestor perspective + * * @return requestedCompletionDate - **/ + **/ @Schema(description = "Requested delivery date from the requestor perspective") - - @Valid - public OffsetDateTime getRequestedCompletionDate() { + + @Valid + public OffsetDateTime getRequestedCompletionDate() { return requestedCompletionDate; } @@ -324,19 +394,40 @@ public class ProductOrderUpdate { } /** - * Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * Order fulfillment start date wished by the requestor. This is used when, for any reason, + * requestor cannot allow seller to begin to operationally begin the fulfillment before a date. + * * @return requestedStartDate - **/ - @Schema(description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") - - @Valid - public OffsetDateTime getRequestedStartDate() { + **/ + @Schema( + description = "Order fulfillment start date wished by the requestor. This is used when, for any reason, requestor cannot allow seller to begin to operationally begin the fulfillment before a date. ") + + @Valid + public OffsetDateTime getRequestedStartDate() { return requestedStartDate; } public void setRequestedStartDate(OffsetDateTime requestedStartDate) { this.requestedStartDate = requestedStartDate; } + + @JsonProperty("requestedStartDate") + public String getRequestedStartDateStr() { + + if (requestedStartDate != null) { + return requestedStartDate.toString(); + } + + return null; + } + + public void setRequestedStartDate(String requestedStartDate) { + + if (requestedStartDate != null) { + this.requestedStartDate = OffsetDateTime.parse(requestedStartDate); + + } + } public ProductOrderUpdate agreement(List<AgreementRef> agreement) { this.agreement = agreement; @@ -353,11 +444,12 @@ public class ProductOrderUpdate { /** * A reference to an agreement defined in the context of the product order + * * @return agreement - **/ + **/ @Schema(description = "A reference to an agreement defined in the context of the product order") - @Valid - public List<AgreementRef> getAgreement() { + @Valid + public List<AgreementRef> getAgreement() { return agreement; } @@ -372,12 +464,13 @@ public class ProductOrderUpdate { /** * Get billingAccount + * * @return billingAccount - **/ + **/ @Schema(description = "") - - @Valid - public BillingAccountRef getBillingAccount() { + + @Valid + public BillingAccountRef getBillingAccount() { return billingAccount; } @@ -400,11 +493,12 @@ public class ProductOrderUpdate { /** * Get channel + * * @return channel - **/ + **/ @Schema(description = "") - @Valid - public List<RelatedChannel> getChannel() { + @Valid + public List<RelatedChannel> getChannel() { return channel; } @@ -427,11 +521,12 @@ public class ProductOrderUpdate { /** * Get note + * * @return note - **/ + **/ @Schema(description = "") - @Valid - public List<Note> getNote() { + @Valid + public List<Note> getNote() { return note; } @@ -454,11 +549,12 @@ public class ProductOrderUpdate { /** * Get orderTotalPrice + * * @return orderTotalPrice - **/ + **/ @Schema(description = "") - @Valid - public List<OrderPrice> getOrderTotalPrice() { + @Valid + public List<OrderPrice> getOrderTotalPrice() { return orderTotalPrice; } @@ -481,11 +577,12 @@ public class ProductOrderUpdate { /** * Get payment + * * @return payment - **/ + **/ @Schema(description = "") - @Valid - public List<PaymentRef> getPayment() { + @Valid + public List<PaymentRef> getPayment() { return payment; } @@ -493,12 +590,14 @@ public class ProductOrderUpdate { this.payment = payment; } - public ProductOrderUpdate productOfferingQualification(List<ProductOfferingQualificationRef> productOfferingQualification) { + public ProductOrderUpdate productOfferingQualification( + List<ProductOfferingQualificationRef> productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; return this; } - public ProductOrderUpdate addProductOfferingQualificationItem(ProductOfferingQualificationRef productOfferingQualificationItem) { + public ProductOrderUpdate addProductOfferingQualificationItem( + ProductOfferingQualificationRef productOfferingQualificationItem) { if (this.productOfferingQualification == null) { this.productOfferingQualification = new ArrayList<>(); } @@ -508,15 +607,17 @@ public class ProductOrderUpdate { /** * Get productOfferingQualification + * * @return productOfferingQualification - **/ + **/ @Schema(description = "") - @Valid - public List<ProductOfferingQualificationRef> getProductOfferingQualification() { + @Valid + public List<ProductOfferingQualificationRef> getProductOfferingQualification() { return productOfferingQualification; } - public void setProductOfferingQualification(List<ProductOfferingQualificationRef> productOfferingQualification) { + public void setProductOfferingQualification( + List<ProductOfferingQualificationRef> productOfferingQualification) { this.productOfferingQualification = productOfferingQualification; } @@ -532,12 +633,14 @@ public class ProductOrderUpdate { /** * Get productOrderItem + * * @return productOrderItem - **/ + **/ @Schema(description = "") - @NotNull - @Valid - @Size(min=1) public List<ProductOrderItem> getProductOrderItem() { + @NotNull + @Valid + @Size(min = 1) + public List<ProductOrderItem> getProductOrderItem() { return productOrderItem; } @@ -560,11 +663,12 @@ public class ProductOrderUpdate { /** * Get quote + * * @return quote - **/ + **/ @Schema(description = "") - @Valid - public List<QuoteRef> getQuote() { + @Valid + public List<QuoteRef> getQuote() { return quote; } @@ -587,11 +691,12 @@ public class ProductOrderUpdate { /** * Get relatedParty + * * @return relatedParty - **/ + **/ @Schema(description = "") - @Valid - public List<RelatedParty> getRelatedParty() { + @Valid + public List<RelatedParty> getRelatedParty() { return relatedParty; } @@ -606,12 +711,13 @@ public class ProductOrderUpdate { /** * Get state + * * @return state - **/ + **/ @Schema(description = "") - - @Valid - public ProductOrderStateType getState() { + + @Valid + public ProductOrderStateType getState() { return state; } @@ -626,11 +732,12 @@ public class ProductOrderUpdate { /** * When sub-classing, this defines the super-class + * * @return baseType - **/ + **/ @Schema(description = "When sub-classing, this defines the super-class") - - public String getAtBaseType() { + + public String getAtBaseType() { return baseType; } @@ -645,11 +752,13 @@ public class ProductOrderUpdate { /** * A URI to a JSON-Schema file that defines additional attributes and relationships + * * @return schemaLocation - **/ - @Schema(description = "A URI to a JSON-Schema file that defines additional attributes and relationships") - - public String getAtSchemaLocation() { + **/ + @Schema( + description = "A URI to a JSON-Schema file that defines additional attributes and relationships") + + public String getAtSchemaLocation() { return schemaLocation; } @@ -664,11 +773,12 @@ public class ProductOrderUpdate { /** * When sub-classing, this defines the sub-class entity name + * * @return type - **/ + **/ @Schema(description = "When sub-classing, this defines the sub-class entity name") - - public String getAtType() { + + public String getAtType() { return type; } @@ -686,53 +796,61 @@ public class ProductOrderUpdate { return false; } ProductOrderUpdate productOrderUpdate = (ProductOrderUpdate) o; - return Objects.equals(this.cancellationDate, productOrderUpdate.cancellationDate) && - Objects.equals(this.cancellationReason, productOrderUpdate.cancellationReason) && - Objects.equals(this.category, productOrderUpdate.category) && - Objects.equals(this.completionDate, productOrderUpdate.completionDate) && - Objects.equals(this.description, productOrderUpdate.description) && - Objects.equals(this.expectedCompletionDate, productOrderUpdate.expectedCompletionDate) && - Objects.equals(this.externalId, productOrderUpdate.externalId) && - Objects.equals(this.notificationContact, productOrderUpdate.notificationContact) && - Objects.equals(this.priority, productOrderUpdate.priority) && - Objects.equals(this.requestedCompletionDate, productOrderUpdate.requestedCompletionDate) && - Objects.equals(this.requestedStartDate, productOrderUpdate.requestedStartDate) && - Objects.equals(this.agreement, productOrderUpdate.agreement) && - Objects.equals(this.billingAccount, productOrderUpdate.billingAccount) && - Objects.equals(this.channel, productOrderUpdate.channel) && - Objects.equals(this.note, productOrderUpdate.note) && - Objects.equals(this.orderTotalPrice, productOrderUpdate.orderTotalPrice) && - Objects.equals(this.payment, productOrderUpdate.payment) && - Objects.equals(this.productOfferingQualification, productOrderUpdate.productOfferingQualification) && - Objects.equals(this.productOrderItem, productOrderUpdate.productOrderItem) && - Objects.equals(this.quote, productOrderUpdate.quote) && - Objects.equals(this.relatedParty, productOrderUpdate.relatedParty) && - Objects.equals(this.state, productOrderUpdate.state) && - Objects.equals(this.baseType, productOrderUpdate.baseType) && - Objects.equals(this.schemaLocation, productOrderUpdate.schemaLocation) && - Objects.equals(this.type, productOrderUpdate.type); + return Objects.equals(this.cancellationDate, productOrderUpdate.cancellationDate) + && Objects.equals(this.cancellationReason, productOrderUpdate.cancellationReason) + && Objects.equals(this.category, productOrderUpdate.category) + && Objects.equals(this.completionDate, productOrderUpdate.completionDate) + && Objects.equals(this.description, productOrderUpdate.description) + && Objects.equals(this.expectedCompletionDate, productOrderUpdate.expectedCompletionDate) + && Objects.equals(this.externalId, productOrderUpdate.externalId) + && Objects.equals(this.notificationContact, productOrderUpdate.notificationContact) + && Objects.equals(this.priority, productOrderUpdate.priority) + && Objects.equals(this.requestedCompletionDate, productOrderUpdate.requestedCompletionDate) + && Objects.equals(this.requestedStartDate, productOrderUpdate.requestedStartDate) + && Objects.equals(this.agreement, productOrderUpdate.agreement) + && Objects.equals(this.billingAccount, productOrderUpdate.billingAccount) + && Objects.equals(this.channel, productOrderUpdate.channel) + && Objects.equals(this.note, productOrderUpdate.note) + && Objects.equals(this.orderTotalPrice, productOrderUpdate.orderTotalPrice) + && Objects.equals(this.payment, productOrderUpdate.payment) + && Objects.equals(this.productOfferingQualification, + productOrderUpdate.productOfferingQualification) + && Objects.equals(this.productOrderItem, productOrderUpdate.productOrderItem) + && Objects.equals(this.quote, productOrderUpdate.quote) + && Objects.equals(this.relatedParty, productOrderUpdate.relatedParty) + && Objects.equals(this.state, productOrderUpdate.state) + && Objects.equals(this.baseType, productOrderUpdate.baseType) + && Objects.equals(this.schemaLocation, productOrderUpdate.schemaLocation) + && Objects.equals(this.type, productOrderUpdate.type); } @Override public int hashCode() { - return Objects.hash(cancellationDate, cancellationReason, category, completionDate, description, expectedCompletionDate, externalId, notificationContact, priority, requestedCompletionDate, requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, productOfferingQualification, productOrderItem, quote, relatedParty, state, baseType, schemaLocation, type); + return Objects.hash(cancellationDate, cancellationReason, category, completionDate, description, + expectedCompletionDate, externalId, notificationContact, priority, requestedCompletionDate, + requestedStartDate, agreement, billingAccount, channel, note, orderTotalPrice, payment, + productOfferingQualification, productOrderItem, quote, relatedParty, state, baseType, + schemaLocation, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ProductOrderUpdate {\n"); - + sb.append(" cancellationDate: ").append(toIndentedString(cancellationDate)).append("\n"); sb.append(" cancellationReason: ").append(toIndentedString(cancellationReason)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" completionDate: ").append(toIndentedString(completionDate)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n"); + sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)) + .append("\n"); sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); - sb.append(" notificationContact: ").append(toIndentedString(notificationContact)).append("\n"); + sb.append(" notificationContact: ").append(toIndentedString(notificationContact)) + .append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n"); + sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)) + .append("\n"); sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n"); sb.append(" agreement: ").append(toIndentedString(agreement)).append("\n"); sb.append(" billingAccount: ").append(toIndentedString(billingAccount)).append("\n"); @@ -740,7 +858,8 @@ public class ProductOrderUpdate { sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" orderTotalPrice: ").append(toIndentedString(orderTotalPrice)).append("\n"); sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); - sb.append(" productOfferingQualification: ").append(toIndentedString(productOfferingQualification)).append("\n"); + sb.append(" productOfferingQualification: ") + .append(toIndentedString(productOfferingQualification)).append("\n"); sb.append(" productOrderItem: ").append(toIndentedString(productOrderItem)).append("\n"); sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n"); @@ -753,8 +872,7 @@ public class ProductOrderUpdate { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) {