Skip to content

Commit

Permalink
Read the proprietary months from the odb
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Jan 2, 2025
1 parent efacd3c commit d415038
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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)
)

0 comments on commit d415038

Please sign in to comment.