package nl.homeserver.energiecontract;

import static java.math.BigDecimal.ZERO;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Getter;
import lombok.Setter;
import nl.homeserver.energie.StroomTariefIndicator;

@Entity
@Table
public class Energiecontract {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Getter @Setter
    private long id;

    @Column(nullable = false, unique = true)
    @Getter @Setter
    private Long van;

    @JsonIgnore
    @Column(nullable = false)
    @Getter @Setter
    private Long totEnMet;

    @Column(precision = 7, scale = 6, nullable = false)
    @Getter @Setter
    private BigDecimal stroomPerKwhNormaalTarief;

    @Column(precision = 7, scale = 6)
    @Getter @Setter
    private BigDecimal stroomPerKwhDalTarief;

    @Column(precision = 7, scale = 6)
    @Getter @Setter
    private BigDecimal gasPerKuub;

    @Getter @Setter
    private String leverancier;

    public BigDecimal getStroomKosten(StroomTariefIndicator stroomTariefIndicator) {
        switch (stroomTariefIndicator) {
            case DAL:
                if (stroomPerKwhDalTarief != null) {
                    return stroomPerKwhDalTarief;
                } else {
                    return stroomPerKwhNormaalTarief;
                }
            case NORMAAL:
                return stroomPerKwhNormaalTarief;
            default:
                return ZERO;
        }
    }
}

@@ -572,36 +572,16 @@
 e.AUTO)%0A
-    @Getter @Setter%0A
     priv
@@ -593,16 +593,16 @@
 ong id;%0A
+
 %0A    @Co
@@ -642,32 +642,36 @@
 rue)%0A    @Getter
+%0A   
  @Setter%0A    pri
@@ -735,32 +735,36 @@
 lse)%0A    @Getter
+%0A   
  @Setter%0A    pri
@@ -843,32 +843,36 @@
 lse)%0A    @Getter
+%0A   
  @Setter%0A    pri
@@ -956,32 +956,36 @@
 = 6)%0A    @Getter
+%0A   
  @Setter%0A    pri
@@ -1065,32 +1065,36 @@
 = 6)%0A    @Getter
+%0A   
  @Setter%0A    pri
@@ -1122,16 +1122,16 @@
 rKuub;%0A%0A
-
     @Get
@@ -1133,16 +1133,20 @@
  @Getter
+%0A   
  @Setter

Remove unneeded Lombok annotations