Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatic transformation of record classes #253

Conversation

TimoGlastra
Copy link
Contributor

Transform record classes and its sub objects using class transformer.

Fixes #106

Was sort of a blocker for some of the work I wanted to do for #187, and it was long overdue this was fixed.

@TimoGlastra TimoGlastra requested a review from a team as a code owner April 29, 2021 21:13
@codecov-commenter
Copy link

Codecov Report

Merging #253 (a37351b) into main (36f957c) will decrease coverage by 0.09%.
The diff coverage is 97.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #253      +/-   ##
==========================================
- Coverage   89.00%   88.90%   -0.10%     
==========================================
  Files         177      177              
  Lines        3364     3362       -2     
  Branches      387      387              
==========================================
- Hits         2994     2989       -5     
- Misses        367      373       +6     
+ Partials        3        0       -3     
Impacted Files Coverage Δ
src/index.ts 100.00% <ø> (ø)
src/modules/ledger/services/LedgerService.ts 83.18% <80.00%> (-1.36%) ⬇️
.../modules/credentials/services/CredentialService.ts 85.56% <83.33%> (+0.13%) ⬆️
src/storage/BaseRecord.ts 90.00% <88.88%> (-10.00%) ⬇️
src/agent/Agent.ts 100.00% <100.00%> (ø)
src/agent/BaseMessage.ts 100.00% <100.00%> (ø)
src/decorators/attachment/Attachment.ts 100.00% <100.00%> (ø)
...es/basic-messages/repository/BasicMessageRecord.ts 100.00% <100.00%> (ø)
src/modules/connections/models/ConnectionRole.ts 100.00% <100.00%> (ø)
...modules/connections/repository/ConnectionRecord.ts 96.42% <100.00%> (-0.76%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36f957c...a37351b. Read the comment docs.

Copy link
Contributor

@jakubkoci jakubkoci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great we finally have it align. So pleasure to review this and see how we're getting rid of those ugly conditional transformations 😄

@jakubkoci jakubkoci merged commit e07b90e into openwallet-foundation:main May 2, 2021
berendsliedrecht pushed a commit to berendsliedrecht/credo-ts that referenced this pull request May 11, 2021
@TimoGlastra TimoGlastra deleted the feature/automatic-record-transformation branch May 15, 2021 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Record classes should be transformed using class-transformer
3 participants