chore: initial commit — UdyamLinc backend, phases A-E
Spring Boot 4 / Java 17 / Postgres. Masters and serving (A), Agmarknet and climate ingestion (B), feature store with 14 derivations (C), SpEL rule engine and risk scoring (D). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user