Add Payment-Service
This commit is contained in:
7
.idea/compiler.xml
generated
7
.idea/compiler.xml
generated
@@ -33,6 +33,13 @@
|
||||
<module name="order-domain-core" options="-parameters" />
|
||||
<module name="order-messaging" options="-parameters" />
|
||||
<module name="order-service" options="" />
|
||||
<module name="payment-application-service" options="-parameters" />
|
||||
<module name="payment-container" options="-parameters" />
|
||||
<module name="payment-dataaccess" options="-parameters" />
|
||||
<module name="payment-domain" options="" />
|
||||
<module name="payment-domain-core" options="-parameters" />
|
||||
<module name="payment-messaging" options="-parameters" />
|
||||
<module name="payment-service" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -7,7 +7,7 @@ package com.food.order.system.kafka.order.avro.model;
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public enum OrderApprovalStatus implements org.apache.avro.generic.GenericEnumSymbol<OrderApprovalStatus> {
|
||||
APPROVED, REJECTED ;
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"OrderApprovalStatus\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"symbols\":[\"APPROVED\",\"REJECTED\"]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"OrderApprovalStatus\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"symbols\":[\"APPROVED\",\"REJECTED\"]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.food.order.system.kafka.order.avro.model;
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public enum PaymentOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentOrderStatus> {
|
||||
PENDING, CANCELLED ;
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"PaymentOrderStatus\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"symbols\":[\"PENDING\",\"CANCELLED\"]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"PaymentOrderStatus\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"symbols\":[\"PENDING\",\"CANCELLED\"]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ import org.apache.avro.specific.SpecificData;
|
||||
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||
private static final long serialVersionUID = 1425163749928760031L;
|
||||
private static final long serialVersionUID = 2928240305434837410L;
|
||||
|
||||
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PaymentRequestAvroModel\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"customerId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"paymentOrderStatus\",\"type\":{\"type\":\"enum\",\"name\":\"PaymentOrderStatus\",\"symbols\":[\"PENDING\",\"CANCELLED\"]}}]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PaymentRequestAvroModel\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"customerId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"paymentOrderStatus\",\"type\":{\"type\":\"enum\",\"name\":\"PaymentOrderStatus\",\"symbols\":[\"PENDING\",\"CANCELLED\"]}}]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
|
||||
private static final SpecificData MODEL$ = new SpecificData();
|
||||
@@ -75,13 +75,13 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
return DECODER.decode(b);
|
||||
}
|
||||
|
||||
private String id;
|
||||
private String sagaId;
|
||||
private String customerId;
|
||||
private String orderId;
|
||||
private java.lang.String id;
|
||||
private java.lang.String sagaId;
|
||||
private java.lang.String customerId;
|
||||
private java.lang.String orderId;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
private PaymentOrderStatus paymentOrderStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus;
|
||||
|
||||
/**
|
||||
* Default constructor. Note that this does not initialize fields
|
||||
@@ -100,7 +100,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param createdAt The new value for createdAt
|
||||
* @param paymentOrderStatus The new value for paymentOrderStatus
|
||||
*/
|
||||
public PaymentRequestAvroModel(String id, String sagaId, String customerId, String orderId, java.math.BigDecimal price, java.time.Instant createdAt, PaymentOrderStatus paymentOrderStatus) {
|
||||
public PaymentRequestAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String customerId, java.lang.String orderId, java.math.BigDecimal price, java.time.Instant createdAt, com.food.order.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus) {
|
||||
this.id = id;
|
||||
this.sagaId = sagaId;
|
||||
this.customerId = customerId;
|
||||
@@ -110,10 +110,10 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
this.paymentOrderStatus = paymentOrderStatus;
|
||||
}
|
||||
|
||||
public SpecificData getSpecificData() { return MODEL$; }
|
||||
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
|
||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||
// Used by DatumWriter. Applications should not call.
|
||||
public Object get(int field$) {
|
||||
public java.lang.Object get(int field$) {
|
||||
switch (field$) {
|
||||
case 0: return id;
|
||||
case 1: return sagaId;
|
||||
@@ -145,7 +145,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
|
||||
// Used by DatumReader. Applications should not call.
|
||||
@SuppressWarnings(value="unchecked")
|
||||
public void put(int field$, Object value$) {
|
||||
public void put(int field$, java.lang.Object value$) {
|
||||
switch (field$) {
|
||||
case 0: id = value$ != null ? value$.toString() : null; break;
|
||||
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
||||
@@ -153,7 +153,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
case 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||
case 4: price = (java.math.BigDecimal)value$; break;
|
||||
case 5: createdAt = (java.time.Instant)value$; break;
|
||||
case 6: paymentOrderStatus = (PaymentOrderStatus)value$; break;
|
||||
case 6: paymentOrderStatus = (com.food.order.system.kafka.order.avro.model.PaymentOrderStatus)value$; break;
|
||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||
}
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'id' field.
|
||||
* @return The value of the 'id' field.
|
||||
*/
|
||||
public String getId() {
|
||||
public java.lang.String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Sets the value of the 'id' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setId(String value) {
|
||||
public void setId(java.lang.String value) {
|
||||
this.id = value;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'sagaId' field.
|
||||
* @return The value of the 'sagaId' field.
|
||||
*/
|
||||
public String getSagaId() {
|
||||
public java.lang.String getSagaId() {
|
||||
return sagaId;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Sets the value of the 'sagaId' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setSagaId(String value) {
|
||||
public void setSagaId(java.lang.String value) {
|
||||
this.sagaId = value;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'customerId' field.
|
||||
* @return The value of the 'customerId' field.
|
||||
*/
|
||||
public String getCustomerId() {
|
||||
public java.lang.String getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Sets the value of the 'customerId' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setCustomerId(String value) {
|
||||
public void setCustomerId(java.lang.String value) {
|
||||
this.customerId = value;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'orderId' field.
|
||||
* @return The value of the 'orderId' field.
|
||||
*/
|
||||
public String getOrderId() {
|
||||
public java.lang.String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Sets the value of the 'orderId' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setOrderId(String value) {
|
||||
public void setOrderId(java.lang.String value) {
|
||||
this.orderId = value;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'paymentOrderStatus' field.
|
||||
* @return The value of the 'paymentOrderStatus' field.
|
||||
*/
|
||||
public PaymentOrderStatus getPaymentOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentOrderStatus getPaymentOrderStatus() {
|
||||
return paymentOrderStatus;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Sets the value of the 'paymentOrderStatus' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setPaymentOrderStatus(PaymentOrderStatus value) {
|
||||
public void setPaymentOrderStatus(com.food.order.system.kafka.order.avro.model.PaymentOrderStatus value) {
|
||||
this.paymentOrderStatus = value;
|
||||
}
|
||||
|
||||
@@ -281,8 +281,8 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Creates a new PaymentRequestAvroModel RecordBuilder.
|
||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static Builder newBuilder() {
|
||||
return new Builder();
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder() {
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,11 +290,11 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param other The existing builder to copy.
|
||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static Builder newBuilder(Builder other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder other) {
|
||||
if (other == null) {
|
||||
return new Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
||||
} else {
|
||||
return new Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,11 +303,11 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param other The existing instance to copy.
|
||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static Builder newBuilder(PaymentRequestAvroModel other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel other) {
|
||||
if (other == null) {
|
||||
return new Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
||||
} else {
|
||||
return new Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,13 +318,13 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PaymentRequestAvroModel>
|
||||
implements org.apache.avro.data.RecordBuilder<PaymentRequestAvroModel> {
|
||||
|
||||
private String id;
|
||||
private String sagaId;
|
||||
private String customerId;
|
||||
private String orderId;
|
||||
private java.lang.String id;
|
||||
private java.lang.String sagaId;
|
||||
private java.lang.String customerId;
|
||||
private java.lang.String orderId;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
private PaymentOrderStatus paymentOrderStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus;
|
||||
|
||||
/** Creates a new Builder */
|
||||
private Builder() {
|
||||
@@ -335,7 +335,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Creates a Builder by copying an existing Builder.
|
||||
* @param other The existing Builder to copy.
|
||||
*/
|
||||
private Builder(Builder other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder other) {
|
||||
super(other);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -371,7 +371,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Creates a Builder by copying an existing PaymentRequestAvroModel instance
|
||||
* @param other The existing instance to copy.
|
||||
*/
|
||||
private Builder(PaymentRequestAvroModel other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel other) {
|
||||
super(SCHEMA$, MODEL$);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -407,7 +407,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'id' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public String getId() {
|
||||
public java.lang.String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'id'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setId(String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setId(java.lang.String value) {
|
||||
validate(fields()[0], value);
|
||||
this.id = value;
|
||||
fieldSetFlags()[0] = true;
|
||||
@@ -437,7 +437,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'id' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearId() {
|
||||
id = null;
|
||||
fieldSetFlags()[0] = false;
|
||||
return this;
|
||||
@@ -447,7 +447,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'sagaId' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public String getSagaId() {
|
||||
public java.lang.String getSagaId() {
|
||||
return sagaId;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'sagaId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setSagaId(String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
validate(fields()[1], value);
|
||||
this.sagaId = value;
|
||||
fieldSetFlags()[1] = true;
|
||||
@@ -477,7 +477,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'sagaId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearSagaId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearSagaId() {
|
||||
sagaId = null;
|
||||
fieldSetFlags()[1] = false;
|
||||
return this;
|
||||
@@ -487,7 +487,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'customerId' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public String getCustomerId() {
|
||||
public java.lang.String getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'customerId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setCustomerId(String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setCustomerId(java.lang.String value) {
|
||||
validate(fields()[2], value);
|
||||
this.customerId = value;
|
||||
fieldSetFlags()[2] = true;
|
||||
@@ -517,7 +517,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'customerId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearCustomerId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearCustomerId() {
|
||||
customerId = null;
|
||||
fieldSetFlags()[2] = false;
|
||||
return this;
|
||||
@@ -527,7 +527,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'orderId' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public String getOrderId() {
|
||||
public java.lang.String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'orderId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setOrderId(String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
validate(fields()[3], value);
|
||||
this.orderId = value;
|
||||
fieldSetFlags()[3] = true;
|
||||
@@ -557,7 +557,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'orderId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearOrderId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearOrderId() {
|
||||
orderId = null;
|
||||
fieldSetFlags()[3] = false;
|
||||
return this;
|
||||
@@ -577,7 +577,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'price'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setPrice(java.math.BigDecimal value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||
validate(fields()[4], value);
|
||||
this.price = value;
|
||||
fieldSetFlags()[4] = true;
|
||||
@@ -597,7 +597,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'price' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearPrice() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearPrice() {
|
||||
price = null;
|
||||
fieldSetFlags()[4] = false;
|
||||
return this;
|
||||
@@ -617,7 +617,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'createdAt'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setCreatedAt(java.time.Instant value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
validate(fields()[5], value);
|
||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||
fieldSetFlags()[5] = true;
|
||||
@@ -637,7 +637,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'createdAt' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearCreatedAt() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearCreatedAt() {
|
||||
fieldSetFlags()[5] = false;
|
||||
return this;
|
||||
}
|
||||
@@ -646,7 +646,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Gets the value of the 'paymentOrderStatus' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public PaymentOrderStatus getPaymentOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentOrderStatus getPaymentOrderStatus() {
|
||||
return paymentOrderStatus;
|
||||
}
|
||||
|
||||
@@ -656,7 +656,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* @param value The value of 'paymentOrderStatus'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder setPaymentOrderStatus(PaymentOrderStatus value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setPaymentOrderStatus(com.food.order.system.kafka.order.avro.model.PaymentOrderStatus value) {
|
||||
validate(fields()[6], value);
|
||||
this.paymentOrderStatus = value;
|
||||
fieldSetFlags()[6] = true;
|
||||
@@ -676,7 +676,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
* Clears the value of the 'paymentOrderStatus' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Builder clearPaymentOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearPaymentOrderStatus() {
|
||||
paymentOrderStatus = null;
|
||||
fieldSetFlags()[6] = false;
|
||||
return this;
|
||||
@@ -687,17 +687,17 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
||||
public PaymentRequestAvroModel build() {
|
||||
try {
|
||||
PaymentRequestAvroModel record = new PaymentRequestAvroModel();
|
||||
record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]);
|
||||
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (String) defaultValue(fields()[1]);
|
||||
record.customerId = fieldSetFlags()[2] ? this.customerId : (String) defaultValue(fields()[2]);
|
||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (String) defaultValue(fields()[3]);
|
||||
record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
|
||||
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (java.lang.String) defaultValue(fields()[1]);
|
||||
record.customerId = fieldSetFlags()[2] ? this.customerId : (java.lang.String) defaultValue(fields()[2]);
|
||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
||||
record.price = fieldSetFlags()[4] ? this.price : (java.math.BigDecimal) defaultValue(fields()[4]);
|
||||
record.createdAt = fieldSetFlags()[5] ? this.createdAt : (java.time.Instant) defaultValue(fields()[5]);
|
||||
record.paymentOrderStatus = fieldSetFlags()[6] ? this.paymentOrderStatus : (PaymentOrderStatus) defaultValue(fields()[6]);
|
||||
record.paymentOrderStatus = fieldSetFlags()[6] ? this.paymentOrderStatus : (com.food.order.system.kafka.order.avro.model.PaymentOrderStatus) defaultValue(fields()[6]);
|
||||
return record;
|
||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
} catch (java.lang.Exception e) {
|
||||
throw new org.apache.avro.AvroRuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,17 +5,19 @@
|
||||
*/
|
||||
package com.food.order.system.kafka.order.avro.model;
|
||||
|
||||
import org.apache.avro.generic.GenericArray;
|
||||
import org.apache.avro.specific.SpecificData;
|
||||
import org.apache.avro.util.Utf8;
|
||||
import org.apache.avro.message.BinaryMessageEncoder;
|
||||
import org.apache.avro.message.BinaryMessageDecoder;
|
||||
import org.apache.avro.message.SchemaStore;
|
||||
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||
private static final long serialVersionUID = -2126784712017759782L;
|
||||
private static final long serialVersionUID = -3686686114915224929L;
|
||||
|
||||
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PaymentResponseAvroModel\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"paymentId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"customerId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"paymentStatus\",\"type\":{\"type\":\"enum\",\"name\":\"PaymentStatus\",\"symbols\":[\"COMPLETED\",\"CANCELLED\",\"FAILED\"]}},{\"name\":\"failureMessages\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PaymentResponseAvroModel\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"paymentId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"customerId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"paymentStatus\",\"type\":{\"type\":\"enum\",\"name\":\"PaymentStatus\",\"symbols\":[\"COMPLETED\",\"CANCELLED\",\"FAILED\"]}},{\"name\":\"failureMessages\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
|
||||
private static final SpecificData MODEL$ = new SpecificData();
|
||||
@@ -82,7 +84,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
private java.lang.String orderId;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
private PaymentStatus paymentStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.PaymentStatus paymentStatus;
|
||||
private java.util.List<java.lang.String> failureMessages;
|
||||
|
||||
/**
|
||||
@@ -104,7 +106,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param paymentStatus The new value for paymentStatus
|
||||
* @param failureMessages The new value for failureMessages
|
||||
*/
|
||||
public PaymentResponseAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String paymentId, java.lang.String customerId, java.lang.String orderId, java.math.BigDecimal price, java.time.Instant createdAt, PaymentStatus paymentStatus, java.util.List<java.lang.String> failureMessages) {
|
||||
public PaymentResponseAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String paymentId, java.lang.String customerId, java.lang.String orderId, java.math.BigDecimal price, java.time.Instant createdAt, com.food.order.system.kafka.order.avro.model.PaymentStatus paymentStatus, java.util.List<java.lang.String> failureMessages) {
|
||||
this.id = id;
|
||||
this.sagaId = sagaId;
|
||||
this.paymentId = paymentId;
|
||||
@@ -164,7 +166,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
case 4: orderId = value$ != null ? value$.toString() : null; break;
|
||||
case 5: price = (java.math.BigDecimal)value$; break;
|
||||
case 6: createdAt = (java.time.Instant)value$; break;
|
||||
case 7: paymentStatus = (PaymentStatus)value$; break;
|
||||
case 7: paymentStatus = (com.food.order.system.kafka.order.avro.model.PaymentStatus)value$; break;
|
||||
case 8: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||
}
|
||||
@@ -293,7 +295,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Gets the value of the 'paymentStatus' field.
|
||||
* @return The value of the 'paymentStatus' field.
|
||||
*/
|
||||
public PaymentStatus getPaymentStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentStatus getPaymentStatus() {
|
||||
return paymentStatus;
|
||||
}
|
||||
|
||||
@@ -302,7 +304,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Sets the value of the 'paymentStatus' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setPaymentStatus(PaymentStatus value) {
|
||||
public void setPaymentStatus(com.food.order.system.kafka.order.avro.model.PaymentStatus value) {
|
||||
this.paymentStatus = value;
|
||||
}
|
||||
|
||||
@@ -327,8 +329,8 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Creates a new PaymentResponseAvroModel RecordBuilder.
|
||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static PaymentResponseAvroModel.Builder newBuilder() {
|
||||
return new PaymentResponseAvroModel.Builder();
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder() {
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,11 +338,11 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param other The existing builder to copy.
|
||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static PaymentResponseAvroModel.Builder newBuilder(PaymentResponseAvroModel.Builder other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder other) {
|
||||
if (other == null) {
|
||||
return new PaymentResponseAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
||||
} else {
|
||||
return new PaymentResponseAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,11 +351,11 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param other The existing instance to copy.
|
||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static PaymentResponseAvroModel.Builder newBuilder(PaymentResponseAvroModel other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel other) {
|
||||
if (other == null) {
|
||||
return new PaymentResponseAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
||||
} else {
|
||||
return new PaymentResponseAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +373,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
private java.lang.String orderId;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
private PaymentStatus paymentStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.PaymentStatus paymentStatus;
|
||||
private java.util.List<java.lang.String> failureMessages;
|
||||
|
||||
/** Creates a new Builder */
|
||||
@@ -383,7 +385,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Creates a Builder by copying an existing Builder.
|
||||
* @param other The existing Builder to copy.
|
||||
*/
|
||||
private Builder(PaymentResponseAvroModel.Builder other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder other) {
|
||||
super(other);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -427,7 +429,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Creates a Builder by copying an existing PaymentResponseAvroModel instance
|
||||
* @param other The existing instance to copy.
|
||||
*/
|
||||
private Builder(PaymentResponseAvroModel other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel other) {
|
||||
super(SCHEMA$, MODEL$);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -481,7 +483,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'id'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setId(java.lang.String value) {
|
||||
validate(fields()[0], value);
|
||||
this.id = value;
|
||||
fieldSetFlags()[0] = true;
|
||||
@@ -501,7 +503,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'id' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearId() {
|
||||
id = null;
|
||||
fieldSetFlags()[0] = false;
|
||||
return this;
|
||||
@@ -521,7 +523,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'sagaId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
validate(fields()[1], value);
|
||||
this.sagaId = value;
|
||||
fieldSetFlags()[1] = true;
|
||||
@@ -541,7 +543,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'sagaId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearSagaId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearSagaId() {
|
||||
sagaId = null;
|
||||
fieldSetFlags()[1] = false;
|
||||
return this;
|
||||
@@ -561,7 +563,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'paymentId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setPaymentId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPaymentId(java.lang.String value) {
|
||||
validate(fields()[2], value);
|
||||
this.paymentId = value;
|
||||
fieldSetFlags()[2] = true;
|
||||
@@ -581,7 +583,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'paymentId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearPaymentId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPaymentId() {
|
||||
paymentId = null;
|
||||
fieldSetFlags()[2] = false;
|
||||
return this;
|
||||
@@ -601,7 +603,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'customerId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setCustomerId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setCustomerId(java.lang.String value) {
|
||||
validate(fields()[3], value);
|
||||
this.customerId = value;
|
||||
fieldSetFlags()[3] = true;
|
||||
@@ -621,7 +623,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'customerId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearCustomerId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearCustomerId() {
|
||||
customerId = null;
|
||||
fieldSetFlags()[3] = false;
|
||||
return this;
|
||||
@@ -641,7 +643,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'orderId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
validate(fields()[4], value);
|
||||
this.orderId = value;
|
||||
fieldSetFlags()[4] = true;
|
||||
@@ -661,7 +663,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'orderId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearOrderId() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearOrderId() {
|
||||
orderId = null;
|
||||
fieldSetFlags()[4] = false;
|
||||
return this;
|
||||
@@ -681,7 +683,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'price'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||
validate(fields()[5], value);
|
||||
this.price = value;
|
||||
fieldSetFlags()[5] = true;
|
||||
@@ -701,7 +703,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'price' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearPrice() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPrice() {
|
||||
price = null;
|
||||
fieldSetFlags()[5] = false;
|
||||
return this;
|
||||
@@ -721,7 +723,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'createdAt'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
validate(fields()[6], value);
|
||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||
fieldSetFlags()[6] = true;
|
||||
@@ -741,7 +743,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'createdAt' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearCreatedAt() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearCreatedAt() {
|
||||
fieldSetFlags()[6] = false;
|
||||
return this;
|
||||
}
|
||||
@@ -750,7 +752,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Gets the value of the 'paymentStatus' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public PaymentStatus getPaymentStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentStatus getPaymentStatus() {
|
||||
return paymentStatus;
|
||||
}
|
||||
|
||||
@@ -760,7 +762,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'paymentStatus'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setPaymentStatus(PaymentStatus value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPaymentStatus(com.food.order.system.kafka.order.avro.model.PaymentStatus value) {
|
||||
validate(fields()[7], value);
|
||||
this.paymentStatus = value;
|
||||
fieldSetFlags()[7] = true;
|
||||
@@ -780,7 +782,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'paymentStatus' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearPaymentStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPaymentStatus() {
|
||||
paymentStatus = null;
|
||||
fieldSetFlags()[7] = false;
|
||||
return this;
|
||||
@@ -800,7 +802,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* @param value The value of 'failureMessages'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||
validate(fields()[8], value);
|
||||
this.failureMessages = value;
|
||||
fieldSetFlags()[8] = true;
|
||||
@@ -820,7 +822,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
* Clears the value of the 'failureMessages' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public PaymentResponseAvroModel.Builder clearFailureMessages() {
|
||||
public com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearFailureMessages() {
|
||||
failureMessages = null;
|
||||
fieldSetFlags()[8] = false;
|
||||
return this;
|
||||
@@ -838,7 +840,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
||||
record.orderId = fieldSetFlags()[4] ? this.orderId : (java.lang.String) defaultValue(fields()[4]);
|
||||
record.price = fieldSetFlags()[5] ? this.price : (java.math.BigDecimal) defaultValue(fields()[5]);
|
||||
record.createdAt = fieldSetFlags()[6] ? this.createdAt : (java.time.Instant) defaultValue(fields()[6]);
|
||||
record.paymentStatus = fieldSetFlags()[7] ? this.paymentStatus : (PaymentStatus) defaultValue(fields()[7]);
|
||||
record.paymentStatus = fieldSetFlags()[7] ? this.paymentStatus : (com.food.order.system.kafka.order.avro.model.PaymentStatus) defaultValue(fields()[7]);
|
||||
record.failureMessages = fieldSetFlags()[8] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[8]);
|
||||
return record;
|
||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.food.order.system.kafka.order.avro.model;
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public enum PaymentStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentStatus> {
|
||||
COMPLETED, CANCELLED, FAILED ;
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"PaymentStatus\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"symbols\":[\"COMPLETED\",\"CANCELLED\",\"FAILED\"]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"PaymentStatus\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"symbols\":[\"COMPLETED\",\"CANCELLED\",\"FAILED\"]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||
}
|
||||
|
||||
@@ -5,17 +5,19 @@
|
||||
*/
|
||||
package com.food.order.system.kafka.order.avro.model;
|
||||
|
||||
import org.apache.avro.message.BinaryMessageDecoder;
|
||||
import org.apache.avro.message.BinaryMessageEncoder;
|
||||
import org.apache.avro.message.SchemaStore;
|
||||
import org.apache.avro.generic.GenericArray;
|
||||
import org.apache.avro.specific.SpecificData;
|
||||
import org.apache.avro.util.Utf8;
|
||||
import org.apache.avro.message.BinaryMessageEncoder;
|
||||
import org.apache.avro.message.BinaryMessageDecoder;
|
||||
import org.apache.avro.message.SchemaStore;
|
||||
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public class Product extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||
private static final long serialVersionUID = -6511580554663840009L;
|
||||
private static final long serialVersionUID = -6762943505103404653L;
|
||||
|
||||
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Product\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"logicalType\":\"uuid\"},{\"name\":\"quantity\",\"type\":\"int\"}]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Product\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"logicalType\":\"uuid\"},{\"name\":\"quantity\",\"type\":\"int\"}]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
|
||||
private static final SpecificData MODEL$ = new SpecificData();
|
||||
@@ -150,8 +152,8 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* Creates a new Product RecordBuilder.
|
||||
* @return A new Product RecordBuilder
|
||||
*/
|
||||
public static Product.Builder newBuilder() {
|
||||
return new Product.Builder();
|
||||
public static com.food.order.system.kafka.order.avro.model.Product.Builder newBuilder() {
|
||||
return new com.food.order.system.kafka.order.avro.model.Product.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,11 +161,11 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* @param other The existing builder to copy.
|
||||
* @return A new Product RecordBuilder
|
||||
*/
|
||||
public static Product.Builder newBuilder(Product.Builder other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.Product.Builder newBuilder(com.food.order.system.kafka.order.avro.model.Product.Builder other) {
|
||||
if (other == null) {
|
||||
return new Product.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.Product.Builder();
|
||||
} else {
|
||||
return new Product.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.Product.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,11 +174,11 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* @param other The existing instance to copy.
|
||||
* @return A new Product RecordBuilder
|
||||
*/
|
||||
public static Product.Builder newBuilder(Product other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.Product.Builder newBuilder(com.food.order.system.kafka.order.avro.model.Product other) {
|
||||
if (other == null) {
|
||||
return new Product.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.Product.Builder();
|
||||
} else {
|
||||
return new Product.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.Product.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +201,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* Creates a Builder by copying an existing Builder.
|
||||
* @param other The existing Builder to copy.
|
||||
*/
|
||||
private Builder(Product.Builder other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.Product.Builder other) {
|
||||
super(other);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -215,7 +217,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* Creates a Builder by copying an existing Product instance
|
||||
* @param other The existing instance to copy.
|
||||
*/
|
||||
private Builder(Product other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.Product other) {
|
||||
super(SCHEMA$, MODEL$);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -241,7 +243,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* @param value The value of 'id'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Product.Builder setId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.Product.Builder setId(java.lang.String value) {
|
||||
validate(fields()[0], value);
|
||||
this.id = value;
|
||||
fieldSetFlags()[0] = true;
|
||||
@@ -261,7 +263,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* Clears the value of the 'id' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Product.Builder clearId() {
|
||||
public com.food.order.system.kafka.order.avro.model.Product.Builder clearId() {
|
||||
id = null;
|
||||
fieldSetFlags()[0] = false;
|
||||
return this;
|
||||
@@ -281,7 +283,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* @param value The value of 'quantity'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Product.Builder setQuantity(int value) {
|
||||
public com.food.order.system.kafka.order.avro.model.Product.Builder setQuantity(int value) {
|
||||
validate(fields()[1], value);
|
||||
this.quantity = value;
|
||||
fieldSetFlags()[1] = true;
|
||||
@@ -301,7 +303,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
||||
* Clears the value of the 'quantity' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public Product.Builder clearQuantity() {
|
||||
public com.food.order.system.kafka.order.avro.model.Product.Builder clearQuantity() {
|
||||
fieldSetFlags()[1] = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -5,17 +5,19 @@
|
||||
*/
|
||||
package com.food.order.system.kafka.order.avro.model;
|
||||
|
||||
import org.apache.avro.generic.GenericArray;
|
||||
import org.apache.avro.specific.SpecificData;
|
||||
import org.apache.avro.util.Utf8;
|
||||
import org.apache.avro.message.BinaryMessageEncoder;
|
||||
import org.apache.avro.message.BinaryMessageDecoder;
|
||||
import org.apache.avro.message.SchemaStore;
|
||||
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||
private static final long serialVersionUID = -3917361261016430486L;
|
||||
private static final long serialVersionUID = -3514710772324064017L;
|
||||
|
||||
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RestaurantApprovalRequestAvroModel\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantOrderStatus\",\"type\":{\"type\":\"enum\",\"name\":\"RestaurantOrderStatus\",\"symbols\":[\"PAID\"]}},{\"name\":\"products\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Product\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"logicalType\":\"uuid\"},{\"name\":\"quantity\",\"type\":\"int\"}]}}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}}]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RestaurantApprovalRequestAvroModel\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantOrderStatus\",\"type\":{\"type\":\"enum\",\"name\":\"RestaurantOrderStatus\",\"symbols\":[\"PAID\"]}},{\"name\":\"products\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Product\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"logicalType\":\"uuid\"},{\"name\":\"quantity\",\"type\":\"int\"}]}}},{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":10,\"scale\":2}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}}]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
|
||||
private static final SpecificData MODEL$ = new SpecificData();
|
||||
@@ -79,8 +81,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
private java.lang.String sagaId;
|
||||
private java.lang.String restaurantId;
|
||||
private java.lang.String orderId;
|
||||
private RestaurantOrderStatus restaurantOrderStatus;
|
||||
private java.util.List<Product> products;
|
||||
private com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus;
|
||||
private java.util.List<com.food.order.system.kafka.order.avro.model.Product> products;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
|
||||
@@ -102,7 +104,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param price The new value for price
|
||||
* @param createdAt The new value for createdAt
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String restaurantId, java.lang.String orderId, RestaurantOrderStatus restaurantOrderStatus, java.util.List<Product> products, java.math.BigDecimal price, java.time.Instant createdAt) {
|
||||
public RestaurantApprovalRequestAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String restaurantId, java.lang.String orderId, com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus, java.util.List<com.food.order.system.kafka.order.avro.model.Product> products, java.math.BigDecimal price, java.time.Instant createdAt) {
|
||||
this.id = id;
|
||||
this.sagaId = sagaId;
|
||||
this.restaurantId = restaurantId;
|
||||
@@ -156,8 +158,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
||||
case 2: restaurantId = value$ != null ? value$.toString() : null; break;
|
||||
case 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||
case 4: restaurantOrderStatus = (RestaurantOrderStatus)value$; break;
|
||||
case 5: products = (java.util.List<Product>)value$; break;
|
||||
case 4: restaurantOrderStatus = (com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus)value$; break;
|
||||
case 5: products = (java.util.List<com.food.order.system.kafka.order.avro.model.Product>)value$; break;
|
||||
case 6: price = (java.math.BigDecimal)value$; break;
|
||||
case 7: createdAt = (java.time.Instant)value$; break;
|
||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||
@@ -236,7 +238,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Gets the value of the 'restaurantOrderStatus' field.
|
||||
* @return The value of the 'restaurantOrderStatus' field.
|
||||
*/
|
||||
public RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||
return restaurantOrderStatus;
|
||||
}
|
||||
|
||||
@@ -245,7 +247,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Sets the value of the 'restaurantOrderStatus' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setRestaurantOrderStatus(RestaurantOrderStatus value) {
|
||||
public void setRestaurantOrderStatus(com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus value) {
|
||||
this.restaurantOrderStatus = value;
|
||||
}
|
||||
|
||||
@@ -253,7 +255,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Gets the value of the 'products' field.
|
||||
* @return The value of the 'products' field.
|
||||
*/
|
||||
public java.util.List<Product> getProducts() {
|
||||
public java.util.List<com.food.order.system.kafka.order.avro.model.Product> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
@@ -262,7 +264,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Sets the value of the 'products' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setProducts(java.util.List<Product> value) {
|
||||
public void setProducts(java.util.List<com.food.order.system.kafka.order.avro.model.Product> value) {
|
||||
this.products = value;
|
||||
}
|
||||
|
||||
@@ -304,8 +306,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Creates a new RestaurantApprovalRequestAvroModel RecordBuilder.
|
||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalRequestAvroModel.Builder newBuilder() {
|
||||
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder() {
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -313,11 +315,11 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param other The existing builder to copy.
|
||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalRequestAvroModel.Builder newBuilder(RestaurantApprovalRequestAvroModel.Builder other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder other) {
|
||||
if (other == null) {
|
||||
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
||||
} else {
|
||||
return new RestaurantApprovalRequestAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,11 +328,11 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param other The existing instance to copy.
|
||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalRequestAvroModel.Builder newBuilder(RestaurantApprovalRequestAvroModel other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel other) {
|
||||
if (other == null) {
|
||||
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
||||
} else {
|
||||
return new RestaurantApprovalRequestAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,8 +347,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
private java.lang.String sagaId;
|
||||
private java.lang.String restaurantId;
|
||||
private java.lang.String orderId;
|
||||
private RestaurantOrderStatus restaurantOrderStatus;
|
||||
private java.util.List<Product> products;
|
||||
private com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus;
|
||||
private java.util.List<com.food.order.system.kafka.order.avro.model.Product> products;
|
||||
private java.math.BigDecimal price;
|
||||
private java.time.Instant createdAt;
|
||||
|
||||
@@ -359,7 +361,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Creates a Builder by copying an existing Builder.
|
||||
* @param other The existing Builder to copy.
|
||||
*/
|
||||
private Builder(RestaurantApprovalRequestAvroModel.Builder other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder other) {
|
||||
super(other);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -399,7 +401,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Creates a Builder by copying an existing RestaurantApprovalRequestAvroModel instance
|
||||
* @param other The existing instance to copy.
|
||||
*/
|
||||
private Builder(RestaurantApprovalRequestAvroModel other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel other) {
|
||||
super(SCHEMA$, MODEL$);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -449,7 +451,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'id'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setId(java.lang.String value) {
|
||||
validate(fields()[0], value);
|
||||
this.id = value;
|
||||
fieldSetFlags()[0] = true;
|
||||
@@ -469,7 +471,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'id' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearId() {
|
||||
id = null;
|
||||
fieldSetFlags()[0] = false;
|
||||
return this;
|
||||
@@ -489,7 +491,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'sagaId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
validate(fields()[1], value);
|
||||
this.sagaId = value;
|
||||
fieldSetFlags()[1] = true;
|
||||
@@ -509,7 +511,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'sagaId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearSagaId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearSagaId() {
|
||||
sagaId = null;
|
||||
fieldSetFlags()[1] = false;
|
||||
return this;
|
||||
@@ -529,7 +531,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'restaurantId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||
validate(fields()[2], value);
|
||||
this.restaurantId = value;
|
||||
fieldSetFlags()[2] = true;
|
||||
@@ -549,7 +551,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'restaurantId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearRestaurantId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearRestaurantId() {
|
||||
restaurantId = null;
|
||||
fieldSetFlags()[2] = false;
|
||||
return this;
|
||||
@@ -569,7 +571,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'orderId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
validate(fields()[3], value);
|
||||
this.orderId = value;
|
||||
fieldSetFlags()[3] = true;
|
||||
@@ -589,7 +591,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'orderId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearOrderId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearOrderId() {
|
||||
orderId = null;
|
||||
fieldSetFlags()[3] = false;
|
||||
return this;
|
||||
@@ -599,7 +601,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Gets the value of the 'restaurantOrderStatus' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||
return restaurantOrderStatus;
|
||||
}
|
||||
|
||||
@@ -609,7 +611,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'restaurantOrderStatus'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setRestaurantOrderStatus(RestaurantOrderStatus value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setRestaurantOrderStatus(com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus value) {
|
||||
validate(fields()[4], value);
|
||||
this.restaurantOrderStatus = value;
|
||||
fieldSetFlags()[4] = true;
|
||||
@@ -629,7 +631,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'restaurantOrderStatus' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearRestaurantOrderStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearRestaurantOrderStatus() {
|
||||
restaurantOrderStatus = null;
|
||||
fieldSetFlags()[4] = false;
|
||||
return this;
|
||||
@@ -639,7 +641,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Gets the value of the 'products' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public java.util.List<Product> getProducts() {
|
||||
public java.util.List<com.food.order.system.kafka.order.avro.model.Product> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
@@ -649,7 +651,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'products'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setProducts(java.util.List<Product> value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setProducts(java.util.List<com.food.order.system.kafka.order.avro.model.Product> value) {
|
||||
validate(fields()[5], value);
|
||||
this.products = value;
|
||||
fieldSetFlags()[5] = true;
|
||||
@@ -669,7 +671,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'products' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearProducts() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearProducts() {
|
||||
products = null;
|
||||
fieldSetFlags()[5] = false;
|
||||
return this;
|
||||
@@ -689,7 +691,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'price'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||
validate(fields()[6], value);
|
||||
this.price = value;
|
||||
fieldSetFlags()[6] = true;
|
||||
@@ -709,7 +711,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'price' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearPrice() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearPrice() {
|
||||
price = null;
|
||||
fieldSetFlags()[6] = false;
|
||||
return this;
|
||||
@@ -729,7 +731,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* @param value The value of 'createdAt'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
validate(fields()[7], value);
|
||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||
fieldSetFlags()[7] = true;
|
||||
@@ -749,7 +751,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
* Clears the value of the 'createdAt' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalRequestAvroModel.Builder clearCreatedAt() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearCreatedAt() {
|
||||
fieldSetFlags()[7] = false;
|
||||
return this;
|
||||
}
|
||||
@@ -763,8 +765,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
||||
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (java.lang.String) defaultValue(fields()[1]);
|
||||
record.restaurantId = fieldSetFlags()[2] ? this.restaurantId : (java.lang.String) defaultValue(fields()[2]);
|
||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
||||
record.restaurantOrderStatus = fieldSetFlags()[4] ? this.restaurantOrderStatus : (RestaurantOrderStatus) defaultValue(fields()[4]);
|
||||
record.products = fieldSetFlags()[5] ? this.products : (java.util.List<Product>) defaultValue(fields()[5]);
|
||||
record.restaurantOrderStatus = fieldSetFlags()[4] ? this.restaurantOrderStatus : (com.food.order.system.kafka.order.avro.model.RestaurantOrderStatus) defaultValue(fields()[4]);
|
||||
record.products = fieldSetFlags()[5] ? this.products : (java.util.List<com.food.order.system.kafka.order.avro.model.Product>) defaultValue(fields()[5]);
|
||||
record.price = fieldSetFlags()[6] ? this.price : (java.math.BigDecimal) defaultValue(fields()[6]);
|
||||
record.createdAt = fieldSetFlags()[7] ? this.createdAt : (java.time.Instant) defaultValue(fields()[7]);
|
||||
return record;
|
||||
|
||||
@@ -5,17 +5,19 @@
|
||||
*/
|
||||
package com.food.order.system.kafka.order.avro.model;
|
||||
|
||||
import org.apache.avro.generic.GenericArray;
|
||||
import org.apache.avro.specific.SpecificData;
|
||||
import org.apache.avro.util.Utf8;
|
||||
import org.apache.avro.message.BinaryMessageEncoder;
|
||||
import org.apache.avro.message.BinaryMessageDecoder;
|
||||
import org.apache.avro.message.SchemaStore;
|
||||
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||
private static final long serialVersionUID = -3431989201238018220L;
|
||||
private static final long serialVersionUID = -5203212934279996672L;
|
||||
|
||||
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RestaurantApprovalResponseAvroModel\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"orderApprovalStatus\",\"type\":{\"type\":\"enum\",\"name\":\"OrderApprovalStatus\",\"symbols\":[\"APPROVED\",\"REJECTED\"]}},{\"name\":\"failureMessages\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RestaurantApprovalResponseAvroModel\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"sagaId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"restaurantId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"orderId\",\"type\":{\"type\":\"string\",\"logicalType\":\"uuid\"}},{\"name\":\"createdAt\",\"type\":{\"type\":\"long\",\"logicalType\":\"timestamp-millis\"}},{\"name\":\"orderApprovalStatus\",\"type\":{\"type\":\"enum\",\"name\":\"OrderApprovalStatus\",\"symbols\":[\"APPROVED\",\"REJECTED\"]}},{\"name\":\"failureMessages\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}}]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
|
||||
private static final SpecificData MODEL$ = new SpecificData();
|
||||
@@ -79,7 +81,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
private java.lang.String restaurantId;
|
||||
private java.lang.String orderId;
|
||||
private java.time.Instant createdAt;
|
||||
private OrderApprovalStatus orderApprovalStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.OrderApprovalStatus orderApprovalStatus;
|
||||
private java.util.List<java.lang.String> failureMessages;
|
||||
|
||||
/**
|
||||
@@ -99,7 +101,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param orderApprovalStatus The new value for orderApprovalStatus
|
||||
* @param failureMessages The new value for failureMessages
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String restaurantId, java.lang.String orderId, java.time.Instant createdAt, OrderApprovalStatus orderApprovalStatus, java.util.List<java.lang.String> failureMessages) {
|
||||
public RestaurantApprovalResponseAvroModel(java.lang.String id, java.lang.String sagaId, java.lang.String restaurantId, java.lang.String orderId, java.time.Instant createdAt, com.food.order.system.kafka.order.avro.model.OrderApprovalStatus orderApprovalStatus, java.util.List<java.lang.String> failureMessages) {
|
||||
this.id = id;
|
||||
this.sagaId = sagaId;
|
||||
this.restaurantId = restaurantId;
|
||||
@@ -151,7 +153,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
case 2: restaurantId = value$ != null ? value$.toString() : null; break;
|
||||
case 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||
case 4: createdAt = (java.time.Instant)value$; break;
|
||||
case 5: orderApprovalStatus = (OrderApprovalStatus)value$; break;
|
||||
case 5: orderApprovalStatus = (com.food.order.system.kafka.order.avro.model.OrderApprovalStatus)value$; break;
|
||||
case 6: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||
}
|
||||
@@ -246,7 +248,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Gets the value of the 'orderApprovalStatus' field.
|
||||
* @return The value of the 'orderApprovalStatus' field.
|
||||
*/
|
||||
public OrderApprovalStatus getOrderApprovalStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.OrderApprovalStatus getOrderApprovalStatus() {
|
||||
return orderApprovalStatus;
|
||||
}
|
||||
|
||||
@@ -255,7 +257,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Sets the value of the 'orderApprovalStatus' field.
|
||||
* @param value the value to set.
|
||||
*/
|
||||
public void setOrderApprovalStatus(OrderApprovalStatus value) {
|
||||
public void setOrderApprovalStatus(com.food.order.system.kafka.order.avro.model.OrderApprovalStatus value) {
|
||||
this.orderApprovalStatus = value;
|
||||
}
|
||||
|
||||
@@ -280,8 +282,8 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Creates a new RestaurantApprovalResponseAvroModel RecordBuilder.
|
||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalResponseAvroModel.Builder newBuilder() {
|
||||
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder() {
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,11 +291,11 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param other The existing builder to copy.
|
||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalResponseAvroModel.Builder newBuilder(RestaurantApprovalResponseAvroModel.Builder other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder other) {
|
||||
if (other == null) {
|
||||
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
||||
} else {
|
||||
return new RestaurantApprovalResponseAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,11 +304,11 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param other The existing instance to copy.
|
||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||
*/
|
||||
public static RestaurantApprovalResponseAvroModel.Builder newBuilder(RestaurantApprovalResponseAvroModel other) {
|
||||
public static com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel other) {
|
||||
if (other == null) {
|
||||
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
||||
} else {
|
||||
return new RestaurantApprovalResponseAvroModel.Builder(other);
|
||||
return new com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder(other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +324,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
private java.lang.String restaurantId;
|
||||
private java.lang.String orderId;
|
||||
private java.time.Instant createdAt;
|
||||
private OrderApprovalStatus orderApprovalStatus;
|
||||
private com.food.order.system.kafka.order.avro.model.OrderApprovalStatus orderApprovalStatus;
|
||||
private java.util.List<java.lang.String> failureMessages;
|
||||
|
||||
/** Creates a new Builder */
|
||||
@@ -334,7 +336,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Creates a Builder by copying an existing Builder.
|
||||
* @param other The existing Builder to copy.
|
||||
*/
|
||||
private Builder(RestaurantApprovalResponseAvroModel.Builder other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder other) {
|
||||
super(other);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -370,7 +372,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Creates a Builder by copying an existing RestaurantApprovalResponseAvroModel instance
|
||||
* @param other The existing instance to copy.
|
||||
*/
|
||||
private Builder(RestaurantApprovalResponseAvroModel other) {
|
||||
private Builder(com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel other) {
|
||||
super(SCHEMA$, MODEL$);
|
||||
if (isValidValue(fields()[0], other.id)) {
|
||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||
@@ -416,7 +418,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'id'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setId(java.lang.String value) {
|
||||
validate(fields()[0], value);
|
||||
this.id = value;
|
||||
fieldSetFlags()[0] = true;
|
||||
@@ -436,7 +438,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'id' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearId() {
|
||||
id = null;
|
||||
fieldSetFlags()[0] = false;
|
||||
return this;
|
||||
@@ -456,7 +458,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'sagaId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||
validate(fields()[1], value);
|
||||
this.sagaId = value;
|
||||
fieldSetFlags()[1] = true;
|
||||
@@ -476,7 +478,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'sagaId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearSagaId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearSagaId() {
|
||||
sagaId = null;
|
||||
fieldSetFlags()[1] = false;
|
||||
return this;
|
||||
@@ -496,7 +498,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'restaurantId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||
validate(fields()[2], value);
|
||||
this.restaurantId = value;
|
||||
fieldSetFlags()[2] = true;
|
||||
@@ -516,7 +518,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'restaurantId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearRestaurantId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearRestaurantId() {
|
||||
restaurantId = null;
|
||||
fieldSetFlags()[2] = false;
|
||||
return this;
|
||||
@@ -536,7 +538,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'orderId'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||
validate(fields()[3], value);
|
||||
this.orderId = value;
|
||||
fieldSetFlags()[3] = true;
|
||||
@@ -556,7 +558,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'orderId' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearOrderId() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearOrderId() {
|
||||
orderId = null;
|
||||
fieldSetFlags()[3] = false;
|
||||
return this;
|
||||
@@ -576,7 +578,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'createdAt'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||
validate(fields()[4], value);
|
||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||
fieldSetFlags()[4] = true;
|
||||
@@ -596,7 +598,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'createdAt' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearCreatedAt() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearCreatedAt() {
|
||||
fieldSetFlags()[4] = false;
|
||||
return this;
|
||||
}
|
||||
@@ -605,7 +607,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Gets the value of the 'orderApprovalStatus' field.
|
||||
* @return The value.
|
||||
*/
|
||||
public OrderApprovalStatus getOrderApprovalStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.OrderApprovalStatus getOrderApprovalStatus() {
|
||||
return orderApprovalStatus;
|
||||
}
|
||||
|
||||
@@ -615,7 +617,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'orderApprovalStatus'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setOrderApprovalStatus(OrderApprovalStatus value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setOrderApprovalStatus(com.food.order.system.kafka.order.avro.model.OrderApprovalStatus value) {
|
||||
validate(fields()[5], value);
|
||||
this.orderApprovalStatus = value;
|
||||
fieldSetFlags()[5] = true;
|
||||
@@ -635,7 +637,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'orderApprovalStatus' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearOrderApprovalStatus() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearOrderApprovalStatus() {
|
||||
orderApprovalStatus = null;
|
||||
fieldSetFlags()[5] = false;
|
||||
return this;
|
||||
@@ -655,7 +657,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* @param value The value of 'failureMessages'.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||
validate(fields()[6], value);
|
||||
this.failureMessages = value;
|
||||
fieldSetFlags()[6] = true;
|
||||
@@ -675,7 +677,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
* Clears the value of the 'failureMessages' field.
|
||||
* @return This builder.
|
||||
*/
|
||||
public RestaurantApprovalResponseAvroModel.Builder clearFailureMessages() {
|
||||
public com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearFailureMessages() {
|
||||
failureMessages = null;
|
||||
fieldSetFlags()[6] = false;
|
||||
return this;
|
||||
@@ -691,7 +693,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
||||
record.restaurantId = fieldSetFlags()[2] ? this.restaurantId : (java.lang.String) defaultValue(fields()[2]);
|
||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
||||
record.createdAt = fieldSetFlags()[4] ? this.createdAt : (java.time.Instant) defaultValue(fields()[4]);
|
||||
record.orderApprovalStatus = fieldSetFlags()[5] ? this.orderApprovalStatus : (OrderApprovalStatus) defaultValue(fields()[5]);
|
||||
record.orderApprovalStatus = fieldSetFlags()[5] ? this.orderApprovalStatus : (com.food.order.system.kafka.order.avro.model.OrderApprovalStatus) defaultValue(fields()[5]);
|
||||
record.failureMessages = fieldSetFlags()[6] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[6]);
|
||||
return record;
|
||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||
|
||||
@@ -7,7 +7,7 @@ package com.food.order.system.kafka.order.avro.model;
|
||||
@org.apache.avro.specific.AvroGenerated
|
||||
public enum RestaurantOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<RestaurantOrderStatus> {
|
||||
PAID ;
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"RestaurantOrderStatus\",\"namespace\":\"com.food.ordering.system.kafka.order.avro.model\",\"symbols\":[\"PAID\"]}");
|
||||
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"RestaurantOrderStatus\",\"namespace\":\"com.food.order.system.kafka.order.avro.model\",\"symbols\":[\"PAID\"]}");
|
||||
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
|
||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"namespace": "com.food.ordering.system.kafka.order.avro.model",
|
||||
"namespace": "com.food.order.system.kafka.order.avro.model",
|
||||
"type": "record",
|
||||
"name": "PaymentResponseAvroModel",
|
||||
"fields": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"namespace": "com.food.ordering.system.kafka.order.avro.model",
|
||||
"namespace": "com.food.order.system.kafka.order.avro.model",
|
||||
"type": "record",
|
||||
"name": "RestaurantApprovalRequestAvroModel",
|
||||
"fields": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"namespace": "com.food.ordering.system.kafka.order.avro.model",
|
||||
"namespace": "com.food.order.system.kafka.order.avro.model",
|
||||
"type": "record",
|
||||
"name": "RestaurantApprovalResponseAvroModel",
|
||||
"fields": [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.food.order.system.order.messaging.publisher.kafka;
|
||||
package com.food.order.system.kafka.producer;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.kafka.clients.producer.RecordMetadata;
|
||||
@@ -8,7 +8,7 @@ import org.springframework.util.concurrent.ListenableFutureCallback;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class OrderKafkaMessageHelper {
|
||||
public class KafkaMessageHelper {
|
||||
|
||||
public <T> ListenableFutureCallback<SendResult<String, T>> getKafkaCallBack
|
||||
(String responseTopicName, T t,String orderId, String requestAvroModelName) {
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.food.order.system.order.messaging.listener.kafka;
|
||||
|
||||
import com.food.order.sysyem.ports.input.message.listener.payment.PaymentResponseMessageListener;
|
||||
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentStatus;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.sysyem.ports.input.message.listener.payment.PaymentResponseMessageListener;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.food.order.system.order.messaging.listener.kafka;
|
||||
|
||||
import com.food.order.sysyem.ports.input.message.listener.restaurantapproval.RestaurantApprovalResponseMessageListener;
|
||||
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.system.kafka.order.avro.model.OrderApprovalStatus;
|
||||
import com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.sysyem.ports.input.message.listener.restaurantapproval.RestaurantApprovalResponseMessageListener;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.food.order.system.order.messaging.publisher.kafka;
|
||||
|
||||
import com.food.order.system.domain.event.OrderCancelledEvent;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.sysyem.config.OrderServiceConfigData;
|
||||
import com.food.order.sysyem.ports.output.message.publisher.payment.OrderCancelledPaymentRequestMessagePublisher;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -19,7 +20,7 @@ public class CancelOrderKafkaMessagePublisher implements OrderCancelledPaymentRe
|
||||
private final OrderServiceConfigData configData;
|
||||
private final KafkaProducer<String, PaymentRequestAvroModel> kafkaProducer;
|
||||
|
||||
private final OrderKafkaMessageHelper orderKafkaMessageHelper;
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
@Override
|
||||
public void publish(OrderCancelledEvent event) {
|
||||
@@ -35,7 +36,7 @@ public class CancelOrderKafkaMessagePublisher implements OrderCancelledPaymentRe
|
||||
configData.getPaymentRequestTopicName(),
|
||||
orderId,
|
||||
paymentRequestAvroModel,
|
||||
orderKafkaMessageHelper.getKafkaCallBack(configData.getPaymentRequestTopicName()
|
||||
kafkaMessageHelper.getKafkaCallBack(configData.getPaymentRequestTopicName()
|
||||
,paymentRequestAvroModel,
|
||||
orderId,
|
||||
"PaymentRequestAvroModel"));
|
||||
|
||||
@@ -2,11 +2,12 @@ package com.food.order.system.order.messaging.publisher.kafka;
|
||||
|
||||
|
||||
import com.food.order.system.domain.event.OrderCreatedEvent;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.sysyem.config.OrderServiceConfigData;
|
||||
import com.food.order.sysyem.ports.output.message.publisher.payment.OrderCreatedPaymentRequestMessagePublisher;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -19,7 +20,7 @@ public class CreateOrderKafkaMessagePublisher implements OrderCreatedPaymentRequ
|
||||
private final OrderMessagingDataMapper orderMessagingDataMapper;
|
||||
private final OrderServiceConfigData configData;
|
||||
private final KafkaProducer<String, PaymentRequestAvroModel> kafkaProducer;
|
||||
private final OrderKafkaMessageHelper orderKafkaMessageHelper;
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -35,7 +36,7 @@ public class CreateOrderKafkaMessagePublisher implements OrderCreatedPaymentRequ
|
||||
configData.getPaymentRequestTopicName(),
|
||||
orderId,
|
||||
paymentRequestAvroModel,
|
||||
orderKafkaMessageHelper.getKafkaCallBack(configData.getPaymentRequestTopicName(),
|
||||
kafkaMessageHelper.getKafkaCallBack(configData.getPaymentRequestTopicName(),
|
||||
paymentRequestAvroModel,
|
||||
orderId,
|
||||
"PaymentRequestAvroModel"));
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.food.order.system.order.messaging.publisher.kafka;
|
||||
|
||||
import com.food.order.sysyem.config.OrderServiceConfigData;
|
||||
import com.food.order.sysyem.ports.output.message.publisher.restaurantapproval.OrderPaidRestaurantRequestMessagePublisher;
|
||||
import com.food.order.system.domain.event.OrderPaidEvent;
|
||||
import com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||
import com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel;
|
||||
import com.food.order.sysyem.config.OrderServiceConfigData;
|
||||
import com.food.order.sysyem.ports.output.message.publisher.restaurantapproval.OrderPaidRestaurantRequestMessagePublisher;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -18,7 +19,7 @@ public class PayOrderKafkaMessagePublisher implements OrderPaidRestaurantRequest
|
||||
private final OrderMessagingDataMapper orderMessagingDataMapper;
|
||||
private final OrderServiceConfigData configData;
|
||||
private final KafkaProducer<String, RestaurantApprovalRequestAvroModel> kafkaProducer;
|
||||
private final OrderKafkaMessageHelper orderKafkaMessageHelper;
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
@Override
|
||||
public void publish(OrderPaidEvent event) {
|
||||
@@ -32,7 +33,7 @@ public class PayOrderKafkaMessagePublisher implements OrderPaidRestaurantRequest
|
||||
kafkaProducer.send(configData.getRestaurantApprovalRequestTopicName(),
|
||||
orderId,
|
||||
message,
|
||||
orderKafkaMessageHelper.getKafkaCallBack(configData.getRestaurantApprovalRequestTopicName(), message,
|
||||
kafkaMessageHelper.getKafkaCallBack(configData.getRestaurantApprovalRequestTopicName(), message,
|
||||
orderId,
|
||||
"RestaurantApprovalRequestAvroModel"));
|
||||
|
||||
|
||||
@@ -11,5 +11,54 @@
|
||||
|
||||
<artifactId>payment-container</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-domain-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-application-service</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-dataaccess</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-messaging</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<image>
|
||||
<name>${project.groupId}/payment.service:${project.version}</name>
|
||||
</image>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>build-image</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.food.order.system.payment.service.domain;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class BeanConfig {
|
||||
|
||||
@Bean
|
||||
public PaymentDomainService paymentDomainService() {
|
||||
return new PaymentDomainServiceImpl();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.food.order.system.payment.service.domain;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
@EnableJpaRepositories(basePackages = "com.food.order.system.payment.data.access")
|
||||
@EntityScan(basePackages = "com.food.order.system.payment.data.access")
|
||||
@SpringBootApplication(scanBasePackages = "com.food.order")
|
||||
public class PaymentServiceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PaymentServiceApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
server:
|
||||
port: 8182
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.food.order.system: DEBUG
|
||||
|
||||
payment-service:
|
||||
payment-request-topic-name: payment-request-value
|
||||
payment-response-topic-name: payment-response-value
|
||||
|
||||
spring:
|
||||
jpa:
|
||||
open-in-view: false
|
||||
show-sql: true
|
||||
database-platform: org.hibernate.dialect.PostgreSQL9Dialect
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.PostgreSQL9Dialect
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=payment&binaryTransfer=true&reWriteBatchedInserts=true&stringtype=unspecified
|
||||
username: postgres
|
||||
password: postgres
|
||||
driver-class-name: org.postgresql.Driver
|
||||
platform: postgres
|
||||
schema: classpath:init-schema.sql
|
||||
data: classpath:init-data.sql
|
||||
initialization-mode: always
|
||||
|
||||
kafka-config:
|
||||
bootstrap-servers: localhost:19092, localhost:29092, localhost:39092
|
||||
schema-registry-url-key: schema.registry.url
|
||||
schema-registry-url: http://localhost:8081
|
||||
num-of-partitions: 3
|
||||
replication-factor: 3
|
||||
|
||||
kafka-producer-config:
|
||||
key-serializer-class: org.apache.kafka.common.serialization.StringSerializer
|
||||
value-serializer-class: io.confluent.kafka.serializers.KafkaAvroSerializer
|
||||
compression-type: snappy
|
||||
acks: all
|
||||
batch-size: 16384
|
||||
batch-size-boost-factor: 100
|
||||
linger-ms: 5
|
||||
request-timeout-ms: 60000
|
||||
retry-count: 5
|
||||
|
||||
kafka-consumer-config:
|
||||
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||
value-deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
|
||||
payment-consumer-group-id: payment-topic-consumer
|
||||
auto-offset-reset: earliest
|
||||
specific-avro-reader-key: specific.avro.reader
|
||||
specific-avro-reader: true
|
||||
batch-listener: true
|
||||
auto-startup: true
|
||||
concurrency-level: 3
|
||||
session-timeout-ms: 10000
|
||||
heartbeat-interval-ms: 3000
|
||||
max-poll-interval-ms: 300000
|
||||
max-poll-records: 500
|
||||
max-partition-fetch-bytes-default: 1048576
|
||||
max-partition-fetch-bytes-boost-factor: 1
|
||||
poll-timeout-ms: 150
|
||||
@@ -0,0 +1,17 @@
|
||||
INSERT INTO payment.credit_entry(id, customer_id, total_credit_amount)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb21', 'd215b5f8-0249-4dc5-89a3-51fd148cfb41', 500.00);
|
||||
INSERT INTO payment.credit_history(id, customer_id, amount, type)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb23', 'd215b5f8-0249-4dc5-89a3-51fd148cfb41', 100.00, 'CREDIT');
|
||||
INSERT INTO payment.credit_history(id, customer_id, amount, type)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb24', 'd215b5f8-0249-4dc5-89a3-51fd148cfb41', 600.00, 'CREDIT');
|
||||
INSERT INTO payment.credit_history(id, customer_id, amount, type)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb25', 'd215b5f8-0249-4dc5-89a3-51fd148cfb41', 200.00, 'DEBIT');
|
||||
|
||||
|
||||
INSERT INTO payment.credit_entry(id, customer_id, total_credit_amount)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb22', 'd215b5f8-0249-4dc5-89a3-51fd148cfb43', 100.00);
|
||||
INSERT INTO payment.credit_history(id, customer_id, amount, type)
|
||||
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb26', 'd215b5f8-0249-4dc5-89a3-51fd148cfb43', 100.00, 'CREDIT');
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
DROP SCHEMA IF EXISTS payment CASCADE;
|
||||
|
||||
CREATE SCHEMA payment;
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
|
||||
DROP TYPE IF EXISTS payment_status;
|
||||
|
||||
CREATE TYPE payment_status AS ENUM ('COMPLETED', 'CANCELLED', 'FAILED');
|
||||
|
||||
DROP TABLE IF EXISTS "payment".payments CASCADE;
|
||||
|
||||
CREATE TABLE "payment".payments
|
||||
(
|
||||
id uuid NOT NULL,
|
||||
customer_id uuid NOT NULL,
|
||||
order_id uuid NOT NULL,
|
||||
price numeric(10,2) NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
status payment_status NOT NULL,
|
||||
CONSTRAINT payments_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS "payment".credit_entry CASCADE;
|
||||
|
||||
CREATE TABLE "payment".credit_entry
|
||||
(
|
||||
id uuid NOT NULL,
|
||||
customer_id uuid NOT NULL,
|
||||
total_credit_amount numeric(10,2) NOT NULL,
|
||||
CONSTRAINT credit_entry_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
DROP TYPE IF EXISTS transaction_type;
|
||||
|
||||
CREATE TYPE transaction_type AS ENUM ('DEBIT', 'CREDIT');
|
||||
|
||||
DROP TABLE IF EXISTS "payment".credit_history CASCADE;
|
||||
|
||||
CREATE TABLE "payment".credit_history
|
||||
(
|
||||
id uuid NOT NULL,
|
||||
customer_id uuid NOT NULL,
|
||||
amount numeric(10,2) NOT NULL,
|
||||
type transaction_type NOT NULL,
|
||||
CONSTRAINT credit_history_pkey PRIMARY KEY (id)
|
||||
);
|
||||
@@ -2,7 +2,6 @@ package com.food.order.system.payment.data.access.credithistory.adapter;
|
||||
|
||||
|
||||
import com.food.order.system.payment.application.service.ports.output.repository.CreditHistoryRepository;
|
||||
import com.food.order.system.payment.data.access.credithistory.entity.CreditHistoryEntity;
|
||||
import com.food.order.system.payment.data.access.credithistory.mapper.CreditHistoryDataAccessMapper;
|
||||
import com.food.order.system.payment.data.access.credithistory.repository.CreditHistoryJpaRepository;
|
||||
import com.food.order.system.payment.service.domain.entity.CreditHistory;
|
||||
@@ -11,7 +10,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class CreditHistoryRepositoryImpl implements CreditHistoryRepository {
|
||||
@@ -33,12 +31,11 @@ public class CreditHistoryRepositoryImpl implements CreditHistoryRepository {
|
||||
|
||||
@Override
|
||||
public Optional<List<CreditHistory>> findByCustomerId(CustomerId customerId) {
|
||||
Optional<List<CreditHistoryEntity>> creditHistory =
|
||||
creditHistoryJpaRepository.findByCustomerId(customerId.getValue());
|
||||
return creditHistory
|
||||
return creditHistoryJpaRepository.findByCustomerId(customerId.getValue())
|
||||
.map(creditHistoryList ->
|
||||
creditHistoryList.stream()
|
||||
.map(creditHistoryDataAccessMapper::creditHistoryEntityToCreditHistory)
|
||||
.collect(Collectors.toList()));
|
||||
.toList());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,25 @@
|
||||
|
||||
<artifactId>payment-messaging</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-application-service</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>kafka-producer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>kafka-consumer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>kafka-model</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.food.order.system.payment.messaging.listener.kafka;
|
||||
|
||||
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import com.food.order.system.payment.application.service.ports.input.message.listener.PaymentRequestMessageListener;
|
||||
import com.food.order.system.payment.messaging.mapper.PaymentMessagingDataMapper;
|
||||
import com.food.order.sysyem.valueobject.PaymentOrderStatus;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.kafka.support.KafkaHeaders;
|
||||
import org.springframework.messaging.handler.annotation.Header;
|
||||
import org.springframework.messaging.handler.annotation.Payload;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class PaymentRequestKafkaListener implements KafkaConsumer<PaymentRequestAvroModel> {
|
||||
|
||||
private final PaymentMessagingDataMapper paymentMessagingDataMapper;
|
||||
private final PaymentRequestMessageListener paymentRequestMessageListener;
|
||||
|
||||
|
||||
@Override
|
||||
@KafkaListener(id = "${kafka-consumer-config.payment-consumer-group-id}",
|
||||
topics = "${payment-service.payment-request-topic-name}")
|
||||
public void receive(@Payload List<PaymentRequestAvroModel> messages,
|
||||
@Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) List<String> keys,
|
||||
@Header(KafkaHeaders.RECEIVED_PARTITION_ID) List<Integer> partitions,
|
||||
@Header(KafkaHeaders.OFFSET) List<Long> offsets) {
|
||||
log.info("{} number of payment requests received with keys:{}, partitions:{} and offsets: {}",
|
||||
messages.size(),
|
||||
keys.toString(),
|
||||
partitions.toString(),
|
||||
offsets.toString());
|
||||
|
||||
messages.forEach(paymentRequestAvroModel -> {
|
||||
if (PaymentOrderStatus.PENDING.name().equalsIgnoreCase(paymentRequestAvroModel.getPaymentOrderStatus().name())) {
|
||||
log.info("Processing payment for order id: {}", paymentRequestAvroModel.getOrderId());
|
||||
paymentRequestMessageListener.completePayment(paymentMessagingDataMapper
|
||||
.paymentRequestAvroModelToPaymentRequest(paymentRequestAvroModel));
|
||||
} else if(PaymentOrderStatus.CANCELLED.name().equalsIgnoreCase(paymentRequestAvroModel.getPaymentOrderStatus().name())) {
|
||||
log.info("Cancelling payment for order id: {}", paymentRequestAvroModel.getOrderId());
|
||||
paymentRequestMessageListener.cancelPayment(paymentMessagingDataMapper
|
||||
.paymentRequestAvroModelToPaymentRequest(paymentRequestAvroModel));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.food.order.system.payment.messaging.mapper;
|
||||
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentStatus;
|
||||
import com.food.order.system.payment.application.service.dto.PaymentRequest;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentCancelledEvent;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentCompletedEvent;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentFailedEvent;
|
||||
import com.food.order.sysyem.valueobject.PaymentOrderStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
public class PaymentMessagingDataMapper {
|
||||
|
||||
public PaymentResponseAvroModel paymentCompletedEventToPaymentResponseAvroModel(PaymentCompletedEvent paymentCompletedEvent) {
|
||||
return PaymentResponseAvroModel.newBuilder()
|
||||
.setId(UUID.randomUUID().toString())
|
||||
.setSagaId("")
|
||||
.setPaymentId(paymentCompletedEvent.getPayment().getId().getValue().toString())
|
||||
.setCustomerId(paymentCompletedEvent.getPayment().getCustomerId().getValue().toString())
|
||||
.setOrderId(paymentCompletedEvent.getPayment().getOrderId().getValue().toString())
|
||||
.setPrice(paymentCompletedEvent.getPayment().getPrice().getAmount())
|
||||
.setCreatedAt(paymentCompletedEvent.getPayment().getCreatedAt().toInstant())
|
||||
.setPaymentStatus(PaymentStatus.valueOf(paymentCompletedEvent.getPayment().getStatus().name()))
|
||||
.setFailureMessages(paymentCompletedEvent.getFailureMessages())
|
||||
.build();
|
||||
}
|
||||
|
||||
public PaymentResponseAvroModel paymentCancelEventToPaymentResponseAvroModel(PaymentCancelledEvent paymentCancelledEvent) {
|
||||
return PaymentResponseAvroModel.newBuilder()
|
||||
.setId(UUID.randomUUID().toString())
|
||||
.setSagaId("")
|
||||
.setPaymentId(paymentCancelledEvent.getPayment().getId().getValue().toString())
|
||||
.setCustomerId(paymentCancelledEvent.getPayment().getCustomerId().getValue().toString())
|
||||
.setOrderId(paymentCancelledEvent.getPayment().getOrderId().getValue().toString())
|
||||
.setPrice(paymentCancelledEvent.getPayment().getPrice().getAmount())
|
||||
.setCreatedAt(paymentCancelledEvent.getPayment().getCreatedAt().toInstant())
|
||||
.setPaymentStatus(PaymentStatus.valueOf(paymentCancelledEvent.getPayment().getStatus().name()))
|
||||
.setFailureMessages(paymentCancelledEvent.getFailureMessages())
|
||||
.build();
|
||||
}
|
||||
|
||||
public PaymentResponseAvroModel paymentFailedEventToPaymentResponseAvroModel(PaymentFailedEvent paymentFailedEvent) {
|
||||
return PaymentResponseAvroModel.newBuilder()
|
||||
.setId(UUID.randomUUID().toString())
|
||||
.setSagaId("")
|
||||
.setPaymentId(paymentFailedEvent.getPayment().getId().getValue().toString())
|
||||
.setCustomerId(paymentFailedEvent.getPayment().getCustomerId().getValue().toString())
|
||||
.setOrderId(paymentFailedEvent.getPayment().getOrderId().getValue().toString())
|
||||
.setPrice(paymentFailedEvent.getPayment().getPrice().getAmount())
|
||||
.setCreatedAt(paymentFailedEvent.getPayment().getCreatedAt().toInstant())
|
||||
.setPaymentStatus(PaymentStatus.valueOf(paymentFailedEvent.getPayment().getStatus().name()))
|
||||
.setFailureMessages(paymentFailedEvent.getFailureMessages())
|
||||
.build();
|
||||
}
|
||||
|
||||
public PaymentRequest paymentRequestAvroModelToPaymentRequest(PaymentRequestAvroModel paymentRequestAvroModel) {
|
||||
return PaymentRequest.builder()
|
||||
.id(paymentRequestAvroModel.getId())
|
||||
.sagaId(paymentRequestAvroModel.getSagaId())
|
||||
.customerId(paymentRequestAvroModel.getCustomerId())
|
||||
.orderId(paymentRequestAvroModel.getOrderId())
|
||||
.price(paymentRequestAvroModel.getPrice())
|
||||
.createdAt(paymentRequestAvroModel.getCreatedAt())
|
||||
.status(PaymentOrderStatus.valueOf(paymentRequestAvroModel.getPaymentOrderStatus().name()))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.food.order.system.payment.messaging.publisher.kafka;
|
||||
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.payment.application.service.config.PaymentServiceConfigData;
|
||||
import com.food.order.system.payment.application.service.ports.output.message.publisher.PaymentCancelledMessagePublisher;
|
||||
import com.food.order.system.payment.messaging.mapper.PaymentMessagingDataMapper;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentCancelledEvent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class PaymentCancelledKafkaMessagePublisher implements PaymentCancelledMessagePublisher {
|
||||
|
||||
private final PaymentMessagingDataMapper paymentDataMapper;
|
||||
private final KafkaProducer<String , PaymentResponseAvroModel> kafkaProducer;
|
||||
private final PaymentServiceConfigData paymentServiceConfigData;
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
|
||||
@Override
|
||||
public void publish(PaymentCancelledEvent event) {
|
||||
log.info("Publishing payment cancelled event to kafka");
|
||||
var orderId = event.getPayment().getOrderId().getValue().toString();
|
||||
try {
|
||||
var paymentResponseAvroModel =
|
||||
paymentDataMapper.paymentCancelEventToPaymentResponseAvroModel(event);
|
||||
|
||||
kafkaProducer.send(paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
orderId,
|
||||
paymentResponseAvroModel,
|
||||
kafkaMessageHelper.getKafkaCallBack(
|
||||
paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
paymentResponseAvroModel,
|
||||
orderId,
|
||||
"PaymentResponseAvroModel"));
|
||||
|
||||
log.info("Published payment cancelled event to kafka");
|
||||
} catch (Exception e) {
|
||||
log.error("Error while publishing payment cancelled event to kafka", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.food.order.system.payment.messaging.publisher.kafka;
|
||||
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.payment.application.service.config.PaymentServiceConfigData;
|
||||
import com.food.order.system.payment.application.service.ports.output.message.publisher.PaymentCompletedMessagePublisher;
|
||||
import com.food.order.system.payment.messaging.mapper.PaymentMessagingDataMapper;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentCompletedEvent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class PaymentCompletedKafkaMessagePublisher implements PaymentCompletedMessagePublisher {
|
||||
|
||||
private final PaymentMessagingDataMapper paymentDataMapper;
|
||||
private final KafkaProducer<String , PaymentResponseAvroModel> kafkaProducer;
|
||||
private final PaymentServiceConfigData paymentServiceConfigData;
|
||||
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
|
||||
@Override
|
||||
public void publish(PaymentCompletedEvent event) {
|
||||
log.info("Publishing payment completed event to kafka");
|
||||
var orderId = event.getPayment().getOrderId().getValue().toString();
|
||||
try {
|
||||
var paymentResponseAvroModel =
|
||||
paymentDataMapper.paymentCompletedEventToPaymentResponseAvroModel(event);
|
||||
|
||||
kafkaProducer.send(paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
orderId,
|
||||
paymentResponseAvroModel,
|
||||
kafkaMessageHelper.getKafkaCallBack(
|
||||
paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
paymentResponseAvroModel,
|
||||
orderId,
|
||||
"PaymentResponseAvroModel"));
|
||||
|
||||
log.info("Published payment completed event to kafka");
|
||||
} catch (Exception e) {
|
||||
log.error("Error while publishing payment completed event to kafka", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.food.order.system.payment.messaging.publisher.kafka;
|
||||
|
||||
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||
import com.food.order.system.kafka.producer.KafkaMessageHelper;
|
||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||
import com.food.order.system.payment.application.service.config.PaymentServiceConfigData;
|
||||
import com.food.order.system.payment.application.service.ports.output.message.publisher.PaymentFailedMessagePublisher;
|
||||
import com.food.order.system.payment.messaging.mapper.PaymentMessagingDataMapper;
|
||||
import com.food.order.system.payment.service.domain.event.PaymentFailedEvent;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class PaymentFailedKafkaMessagePublisher implements PaymentFailedMessagePublisher {
|
||||
|
||||
private final PaymentMessagingDataMapper paymentDataMapper;
|
||||
private final KafkaProducer<String , PaymentResponseAvroModel> kafkaProducer;
|
||||
private final PaymentServiceConfigData paymentServiceConfigData;
|
||||
|
||||
private final KafkaMessageHelper kafkaMessageHelper;
|
||||
|
||||
|
||||
@Override
|
||||
public void publish(PaymentFailedEvent event) {
|
||||
log.info("Publishing payment failed event to kafka");
|
||||
var orderId = event.getPayment().getOrderId().getValue().toString();
|
||||
try {
|
||||
var paymentResponseAvroModel =
|
||||
paymentDataMapper.paymentFailedEventToPaymentResponseAvroModel(event);
|
||||
|
||||
kafkaProducer.send(paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
orderId,
|
||||
paymentResponseAvroModel,
|
||||
kafkaMessageHelper.getKafkaCallBack(
|
||||
paymentServiceConfigData.getPaymentResponseTopicName(),
|
||||
paymentResponseAvroModel,
|
||||
orderId,
|
||||
"PaymentResponseAvroModel"));
|
||||
|
||||
log.info("Published payment failed event to kafka");
|
||||
} catch (Exception e) {
|
||||
log.error("Error while publishing payment failed event to kafka", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
pom.xml
19
pom.xml
@@ -60,6 +60,25 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-domain-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-dataaccess</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>payment-messaging</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.food.order</groupId>
|
||||
<artifactId>order-application-service</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user