diff --git a/openapi.json b/openapi.json index b2a22e1..6b693ad 100755 --- a/openapi.json +++ b/openapi.json @@ -7286,10 +7286,14 @@ "$ref": "#/components/schemas/EventStatus" }, "amount": { - "$ref": "#/components/schemas/AmountEvent" + "description": "Amount of the event.", + "type": "number", + "format": "float" }, "timestamp": { - "$ref": "#/components/schemas/TimestampEvent" + "description": "Date and time of the transaction event.", + "type": "string", + "format": "date-time" }, "fee_amount": { "description": "Amount of the fee related to the event.", @@ -7874,10 +7878,14 @@ "$ref": "#/components/schemas/EventStatus" }, "amount": { - "$ref": "#/components/schemas/AmountEvent" + "description": "Amount of the event.", + "type": "string", + "format": "double" }, "timestamp": { - "$ref": "#/components/schemas/TimestampEvent" + "description": "Date and time of the transaction event.", + "type": "string", + "format": "date-time" }, "receipt_no": { "type": "string" @@ -8006,26 +8014,57 @@ "type": "object", "properties": { "name": { - "description": "Product name.", - "type": "string" - }, - "description": { - "description": "Product description.", - "type": "string" + "description": "Product name", + "type": "string", + "example": "Coffee" }, "price": { - "description": "Product price.", - "type": "number", - "format": "float" + "description": "Product price", + "type": "string", + "format": "double", + "example": "150.0" + }, + "vat_rate": { + "description": "VAT rate", + "type": "string", + "format": "double", + "example": "0.0" + }, + "single_vat_amount": { + "description": "VAT amount for a single product", + "type": "string", + "format": "double", + "example": "0.0" + }, + "price_with_vat": { + "description": "Product price including VAT", + "type": "string", + "format": "double", + "example": "150.0" + }, + "vat_amount": { + "description": "VAT amount", + "type": "string", + "format": "double", + "example": "0.0" }, "quantity": { - "description": "Product quantity.", - "type": "integer" + "description": "Product quantity", + "type": "integer", + "format": "int64", + "example": 1 }, "total_price": { - "description": "Quantity x product price.", - "type": "number", - "format": "float" + "description": "Quantity x product price", + "type": "string", + "format": "double", + "example": "150.0" + }, + "total_with_vat": { + "description": "Total price including VAT", + "type": "string", + "format": "double", + "example": "150.0" } } } @@ -8104,7 +8143,9 @@ "$ref": "#/components/schemas/EventStatus" }, "amount": { - "$ref": "#/components/schemas/AmountEvent" + "description": "Amount of the event.", + "type": "number", + "format": "float" }, "due_date": { "description": "Date when the transaction event is due to occur.", @@ -8121,7 +8162,9 @@ "type": "integer" }, "timestamp": { - "$ref": "#/components/schemas/TimestampEvent" + "description": "Date and time of the transaction event.", + "type": "string", + "format": "date-time" } } }, @@ -8531,11 +8574,6 @@ } } }, - "AmountEvent": { - "description": "Amount of the event.", - "type": "number", - "format": "float" - }, "Currency": { "description": "Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported currency values are enumerated above.", "type": "string", @@ -8630,11 +8668,6 @@ "description": "Unique ID of the transaction.", "type": "string" }, - "TimestampEvent": { - "description": "Date and time of the transaction event.", - "type": "string", - "format": "date-time" - }, "Permissions": { "description": "Permissions assigned to an operator or user.", "type": "object", @@ -8721,12 +8754,41 @@ "example": {}, "additionalProperties": true }, - "CountryCode": { - "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\ncountry code. This definition users `oneOf` with a two-character string\ntype to allow for support of future countries in client code.", - "type": "string", - "example": "BR", - "maxLength": 2, - "minLength": 2 + "Problem": { + "description": "A RFC 9457 problem details object.\n\nAdditional properties specific to the problem type may be present.\n", + "type": "object", + "properties": { + "type": { + "description": "A URI reference that identifies the problem type.", + "type": "string", + "format": "uri", + "example": "https://developer.sumup.com/problem/not-found" + }, + "title": { + "description": "A short, human-readable summary of the problem type.", + "type": "string", + "example": "Requested resource couldn't be found." + }, + "status": { + "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", + "type": "integer", + "example": 404 + }, + "detail": { + "description": "A human-readable explanation specific to this occurrence of the problem.", + "type": "string", + "example": "The requested resource doesn't exist or does not belong to you." + }, + "instance": { + "description": "A URI reference that identifies the specific occurrence of the problem.", + "type": "string", + "format": "uri" + } + }, + "additionalProperties": true, + "required": [ + "type" + ] }, "Address": { "description": "An address somewhere in the world. The address fields used depend on the country conventions. For example, in Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses is `state`, whereas in Chile it's `region`.\nWhether an address is valid or not depends on whether the locally required fields are present. Fields not supported in a country will be ignored.", @@ -8856,18 +8918,28 @@ "country" ] }, + "CountryCode": { + "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\ncountry code. This definition users `oneOf` with a two-character string\ntype to allow for support of future countries in client code.", + "type": "string", + "example": "BR", + "maxLength": 2, + "minLength": 2, + "pattern": "^[A-Z]{2}$" + }, "PersonalIdentifier": { "type": "object", "properties": { "ref": { "description": "The unique reference for the personal identifier type.", "type": "string", - "example": "br.cpf" + "example": "br.cpf", + "maxLength": 32 }, "value": { "description": "The company identifier value.", "type": "string", - "example": "847.060.136-90" + "example": "847.060.136-90", + "maxLength": 128 } }, "example": { @@ -8879,42 +8951,6 @@ "value" ] }, - "Problem": { - "description": "A RFC 9457 problem details object.\n\nAdditional properties specific to the problem type may be present.\n", - "type": "object", - "properties": { - "type": { - "description": "A URI reference that identifies the problem type.", - "type": "string", - "format": "uri" - }, - "title": { - "description": "A short, human-readable summary of the problem type.", - "type": "string" - }, - "status": { - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "type": "integer", - "example": 400, - "exclusiveMaximum": true, - "maximum": 600, - "minimum": 400 - }, - "detail": { - "description": "A human-readable explanation specific to this occurrence of the problem.", - "type": "string" - }, - "instance": { - "description": "A URI reference that identifies the specific occurrence of the problem.", - "type": "string", - "format": "uri" - } - }, - "additionalProperties": true, - "required": [ - "type" - ] - }, "MembershipStatus": { "description": "The status of the membership.", "type": "string", diff --git a/src/main/java/com/sumup/sdk/models/AmountEvent.java b/src/main/java/com/sumup/sdk/models/AmountEvent.java deleted file mode 100644 index 9c393ab..0000000 --- a/src/main/java/com/sumup/sdk/models/AmountEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -/** Amount of the event. */ -public record AmountEvent(Float value) { - /** - * Creates a builder for AmountEvent. - * - * @return Builder that constructs immutable AmountEvent instances. - */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for AmountEvent instances. */ - public static final class Builder { - private Float value; - - private Builder() {} - - /** - * Sets the value for {@code value}. - * - * @param value Value for the value field. - * @return This builder instance. - */ - public Builder value(Float value) { - this.value = value; - return this; - } - - /** - * Builds an immutable AmountEvent instance. - * - * @return Immutable AmountEvent. - */ - public AmountEvent build() { - return new AmountEvent(value); - } - } -} diff --git a/src/main/java/com/sumup/sdk/models/Event.java b/src/main/java/com/sumup/sdk/models/Event.java index 381c944..dab1478 100644 --- a/src/main/java/com/sumup/sdk/models/Event.java +++ b/src/main/java/com/sumup/sdk/models/Event.java @@ -3,7 +3,7 @@ public record Event( /** Amount of the event. */ - com.sumup.sdk.models.AmountEvent amount, + Float amount, /** Amount deducted for the event. */ Float deductedAmount, @@ -24,7 +24,7 @@ public record Event( com.sumup.sdk.models.EventStatus status, /** Date and time of the transaction event. */ - com.sumup.sdk.models.TimestampEvent timestamp, + java.time.OffsetDateTime timestamp, /** Unique ID of the transaction. */ com.sumup.sdk.models.TransactionId transactionId, @@ -42,14 +42,14 @@ public static Builder builder() { /** Builder for Event instances. */ public static final class Builder { - private com.sumup.sdk.models.AmountEvent amount; + private Float amount; private Float deductedAmount; private Float deductedFeeAmount; private Float feeAmount; private com.sumup.sdk.models.EventId id; private Long installmentNumber; private com.sumup.sdk.models.EventStatus status; - private com.sumup.sdk.models.TimestampEvent timestamp; + private java.time.OffsetDateTime timestamp; private com.sumup.sdk.models.TransactionId transactionId; private com.sumup.sdk.models.EventType type; @@ -61,7 +61,7 @@ private Builder() {} * @param amount Amount of the event. * @return This builder instance. */ - public Builder amount(com.sumup.sdk.models.AmountEvent amount) { + public Builder amount(Float amount) { this.amount = amount; return this; } @@ -138,7 +138,7 @@ public Builder status(com.sumup.sdk.models.EventStatus status) { * @param timestamp Date and time of the transaction event. * @return This builder instance. */ - public Builder timestamp(com.sumup.sdk.models.TimestampEvent timestamp) { + public Builder timestamp(java.time.OffsetDateTime timestamp) { this.timestamp = timestamp; return this; } diff --git a/src/main/java/com/sumup/sdk/models/ReceiptEvent.java b/src/main/java/com/sumup/sdk/models/ReceiptEvent.java index 9b15bfc..f133f0c 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptEvent.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptEvent.java @@ -3,7 +3,7 @@ public record ReceiptEvent( /** Amount of the event. */ - com.sumup.sdk.models.AmountEvent amount, + String amount, /** Unique ID of the transaction event. */ com.sumup.sdk.models.EventId id, @@ -13,7 +13,7 @@ public record ReceiptEvent( com.sumup.sdk.models.EventStatus status, /** Date and time of the transaction event. */ - com.sumup.sdk.models.TimestampEvent timestamp, + java.time.OffsetDateTime timestamp, /** Unique ID of the transaction. */ com.sumup.sdk.models.TransactionId transactionId, @@ -31,11 +31,11 @@ public static Builder builder() { /** Builder for ReceiptEvent instances. */ public static final class Builder { - private com.sumup.sdk.models.AmountEvent amount; + private String amount; private com.sumup.sdk.models.EventId id; private String receiptNo; private com.sumup.sdk.models.EventStatus status; - private com.sumup.sdk.models.TimestampEvent timestamp; + private java.time.OffsetDateTime timestamp; private com.sumup.sdk.models.TransactionId transactionId; private com.sumup.sdk.models.EventType type; @@ -47,7 +47,7 @@ private Builder() {} * @param amount Amount of the event. * @return This builder instance. */ - public Builder amount(com.sumup.sdk.models.AmountEvent amount) { + public Builder amount(String amount) { this.amount = amount; return this; } @@ -91,7 +91,7 @@ public Builder status(com.sumup.sdk.models.EventStatus status) { * @param timestamp Date and time of the transaction event. * @return This builder instance. */ - public Builder timestamp(com.sumup.sdk.models.TimestampEvent timestamp) { + public Builder timestamp(java.time.OffsetDateTime timestamp) { this.timestamp = timestamp; return this; } diff --git a/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java index ed1e1fa..df7dbba 100644 --- a/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java +++ b/src/main/java/com/sumup/sdk/models/ReceiptTransactionProductsItem.java @@ -2,20 +2,32 @@ package com.sumup.sdk.models; public record ReceiptTransactionProductsItem( - /** Product description. */ - String description, - - /** Product name. */ + /** Product name */ String name, - /** Product price. */ - Float price, + /** Product price */ + String price, + + /** Product price including VAT */ + String priceWithVat, - /** Product quantity. */ + /** Product quantity */ Long quantity, - /** Quantity x product price. */ - Float totalPrice) { + /** VAT amount for a single product */ + String singleVatAmount, + + /** Quantity x product price */ + String totalPrice, + + /** Total price including VAT */ + String totalWithVat, + + /** VAT amount */ + String vatAmount, + + /** VAT rate */ + String vatRate) { /** * Creates a builder for ReceiptTransactionProductsItem. * @@ -27,51 +39,55 @@ public static Builder builder() { /** Builder for ReceiptTransactionProductsItem instances. */ public static final class Builder { - private String description; private String name; - private Float price; + private String price; + private String priceWithVat; private Long quantity; - private Float totalPrice; + private String singleVatAmount; + private String totalPrice; + private String totalWithVat; + private String vatAmount; + private String vatRate; private Builder() {} /** - * Sets the value for {@code description}. + * Sets the value for {@code name}. * - * @param description Product description. + * @param name Product name * @return This builder instance. */ - public Builder description(String description) { - this.description = description; + public Builder name(String name) { + this.name = name; return this; } /** - * Sets the value for {@code name}. + * Sets the value for {@code price}. * - * @param name Product name. + * @param price Product price * @return This builder instance. */ - public Builder name(String name) { - this.name = name; + public Builder price(String price) { + this.price = price; return this; } /** - * Sets the value for {@code price}. + * Sets the value for {@code priceWithVat}. * - * @param price Product price. + * @param priceWithVat Product price including VAT * @return This builder instance. */ - public Builder price(Float price) { - this.price = price; + public Builder priceWithVat(String priceWithVat) { + this.priceWithVat = priceWithVat; return this; } /** * Sets the value for {@code quantity}. * - * @param quantity Product quantity. + * @param quantity Product quantity * @return This builder instance. */ public Builder quantity(Long quantity) { @@ -79,24 +95,77 @@ public Builder quantity(Long quantity) { return this; } + /** + * Sets the value for {@code singleVatAmount}. + * + * @param singleVatAmount VAT amount for a single product + * @return This builder instance. + */ + public Builder singleVatAmount(String singleVatAmount) { + this.singleVatAmount = singleVatAmount; + return this; + } + /** * Sets the value for {@code totalPrice}. * - * @param totalPrice Quantity x product price. + * @param totalPrice Quantity x product price * @return This builder instance. */ - public Builder totalPrice(Float totalPrice) { + public Builder totalPrice(String totalPrice) { this.totalPrice = totalPrice; return this; } + /** + * Sets the value for {@code totalWithVat}. + * + * @param totalWithVat Total price including VAT + * @return This builder instance. + */ + public Builder totalWithVat(String totalWithVat) { + this.totalWithVat = totalWithVat; + return this; + } + + /** + * Sets the value for {@code vatAmount}. + * + * @param vatAmount VAT amount + * @return This builder instance. + */ + public Builder vatAmount(String vatAmount) { + this.vatAmount = vatAmount; + return this; + } + + /** + * Sets the value for {@code vatRate}. + * + * @param vatRate VAT rate + * @return This builder instance. + */ + public Builder vatRate(String vatRate) { + this.vatRate = vatRate; + return this; + } + /** * Builds an immutable ReceiptTransactionProductsItem instance. * * @return Immutable ReceiptTransactionProductsItem. */ public ReceiptTransactionProductsItem build() { - return new ReceiptTransactionProductsItem(description, name, price, quantity, totalPrice); + return new ReceiptTransactionProductsItem( + name, + price, + priceWithVat, + quantity, + singleVatAmount, + totalPrice, + totalWithVat, + vatAmount, + vatRate); } } } diff --git a/src/main/java/com/sumup/sdk/models/TimestampEvent.java b/src/main/java/com/sumup/sdk/models/TimestampEvent.java deleted file mode 100644 index 700a393..0000000 --- a/src/main/java/com/sumup/sdk/models/TimestampEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -/** Date and time of the transaction event. */ -public record TimestampEvent(java.time.OffsetDateTime value) { - /** - * Creates a builder for TimestampEvent. - * - * @return Builder that constructs immutable TimestampEvent instances. - */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for TimestampEvent instances. */ - public static final class Builder { - private java.time.OffsetDateTime value; - - private Builder() {} - - /** - * Sets the value for {@code value}. - * - * @param value Value for the value field. - * @return This builder instance. - */ - public Builder value(java.time.OffsetDateTime value) { - this.value = value; - return this; - } - - /** - * Builds an immutable TimestampEvent instance. - * - * @return Immutable TimestampEvent. - */ - public TimestampEvent build() { - return new TimestampEvent(value); - } - } -} diff --git a/src/main/java/com/sumup/sdk/models/TransactionEvent.java b/src/main/java/com/sumup/sdk/models/TransactionEvent.java index 7fc40a1..c5c9b64 100644 --- a/src/main/java/com/sumup/sdk/models/TransactionEvent.java +++ b/src/main/java/com/sumup/sdk/models/TransactionEvent.java @@ -4,7 +4,7 @@ /** Details of a transaction event. */ public record TransactionEvent( /** Amount of the event. */ - com.sumup.sdk.models.AmountEvent amount, + Float amount, /** Date when the transaction event occurred. */ java.time.LocalDate date, @@ -28,7 +28,7 @@ public record TransactionEvent( com.sumup.sdk.models.EventStatus status, /** Date and time of the transaction event. */ - com.sumup.sdk.models.TimestampEvent timestamp) { + java.time.OffsetDateTime timestamp) { /** * Creates a builder for TransactionEvent. * @@ -40,14 +40,14 @@ public static Builder builder() { /** Builder for TransactionEvent instances. */ public static final class Builder { - private com.sumup.sdk.models.AmountEvent amount; + private Float amount; private java.time.LocalDate date; private java.time.LocalDate dueDate; private com.sumup.sdk.models.EventType eventType; private com.sumup.sdk.models.EventId id; private Long installmentNumber; private com.sumup.sdk.models.EventStatus status; - private com.sumup.sdk.models.TimestampEvent timestamp; + private java.time.OffsetDateTime timestamp; private Builder() {} @@ -57,7 +57,7 @@ private Builder() {} * @param amount Amount of the event. * @return This builder instance. */ - public Builder amount(com.sumup.sdk.models.AmountEvent amount) { + public Builder amount(Float amount) { this.amount = amount; return this; } @@ -135,7 +135,7 @@ public Builder status(com.sumup.sdk.models.EventStatus status) { * @param timestamp Date and time of the transaction event. * @return This builder instance. */ - public Builder timestamp(com.sumup.sdk.models.TimestampEvent timestamp) { + public Builder timestamp(java.time.OffsetDateTime timestamp) { this.timestamp = timestamp; return this; }