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

Read the proprietary months from the odb #4450

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object ProgramDetailsTile:
FormInfo(Constants.GppDateFormatter.format(props.semester.end.localDate), "End"),
// Thesis should be set True if any of the investigators will use the proposal as part of their thesis (3390)
FormInfo(if (thesis) "Yes" else "No", "Thesis"),
FormInfo(s"${details.proprietaryMonths} months", "Propietary")
FormInfo(s"${details.proprietaryMonths} months", "Proprietary")
),
<.div(
TimeAwardTable(details.allocations),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ package explore.model
import cats.Eq
import cats.derived.*
import cats.syntax.all.*
import eu.timepit.refined.cats.given
import eu.timepit.refined.types.numeric.NonNegInt
import io.circe.Decoder
import io.circe.refined.given
import lucuma.core.enums.ProgramType
import lucuma.core.model.PartnerLink
import lucuma.core.model.ProgramReference
Expand All @@ -24,7 +27,7 @@ case class ProgramDetails(
invitations: List[UserInvitation],
reference: Option[ProgramReference],
allocations: CategoryAllocationList,
proprietaryMonths: Int
proprietaryMonths: NonNegInt
) derives Eq:
val allUsers: List[ProgramUserWithRole] = pi.fold(users)(_ :: users)

Expand Down Expand Up @@ -52,6 +55,6 @@ object ProgramDetails:
r <-
c.downField("reference").downField("label").success.traverse(_.as[Option[ProgramReference]])
as <- c.downField("allocations").as[CategoryAllocationList]
// pm <- c.downField("goa").downField("proprietaryMonths").as[Int]
} yield ProgramDetails(t, p, ps, pi, us, in, r.flatten, as, 2)
pm <- c.downField("goa").downField("proprietaryMonths").as[NonNegInt]
} yield ProgramDetails(t, p, ps, pi, us, in, r.flatten, as, pm)
)
Loading