14 lines
419 B
TypeScript
14 lines
419 B
TypeScript
import { Schema } from "effect"
|
|
|
|
import { Identifier } from "@/id/id"
|
|
import { zod, ZodOverride } from "@/util/effect-zod"
|
|
import { withStatics } from "@/util/schema"
|
|
|
|
export const EventID = Schema.String.annotate({ [ZodOverride]: Identifier.schema("event") }).pipe(
|
|
Schema.brand("EventID"),
|
|
withStatics((s) => ({
|
|
ascending: (id?: string) => s.make(Identifier.ascending("event", id)),
|
|
zod: zod(s),
|
|
})),
|
|
)
|