-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add ProposalAttachmentType dynamic enum. #389
Conversation
shortName: String, | ||
longName: String | ||
) derives Eq: | ||
val accept: String = ".pdf" // only PDF files are currently allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have this as a constant on the object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. We can. I was just anticipating the day when they
decide that we need to support different file types for different attachment types, like we do for obs attachments. But, that's probably a bit too paranoid and easy to fix, anyway.
// This is a meta decoder, not a decoder for enum instances (which comes from the `Enumerated` instance) | ||
given Decoder[ProposalAttachmentType] = semiauto.deriveDecoder | ||
|
||
DynamicEnums.parsedEnums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can abstract away the common logic of all dynamic enums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to. 🤔 I'll probably have to add Partner
at some point soon. I'll look at it then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
========================================
- Coverage 5.84% 5.71% -0.14%
========================================
Files 33 34 +1
Lines 2481 2485 +4
Branches 2 1 -1
========================================
- Hits 145 142 -3
- Misses 2336 2343 +7 ☔ View full report in Codecov by Sentry. |
No description provided.