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

Add ProposalAttachmentType dynamic enum. #389

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

toddburnside
Copy link
Contributor

No description provided.

shortName: String,
longName: String
) derives Eq:
val accept: String = ".pdf" // only PDF files are currently allowed
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@rpiaggio rpiaggio left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (6390b3c) 5.84% compared to head (40a3f37) 5.71%.

Files Patch % Lines
.../lucuma/schemas/enums/ProposalAttachmentType.scala 0.00% 13 Missing ⚠️
.../src/clue/scala/lucuma/schemas/ObservationDB.scala 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@toddburnside toddburnside merged commit 1ac4f21 into main Dec 12, 2023
8 checks passed
@toddburnside toddburnside deleted the proposal-attachment-type branch December 12, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants