Creating an effectful filter to access and validate properties in a `Schema.Class` involves using...

Given Schema.Classhow do I create an effectful filter, that can access "all" the properties?

Sample:

class SomeThing extends Schema.Class<SomeThing>(
    'SomeThing',
)({
    type: Schema.Literal('some_type'),
    someId: Schema.String,
    details: Schema.Struct({
        variant: Schema.Literal(
            'A',
            'B',
            'C',
        ),
        relevantDate: Schema.DateFromString.pipe(Schema.validDate()).pipe(
            Schema.greaterThanDate(new Date()),
        ),
    }),
    description: Schema.Trim.pipe(Schema.maxLength(120), Schema.minLength(1)),
}) {}


Now relevantDate isn't just supposed to be checked based on after the current date, but also before another date derived from the someId. How would I best go about that?
Was this page helpful?