Closed jkoren closed 3 months ago
I used (a pydantic2 fork of) pydantic2ts
to generate this Typescript of the rules engine (not their schema) in case we find it useful at any point in this process.
Have you used types/interfaces instead of classes before? I wanted to talk to you about that but we ran out of time. Essentially I’m trying to realize what is the benefit for us in stateful class instance objects as here vs simple stateless plain typescript objects re-created much like the classes in your PRs?
In Slack, Jeff asked the difference between type
syntax, interface
syntax and even class
syntax. I found an awesome SO answer that explains the syntax and other (sorta minor) differences around choosing Types vs Interfaces https://stackoverflow.com/a/52682220
I read the article, and updated PR 133 to use interfaces. good suggestion!
@alanisaac Yes NaturalGasBill is an aggregate root and would have an array of NaturalGasBillRecords as part of the object.
@jkoren What if we combine and move all the typescript files from heat-stack/model
in to the heat-stack/types/index.d.ts
or heat-stack/types/index.ts
file if that doesn't work for some reason?
Hey @thadk thanks for looking at the PR. I looked at heat-stack/types and don't see an index file. Combining is ok with me. Is this a more standard place to put model definitions?
@jkoren Yep, please create heat-stack/types/index.d.ts
with the combined set of those and we can probably merge this. I think combining related types is pretty common.
Also I think heat-stack/models
is a bit inaccurate naming since the database schemas won't be controlled by these files, only the types.
The SQLite database schema is controlled by the schema.prisma
file I believe.
@thadk combined interfaces into single file
@jkoren Oop, tests aren't passing though. Looks like some references might still be on the old setup.
I saw that .. its funny it’s working when running locally. I’ll take a look later.
On Tue, Feb 6, 2024 at 11:40 AM Thad Kerosky @.***> wrote:
@jkoren https://github.com/jkoren Oop, tests aren't passing though. Looks like some references might still be on the old setup.
— Reply to this email directly, view it on GitHub https://github.com/codeforboston/home-energy-analysis-tool/pull/133#issuecomment-1930298856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBW5U747XKN7TFYDXJ5JV3YSJMJLAVCNFSM6AAAAABBVZGYOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZQGI4TQOBVGY . You are receiving this because you were mentioned.Message ID: @.***>
Thanks so much Jeff and all on this one.
Created Classes for HEAT Calculator.
There are 8 classes, as described in this comment of Issue 124.
The models are stored in the /models directory The object fields will map to database fields.