refactor(flight-state): SCHD 日计划收敛为缺失保留合并语义并对齐现行设计文档

按现行 docs/flight-state.md(111 行版,§1-§7)全面对齐 domain 包及其消费方,
删除整套指向已退役长版文档(§5.x-§10)的引用与死代码:

- 语义:FlightStateEngine.snapshotState 由"完整快照整体替换"改为 §3.1 合并语义
  ——出现 Set/Replace、缺失保留、标量空串显式清空;DELETED 不被日计划恢复(§3.3)。
- 校验:validateMessage 移除从未接线的报文覆盖范围(scope)参数,只保留 §4 步骤 2
  的声明数量/航班标识/运营日推导校验;ScheduleBody 删除 scopeStart/scopeEnd。
- 删除死代码:domain/Decision.kt、FlightModel 的 SnapshotPatch/UpsertOutcome、
  ProcState.isTerminal/archivable、SnapshotFlag.SEQN_REGRESSION、
  ScheduleRecord.seqn(及 wire FlightRecordXml.SEQN);codec 移除未消费 FFID。
- 删除未接线且引用已退役列(fday/last_message_id)的 SqlDialect 方言脚手架,
  oracle11g README 改为按 V1 现列重建的口径。
- 注释/测试:domain、processing、infra 仓储与 jobs/delivery、配置类及对应测试的
  KDoc 章节引用全部对齐现行 flight-state.md/design.md;FlightStateEngineTest
  重写为合并语义(62/62 通过)。

V1__flight_state_baseline.sql 保留原样(内容注释仍带旧章节号,改动会破坏
已应用迁移的 Flyway checksum,待重建基线或 V2 净迁移时收敛)。
This commit is contained in:
windyboy
2026-09-09 22:17:04 +08:00
parent b75f566276
commit 99a0f5f738
35 changed files with 320 additions and 370 deletions
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText
import com.gzzn.omms.msgexchange.domain.flight.ScheduleRecord
import java.time.LocalDate
/** Stable payload boundary used by processing. It is deliberately not an XML model. */
data class FlopPayload(
@@ -18,8 +17,6 @@ data class FlopPayload(
data class ScheduleBody(
val recsDeclared: Int,
val records: List<ScheduleRecord>,
val scopeStart: LocalDate? = null,
val scopeEnd: LocalDate? = null,
)
/**
@@ -54,9 +51,7 @@ data class SchdXml(
@JsonIgnoreProperties(ignoreUnknown = true)
data class FlightRecordXml(
@param:JacksonXmlProperty(localName = "FLID") val flid: String? = null,
@param:JacksonXmlProperty(localName = "FFID") val ffid: String? = null,
@param:JacksonXmlProperty(localName = "FDEL") val fdel: FdelXml? = null,
@param:JacksonXmlProperty(localName = "SEQN") val seqn: Long? = null,
@param:JacksonXmlProperty(localName = "ALCD") val alcd: String? = null,
@param:JacksonXmlProperty(localName = "ALSC") val alsc: String? = null,
@param:JacksonXmlProperty(localName = "FLNO") val flno: String? = null,
@@ -16,12 +16,12 @@ internal object SisWireMapper {
private fun scheduleRecord(xml: FlightRecordXml): ScheduleRecord? =
xml.flid?.trim()?.takeIf(String::isNotEmpty)?.let {
ScheduleRecord(it, xml.scalars(), xml.collections(), xml.seqn ?: 0L)
ScheduleRecord(it, xml.scalars(), xml.collections())
}
private fun FlightRecordXml.scalars(): Map<String, String> = linkedMapOf<String, String>().apply {
listOf(
"FFID" to ffid, "ALCD" to alcd, "ALSC" to alsc, "FLNO" to flno, "MVIN" to mvin, "SODT" to sodt,
"ALCD" to alcd, "ALSC" to alsc, "FLNO" to flno, "MVIN" to mvin, "SODT" to sodt,
"FLTY" to flty, "FLIN" to flin, "ACFT" to acft, "RENO" to reno, "TAOP" to taop,
"TAFL" to tafl, "TAID" to taid, "TRML" to trml, "MAXP" to maxp, "CSOP" to csop,
"CSFT" to csft, "MAID" to maid, "ESTT" to estt, "ACTT" to actt, "STND" to stnd,