Skip to main content

Code Conventions

Error Handling in Parsers​

danger

Never throw inside a Flow { } block in a parser. Exceptions inside a flow create uncollectable flows and break the entire stream.

Sensitive Data Masking​

Always check fieldSpec.sensitive before including a value in any log or error message. Use "***" as the placeholder.

Kotlin Style​

  • Data classes for all models β€” keep them immutable; use .copy() for mutations
  • Logging β€” private val log = KotlinLogging.logger {} at file level, not class level
  • Beans β€” @Component only; no manual @Bean factory methods unless unavoidable
  • Coroutines β€” suspend fun for I/O, Flow<T> for streams; never runBlocking in production paths
  • Strings β€” use string templates over concatenation
  • Named arguments β€” required for data class constructors with more than 3 parameters

Package Structure​

What NOT To Do​

Do notReason
Add flyway-database-postgresql dependencyDoes not exist in Flyway 9.x (Boot 3.2.3 BOM)
Enable bootJar on platform-pipeline or platform-schedulerNo main class β€” will fail build
Load an entire file into a List in a parserBreaks stream-first design; use Flow and emit
Log raw values for sensitive=true fieldsPII leak; always mask with ***
Throw exceptions inside Flow { } blocksCreates uncollectable flow; add ParseError to record instead
Commit a filled .env fileGitignored for a reason β€” use env.example as reference
Use JUnit test classesProject is Kotest-only; JUnit Vintage is excluded
Modify ParserRegistry to hard-code a new parserBreaks Open/Closed; annotate the new parser @Component