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

wip #1342

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

wip #1342

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
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val disciplineMunitVersion = "1.0.9"
val flywayVersion = "9.20.0"
val fs2AwsVersion = "6.1.3"
val fs2Version = "3.10.2"
val grackleVersion = "0.20.0"
val grackleVersion = "0.21-7c15071-SNAPSHOT"
val http4sBlazeVersion = "0.23.16"
val http4sEmberVersion = "0.23.27"
val http4sJdkHttpClientVersion = "0.9.1"
Expand All @@ -18,7 +18,7 @@ val log4catsVersion = "2.7.0"
val lucumaCatalogVersion = "0.47.3"
val lucumaItcVersion = "0.21.17"
val lucumaCoreVersion = "0.101.2"
val lucumaGraphQLRoutesVersion = "0.8.13"
val lucumaGraphQLRoutesVersion = "0.8.13-2-00923a2-20240819T145844Z-SNAPSHOT"
val lucumaSsoVersion = "0.6.21"
val munitVersion = "0.7.29" // check test output if you attempt to update this
val munitCatsEffectVersion = "1.0.7" // check test output if you attempt to update this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ trait ExecutionEventMapping[F[_]] extends ExecutionEventTable[F]
case Dataset => DatasetEventType
}

private def mkPredicate(eventType: lucuma.odb.data.ExecutionEventType): Option[Predicate] =
Eql(ExecutionEventType / "eventType", Const(eventType)).some
private def mkPredicate(eventType: lucuma.odb.data.ExecutionEventType): Result[Predicate] =
Result(Eql(ExecutionEventType / "eventType", Const(eventType)))

override def narrowPredicate(tpe: Type): Option[Predicate] =
override def narrowPredicate(tpe: Type): Result[Predicate] =
tpe match {
case SequenceEventType => mkPredicate(Sequence)
case SlewEventType => mkPredicate(Slew)
case AtomEventType => mkPredicate(Atom)
case StepEventType => mkPredicate(Step)
case DatasetEventType => mkPredicate(Dataset)
case _ => none
case t => Result.internalError(s"executionEventTypeDiscriminator: cannot narrow to $t")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ trait ProgramReferenceMapping[F[_]]
case PT.System => Result(SystemProgramReferenceType)
}

private def mkPredicate(tpe: PT): Option[Predicate] =
Eql(ProgramReferenceType / "type", Const(tpe)).some
private def mkPredicate(tpe: PT): Result[Predicate] =
Result(Eql(ProgramReferenceType / "type", Const(tpe)))

override def narrowPredicate(tpe: Type): Option[Predicate] =
override def narrowPredicate(tpe: Type): Result[Predicate] =
tpe match {
case CalibrationProgramReferenceType => mkPredicate(PT.Calibration)
case CommissioningProgramReferenceType => mkPredicate(PT.Commissioning)
Expand All @@ -67,7 +67,7 @@ trait ProgramReferenceMapping[F[_]]
case MonitoringProgramReferenceType => mkPredicate(PT.Monitoring)
case ScienceProgramReferenceType => mkPredicate(PT.Science)
case SystemProgramReferenceType => mkPredicate(PT.System)
case _ => none
case t => Result.internalError(s"programReferenceTypeDiscriminator: cannot narrow to $t")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ trait ProposalTypeMapping[F[_]] extends BaseMapping[F]
case ScienceSubtype.SystemVerification => Result(SystemVerificationType)
}

private def mkPredicate(tpe: ScienceSubtype): Option[Predicate] =
Eql(ProposalTypeType / "scienceSubtype", Const(tpe)).some
private def mkPredicate(tpe: ScienceSubtype): Result[Predicate] =
Result(Eql(ProposalTypeType / "scienceSubtype", Const(tpe)))

override def narrowPredicate(tpe: Type): Option[Predicate] =
override def narrowPredicate(tpe: Type): Result[Predicate] =
tpe match {
case ClassicalType => mkPredicate(ScienceSubtype.Classical)
case DemoScienceType => mkPredicate(ScienceSubtype.DemoScience)
Expand All @@ -66,7 +66,7 @@ trait ProposalTypeMapping[F[_]] extends BaseMapping[F]
case PoorWeatherType => mkPredicate(ScienceSubtype.PoorWeather)
case QueueType => mkPredicate(ScienceSubtype.Queue)
case SystemVerificationType => mkPredicate(ScienceSubtype.SystemVerification)
case _ => none
case t => Result.internalError(s"proposalTypeDiscriminator: cannot narrow to $t")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ trait StepConfigMapping[F[_]] extends StepRecordView[F] {
case SmartGcal => SmartGcalType
}

private def mkPredicate(stepType: StepType): Option[Predicate] =
Eql(StepConfigType / "stepType", Const(stepType)).some
private def mkPredicate(stepType: StepType): Result[Predicate] =
Result(Eql(StepConfigType / "stepType", Const(stepType)))

override def narrowPredicate(tpe: Type): Option[Predicate] =
override def narrowPredicate(tpe: Type): Result[Predicate] =
tpe match {
case BiasType => mkPredicate(Bias)
case DarkType => mkPredicate(Dark)
case GcalType => mkPredicate(Gcal)
case ScienceType => mkPredicate(Science)
case SmartGcalType => mkPredicate(SmartGcal)
case _ => none
case t => Result.internalError(s"stepConfigDiscriminator: cannot narrow to $t")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ trait TimeChargeDiscountMapping[F[_]] extends DatasetTable[F]
case d => Result.internalError(s"No TimeChargeDiscount implementation for ${d.dbTag}")
}

private def mkPredicate(discountType: DiscountDiscriminator): Option[Predicate] =
Eql(TimeChargeDiscountType / "type", Const(discountType)).some
private def mkPredicate(discountType: DiscountDiscriminator): Result[Predicate] =
Result(Eql(TimeChargeDiscountType / "type", Const(discountType)))

override def narrowPredicate(tpe: Type): Option[Predicate] =
override def narrowPredicate(tpe: Type): Result[Predicate] =
tpe match {
case TimeChargeDaylightDiscountType => mkPredicate(DiscountDiscriminator.Daylight)
case TimeChargeNoDataDiscountType => mkPredicate(DiscountDiscriminator.NoData)
case TimeChargeQaDiscountType => mkPredicate(DiscountDiscriminator.Qa)
case _ => none
case t => Result.internalError(s"TimeChargeDiscountMapping.discriminator: cannot narrow to $t")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ trait TimingWindowMappings[F[_]] extends TimingWindowView[F] {
}
}

def narrowPredicate(subtpe: Type): Option[Predicate] = {
def mkPredicate(tpe: TimingWindowEndTypeEnum): Option[Predicate] =
Some(Eql(TimingWindowEndType / "endType", Const(tpe)))
def narrowPredicate(subtpe: Type): Result[Predicate] = {
def mkPredicate(tpe: TimingWindowEndTypeEnum): Result[Predicate] =
Result(Eql(TimingWindowEndType / "endType", Const(tpe)))

subtpe match {
case TimingWindowEndAtType => mkPredicate(TimingWindowEndTypeEnum.At)
case TimingWindowEndAfterType => mkPredicate(TimingWindowEndTypeEnum.After)
case _ => None
case t => Result.internalError(s"TimingWindowMappings.endDiscriminator: cannot narrow to $t")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object VisitService {

val rt = for
v <- ResultT(insertVisit)
_ <- ResultT.success(insertStatic(v.some).void)
_ <- ResultT.liftF(insertStatic(v.some).void)
yield v

rt.value
Expand Down
Loading