Closed evamaxfield closed 3 years ago
I like the idea. Also if we ever change the object, we would only need to change the code in one place.
I think this is a good idea too, especially now with the new database redesign we have a good starting point to build off of. This will make the code more flexible and easier to refactor. With dedicated objects I think the code gains readability since we'd easily know what's available to an object without needing domain knowledge on a dictionary's keys.
I've been getting to know the codebase. Since data types are changing for this issue, I think a good way to refactor would be TDD
@osethan I don't know what the acronym "TDD" stands form :joy:
Test Driven Development, rewrite tests then make code pass.
Use Case
Please provide a use case to help us understand your request in context
So I think the idea is decently simple enough. Currently all of our database functions (current and planned) all simply accept dictionaries. If instead we said "we accept a
Body
object, or aEvent
object, it would be self validating and also somewhat easier to define a "general" pipeline as "this function must accept aEvent
and must return aTranscript
or similar.I will note I think this is probably a longer term thing and not immediately needed but taking opinions.