openapi icon indicating copy to clipboard operation
openapi copied to clipboard

Request: Split `period` into two types

Open phayes opened this issue 4 years ago • 0 comments

It would be nice if period was split up into two types, one might be called period and the the other closed_period.

This would allow us to differentiate between :

  1. periods where start and end might be null and therefore possibly open-ended. This one maps to the current period type.
  2. periods that always have a start and end date (not nullable), we could call this one closed_period. Many instances of the existing period type could be moved into this type.

Right now, null-checking on periods is super annoying, even when I can reasonable assume those values will not be null. However, making assumptions is a bad idea, so this should be represented by concrete types that explicitly delineate when the period is definitely closed, and the start and end non-null.

phayes avatar Jun 03 '21 19:06 phayes