LinuxForHealth/x12

Implement Builder Pattern For Domain Modeling

dixonwhitmire opened this issue · 1 comments

The Pydantic library is a parsing and validation framework. It doesn't provide much in the way of constructing objects or models. For the X12 formats this means that the model input has to be either a correctly formed and in some cases deeply nested, dictionary or a slew of kwags in the __init__() method.

#pseudo code
x12_270_builder = X12270Builder()
x12_270_model = x12_270_builder.build_loop2000a()
                               .build_loop2100a()
                                # etc etc
                                .build()

Reference - pydantic/pydantic#2152

Will close for now and reevaluate later if necessary