Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tpolecat committed Jan 8, 2025
1 parent 1a623c6 commit e570fa0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12654,18 +12654,8 @@ input WhereObservation {
"""
scienceBand: WhereOptionOrderScienceBand

workflow: WhereObservationWorkflow

}

input WhereObservationWorkflow {
AND: [WhereObservationWorkflow!]
OR: [WhereObservationWorkflow!]
NOT: WhereObservationWorkflow
state: WhereEqObservationWorkflowState
}


"""
Configuration request filter options. All specified items must match.
"""
Expand Down Expand Up @@ -13630,31 +13620,6 @@ input WhereOrderConfigurationRequestStatus {
LTE: ConfigurationRequestStatus
}

input WhereEqObservationWorkflowState {

"""
Matches if the property is exactly the supplied value.
"""
EQ: ObservationWorkflowState

"""
Matches if the property is not the supplied value.
"""
NEQ: ObservationWorkflowState

"""
Matches if the property value is any of the supplied options.
"""
IN: [ObservationWorkflowState!]

"""
Matches if the property value is none of the supplied values.
"""
NIN: [ObservationWorkflowState!]

}


"""
Filters on equality or order comparisons of PosBigDecimal properties. All
supplied criteria must match, but usually only one is selected.
Expand Down
2 changes: 1 addition & 1 deletion modules/service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<logger name="lucuma-odb" level="INFO" />
<logger name="lucuma-odb-container" level="DEBUG" />
<logger name="lucuma-odb-test" level="ALL" />
<logger name="lucuma-odb-test" level="ERROR" />
<logger name="org.http4s.server.middleware.Logger" level="WARN" />
<logger name="org.testcontainers" level="WARN" />
<logger name="org.http4s.server.service-errors" level="OFF" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ object WhereObservation {
val WhereReferenceBinding = WhereObservationReference.binding(path / "reference")
val WhereProgramBinding = WhereProgram.binding(path / "program")
val ScienceBandBinding = WhereOptionOrder.binding(path / "scienceBand", enumeratedBinding[ScienceBand])
val WorkflowBinding = WhereObservationWorkflow.binding(path / "workflow")

lazy val WhereObservationBinding = binding(path)
ObjectFieldsBinding.rmap {
Expand All @@ -34,10 +33,9 @@ object WhereObservation {
WhereProgramBinding.Option("program", rProgram),
SubtitleBinding.Option("subtitle", rSubtitle),
ScienceBandBinding.Option("scienceBand", rScienceBand),
WorkflowBinding.Option("workflow", rWorkflow)
) =>
(rAND, rOR, rNOT, rId, rRef, rProgram, rSubtitle, rScienceBand, rWorkflow).parMapN {
(AND, OR, NOT, id, ref, program, subtitle, scienceBand, workflow) =>
(rAND, rOR, rNOT, rId, rRef, rProgram, rSubtitle, rScienceBand).parMapN {
(AND, OR, NOT, id, ref, program, subtitle, scienceBand) =>
and(List(
AND.map(and),
OR.map(or),
Expand All @@ -47,7 +45,6 @@ object WhereObservation {
program,
subtitle,
scienceBand,
workflow,
).flatten)
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import grackle.Predicate
import grackle.Predicate.*
import lucuma.odb.graphql.binding.*

object WhereProposal:
object WhereProposal {

def binding(path: Path): Matcher[Predicate] =
def binding(path: Path): Matcher[Predicate] = {

val WhereTitleBinding = WhereOptionString.binding(path / "title")
val WhereProposalReferenceBinding = WhereProposalReference.binding(path / "reference")

lazy val WhereProposalBinding = binding(path) // lazy self-reference
ObjectFieldsBinding.rmap:
lazy val WhereProposalBinding = binding(path)

ObjectFieldsBinding.rmap {
case List(
BooleanBinding.Option("IS_NULL", rIsNull),
WhereProposalBinding.List.Option("AND", rAND),
Expand All @@ -26,7 +27,7 @@ object WhereProposal:
WhereTitleBinding.Option("title", rTitle),
WhereProposalReferenceBinding.Option("reference", rRef),
) =>
(rIsNull, rAND, rOR, rNOT, rTitle, rRef).parMapN:
(rIsNull, rAND, rOR, rNOT, rTitle, rRef).parMapN {
(isNull, AND, OR, NOT, title, ref) =>
and(List(
isNull.map(IsNull(path / "program_id", _)),
Expand All @@ -36,4 +37,8 @@ object WhereProposal:
title,
ref
).flatten)
}
}
}

}

0 comments on commit e570fa0

Please sign in to comment.