-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
const unassignedQuery1 = Time
.use((time) =>
pipe(
Q.make<PickItem.Encoded>(),
where("assignedToId", null),
and("state.at", "gte", subDays(time.now, 5).toISOString()),
and("state._tag", "in", ["Valid", "LabelCreated"])
)
) const q = yield* pickItemRepo.unassignedQuery1
const items = yield* pickItemRepo
.query(() =>
pipe(
q,
Q.project(
S.encodedSchema(S.Struct(PickItem.pick("assignedToId", "carrier", "state", "priority"))),
"project"
)
)
)or
const items = yield* pickItemRepo.unassignedQuery1.pipe(
Effect.flatMap((q) =>
pickItemRepo
.query(() =>
pipe(
q,
Q.project(
S.encodedSchema(S.Struct(PickItem.pick("assignedToId", "carrier", "state", "priority"))),
"project"
)
)
)
)
would love this to be:
const items = yield* pickItemRepo
.unassignedQuery(
Q.project(
S.encodedSchema(S.Struct(PickItem.pick("assignedToId", "carrier", "state", "priority"))),
"project"
)
)so we need a utility that can define base queries;
unassignedQuery = generateBaseQuery(...)
Metadata
Metadata
Assignees
Labels
No labels