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:
LincPay
2026-08-06 13:30:14 +05:30
co-authored by Claude Opus 5
commit 1b9b02f2c7
100 changed files with 7935 additions and 0 deletions
@@ -0,0 +1,123 @@
package com.lincfusion.udyamlinc.dto;
import com.lincfusion.udyamlinc.enterprise.Enterprise;
import com.lincfusion.udyamlinc.enterprise.LedgerEntry;
import com.lincfusion.udyamlinc.officer.FieldVisit;
import com.lincfusion.udyamlinc.risk.ForecastPoint;
import com.lincfusion.udyamlinc.risk.ReasonCode;
import com.lincfusion.udyamlinc.risk.RiskAlert;
import com.lincfusion.udyamlinc.risk.StressScore;
import java.math.BigDecimal;
import java.util.List;
/** Response shapes. These mirror the interfaces in UdyamLinc-UI/src/lib/api.ts. */
public final class UdyamResponses {
private UdyamResponses() {
}
public record OfficerSessionResponse(
String token,
String tokenType,
String username,
String fullName,
String role,
List<String> blocks,
String branch) {
}
public record EnterpriseSessionResponse(
String token,
String tokenType,
String enterpriseId,
String name,
String nameHi,
String sector,
String block,
String lang) {
}
/** An enterprise flattened with its sector code, as the console's table expects. */
public record EnterpriseRow(
Long id,
String enterpriseId,
String name,
String nameHi,
String sector,
String block,
String district,
Integer ownerCount,
Integer vintageMonths,
BigDecimal loanOutstanding,
BigDecimal monthlyInstalment,
Integer score,
String band,
List<Integer> trend,
String lastUpdated) {
}
/** Dashboard KPI tiles plus the enterprises-by-risk register. */
public record PortfolioResponse(
String block,
String month,
long total,
long totalDelta,
long red,
long redDelta,
long watch,
long watchDelta,
long standard,
long standardDelta,
int updatedMinutesAgo,
List<EnterpriseRow> rows) {
}
/** Everything the risk detail panel needs for one enterprise. */
public record EnterpriseDetailResponse(
Enterprise enterprise,
String sector,
String district,
StressScore score,
List<ReasonCode> reasons,
List<ForecastPoint> forecast,
List<RiskAlert> alerts,
List<FieldVisit> visits,
List<LedgerEntry> ledger) {
}
public record ForecastResponse(
String enterpriseId,
String modelVersion,
String engine,
int horizonMonths,
String breachMonth,
BigDecimal shortfall,
List<ForecastPoint> points) {
}
/** The enterprise app's Home tab in one call. */
public record AppHomeResponse(
Enterprise enterprise,
RiskAlert alert,
List<ForecastPoint> forecast,
BigDecimal todayIn,
BigDecimal todayOut,
String adviceEn,
String adviceHi,
String lastSyncedAt) {
}
public record SyncResultResponse(int accepted, int duplicates, String syncedAt) {
}
/** One playbook action, offered for a band. */
public record PlaybookActionResponse(
String code, String label, String labelHi, String appliesTo, String detail) {
}
/** Sector pack rollup for the Forecasts screen. */
public record SectorRollupResponse(
String sector, String label, long count, long red, long watch, long standard, int avgScore) {
}
}