22package com .sumup .sdk .models ;
33
44public record ReceiptTransactionProductsItem (
5- /** Product description. */
6- String description ,
7-
8- /** Product name. */
5+ /** Product name */
96 String name ,
107
11- /** Product price. */
12- Float price ,
8+ /** Product price */
9+ String price ,
10+
11+ /** Product price including VAT */
12+ String priceWithVat ,
1313
14- /** Product quantity. */
14+ /** Product quantity */
1515 Long quantity ,
1616
17- /** Quantity x product price. */
18- Float totalPrice ) {
17+ /** VAT amount for a single product */
18+ String singleVatAmount ,
19+
20+ /** Quantity x product price */
21+ String totalPrice ,
22+
23+ /** Total price including VAT */
24+ String totalWithVat ,
25+
26+ /** VAT amount */
27+ String vatAmount ,
28+
29+ /** VAT rate */
30+ String vatRate ) {
1931 /**
2032 * Creates a builder for ReceiptTransactionProductsItem.
2133 *
@@ -27,76 +39,133 @@ public static Builder builder() {
2739
2840 /** Builder for ReceiptTransactionProductsItem instances. */
2941 public static final class Builder {
30- private String description ;
3142 private String name ;
32- private Float price ;
43+ private String price ;
44+ private String priceWithVat ;
3345 private Long quantity ;
34- private Float totalPrice ;
46+ private String singleVatAmount ;
47+ private String totalPrice ;
48+ private String totalWithVat ;
49+ private String vatAmount ;
50+ private String vatRate ;
3551
3652 private Builder () {}
3753
3854 /**
39- * Sets the value for {@code description }.
55+ * Sets the value for {@code name }.
4056 *
41- * @param description Product description.
57+ * @param name Product name
4258 * @return This builder instance.
4359 */
44- public Builder description (String description ) {
45- this .description = description ;
60+ public Builder name (String name ) {
61+ this .name = name ;
4662 return this ;
4763 }
4864
4965 /**
50- * Sets the value for {@code name }.
66+ * Sets the value for {@code price }.
5167 *
52- * @param name Product name.
68+ * @param price Product price
5369 * @return This builder instance.
5470 */
55- public Builder name (String name ) {
56- this .name = name ;
71+ public Builder price (String price ) {
72+ this .price = price ;
5773 return this ;
5874 }
5975
6076 /**
61- * Sets the value for {@code price }.
77+ * Sets the value for {@code priceWithVat }.
6278 *
63- * @param price Product price.
79+ * @param priceWithVat Product price including VAT
6480 * @return This builder instance.
6581 */
66- public Builder price ( Float price ) {
67- this .price = price ;
82+ public Builder priceWithVat ( String priceWithVat ) {
83+ this .priceWithVat = priceWithVat ;
6884 return this ;
6985 }
7086
7187 /**
7288 * Sets the value for {@code quantity}.
7389 *
74- * @param quantity Product quantity.
90+ * @param quantity Product quantity
7591 * @return This builder instance.
7692 */
7793 public Builder quantity (Long quantity ) {
7894 this .quantity = quantity ;
7995 return this ;
8096 }
8197
98+ /**
99+ * Sets the value for {@code singleVatAmount}.
100+ *
101+ * @param singleVatAmount VAT amount for a single product
102+ * @return This builder instance.
103+ */
104+ public Builder singleVatAmount (String singleVatAmount ) {
105+ this .singleVatAmount = singleVatAmount ;
106+ return this ;
107+ }
108+
82109 /**
83110 * Sets the value for {@code totalPrice}.
84111 *
85- * @param totalPrice Quantity x product price.
112+ * @param totalPrice Quantity x product price
86113 * @return This builder instance.
87114 */
88- public Builder totalPrice (Float totalPrice ) {
115+ public Builder totalPrice (String totalPrice ) {
89116 this .totalPrice = totalPrice ;
90117 return this ;
91118 }
92119
120+ /**
121+ * Sets the value for {@code totalWithVat}.
122+ *
123+ * @param totalWithVat Total price including VAT
124+ * @return This builder instance.
125+ */
126+ public Builder totalWithVat (String totalWithVat ) {
127+ this .totalWithVat = totalWithVat ;
128+ return this ;
129+ }
130+
131+ /**
132+ * Sets the value for {@code vatAmount}.
133+ *
134+ * @param vatAmount VAT amount
135+ * @return This builder instance.
136+ */
137+ public Builder vatAmount (String vatAmount ) {
138+ this .vatAmount = vatAmount ;
139+ return this ;
140+ }
141+
142+ /**
143+ * Sets the value for {@code vatRate}.
144+ *
145+ * @param vatRate VAT rate
146+ * @return This builder instance.
147+ */
148+ public Builder vatRate (String vatRate ) {
149+ this .vatRate = vatRate ;
150+ return this ;
151+ }
152+
93153 /**
94154 * Builds an immutable ReceiptTransactionProductsItem instance.
95155 *
96156 * @return Immutable ReceiptTransactionProductsItem.
97157 */
98158 public ReceiptTransactionProductsItem build () {
99- return new ReceiptTransactionProductsItem (description , name , price , quantity , totalPrice );
159+ return new ReceiptTransactionProductsItem (
160+ name ,
161+ price ,
162+ priceWithVat ,
163+ quantity ,
164+ singleVatAmount ,
165+ totalPrice ,
166+ totalWithVat ,
167+ vatAmount ,
168+ vatRate );
100169 }
101170 }
102171}
0 commit comments