Fix bug
This commit is contained in:
55
customer-service/pom.xml
Normal file
55
customer-service/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>food-ordering-system</artifactId>
|
||||||
|
<groupId>com.food.order</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>customer-service</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<image>
|
||||||
|
<name>${project.groupId}/customer.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,13 @@
|
|||||||
|
package com.food.order.system.customer.service;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication(scanBasePackages = "com.food.order")
|
||||||
|
public class CustomerServiceApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(CustomerServiceApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
22
customer-service/src/main/resources/application.yml
Normal file
22
customer-service/src/main/resources/application.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
server:
|
||||||
|
port: 8184
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jpa:
|
||||||
|
open-in-view: false
|
||||||
|
show-sql: false
|
||||||
|
database-platform: org.hibernate.dialect.PostgreSQL9Dialect
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
dialect: org.hibernate.dialect.PostgreSQL9Dialect
|
||||||
|
datasource:
|
||||||
|
url: jdbc:postgresql://localhost:5432/postgres?currentSchema=customer&binaryTransfer=true&reWriteBatchedInserts=true
|
||||||
|
username: postgres
|
||||||
|
password: postgres
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
sql:
|
||||||
|
init:
|
||||||
|
mode: always
|
||||||
|
schema-locations: classpath:init-schema.sql
|
||||||
|
data-locations: classpath:init-data.sql
|
||||||
|
platform: postgres
|
||||||
5
customer-service/src/main/resources/init-data.sql
Normal file
5
customer-service/src/main/resources/init-data.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
INSERT INTO customer.customers(id, username, first_name, last_name)
|
||||||
|
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb41', 'user_1', 'First', 'User');
|
||||||
|
|
||||||
|
INSERT INTO customer.customers(id, username, first_name, last_name)
|
||||||
|
VALUES ('d215b5f8-0249-4dc5-89a3-51fd148cfb42', 'user_2', 'Second', 'User');
|
||||||
46
customer-service/src/main/resources/init-schema.sql
Normal file
46
customer-service/src/main/resources/init-schema.sql
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
DROP SCHEMA IF EXISTS customer CASCADE;
|
||||||
|
|
||||||
|
CREATE SCHEMA customer;
|
||||||
|
|
||||||
|
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||||
|
|
||||||
|
CREATE TABLE customer.customers
|
||||||
|
(
|
||||||
|
id uuid NOT NULL,
|
||||||
|
username character varying COLLATE pg_catalog."default" NOT NULL,
|
||||||
|
first_name character varying COLLATE pg_catalog."default" NOT NULL,
|
||||||
|
last_name character varying COLLATE pg_catalog."default" NOT NULL,
|
||||||
|
CONSTRAINT customers_pkey PRIMARY KEY (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
DROP MATERIALIZED VIEW IF EXISTS customer.order_customer_m_view;
|
||||||
|
|
||||||
|
CREATE MATERIALIZED VIEW customer.order_customer_m_view
|
||||||
|
TABLESPACE pg_default
|
||||||
|
AS
|
||||||
|
SELECT id,
|
||||||
|
username,
|
||||||
|
first_name,
|
||||||
|
last_name
|
||||||
|
FROM customer.customers
|
||||||
|
WITH DATA;
|
||||||
|
|
||||||
|
refresh materialized VIEW customer.order_customer_m_view;
|
||||||
|
|
||||||
|
DROP function IF EXISTS customer.refresh_order_customer_m_view;
|
||||||
|
|
||||||
|
CREATE OR replace function customer.refresh_order_customer_m_view()
|
||||||
|
returns trigger
|
||||||
|
AS '
|
||||||
|
BEGIN
|
||||||
|
refresh materialized VIEW customer.order_customer_m_view;
|
||||||
|
return null;
|
||||||
|
END;
|
||||||
|
' LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
DROP trigger IF EXISTS refresh_order_customer_m_view ON customer.customers;
|
||||||
|
|
||||||
|
CREATE trigger refresh_order_customer_m_view
|
||||||
|
after INSERT OR UPDATE OR DELETE OR truncate
|
||||||
|
ON customer.customers FOR each statement
|
||||||
|
EXECUTE PROCEDURE customer.refresh_order_customer_m_view();
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
package com.food.order.system.kafka.order.avro.model;
|
||||||
@org.apache.avro.specific.AvroGenerated
|
@org.apache.avro.specific.AvroGenerated
|
||||||
public enum OrderApprovalStatus implements org.apache.avro.generic.GenericEnumSymbol<OrderApprovalStatus> {
|
public enum OrderApprovalStatus implements org.apache.avro.generic.GenericEnumSymbol<OrderApprovalStatus> {
|
||||||
APPROVED, REJECTED ;
|
APPROVED, REJECTED ;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
package com.food.order.system.kafka.order.avro.model;
|
||||||
@org.apache.avro.specific.AvroGenerated
|
@org.apache.avro.specific.AvroGenerated
|
||||||
public enum PaymentOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentOrderStatus> {
|
public enum PaymentOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentOrderStatus> {
|
||||||
PENDING, CANCELLED ;
|
PENDING, CANCELLED ;
|
||||||
@@ -3,14 +3,12 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
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.BinaryMessageDecoder;
|
||||||
|
import org.apache.avro.message.BinaryMessageEncoder;
|
||||||
import org.apache.avro.message.SchemaStore;
|
import org.apache.avro.message.SchemaStore;
|
||||||
|
import org.apache.avro.specific.SpecificData;
|
||||||
|
|
||||||
@org.apache.avro.specific.AvroGenerated
|
@org.apache.avro.specific.AvroGenerated
|
||||||
public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
|
||||||
@@ -77,13 +75,13 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
return DECODER.decode(b);
|
return DECODER.decode(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
private java.lang.String id;
|
private String id;
|
||||||
private java.lang.String sagaId;
|
private String sagaId;
|
||||||
private java.lang.String customerId;
|
private String customerId;
|
||||||
private java.lang.String orderId;
|
private String orderId;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus;
|
private PaymentOrderStatus paymentOrderStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. Note that this does not initialize fields
|
* Default constructor. Note that this does not initialize fields
|
||||||
@@ -102,7 +100,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param createdAt The new value for createdAt
|
* @param createdAt The new value for createdAt
|
||||||
* @param paymentOrderStatus The new value for paymentOrderStatus
|
* @param paymentOrderStatus The new value for 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.ordering.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus) {
|
public PaymentRequestAvroModel(String id, String sagaId, String customerId, String orderId, java.math.BigDecimal price, java.time.Instant createdAt, PaymentOrderStatus paymentOrderStatus) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.sagaId = sagaId;
|
this.sagaId = sagaId;
|
||||||
this.customerId = customerId;
|
this.customerId = customerId;
|
||||||
@@ -112,10 +110,10 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
this.paymentOrderStatus = paymentOrderStatus;
|
this.paymentOrderStatus = paymentOrderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
|
public SpecificData getSpecificData() { return MODEL$; }
|
||||||
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
|
||||||
// Used by DatumWriter. Applications should not call.
|
// Used by DatumWriter. Applications should not call.
|
||||||
public java.lang.Object get(int field$) {
|
public Object get(int field$) {
|
||||||
switch (field$) {
|
switch (field$) {
|
||||||
case 0: return id;
|
case 0: return id;
|
||||||
case 1: return sagaId;
|
case 1: return sagaId;
|
||||||
@@ -147,7 +145,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
|
|
||||||
// Used by DatumReader. Applications should not call.
|
// Used by DatumReader. Applications should not call.
|
||||||
@SuppressWarnings(value="unchecked")
|
@SuppressWarnings(value="unchecked")
|
||||||
public void put(int field$, java.lang.Object value$) {
|
public void put(int field$, Object value$) {
|
||||||
switch (field$) {
|
switch (field$) {
|
||||||
case 0: id = value$ != null ? value$.toString() : null; break;
|
case 0: id = value$ != null ? value$.toString() : null; break;
|
||||||
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
||||||
@@ -155,7 +153,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
case 3: orderId = value$ != null ? value$.toString() : null; break;
|
case 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||||
case 4: price = (java.math.BigDecimal)value$; break;
|
case 4: price = (java.math.BigDecimal)value$; break;
|
||||||
case 5: createdAt = (java.time.Instant)value$; break;
|
case 5: createdAt = (java.time.Instant)value$; break;
|
||||||
case 6: paymentOrderStatus = (com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus)value$; break;
|
case 6: paymentOrderStatus = (PaymentOrderStatus)value$; break;
|
||||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,7 +162,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'id' field.
|
* Gets the value of the 'id' field.
|
||||||
* @return The value of the 'id' field.
|
* @return The value of the 'id' field.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +171,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Sets the value of the 'id' field.
|
* Sets the value of the 'id' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setId(java.lang.String value) {
|
public void setId(String value) {
|
||||||
this.id = value;
|
this.id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +179,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'sagaId' field.
|
* Gets the value of the 'sagaId' field.
|
||||||
* @return The value of the 'sagaId' field.
|
* @return The value of the 'sagaId' field.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getSagaId() {
|
public String getSagaId() {
|
||||||
return sagaId;
|
return sagaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +188,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Sets the value of the 'sagaId' field.
|
* Sets the value of the 'sagaId' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setSagaId(java.lang.String value) {
|
public void setSagaId(String value) {
|
||||||
this.sagaId = value;
|
this.sagaId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,7 +196,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'customerId' field.
|
* Gets the value of the 'customerId' field.
|
||||||
* @return The value of the 'customerId' field.
|
* @return The value of the 'customerId' field.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getCustomerId() {
|
public String getCustomerId() {
|
||||||
return customerId;
|
return customerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +205,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Sets the value of the 'customerId' field.
|
* Sets the value of the 'customerId' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setCustomerId(java.lang.String value) {
|
public void setCustomerId(String value) {
|
||||||
this.customerId = value;
|
this.customerId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +213,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'orderId' field.
|
* Gets the value of the 'orderId' field.
|
||||||
* @return The value of the 'orderId' field.
|
* @return The value of the 'orderId' field.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getOrderId() {
|
public String getOrderId() {
|
||||||
return orderId;
|
return orderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +222,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Sets the value of the 'orderId' field.
|
* Sets the value of the 'orderId' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setOrderId(java.lang.String value) {
|
public void setOrderId(String value) {
|
||||||
this.orderId = value;
|
this.orderId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +264,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'paymentOrderStatus' field.
|
* Gets the value of the 'paymentOrderStatus' field.
|
||||||
* @return The value of the 'paymentOrderStatus' field.
|
* @return The value of the 'paymentOrderStatus' field.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus getPaymentOrderStatus() {
|
public PaymentOrderStatus getPaymentOrderStatus() {
|
||||||
return paymentOrderStatus;
|
return paymentOrderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +273,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Sets the value of the 'paymentOrderStatus' field.
|
* Sets the value of the 'paymentOrderStatus' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setPaymentOrderStatus(com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus value) {
|
public void setPaymentOrderStatus(PaymentOrderStatus value) {
|
||||||
this.paymentOrderStatus = value;
|
this.paymentOrderStatus = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,8 +281,8 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Creates a new PaymentRequestAvroModel RecordBuilder.
|
* Creates a new PaymentRequestAvroModel RecordBuilder.
|
||||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder() {
|
public static Builder newBuilder() {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
return new Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,11 +290,11 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param other The existing builder to copy.
|
* @param other The existing builder to copy.
|
||||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder other) {
|
public static Builder newBuilder(Builder other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
return new Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder(other);
|
return new Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,11 +303,11 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
* @return A new PaymentRequestAvroModel RecordBuilder
|
* @return A new PaymentRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel other) {
|
public static Builder newBuilder(PaymentRequestAvroModel other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder();
|
return new Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder(other);
|
return new Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,13 +318,13 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PaymentRequestAvroModel>
|
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<PaymentRequestAvroModel>
|
||||||
implements org.apache.avro.data.RecordBuilder<PaymentRequestAvroModel> {
|
implements org.apache.avro.data.RecordBuilder<PaymentRequestAvroModel> {
|
||||||
|
|
||||||
private java.lang.String id;
|
private String id;
|
||||||
private java.lang.String sagaId;
|
private String sagaId;
|
||||||
private java.lang.String customerId;
|
private String customerId;
|
||||||
private java.lang.String orderId;
|
private String orderId;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus paymentOrderStatus;
|
private PaymentOrderStatus paymentOrderStatus;
|
||||||
|
|
||||||
/** Creates a new Builder */
|
/** Creates a new Builder */
|
||||||
private Builder() {
|
private Builder() {
|
||||||
@@ -337,7 +335,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Creates a Builder by copying an existing Builder.
|
* Creates a Builder by copying an existing Builder.
|
||||||
* @param other The existing Builder to copy.
|
* @param other The existing Builder to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder other) {
|
private Builder(Builder other) {
|
||||||
super(other);
|
super(other);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -373,7 +371,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Creates a Builder by copying an existing PaymentRequestAvroModel instance
|
* Creates a Builder by copying an existing PaymentRequestAvroModel instance
|
||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel other) {
|
private Builder(PaymentRequestAvroModel other) {
|
||||||
super(SCHEMA$, MODEL$);
|
super(SCHEMA$, MODEL$);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -409,7 +407,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'id' field.
|
* Gets the value of the 'id' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +417,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'id'.
|
* @param value The value of 'id'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setId(java.lang.String value) {
|
public Builder setId(String value) {
|
||||||
validate(fields()[0], value);
|
validate(fields()[0], value);
|
||||||
this.id = value;
|
this.id = value;
|
||||||
fieldSetFlags()[0] = true;
|
fieldSetFlags()[0] = true;
|
||||||
@@ -439,7 +437,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'id' field.
|
* Clears the value of the 'id' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearId() {
|
public Builder clearId() {
|
||||||
id = null;
|
id = null;
|
||||||
fieldSetFlags()[0] = false;
|
fieldSetFlags()[0] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -449,7 +447,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'sagaId' field.
|
* Gets the value of the 'sagaId' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getSagaId() {
|
public String getSagaId() {
|
||||||
return sagaId;
|
return sagaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,7 +457,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'sagaId'.
|
* @param value The value of 'sagaId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
public Builder setSagaId(String value) {
|
||||||
validate(fields()[1], value);
|
validate(fields()[1], value);
|
||||||
this.sagaId = value;
|
this.sagaId = value;
|
||||||
fieldSetFlags()[1] = true;
|
fieldSetFlags()[1] = true;
|
||||||
@@ -479,7 +477,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'sagaId' field.
|
* Clears the value of the 'sagaId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearSagaId() {
|
public Builder clearSagaId() {
|
||||||
sagaId = null;
|
sagaId = null;
|
||||||
fieldSetFlags()[1] = false;
|
fieldSetFlags()[1] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -489,7 +487,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'customerId' field.
|
* Gets the value of the 'customerId' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getCustomerId() {
|
public String getCustomerId() {
|
||||||
return customerId;
|
return customerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,7 +497,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'customerId'.
|
* @param value The value of 'customerId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setCustomerId(java.lang.String value) {
|
public Builder setCustomerId(String value) {
|
||||||
validate(fields()[2], value);
|
validate(fields()[2], value);
|
||||||
this.customerId = value;
|
this.customerId = value;
|
||||||
fieldSetFlags()[2] = true;
|
fieldSetFlags()[2] = true;
|
||||||
@@ -519,7 +517,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'customerId' field.
|
* Clears the value of the 'customerId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearCustomerId() {
|
public Builder clearCustomerId() {
|
||||||
customerId = null;
|
customerId = null;
|
||||||
fieldSetFlags()[2] = false;
|
fieldSetFlags()[2] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -529,7 +527,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'orderId' field.
|
* Gets the value of the 'orderId' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public java.lang.String getOrderId() {
|
public String getOrderId() {
|
||||||
return orderId;
|
return orderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,7 +537,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'orderId'.
|
* @param value The value of 'orderId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
public Builder setOrderId(String value) {
|
||||||
validate(fields()[3], value);
|
validate(fields()[3], value);
|
||||||
this.orderId = value;
|
this.orderId = value;
|
||||||
fieldSetFlags()[3] = true;
|
fieldSetFlags()[3] = true;
|
||||||
@@ -559,7 +557,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'orderId' field.
|
* Clears the value of the 'orderId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearOrderId() {
|
public Builder clearOrderId() {
|
||||||
orderId = null;
|
orderId = null;
|
||||||
fieldSetFlags()[3] = false;
|
fieldSetFlags()[3] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -579,7 +577,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'price'.
|
* @param value The value of 'price'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
public Builder setPrice(java.math.BigDecimal value) {
|
||||||
validate(fields()[4], value);
|
validate(fields()[4], value);
|
||||||
this.price = value;
|
this.price = value;
|
||||||
fieldSetFlags()[4] = true;
|
fieldSetFlags()[4] = true;
|
||||||
@@ -599,7 +597,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'price' field.
|
* Clears the value of the 'price' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearPrice() {
|
public Builder clearPrice() {
|
||||||
price = null;
|
price = null;
|
||||||
fieldSetFlags()[4] = false;
|
fieldSetFlags()[4] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -619,7 +617,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'createdAt'.
|
* @param value The value of 'createdAt'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
public Builder setCreatedAt(java.time.Instant value) {
|
||||||
validate(fields()[5], value);
|
validate(fields()[5], value);
|
||||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||||
fieldSetFlags()[5] = true;
|
fieldSetFlags()[5] = true;
|
||||||
@@ -639,7 +637,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'createdAt' field.
|
* Clears the value of the 'createdAt' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearCreatedAt() {
|
public Builder clearCreatedAt() {
|
||||||
fieldSetFlags()[5] = false;
|
fieldSetFlags()[5] = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -648,7 +646,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Gets the value of the 'paymentOrderStatus' field.
|
* Gets the value of the 'paymentOrderStatus' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus getPaymentOrderStatus() {
|
public PaymentOrderStatus getPaymentOrderStatus() {
|
||||||
return paymentOrderStatus;
|
return paymentOrderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -658,7 +656,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* @param value The value of 'paymentOrderStatus'.
|
* @param value The value of 'paymentOrderStatus'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder setPaymentOrderStatus(com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus value) {
|
public Builder setPaymentOrderStatus(PaymentOrderStatus value) {
|
||||||
validate(fields()[6], value);
|
validate(fields()[6], value);
|
||||||
this.paymentOrderStatus = value;
|
this.paymentOrderStatus = value;
|
||||||
fieldSetFlags()[6] = true;
|
fieldSetFlags()[6] = true;
|
||||||
@@ -678,7 +676,7 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
* Clears the value of the 'paymentOrderStatus' field.
|
* Clears the value of the 'paymentOrderStatus' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel.Builder clearPaymentOrderStatus() {
|
public Builder clearPaymentOrderStatus() {
|
||||||
paymentOrderStatus = null;
|
paymentOrderStatus = null;
|
||||||
fieldSetFlags()[6] = false;
|
fieldSetFlags()[6] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -689,17 +687,17 @@ public class PaymentRequestAvroModel extends org.apache.avro.specific.SpecificRe
|
|||||||
public PaymentRequestAvroModel build() {
|
public PaymentRequestAvroModel build() {
|
||||||
try {
|
try {
|
||||||
PaymentRequestAvroModel record = new PaymentRequestAvroModel();
|
PaymentRequestAvroModel record = new PaymentRequestAvroModel();
|
||||||
record.id = fieldSetFlags()[0] ? this.id : (java.lang.String) defaultValue(fields()[0]);
|
record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]);
|
||||||
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (java.lang.String) defaultValue(fields()[1]);
|
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (String) defaultValue(fields()[1]);
|
||||||
record.customerId = fieldSetFlags()[2] ? this.customerId : (java.lang.String) defaultValue(fields()[2]);
|
record.customerId = fieldSetFlags()[2] ? this.customerId : (String) defaultValue(fields()[2]);
|
||||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
record.orderId = fieldSetFlags()[3] ? this.orderId : (String) defaultValue(fields()[3]);
|
||||||
record.price = fieldSetFlags()[4] ? this.price : (java.math.BigDecimal) defaultValue(fields()[4]);
|
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.createdAt = fieldSetFlags()[5] ? this.createdAt : (java.time.Instant) defaultValue(fields()[5]);
|
||||||
record.paymentOrderStatus = fieldSetFlags()[6] ? this.paymentOrderStatus : (com.food.ordering.system.kafka.order.avro.model.PaymentOrderStatus) defaultValue(fields()[6]);
|
record.paymentOrderStatus = fieldSetFlags()[6] ? this.paymentOrderStatus : (PaymentOrderStatus) defaultValue(fields()[6]);
|
||||||
return record;
|
return record;
|
||||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (java.lang.Exception e) {
|
} catch (Exception e) {
|
||||||
throw new org.apache.avro.AvroRuntimeException(e);
|
throw new org.apache.avro.AvroRuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,9 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
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.specific.SpecificData;
|
||||||
import org.apache.avro.util.Utf8;
|
|
||||||
import org.apache.avro.message.BinaryMessageEncoder;
|
import org.apache.avro.message.BinaryMessageEncoder;
|
||||||
import org.apache.avro.message.BinaryMessageDecoder;
|
import org.apache.avro.message.BinaryMessageDecoder;
|
||||||
import org.apache.avro.message.SchemaStore;
|
import org.apache.avro.message.SchemaStore;
|
||||||
@@ -84,7 +82,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.PaymentStatus paymentStatus;
|
private PaymentStatus paymentStatus;
|
||||||
private java.util.List<java.lang.String> failureMessages;
|
private java.util.List<java.lang.String> failureMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,7 +104,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param paymentStatus The new value for paymentStatus
|
* @param paymentStatus The new value for paymentStatus
|
||||||
* @param failureMessages The new value for failureMessages
|
* @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, com.food.ordering.system.kafka.order.avro.model.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, PaymentStatus paymentStatus, java.util.List<java.lang.String> failureMessages) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.sagaId = sagaId;
|
this.sagaId = sagaId;
|
||||||
this.paymentId = paymentId;
|
this.paymentId = paymentId;
|
||||||
@@ -166,7 +164,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
case 4: orderId = value$ != null ? value$.toString() : null; break;
|
case 4: orderId = value$ != null ? value$.toString() : null; break;
|
||||||
case 5: price = (java.math.BigDecimal)value$; break;
|
case 5: price = (java.math.BigDecimal)value$; break;
|
||||||
case 6: createdAt = (java.time.Instant)value$; break;
|
case 6: createdAt = (java.time.Instant)value$; break;
|
||||||
case 7: paymentStatus = (com.food.ordering.system.kafka.order.avro.model.PaymentStatus)value$; break;
|
case 7: paymentStatus = (PaymentStatus)value$; break;
|
||||||
case 8: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
case 8: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
||||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||||
}
|
}
|
||||||
@@ -295,7 +293,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Gets the value of the 'paymentStatus' field.
|
* Gets the value of the 'paymentStatus' field.
|
||||||
* @return The value of the 'paymentStatus' field.
|
* @return The value of the 'paymentStatus' field.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentStatus getPaymentStatus() {
|
public PaymentStatus getPaymentStatus() {
|
||||||
return paymentStatus;
|
return paymentStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +302,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Sets the value of the 'paymentStatus' field.
|
* Sets the value of the 'paymentStatus' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setPaymentStatus(com.food.ordering.system.kafka.order.avro.model.PaymentStatus value) {
|
public void setPaymentStatus(PaymentStatus value) {
|
||||||
this.paymentStatus = value;
|
this.paymentStatus = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,8 +327,8 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Creates a new PaymentResponseAvroModel RecordBuilder.
|
* Creates a new PaymentResponseAvroModel RecordBuilder.
|
||||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder() {
|
public static PaymentResponseAvroModel.Builder newBuilder() {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
return new PaymentResponseAvroModel.Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -338,11 +336,11 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param other The existing builder to copy.
|
* @param other The existing builder to copy.
|
||||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder other) {
|
public static PaymentResponseAvroModel.Builder newBuilder(PaymentResponseAvroModel.Builder other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
return new PaymentResponseAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder(other);
|
return new PaymentResponseAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -351,11 +349,11 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
* @return A new PaymentResponseAvroModel RecordBuilder
|
* @return A new PaymentResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel other) {
|
public static PaymentResponseAvroModel.Builder newBuilder(PaymentResponseAvroModel other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder();
|
return new PaymentResponseAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder(other);
|
return new PaymentResponseAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,7 +371,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.PaymentStatus paymentStatus;
|
private PaymentStatus paymentStatus;
|
||||||
private java.util.List<java.lang.String> failureMessages;
|
private java.util.List<java.lang.String> failureMessages;
|
||||||
|
|
||||||
/** Creates a new Builder */
|
/** Creates a new Builder */
|
||||||
@@ -385,7 +383,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Creates a Builder by copying an existing Builder.
|
* Creates a Builder by copying an existing Builder.
|
||||||
* @param other The existing Builder to copy.
|
* @param other The existing Builder to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder other) {
|
private Builder(PaymentResponseAvroModel.Builder other) {
|
||||||
super(other);
|
super(other);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -429,7 +427,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Creates a Builder by copying an existing PaymentResponseAvroModel instance
|
* Creates a Builder by copying an existing PaymentResponseAvroModel instance
|
||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel other) {
|
private Builder(PaymentResponseAvroModel other) {
|
||||||
super(SCHEMA$, MODEL$);
|
super(SCHEMA$, MODEL$);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -483,7 +481,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'id'.
|
* @param value The value of 'id'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setId(java.lang.String value) {
|
public PaymentResponseAvroModel.Builder setId(java.lang.String value) {
|
||||||
validate(fields()[0], value);
|
validate(fields()[0], value);
|
||||||
this.id = value;
|
this.id = value;
|
||||||
fieldSetFlags()[0] = true;
|
fieldSetFlags()[0] = true;
|
||||||
@@ -503,7 +501,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'id' field.
|
* Clears the value of the 'id' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearId() {
|
public PaymentResponseAvroModel.Builder clearId() {
|
||||||
id = null;
|
id = null;
|
||||||
fieldSetFlags()[0] = false;
|
fieldSetFlags()[0] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -523,7 +521,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'sagaId'.
|
* @param value The value of 'sagaId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
public PaymentResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||||
validate(fields()[1], value);
|
validate(fields()[1], value);
|
||||||
this.sagaId = value;
|
this.sagaId = value;
|
||||||
fieldSetFlags()[1] = true;
|
fieldSetFlags()[1] = true;
|
||||||
@@ -543,7 +541,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'sagaId' field.
|
* Clears the value of the 'sagaId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearSagaId() {
|
public PaymentResponseAvroModel.Builder clearSagaId() {
|
||||||
sagaId = null;
|
sagaId = null;
|
||||||
fieldSetFlags()[1] = false;
|
fieldSetFlags()[1] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -563,7 +561,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'paymentId'.
|
* @param value The value of 'paymentId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPaymentId(java.lang.String value) {
|
public PaymentResponseAvroModel.Builder setPaymentId(java.lang.String value) {
|
||||||
validate(fields()[2], value);
|
validate(fields()[2], value);
|
||||||
this.paymentId = value;
|
this.paymentId = value;
|
||||||
fieldSetFlags()[2] = true;
|
fieldSetFlags()[2] = true;
|
||||||
@@ -583,7 +581,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'paymentId' field.
|
* Clears the value of the 'paymentId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPaymentId() {
|
public PaymentResponseAvroModel.Builder clearPaymentId() {
|
||||||
paymentId = null;
|
paymentId = null;
|
||||||
fieldSetFlags()[2] = false;
|
fieldSetFlags()[2] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -603,7 +601,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'customerId'.
|
* @param value The value of 'customerId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setCustomerId(java.lang.String value) {
|
public PaymentResponseAvroModel.Builder setCustomerId(java.lang.String value) {
|
||||||
validate(fields()[3], value);
|
validate(fields()[3], value);
|
||||||
this.customerId = value;
|
this.customerId = value;
|
||||||
fieldSetFlags()[3] = true;
|
fieldSetFlags()[3] = true;
|
||||||
@@ -623,7 +621,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'customerId' field.
|
* Clears the value of the 'customerId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearCustomerId() {
|
public PaymentResponseAvroModel.Builder clearCustomerId() {
|
||||||
customerId = null;
|
customerId = null;
|
||||||
fieldSetFlags()[3] = false;
|
fieldSetFlags()[3] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -643,7 +641,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'orderId'.
|
* @param value The value of 'orderId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
public PaymentResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||||
validate(fields()[4], value);
|
validate(fields()[4], value);
|
||||||
this.orderId = value;
|
this.orderId = value;
|
||||||
fieldSetFlags()[4] = true;
|
fieldSetFlags()[4] = true;
|
||||||
@@ -663,7 +661,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'orderId' field.
|
* Clears the value of the 'orderId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearOrderId() {
|
public PaymentResponseAvroModel.Builder clearOrderId() {
|
||||||
orderId = null;
|
orderId = null;
|
||||||
fieldSetFlags()[4] = false;
|
fieldSetFlags()[4] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -683,7 +681,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'price'.
|
* @param value The value of 'price'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
public PaymentResponseAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||||
validate(fields()[5], value);
|
validate(fields()[5], value);
|
||||||
this.price = value;
|
this.price = value;
|
||||||
fieldSetFlags()[5] = true;
|
fieldSetFlags()[5] = true;
|
||||||
@@ -703,7 +701,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'price' field.
|
* Clears the value of the 'price' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPrice() {
|
public PaymentResponseAvroModel.Builder clearPrice() {
|
||||||
price = null;
|
price = null;
|
||||||
fieldSetFlags()[5] = false;
|
fieldSetFlags()[5] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -723,7 +721,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'createdAt'.
|
* @param value The value of 'createdAt'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
public PaymentResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||||
validate(fields()[6], value);
|
validate(fields()[6], value);
|
||||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||||
fieldSetFlags()[6] = true;
|
fieldSetFlags()[6] = true;
|
||||||
@@ -743,7 +741,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'createdAt' field.
|
* Clears the value of the 'createdAt' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearCreatedAt() {
|
public PaymentResponseAvroModel.Builder clearCreatedAt() {
|
||||||
fieldSetFlags()[6] = false;
|
fieldSetFlags()[6] = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -752,7 +750,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Gets the value of the 'paymentStatus' field.
|
* Gets the value of the 'paymentStatus' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentStatus getPaymentStatus() {
|
public PaymentStatus getPaymentStatus() {
|
||||||
return paymentStatus;
|
return paymentStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -762,7 +760,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'paymentStatus'.
|
* @param value The value of 'paymentStatus'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setPaymentStatus(com.food.ordering.system.kafka.order.avro.model.PaymentStatus value) {
|
public PaymentResponseAvroModel.Builder setPaymentStatus(PaymentStatus value) {
|
||||||
validate(fields()[7], value);
|
validate(fields()[7], value);
|
||||||
this.paymentStatus = value;
|
this.paymentStatus = value;
|
||||||
fieldSetFlags()[7] = true;
|
fieldSetFlags()[7] = true;
|
||||||
@@ -782,7 +780,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'paymentStatus' field.
|
* Clears the value of the 'paymentStatus' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearPaymentStatus() {
|
public PaymentResponseAvroModel.Builder clearPaymentStatus() {
|
||||||
paymentStatus = null;
|
paymentStatus = null;
|
||||||
fieldSetFlags()[7] = false;
|
fieldSetFlags()[7] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -802,7 +800,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* @param value The value of 'failureMessages'.
|
* @param value The value of 'failureMessages'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
public PaymentResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||||
validate(fields()[8], value);
|
validate(fields()[8], value);
|
||||||
this.failureMessages = value;
|
this.failureMessages = value;
|
||||||
fieldSetFlags()[8] = true;
|
fieldSetFlags()[8] = true;
|
||||||
@@ -822,7 +820,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
* Clears the value of the 'failureMessages' field.
|
* Clears the value of the 'failureMessages' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel.Builder clearFailureMessages() {
|
public PaymentResponseAvroModel.Builder clearFailureMessages() {
|
||||||
failureMessages = null;
|
failureMessages = null;
|
||||||
fieldSetFlags()[8] = false;
|
fieldSetFlags()[8] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -840,7 +838,7 @@ public class PaymentResponseAvroModel extends org.apache.avro.specific.SpecificR
|
|||||||
record.orderId = fieldSetFlags()[4] ? this.orderId : (java.lang.String) defaultValue(fields()[4]);
|
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.price = fieldSetFlags()[5] ? this.price : (java.math.BigDecimal) defaultValue(fields()[5]);
|
||||||
record.createdAt = fieldSetFlags()[6] ? this.createdAt : (java.time.Instant) defaultValue(fields()[6]);
|
record.createdAt = fieldSetFlags()[6] ? this.createdAt : (java.time.Instant) defaultValue(fields()[6]);
|
||||||
record.paymentStatus = fieldSetFlags()[7] ? this.paymentStatus : (com.food.ordering.system.kafka.order.avro.model.PaymentStatus) defaultValue(fields()[7]);
|
record.paymentStatus = fieldSetFlags()[7] ? this.paymentStatus : (PaymentStatus) defaultValue(fields()[7]);
|
||||||
record.failureMessages = fieldSetFlags()[8] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[8]);
|
record.failureMessages = fieldSetFlags()[8] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[8]);
|
||||||
return record;
|
return record;
|
||||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
package com.food.order.system.kafka.order.avro.model;
|
||||||
@org.apache.avro.specific.AvroGenerated
|
@org.apache.avro.specific.AvroGenerated
|
||||||
public enum PaymentStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentStatus> {
|
public enum PaymentStatus implements org.apache.avro.generic.GenericEnumSymbol<PaymentStatus> {
|
||||||
COMPLETED, CANCELLED, FAILED ;
|
COMPLETED, CANCELLED, FAILED ;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
package com.food.order.system.kafka.order.avro.model;
|
||||||
|
|
||||||
import org.apache.avro.message.BinaryMessageDecoder;
|
import org.apache.avro.message.BinaryMessageDecoder;
|
||||||
import org.apache.avro.message.BinaryMessageEncoder;
|
import org.apache.avro.message.BinaryMessageEncoder;
|
||||||
@@ -150,8 +150,8 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* Creates a new Product RecordBuilder.
|
* Creates a new Product RecordBuilder.
|
||||||
* @return A new Product RecordBuilder
|
* @return A new Product RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.Product.Builder newBuilder() {
|
public static Product.Builder newBuilder() {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.Product.Builder();
|
return new Product.Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,11 +159,11 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* @param other The existing builder to copy.
|
* @param other The existing builder to copy.
|
||||||
* @return A new Product RecordBuilder
|
* @return A new Product RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.Product.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.Product.Builder other) {
|
public static Product.Builder newBuilder(Product.Builder other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.Product.Builder();
|
return new Product.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.Product.Builder(other);
|
return new Product.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,11 +172,11 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
* @return A new Product RecordBuilder
|
* @return A new Product RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.Product.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.Product other) {
|
public static Product.Builder newBuilder(Product other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.Product.Builder();
|
return new Product.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.Product.Builder(other);
|
return new Product.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* Creates a Builder by copying an existing Builder.
|
* Creates a Builder by copying an existing Builder.
|
||||||
* @param other The existing Builder to copy.
|
* @param other The existing Builder to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.Product.Builder other) {
|
private Builder(Product.Builder other) {
|
||||||
super(other);
|
super(other);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -215,7 +215,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* Creates a Builder by copying an existing Product instance
|
* Creates a Builder by copying an existing Product instance
|
||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.Product other) {
|
private Builder(Product other) {
|
||||||
super(SCHEMA$, MODEL$);
|
super(SCHEMA$, MODEL$);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -241,7 +241,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* @param value The value of 'id'.
|
* @param value The value of 'id'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.Product.Builder setId(java.lang.String value) {
|
public Product.Builder setId(java.lang.String value) {
|
||||||
validate(fields()[0], value);
|
validate(fields()[0], value);
|
||||||
this.id = value;
|
this.id = value;
|
||||||
fieldSetFlags()[0] = true;
|
fieldSetFlags()[0] = true;
|
||||||
@@ -261,7 +261,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* Clears the value of the 'id' field.
|
* Clears the value of the 'id' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.Product.Builder clearId() {
|
public Product.Builder clearId() {
|
||||||
id = null;
|
id = null;
|
||||||
fieldSetFlags()[0] = false;
|
fieldSetFlags()[0] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -281,7 +281,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* @param value The value of 'quantity'.
|
* @param value The value of 'quantity'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.Product.Builder setQuantity(int value) {
|
public Product.Builder setQuantity(int value) {
|
||||||
validate(fields()[1], value);
|
validate(fields()[1], value);
|
||||||
this.quantity = value;
|
this.quantity = value;
|
||||||
fieldSetFlags()[1] = true;
|
fieldSetFlags()[1] = true;
|
||||||
@@ -301,7 +301,7 @@ public class Product extends org.apache.avro.specific.SpecificRecordBase impleme
|
|||||||
* Clears the value of the 'quantity' field.
|
* Clears the value of the 'quantity' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.Product.Builder clearQuantity() {
|
public Product.Builder clearQuantity() {
|
||||||
fieldSetFlags()[1] = false;
|
fieldSetFlags()[1] = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,9 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
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.specific.SpecificData;
|
||||||
import org.apache.avro.util.Utf8;
|
|
||||||
import org.apache.avro.message.BinaryMessageEncoder;
|
import org.apache.avro.message.BinaryMessageEncoder;
|
||||||
import org.apache.avro.message.BinaryMessageDecoder;
|
import org.apache.avro.message.BinaryMessageDecoder;
|
||||||
import org.apache.avro.message.SchemaStore;
|
import org.apache.avro.message.SchemaStore;
|
||||||
@@ -81,8 +79,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
private java.lang.String sagaId;
|
private java.lang.String sagaId;
|
||||||
private java.lang.String restaurantId;
|
private java.lang.String restaurantId;
|
||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus;
|
private RestaurantOrderStatus restaurantOrderStatus;
|
||||||
private java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> products;
|
private java.util.List<Product> products;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
|
|
||||||
@@ -104,7 +102,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param price The new value for price
|
* @param price The new value for price
|
||||||
* @param createdAt The new value for createdAt
|
* @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, com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus, java.util.List<com.food.ordering.system.kafka.order.avro.model.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, RestaurantOrderStatus restaurantOrderStatus, java.util.List<Product> products, java.math.BigDecimal price, java.time.Instant createdAt) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.sagaId = sagaId;
|
this.sagaId = sagaId;
|
||||||
this.restaurantId = restaurantId;
|
this.restaurantId = restaurantId;
|
||||||
@@ -158,8 +156,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
case 1: sagaId = value$ != null ? value$.toString() : null; break;
|
||||||
case 2: restaurantId = 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 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||||
case 4: restaurantOrderStatus = (com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus)value$; break;
|
case 4: restaurantOrderStatus = (RestaurantOrderStatus)value$; break;
|
||||||
case 5: products = (java.util.List<com.food.ordering.system.kafka.order.avro.model.Product>)value$; break;
|
case 5: products = (java.util.List<Product>)value$; break;
|
||||||
case 6: price = (java.math.BigDecimal)value$; break;
|
case 6: price = (java.math.BigDecimal)value$; break;
|
||||||
case 7: createdAt = (java.time.Instant)value$; break;
|
case 7: createdAt = (java.time.Instant)value$; break;
|
||||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||||
@@ -238,7 +236,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Gets the value of the 'restaurantOrderStatus' field.
|
* Gets the value of the 'restaurantOrderStatus' field.
|
||||||
* @return The value of the 'restaurantOrderStatus' field.
|
* @return The value of the 'restaurantOrderStatus' field.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus getRestaurantOrderStatus() {
|
public RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||||
return restaurantOrderStatus;
|
return restaurantOrderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +245,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Sets the value of the 'restaurantOrderStatus' field.
|
* Sets the value of the 'restaurantOrderStatus' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setRestaurantOrderStatus(com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus value) {
|
public void setRestaurantOrderStatus(RestaurantOrderStatus value) {
|
||||||
this.restaurantOrderStatus = value;
|
this.restaurantOrderStatus = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +253,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Gets the value of the 'products' field.
|
* Gets the value of the 'products' field.
|
||||||
* @return The value of the 'products' field.
|
* @return The value of the 'products' field.
|
||||||
*/
|
*/
|
||||||
public java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> getProducts() {
|
public java.util.List<Product> getProducts() {
|
||||||
return products;
|
return products;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +262,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Sets the value of the 'products' field.
|
* Sets the value of the 'products' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setProducts(java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> value) {
|
public void setProducts(java.util.List<Product> value) {
|
||||||
this.products = value;
|
this.products = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,8 +304,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Creates a new RestaurantApprovalRequestAvroModel RecordBuilder.
|
* Creates a new RestaurantApprovalRequestAvroModel RecordBuilder.
|
||||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder() {
|
public static RestaurantApprovalRequestAvroModel.Builder newBuilder() {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,11 +313,11 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param other The existing builder to copy.
|
* @param other The existing builder to copy.
|
||||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder other) {
|
public static RestaurantApprovalRequestAvroModel.Builder newBuilder(RestaurantApprovalRequestAvroModel.Builder other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder(other);
|
return new RestaurantApprovalRequestAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,11 +326,11 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
* @return A new RestaurantApprovalRequestAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel other) {
|
public static RestaurantApprovalRequestAvroModel.Builder newBuilder(RestaurantApprovalRequestAvroModel other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder();
|
return new RestaurantApprovalRequestAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder(other);
|
return new RestaurantApprovalRequestAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,8 +345,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
private java.lang.String sagaId;
|
private java.lang.String sagaId;
|
||||||
private java.lang.String restaurantId;
|
private java.lang.String restaurantId;
|
||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus restaurantOrderStatus;
|
private RestaurantOrderStatus restaurantOrderStatus;
|
||||||
private java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> products;
|
private java.util.List<Product> products;
|
||||||
private java.math.BigDecimal price;
|
private java.math.BigDecimal price;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
|
|
||||||
@@ -361,7 +359,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Creates a Builder by copying an existing Builder.
|
* Creates a Builder by copying an existing Builder.
|
||||||
* @param other The existing Builder to copy.
|
* @param other The existing Builder to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder other) {
|
private Builder(RestaurantApprovalRequestAvroModel.Builder other) {
|
||||||
super(other);
|
super(other);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -401,7 +399,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Creates a Builder by copying an existing RestaurantApprovalRequestAvroModel instance
|
* Creates a Builder by copying an existing RestaurantApprovalRequestAvroModel instance
|
||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel other) {
|
private Builder(RestaurantApprovalRequestAvroModel other) {
|
||||||
super(SCHEMA$, MODEL$);
|
super(SCHEMA$, MODEL$);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -451,7 +449,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'id'.
|
* @param value The value of 'id'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setId(java.lang.String value) {
|
public RestaurantApprovalRequestAvroModel.Builder setId(java.lang.String value) {
|
||||||
validate(fields()[0], value);
|
validate(fields()[0], value);
|
||||||
this.id = value;
|
this.id = value;
|
||||||
fieldSetFlags()[0] = true;
|
fieldSetFlags()[0] = true;
|
||||||
@@ -471,7 +469,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'id' field.
|
* Clears the value of the 'id' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearId() {
|
public RestaurantApprovalRequestAvroModel.Builder clearId() {
|
||||||
id = null;
|
id = null;
|
||||||
fieldSetFlags()[0] = false;
|
fieldSetFlags()[0] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -491,7 +489,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'sagaId'.
|
* @param value The value of 'sagaId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
public RestaurantApprovalRequestAvroModel.Builder setSagaId(java.lang.String value) {
|
||||||
validate(fields()[1], value);
|
validate(fields()[1], value);
|
||||||
this.sagaId = value;
|
this.sagaId = value;
|
||||||
fieldSetFlags()[1] = true;
|
fieldSetFlags()[1] = true;
|
||||||
@@ -511,7 +509,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'sagaId' field.
|
* Clears the value of the 'sagaId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearSagaId() {
|
public RestaurantApprovalRequestAvroModel.Builder clearSagaId() {
|
||||||
sagaId = null;
|
sagaId = null;
|
||||||
fieldSetFlags()[1] = false;
|
fieldSetFlags()[1] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -531,7 +529,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'restaurantId'.
|
* @param value The value of 'restaurantId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setRestaurantId(java.lang.String value) {
|
public RestaurantApprovalRequestAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||||
validate(fields()[2], value);
|
validate(fields()[2], value);
|
||||||
this.restaurantId = value;
|
this.restaurantId = value;
|
||||||
fieldSetFlags()[2] = true;
|
fieldSetFlags()[2] = true;
|
||||||
@@ -551,7 +549,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'restaurantId' field.
|
* Clears the value of the 'restaurantId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearRestaurantId() {
|
public RestaurantApprovalRequestAvroModel.Builder clearRestaurantId() {
|
||||||
restaurantId = null;
|
restaurantId = null;
|
||||||
fieldSetFlags()[2] = false;
|
fieldSetFlags()[2] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -571,7 +569,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'orderId'.
|
* @param value The value of 'orderId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
public RestaurantApprovalRequestAvroModel.Builder setOrderId(java.lang.String value) {
|
||||||
validate(fields()[3], value);
|
validate(fields()[3], value);
|
||||||
this.orderId = value;
|
this.orderId = value;
|
||||||
fieldSetFlags()[3] = true;
|
fieldSetFlags()[3] = true;
|
||||||
@@ -591,7 +589,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'orderId' field.
|
* Clears the value of the 'orderId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearOrderId() {
|
public RestaurantApprovalRequestAvroModel.Builder clearOrderId() {
|
||||||
orderId = null;
|
orderId = null;
|
||||||
fieldSetFlags()[3] = false;
|
fieldSetFlags()[3] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -601,7 +599,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Gets the value of the 'restaurantOrderStatus' field.
|
* Gets the value of the 'restaurantOrderStatus' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus getRestaurantOrderStatus() {
|
public RestaurantOrderStatus getRestaurantOrderStatus() {
|
||||||
return restaurantOrderStatus;
|
return restaurantOrderStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,7 +609,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'restaurantOrderStatus'.
|
* @param value The value of 'restaurantOrderStatus'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setRestaurantOrderStatus(com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus value) {
|
public RestaurantApprovalRequestAvroModel.Builder setRestaurantOrderStatus(RestaurantOrderStatus value) {
|
||||||
validate(fields()[4], value);
|
validate(fields()[4], value);
|
||||||
this.restaurantOrderStatus = value;
|
this.restaurantOrderStatus = value;
|
||||||
fieldSetFlags()[4] = true;
|
fieldSetFlags()[4] = true;
|
||||||
@@ -631,7 +629,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'restaurantOrderStatus' field.
|
* Clears the value of the 'restaurantOrderStatus' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearRestaurantOrderStatus() {
|
public RestaurantApprovalRequestAvroModel.Builder clearRestaurantOrderStatus() {
|
||||||
restaurantOrderStatus = null;
|
restaurantOrderStatus = null;
|
||||||
fieldSetFlags()[4] = false;
|
fieldSetFlags()[4] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -641,7 +639,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Gets the value of the 'products' field.
|
* Gets the value of the 'products' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> getProducts() {
|
public java.util.List<Product> getProducts() {
|
||||||
return products;
|
return products;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,7 +649,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'products'.
|
* @param value The value of 'products'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setProducts(java.util.List<com.food.ordering.system.kafka.order.avro.model.Product> value) {
|
public RestaurantApprovalRequestAvroModel.Builder setProducts(java.util.List<Product> value) {
|
||||||
validate(fields()[5], value);
|
validate(fields()[5], value);
|
||||||
this.products = value;
|
this.products = value;
|
||||||
fieldSetFlags()[5] = true;
|
fieldSetFlags()[5] = true;
|
||||||
@@ -671,7 +669,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'products' field.
|
* Clears the value of the 'products' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearProducts() {
|
public RestaurantApprovalRequestAvroModel.Builder clearProducts() {
|
||||||
products = null;
|
products = null;
|
||||||
fieldSetFlags()[5] = false;
|
fieldSetFlags()[5] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -691,7 +689,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'price'.
|
* @param value The value of 'price'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
public RestaurantApprovalRequestAvroModel.Builder setPrice(java.math.BigDecimal value) {
|
||||||
validate(fields()[6], value);
|
validate(fields()[6], value);
|
||||||
this.price = value;
|
this.price = value;
|
||||||
fieldSetFlags()[6] = true;
|
fieldSetFlags()[6] = true;
|
||||||
@@ -711,7 +709,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'price' field.
|
* Clears the value of the 'price' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearPrice() {
|
public RestaurantApprovalRequestAvroModel.Builder clearPrice() {
|
||||||
price = null;
|
price = null;
|
||||||
fieldSetFlags()[6] = false;
|
fieldSetFlags()[6] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -731,7 +729,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* @param value The value of 'createdAt'.
|
* @param value The value of 'createdAt'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
public RestaurantApprovalRequestAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||||
validate(fields()[7], value);
|
validate(fields()[7], value);
|
||||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||||
fieldSetFlags()[7] = true;
|
fieldSetFlags()[7] = true;
|
||||||
@@ -751,7 +749,7 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
* Clears the value of the 'createdAt' field.
|
* Clears the value of the 'createdAt' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel.Builder clearCreatedAt() {
|
public RestaurantApprovalRequestAvroModel.Builder clearCreatedAt() {
|
||||||
fieldSetFlags()[7] = false;
|
fieldSetFlags()[7] = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -765,8 +763,8 @@ public class RestaurantApprovalRequestAvroModel extends org.apache.avro.specific
|
|||||||
record.sagaId = fieldSetFlags()[1] ? this.sagaId : (java.lang.String) defaultValue(fields()[1]);
|
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.restaurantId = fieldSetFlags()[2] ? this.restaurantId : (java.lang.String) defaultValue(fields()[2]);
|
||||||
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
record.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
||||||
record.restaurantOrderStatus = fieldSetFlags()[4] ? this.restaurantOrderStatus : (com.food.ordering.system.kafka.order.avro.model.RestaurantOrderStatus) defaultValue(fields()[4]);
|
record.restaurantOrderStatus = fieldSetFlags()[4] ? this.restaurantOrderStatus : (RestaurantOrderStatus) defaultValue(fields()[4]);
|
||||||
record.products = fieldSetFlags()[5] ? this.products : (java.util.List<com.food.ordering.system.kafka.order.avro.model.Product>) defaultValue(fields()[5]);
|
record.products = fieldSetFlags()[5] ? this.products : (java.util.List<Product>) defaultValue(fields()[5]);
|
||||||
record.price = fieldSetFlags()[6] ? this.price : (java.math.BigDecimal) defaultValue(fields()[6]);
|
record.price = fieldSetFlags()[6] ? this.price : (java.math.BigDecimal) defaultValue(fields()[6]);
|
||||||
record.createdAt = fieldSetFlags()[7] ? this.createdAt : (java.time.Instant) defaultValue(fields()[7]);
|
record.createdAt = fieldSetFlags()[7] ? this.createdAt : (java.time.Instant) defaultValue(fields()[7]);
|
||||||
return record;
|
return record;
|
||||||
@@ -3,11 +3,9 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
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.specific.SpecificData;
|
||||||
import org.apache.avro.util.Utf8;
|
|
||||||
import org.apache.avro.message.BinaryMessageEncoder;
|
import org.apache.avro.message.BinaryMessageEncoder;
|
||||||
import org.apache.avro.message.BinaryMessageDecoder;
|
import org.apache.avro.message.BinaryMessageDecoder;
|
||||||
import org.apache.avro.message.SchemaStore;
|
import org.apache.avro.message.SchemaStore;
|
||||||
@@ -81,7 +79,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
private java.lang.String restaurantId;
|
private java.lang.String restaurantId;
|
||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus orderApprovalStatus;
|
private OrderApprovalStatus orderApprovalStatus;
|
||||||
private java.util.List<java.lang.String> failureMessages;
|
private java.util.List<java.lang.String> failureMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +99,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param orderApprovalStatus The new value for orderApprovalStatus
|
* @param orderApprovalStatus The new value for orderApprovalStatus
|
||||||
* @param failureMessages The new value for failureMessages
|
* @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, com.food.ordering.system.kafka.order.avro.model.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, OrderApprovalStatus orderApprovalStatus, java.util.List<java.lang.String> failureMessages) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.sagaId = sagaId;
|
this.sagaId = sagaId;
|
||||||
this.restaurantId = restaurantId;
|
this.restaurantId = restaurantId;
|
||||||
@@ -153,7 +151,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
case 2: restaurantId = 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 3: orderId = value$ != null ? value$.toString() : null; break;
|
||||||
case 4: createdAt = (java.time.Instant)value$; break;
|
case 4: createdAt = (java.time.Instant)value$; break;
|
||||||
case 5: orderApprovalStatus = (com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus)value$; break;
|
case 5: orderApprovalStatus = (OrderApprovalStatus)value$; break;
|
||||||
case 6: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
case 6: failureMessages = (java.util.List<java.lang.String>)value$; break;
|
||||||
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
|
||||||
}
|
}
|
||||||
@@ -248,7 +246,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Gets the value of the 'orderApprovalStatus' field.
|
* Gets the value of the 'orderApprovalStatus' field.
|
||||||
* @return The value of the 'orderApprovalStatus' field.
|
* @return The value of the 'orderApprovalStatus' field.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus getOrderApprovalStatus() {
|
public OrderApprovalStatus getOrderApprovalStatus() {
|
||||||
return orderApprovalStatus;
|
return orderApprovalStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +255,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Sets the value of the 'orderApprovalStatus' field.
|
* Sets the value of the 'orderApprovalStatus' field.
|
||||||
* @param value the value to set.
|
* @param value the value to set.
|
||||||
*/
|
*/
|
||||||
public void setOrderApprovalStatus(com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus value) {
|
public void setOrderApprovalStatus(OrderApprovalStatus value) {
|
||||||
this.orderApprovalStatus = value;
|
this.orderApprovalStatus = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,8 +280,8 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Creates a new RestaurantApprovalResponseAvroModel RecordBuilder.
|
* Creates a new RestaurantApprovalResponseAvroModel RecordBuilder.
|
||||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder() {
|
public static RestaurantApprovalResponseAvroModel.Builder newBuilder() {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -291,11 +289,11 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param other The existing builder to copy.
|
* @param other The existing builder to copy.
|
||||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder other) {
|
public static RestaurantApprovalResponseAvroModel.Builder newBuilder(RestaurantApprovalResponseAvroModel.Builder other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder(other);
|
return new RestaurantApprovalResponseAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,11 +302,11 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
* @return A new RestaurantApprovalResponseAvroModel RecordBuilder
|
||||||
*/
|
*/
|
||||||
public static com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder newBuilder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel other) {
|
public static RestaurantApprovalResponseAvroModel.Builder newBuilder(RestaurantApprovalResponseAvroModel other) {
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder();
|
return new RestaurantApprovalResponseAvroModel.Builder();
|
||||||
} else {
|
} else {
|
||||||
return new com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder(other);
|
return new RestaurantApprovalResponseAvroModel.Builder(other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +322,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
private java.lang.String restaurantId;
|
private java.lang.String restaurantId;
|
||||||
private java.lang.String orderId;
|
private java.lang.String orderId;
|
||||||
private java.time.Instant createdAt;
|
private java.time.Instant createdAt;
|
||||||
private com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus orderApprovalStatus;
|
private OrderApprovalStatus orderApprovalStatus;
|
||||||
private java.util.List<java.lang.String> failureMessages;
|
private java.util.List<java.lang.String> failureMessages;
|
||||||
|
|
||||||
/** Creates a new Builder */
|
/** Creates a new Builder */
|
||||||
@@ -336,7 +334,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Creates a Builder by copying an existing Builder.
|
* Creates a Builder by copying an existing Builder.
|
||||||
* @param other The existing Builder to copy.
|
* @param other The existing Builder to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder other) {
|
private Builder(RestaurantApprovalResponseAvroModel.Builder other) {
|
||||||
super(other);
|
super(other);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -372,7 +370,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Creates a Builder by copying an existing RestaurantApprovalResponseAvroModel instance
|
* Creates a Builder by copying an existing RestaurantApprovalResponseAvroModel instance
|
||||||
* @param other The existing instance to copy.
|
* @param other The existing instance to copy.
|
||||||
*/
|
*/
|
||||||
private Builder(com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel other) {
|
private Builder(RestaurantApprovalResponseAvroModel other) {
|
||||||
super(SCHEMA$, MODEL$);
|
super(SCHEMA$, MODEL$);
|
||||||
if (isValidValue(fields()[0], other.id)) {
|
if (isValidValue(fields()[0], other.id)) {
|
||||||
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
this.id = data().deepCopy(fields()[0].schema(), other.id);
|
||||||
@@ -418,7 +416,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'id'.
|
* @param value The value of 'id'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setId(java.lang.String value) {
|
public RestaurantApprovalResponseAvroModel.Builder setId(java.lang.String value) {
|
||||||
validate(fields()[0], value);
|
validate(fields()[0], value);
|
||||||
this.id = value;
|
this.id = value;
|
||||||
fieldSetFlags()[0] = true;
|
fieldSetFlags()[0] = true;
|
||||||
@@ -438,7 +436,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'id' field.
|
* Clears the value of the 'id' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearId() {
|
public RestaurantApprovalResponseAvroModel.Builder clearId() {
|
||||||
id = null;
|
id = null;
|
||||||
fieldSetFlags()[0] = false;
|
fieldSetFlags()[0] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -458,7 +456,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'sagaId'.
|
* @param value The value of 'sagaId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
public RestaurantApprovalResponseAvroModel.Builder setSagaId(java.lang.String value) {
|
||||||
validate(fields()[1], value);
|
validate(fields()[1], value);
|
||||||
this.sagaId = value;
|
this.sagaId = value;
|
||||||
fieldSetFlags()[1] = true;
|
fieldSetFlags()[1] = true;
|
||||||
@@ -478,7 +476,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'sagaId' field.
|
* Clears the value of the 'sagaId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearSagaId() {
|
public RestaurantApprovalResponseAvroModel.Builder clearSagaId() {
|
||||||
sagaId = null;
|
sagaId = null;
|
||||||
fieldSetFlags()[1] = false;
|
fieldSetFlags()[1] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -498,7 +496,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'restaurantId'.
|
* @param value The value of 'restaurantId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setRestaurantId(java.lang.String value) {
|
public RestaurantApprovalResponseAvroModel.Builder setRestaurantId(java.lang.String value) {
|
||||||
validate(fields()[2], value);
|
validate(fields()[2], value);
|
||||||
this.restaurantId = value;
|
this.restaurantId = value;
|
||||||
fieldSetFlags()[2] = true;
|
fieldSetFlags()[2] = true;
|
||||||
@@ -518,7 +516,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'restaurantId' field.
|
* Clears the value of the 'restaurantId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearRestaurantId() {
|
public RestaurantApprovalResponseAvroModel.Builder clearRestaurantId() {
|
||||||
restaurantId = null;
|
restaurantId = null;
|
||||||
fieldSetFlags()[2] = false;
|
fieldSetFlags()[2] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -538,7 +536,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'orderId'.
|
* @param value The value of 'orderId'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
public RestaurantApprovalResponseAvroModel.Builder setOrderId(java.lang.String value) {
|
||||||
validate(fields()[3], value);
|
validate(fields()[3], value);
|
||||||
this.orderId = value;
|
this.orderId = value;
|
||||||
fieldSetFlags()[3] = true;
|
fieldSetFlags()[3] = true;
|
||||||
@@ -558,7 +556,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'orderId' field.
|
* Clears the value of the 'orderId' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearOrderId() {
|
public RestaurantApprovalResponseAvroModel.Builder clearOrderId() {
|
||||||
orderId = null;
|
orderId = null;
|
||||||
fieldSetFlags()[3] = false;
|
fieldSetFlags()[3] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -578,7 +576,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'createdAt'.
|
* @param value The value of 'createdAt'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
public RestaurantApprovalResponseAvroModel.Builder setCreatedAt(java.time.Instant value) {
|
||||||
validate(fields()[4], value);
|
validate(fields()[4], value);
|
||||||
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
this.createdAt = value.truncatedTo(java.time.temporal.ChronoUnit.MILLIS);
|
||||||
fieldSetFlags()[4] = true;
|
fieldSetFlags()[4] = true;
|
||||||
@@ -598,7 +596,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'createdAt' field.
|
* Clears the value of the 'createdAt' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearCreatedAt() {
|
public RestaurantApprovalResponseAvroModel.Builder clearCreatedAt() {
|
||||||
fieldSetFlags()[4] = false;
|
fieldSetFlags()[4] = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -607,7 +605,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Gets the value of the 'orderApprovalStatus' field.
|
* Gets the value of the 'orderApprovalStatus' field.
|
||||||
* @return The value.
|
* @return The value.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus getOrderApprovalStatus() {
|
public OrderApprovalStatus getOrderApprovalStatus() {
|
||||||
return orderApprovalStatus;
|
return orderApprovalStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,7 +615,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'orderApprovalStatus'.
|
* @param value The value of 'orderApprovalStatus'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setOrderApprovalStatus(com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus value) {
|
public RestaurantApprovalResponseAvroModel.Builder setOrderApprovalStatus(OrderApprovalStatus value) {
|
||||||
validate(fields()[5], value);
|
validate(fields()[5], value);
|
||||||
this.orderApprovalStatus = value;
|
this.orderApprovalStatus = value;
|
||||||
fieldSetFlags()[5] = true;
|
fieldSetFlags()[5] = true;
|
||||||
@@ -637,7 +635,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'orderApprovalStatus' field.
|
* Clears the value of the 'orderApprovalStatus' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearOrderApprovalStatus() {
|
public RestaurantApprovalResponseAvroModel.Builder clearOrderApprovalStatus() {
|
||||||
orderApprovalStatus = null;
|
orderApprovalStatus = null;
|
||||||
fieldSetFlags()[5] = false;
|
fieldSetFlags()[5] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -657,7 +655,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* @param value The value of 'failureMessages'.
|
* @param value The value of 'failureMessages'.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
public RestaurantApprovalResponseAvroModel.Builder setFailureMessages(java.util.List<java.lang.String> value) {
|
||||||
validate(fields()[6], value);
|
validate(fields()[6], value);
|
||||||
this.failureMessages = value;
|
this.failureMessages = value;
|
||||||
fieldSetFlags()[6] = true;
|
fieldSetFlags()[6] = true;
|
||||||
@@ -677,7 +675,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
* Clears the value of the 'failureMessages' field.
|
* Clears the value of the 'failureMessages' field.
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
*/
|
*/
|
||||||
public com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel.Builder clearFailureMessages() {
|
public RestaurantApprovalResponseAvroModel.Builder clearFailureMessages() {
|
||||||
failureMessages = null;
|
failureMessages = null;
|
||||||
fieldSetFlags()[6] = false;
|
fieldSetFlags()[6] = false;
|
||||||
return this;
|
return this;
|
||||||
@@ -693,7 +691,7 @@ public class RestaurantApprovalResponseAvroModel extends org.apache.avro.specifi
|
|||||||
record.restaurantId = fieldSetFlags()[2] ? this.restaurantId : (java.lang.String) defaultValue(fields()[2]);
|
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.orderId = fieldSetFlags()[3] ? this.orderId : (java.lang.String) defaultValue(fields()[3]);
|
||||||
record.createdAt = fieldSetFlags()[4] ? this.createdAt : (java.time.Instant) defaultValue(fields()[4]);
|
record.createdAt = fieldSetFlags()[4] ? this.createdAt : (java.time.Instant) defaultValue(fields()[4]);
|
||||||
record.orderApprovalStatus = fieldSetFlags()[5] ? this.orderApprovalStatus : (com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus) defaultValue(fields()[5]);
|
record.orderApprovalStatus = fieldSetFlags()[5] ? this.orderApprovalStatus : (OrderApprovalStatus) defaultValue(fields()[5]);
|
||||||
record.failureMessages = fieldSetFlags()[6] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[6]);
|
record.failureMessages = fieldSetFlags()[6] ? this.failureMessages : (java.util.List<java.lang.String>) defaultValue(fields()[6]);
|
||||||
return record;
|
return record;
|
||||||
} catch (org.apache.avro.AvroMissingFieldException e) {
|
} catch (org.apache.avro.AvroMissingFieldException e) {
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* DO NOT EDIT DIRECTLY
|
* DO NOT EDIT DIRECTLY
|
||||||
*/
|
*/
|
||||||
package com.food.ordering.system.kafka.order.avro.model;
|
package com.food.order.system.kafka.order.avro.model;
|
||||||
@org.apache.avro.specific.AvroGenerated
|
@org.apache.avro.specific.AvroGenerated
|
||||||
public enum RestaurantOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<RestaurantOrderStatus> {
|
public enum RestaurantOrderStatus implements org.apache.avro.generic.GenericEnumSymbol<RestaurantOrderStatus> {
|
||||||
PAID ;
|
PAID ;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"namespace": "com.food.ordering.system.kafka.order.avro.model",
|
"namespace": "com.food.order.system.kafka.order.avro.model",
|
||||||
"type": "record",
|
"type": "record",
|
||||||
"name": "PaymentRequestAvroModel",
|
"name": "PaymentRequestAvroModel",
|
||||||
"fields": [
|
"fields": [
|
||||||
|
|||||||
@@ -1,52 +1,48 @@
|
|||||||
package com.food.order.system.kafka.producer.service.impl;
|
package com.food.order.system.kafka.producer.service.impl;
|
||||||
|
|
||||||
|
import com.food.order.system.kafka.producer.exception.KafkaProducerException;
|
||||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.avro.specific.SpecificRecordBase;
|
import org.apache.avro.specific.SpecificRecordBase;
|
||||||
|
import org.springframework.kafka.KafkaException;
|
||||||
import org.springframework.kafka.core.KafkaTemplate;
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
import org.springframework.kafka.support.SendResult;
|
import org.springframework.kafka.support.SendResult;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.concurrent.ListenableFuture;
|
||||||
import org.springframework.util.concurrent.ListenableFutureCallback;
|
import org.springframework.util.concurrent.ListenableFutureCallback;
|
||||||
|
|
||||||
import javax.annotation.PreDestroy;
|
import javax.annotation.PreDestroy;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@Component
|
||||||
public class KafkaProducerImpl<K extends Serializable, V extends SpecificRecordBase> implements KafkaProducer<K, V> {
|
public class KafkaProducerImpl<K extends Serializable, V extends SpecificRecordBase> implements KafkaProducer<K, V> {
|
||||||
|
|
||||||
private final KafkaTemplate<K, V> kafkaTemplate;
|
private final KafkaTemplate<K, V> kafkaTemplate;
|
||||||
|
|
||||||
@Override
|
public KafkaProducerImpl(KafkaTemplate<K, V> kafkaTemplate) {
|
||||||
public void send(String topicName, K key, V message, ListenableFutureCallback<SendResult<K, V>> callback) {
|
this.kafkaTemplate = kafkaTemplate;
|
||||||
log.info("Sending message to topic: {}, also message {}", topicName,message);
|
|
||||||
kafkaTemplate.send(topicName, key, message)
|
|
||||||
.addCallback(new ListenableFutureCallback<>() {
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable ex) {
|
|
||||||
log.error("Error sending message to topic: {}, also message {}", topicName, message, ex);
|
|
||||||
callback.onFailure(ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(SendResult<K, V> result) {
|
|
||||||
log.info("Message sent to topic: {}, also message {}", topicName, message);
|
|
||||||
callback.onSuccess(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreDestroy
|
@Override
|
||||||
public void destroy() {
|
public void send(String topicName, K key, V message, ListenableFutureCallback<SendResult<K, V>> callback) {
|
||||||
log.info("KafkaProducerImpl is being destroyed");
|
log.info("Sending message={} to topic={}", message, topicName);
|
||||||
if (Objects.nonNull(kafkaTemplate)) {
|
try {
|
||||||
kafkaTemplate.destroy();
|
ListenableFuture<SendResult<K, V>> kafkaResultFuture = kafkaTemplate.send(topicName, key, message);
|
||||||
|
kafkaResultFuture.addCallback(callback);
|
||||||
|
} catch (KafkaException e) {
|
||||||
|
log.error("Error on kafka producer with key: {}, message: {} and exception: {}", key, message,
|
||||||
|
e.getMessage());
|
||||||
|
throw new KafkaProducerException("Error on kafka producer with key: " + key + " and message: " + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
public void close() {
|
||||||
|
if (kafkaTemplate != null) {
|
||||||
|
log.info("Closing kafka producer!");
|
||||||
|
kafkaTemplate.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,11 @@
|
|||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.avro</groupId>
|
||||||
|
<artifactId>avro</artifactId>
|
||||||
|
<version>${avro.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.kafka</groupId>
|
<groupId>org.springframework.kafka</groupId>
|
||||||
@@ -60,11 +65,7 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.avro</groupId>
|
|
||||||
<artifactId>avro</artifactId>
|
|
||||||
<version>${avro.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
|||||||
|
|
||||||
@EnableJpaRepositories("com.food.order.system.data.access")
|
@EnableJpaRepositories("com.food.order.system.data.access")
|
||||||
@EntityScan(basePackages = "com.food.order.system.data.access")
|
@EntityScan(basePackages = "com.food.order.system.data.access")
|
||||||
@SpringBootApplication(scanBasePackages = "com.food.order.system")
|
@SpringBootApplication(scanBasePackages = "com.food.order")
|
||||||
public class OrderServiceApplication {
|
public class OrderServiceApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(OrderServiceApplication.class, args);
|
SpringApplication.run(OrderServiceApplication.class, args);
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.food.order.system.order.messaging.listener.kafka;
|
|||||||
import com.food.order.sysyem.ports.input.message.listener.payment.PaymentResponseMessageListener;
|
import com.food.order.sysyem.ports.input.message.listener.payment.PaymentResponseMessageListener;
|
||||||
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
||||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
import com.food.order.system.kafka.order.avro.model.PaymentResponseAvroModel;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.PaymentStatus;
|
import com.food.order.system.kafka.order.avro.model.PaymentStatus;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.kafka.annotation.KafkaListener;
|
import org.springframework.kafka.annotation.KafkaListener;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.food.order.system.order.messaging.listener.kafka;
|
|||||||
import com.food.order.sysyem.ports.input.message.listener.restaurantapproval.RestaurantApprovalResponseMessageListener;
|
import com.food.order.sysyem.ports.input.message.listener.restaurantapproval.RestaurantApprovalResponseMessageListener;
|
||||||
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
import com.food.order.system.kafka.consumer.KafkaConsumer;
|
||||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.OrderApprovalStatus;
|
import com.food.order.system.kafka.order.avro.model.OrderApprovalStatus;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel;
|
import com.food.order.system.kafka.order.avro.model.RestaurantApprovalResponseAvroModel;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.kafka.annotation.KafkaListener;
|
import org.springframework.kafka.annotation.KafkaListener;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.food.order.system.order.messaging.mapper;
|
package com.food.order.system.order.messaging.mapper;
|
||||||
|
|
||||||
|
import com.food.order.system.domain.event.OrderCancelledEvent;
|
||||||
|
import com.food.order.system.domain.event.OrderCreatedEvent;
|
||||||
|
import com.food.order.system.domain.event.OrderPaidEvent;
|
||||||
|
import com.food.order.system.kafka.order.avro.model.*;
|
||||||
import com.food.order.sysyem.dto.message.PaymentResponse;
|
import com.food.order.sysyem.dto.message.PaymentResponse;
|
||||||
import com.food.order.sysyem.dto.message.RestaurantApprovalResponse;
|
import com.food.order.sysyem.dto.message.RestaurantApprovalResponse;
|
||||||
import com.food.order.sysyem.valueobject.OrderApprovalStatus;
|
import com.food.order.sysyem.valueobject.OrderApprovalStatus;
|
||||||
import com.food.order.sysyem.valueobject.PaymentStatus;
|
import com.food.order.sysyem.valueobject.PaymentStatus;
|
||||||
import com.food.order.system.domain.event.OrderCancelledEvent;
|
|
||||||
import com.food.order.system.domain.event.OrderCreatedEvent;
|
|
||||||
import com.food.order.system.domain.event.OrderPaidEvent;
|
|
||||||
import com.food.ordering.system.kafka.order.avro.model.*;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -15,20 +15,20 @@ import java.util.UUID;
|
|||||||
@Component
|
@Component
|
||||||
public class OrderMessagingDataMapper {
|
public class OrderMessagingDataMapper {
|
||||||
|
|
||||||
public PaymentRequestAvroModel orderCreatedEventToPaymenRequestAvroModel(OrderCreatedEvent orderCreatedEvent) {
|
public PaymentRequestAvroModel orderCreatedEventToPaymentRequestAvroModel(OrderCreatedEvent orderCreatedEvent) {
|
||||||
var order = orderCreatedEvent.getOrder();
|
var order = orderCreatedEvent.getOrder();
|
||||||
return PaymentRequestAvroModel.newBuilder()
|
return PaymentRequestAvroModel.newBuilder()
|
||||||
.setOrderId(order.getId().getValue().toString())
|
.setId(UUID.randomUUID().toString())
|
||||||
.setSagaId("")
|
.setSagaId("")
|
||||||
.setCustomerId(order.getCustomerId().getValue().toString())
|
.setCustomerId(order.getCustomerId().getValue().toString())
|
||||||
.setId(UUID.randomUUID().toString())
|
.setOrderId(order.getId().getValue().toString())
|
||||||
.setPrice(order.getPrice().getAmount())
|
.setPrice(order.getPrice().getAmount())
|
||||||
.setCreatedAt(orderCreatedEvent.getCreatedAt().toInstant())
|
.setCreatedAt(orderCreatedEvent.getCreatedAt().toInstant())
|
||||||
.setPaymentOrderStatus(PaymentOrderStatus.PENDING)
|
.setPaymentOrderStatus(PaymentOrderStatus.PENDING)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PaymentRequestAvroModel orderCancelledEventToPaymenRequestAvroModel(OrderCancelledEvent orderCancelledEvent) {
|
public PaymentRequestAvroModel orderCancelledEventToPaymentRequestAvroModel(OrderCancelledEvent orderCancelledEvent) {
|
||||||
var order = orderCancelledEvent.getOrder();
|
var order = orderCancelledEvent.getOrder();
|
||||||
return PaymentRequestAvroModel.newBuilder()
|
return PaymentRequestAvroModel.newBuilder()
|
||||||
.setOrderId(order.getId().getValue().toString())
|
.setOrderId(order.getId().getValue().toString())
|
||||||
@@ -48,7 +48,7 @@ public class OrderMessagingDataMapper {
|
|||||||
.setOrderId(order.getId().getValue().toString())
|
.setOrderId(order.getId().getValue().toString())
|
||||||
.setRestaurantId(order.getRestaurantId().getValue().toString())
|
.setRestaurantId(order.getRestaurantId().getValue().toString())
|
||||||
.setProducts(order.getItems().stream()
|
.setProducts(order.getItems().stream()
|
||||||
.map(item -> com.food.ordering.system.kafka.order.avro.model.Product.newBuilder()
|
.map(item -> Product.newBuilder()
|
||||||
.setId(item.getId().getValue().toString())
|
.setId(item.getId().getValue().toString())
|
||||||
.setQuantity(item.getQuantity())
|
.setQuantity(item.getQuantity())
|
||||||
.build())
|
.build())
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.food.order.system.order.messaging.publisher.kafka;
|
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.payment.OrderCancelledPaymentRequestMessagePublisher;
|
|
||||||
import com.food.order.system.domain.event.OrderCancelledEvent;
|
import com.food.order.system.domain.event.OrderCancelledEvent;
|
||||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
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.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -29,7 +29,7 @@ public class CancelOrderKafkaMessagePublisher implements OrderCancelledPaymentRe
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
var paymentRequestAvroModel =
|
var paymentRequestAvroModel =
|
||||||
orderMessagingDataMapper.orderCancelledEventToPaymenRequestAvroModel(event);
|
orderMessagingDataMapper.orderCancelledEventToPaymentRequestAvroModel(event);
|
||||||
|
|
||||||
kafkaProducer.send(
|
kafkaProducer.send(
|
||||||
configData.getPaymentRequestTopicName(),
|
configData.getPaymentRequestTopicName(),
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package com.food.order.system.order.messaging.publisher.kafka;
|
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.payment.OrderCreatedPaymentRequestMessagePublisher;
|
|
||||||
import com.food.order.system.domain.event.OrderCreatedEvent;
|
import com.food.order.system.domain.event.OrderCreatedEvent;
|
||||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.PaymentRequestAvroModel;
|
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.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -29,7 +29,7 @@ public class CreateOrderKafkaMessagePublisher implements OrderCreatedPaymentRequ
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
var paymentRequestAvroModel =
|
var paymentRequestAvroModel =
|
||||||
orderMessagingDataMapper.orderCreatedEventToPaymenRequestAvroModel(event);
|
orderMessagingDataMapper.orderCreatedEventToPaymentRequestAvroModel(event);
|
||||||
|
|
||||||
kafkaProducer.send(
|
kafkaProducer.send(
|
||||||
configData.getPaymentRequestTopicName(),
|
configData.getPaymentRequestTopicName(),
|
||||||
@@ -43,7 +43,7 @@ public class CreateOrderKafkaMessagePublisher implements OrderCreatedPaymentRequ
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
log.error("Error publishing order created event for order id: {}", orderId, e);
|
log.error("Error publishing order created event for order id: {} and message is {}", orderId, e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import org.springframework.util.concurrent.ListenableFutureCallback;
|
|||||||
public class OrderKafkaMessageHelper {
|
public class OrderKafkaMessageHelper {
|
||||||
|
|
||||||
public <T> ListenableFutureCallback<SendResult<String, T>> getKafkaCallBack
|
public <T> ListenableFutureCallback<SendResult<String, T>> getKafkaCallBack
|
||||||
(String responseTopicName, T requestAvroModel,String orderId, String requestAvroModelName) {
|
(String responseTopicName, T t,String orderId, String requestAvroModelName) {
|
||||||
return new ListenableFutureCallback<SendResult<String , T>>() {
|
return new ListenableFutureCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable ex) {
|
public void onFailure(Throwable ex) {
|
||||||
log.error("Error while sending " + requestAvroModelName +
|
log.error("Error while sending " + requestAvroModelName +
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.food.order.sysyem.ports.output.message.publisher.restaurantapproval.O
|
|||||||
import com.food.order.system.domain.event.OrderPaidEvent;
|
import com.food.order.system.domain.event.OrderPaidEvent;
|
||||||
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
import com.food.order.system.kafka.producer.service.KafkaProducer;
|
||||||
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
import com.food.order.system.order.messaging.mapper.OrderMessagingDataMapper;
|
||||||
import com.food.ordering.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel;
|
import com.food.order.system.kafka.order.avro.model.RestaurantApprovalRequestAvroModel;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|||||||
Reference in New Issue
Block a user