Atomic extraction of the deadline-rule compute engine + types from
internal/services into a new pkg/litigationplanner package that paliad
+ youpc.org can both import. No behaviour change — every existing test
passes against the post-move shape.
Package contents (~1850 LoC):
- doc.go package docstring + reuse manifesto
- types.go Rule, ProceedingType, NullableJSON, AdjustmentReason,
HolidayDTO, CalcOptions, CalcRuleParams, Timeline,
TimelineEntry, RuleCalculation*, FristenrechnerType,
ProjectHint, sentinel errors
- catalog.go Catalog interface (proceeding + rule lookups)
- holidays.go HolidayCalendar interface
- courts.go CourtRegistry interface + DefaultsForJurisdiction +
country/regime constants
- expr.go EvalConditionExpr + HasConditionExpr +
ExtractFlagsFromExpr (jsonb gate evaluator)
- durations.go ApplyDuration + AddWorkingDays (pure compute)
- subtrack.go SubTrackRouting + LookupSubTrackRouting registry
- legal_source.go FormatLegalSourceDisplay + BuildLegalSourceURL
- proceeding_mapping.go MapLitigationToFristenrechner + code constants
(CodeUPCInfringement, CodeDEInfringementLG, ...)
- engine.go Calculate + CalculateRule + the trigger-event
branch + applyRuleOverrides (the big move)
paliad side (~1900 LoC net deletion):
- internal/services/fristenrechner.go shrinks from 1505 → ~290 lines
(thin paliad Catalog adapter + type aliases for back-compat).
- internal/models/models.go: DeadlineRule, ProceedingType, NullableJSON
become type aliases to litigationplanner.* — every sqlx scan and
every projection_service caller compiles unchanged.
- internal/services/holidays.go: AdjustmentReason + HolidayDTO become
aliases to lp.* (canonical definitions now in the package).
- internal/services/proceeding_mapping.go: rewritten as thin re-exports
of lp constants + helpers.
- internal/services/deadline_search_service.go: FormatLegalSourceDisplay
+ BuildLegalSourceURL replaced with delegating wrappers to lp.
Catalog interface satisfaction:
- DeadlineRuleService → paliadCatalog adapter (wraps the existing
service, replicates the original SELECT shapes).
- HolidayService → satisfies lp.HolidayCalendar directly (compile-
time assertion at end of fristenrechner.go).
- CourtService → satisfies lp.CourtRegistry directly.
Wire shape is byte-identical. JSON tags on Rule / ProceedingType /
Timeline / TimelineEntry / RuleCalculation match the historical
UIResponse / UIDeadline shape; the frontend reads the same bytes.
Slice B (Catalog interface + paliad loader cleanup) is folded into
this commit since Slice A already needs the interfaces to call
Calculate across the boundary. Slice C (embedded UPC snapshot +
generator) is the next coder shift; the Berufung unification m
called out lands in Slice B/C per head's brief.
Refs: docs/design-litigation-planner-2026-05-26.md
64 lines
2.8 KiB
Go
64 lines
2.8 KiB
Go
package services
|
|
|
|
import lp "mgit.msbls.de/m/paliad/pkg/litigationplanner"
|
|
|
|
// proceeding_mapping bridges the two proceeding-type vocabularies in
|
|
// the codebase. The canonical implementations now live in
|
|
// pkg/litigationplanner — this file keeps the existing service-level
|
|
// names alive as re-exports so the rest of internal/services + tests
|
|
// compile without an import-rewrite.
|
|
//
|
|
// See pkg/litigationplanner/proceeding_mapping.go for the logic +
|
|
// docs/design-determinator-row-cascade-2026-05-13.md §4.2 for the
|
|
// design rationale.
|
|
|
|
// Stable code constants — re-exported from the package so existing
|
|
// services / handlers can keep using the bare names.
|
|
const (
|
|
CodeUPCInfringement = lp.CodeUPCInfringement
|
|
CodeUPCRevocation = lp.CodeUPCRevocation
|
|
CodeUPCCounterclaim = lp.CodeUPCCounterclaim
|
|
CodeUPCPreliminary = lp.CodeUPCPreliminary
|
|
CodeUPCDamages = lp.CodeUPCDamages
|
|
CodeUPCDiscovery = lp.CodeUPCDiscovery
|
|
CodeUPCAppealMerits = lp.CodeUPCAppealMerits
|
|
CodeUPCAppealOrder = lp.CodeUPCAppealOrder
|
|
CodeUPCAppealCost = lp.CodeUPCAppealCost
|
|
CodeDEInfringementLG = lp.CodeDEInfringementLG
|
|
CodeDEInfringementOLG = lp.CodeDEInfringementOLG
|
|
CodeDEInfringementBGH = lp.CodeDEInfringementBGH
|
|
CodeDENullityBPatG = lp.CodeDENullityBPatG
|
|
CodeDENullityBGH = lp.CodeDENullityBGH
|
|
CodeEPAGrant = lp.CodeEPAGrant
|
|
CodeEPAOpposition = lp.CodeEPAOpposition
|
|
CodeEPAOppositionAppeal = lp.CodeEPAOppositionAppeal
|
|
CodeDPMAOpposition = lp.CodeDPMAOpposition
|
|
CodeDPMAAppealBPatG = lp.CodeDPMAAppealBPatG
|
|
CodeDPMAAppealBGH = lp.CodeDPMAAppealBGH
|
|
)
|
|
|
|
// MapLitigationToFristenrechner returns the fristenrechner code +
|
|
// condition flags implied by a (litigationCode, jurisdiction) pair.
|
|
// Delegates to litigationplanner.MapLitigationToFristenrechner.
|
|
func MapLitigationToFristenrechner(litigationCode, jurisdiction string) (fristenrechnerCode string, conditionFlags []string, ok bool) {
|
|
return lp.MapLitigationToFristenrechner(litigationCode, jurisdiction)
|
|
}
|
|
|
|
// ResolveCounterclaimRouting handles the determinator's upc.ccr.cfi
|
|
// illustrative-peer route. Delegates to
|
|
// litigationplanner.ResolveCounterclaimRouting.
|
|
func ResolveCounterclaimRouting(code string) (effectiveCode string, defaultFlags []string, routed bool) {
|
|
return lp.ResolveCounterclaimRouting(code)
|
|
}
|
|
|
|
// SubTrackRoutings exposes the sub-track routing registry. SubTrackRouting
|
|
// is aliased in fristenrechner.go.
|
|
var SubTrackRoutings = lp.SubTrackRoutings
|
|
|
|
// LookupSubTrackRouting returns the sub-track routing for a proceeding
|
|
// code, or (zero, false) if the code is not a sub-track. Delegates to
|
|
// litigationplanner.LookupSubTrackRouting.
|
|
func LookupSubTrackRouting(code string) (SubTrackRouting, bool) {
|
|
return lp.LookupSubTrackRouting(code)
|
|
}
|