package com.lincfusion.udyamlinc.master; import jakarta.persistence.*; import lombok.*; /** * The join key for every external signal. Mandi prices and climate series are * pulled per district, never per enterprise — that is what keeps ingestion to * roughly forty rows a day instead of one call per enterprise. */ @Entity @Table(name = "district", indexes = @Index(name = "ix_district_code", columnList = "code", unique = true)) @Getter @Setter @NoArgsConstructor @AllArgsConstructor @Builder public class District { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; /** SEHORE, VIDISHA… */ @Column(nullable = false, unique = true, length = 32) private String code; @Column(nullable = false, length = 64) private String name; @Column(length = 64) private String nameHi; @Column(nullable = false, length = 64) private String state; /** District centroid — used to pick the climate grid cell. */ private Double latitude; private Double longitude; private Boolean active; @PrePersist void onCreate() { if (active == null) active = Boolean.TRUE; } }