package com.example.kafka.entity;

import com.example.kafka.enumerator.OrderStatus;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;


/**
 * Order entity class which has define all properties for Order class
 */
@Data
@ToString
@EqualsAndHashCode(of={"id","name"})
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@Document(value = "orders")
public class Order {

    /**
     * Order id
     */
    @Id
    @JsonProperty(value = "id")
    private String id;

    /**
     * Order's name
     */
    @JsonProperty(value = "name")
    private String name;

    /**
     * Order amount
     */
    @JsonProperty(value = "amount")
    private double amount;

    /**
     * Order status
     */
    @JsonProperty(value = "orderStatus")
    private OrderStatus orderStatus;
}
