fixture.ts
This file
Path
apps/cli/test/tui/fixture.ts
71 lines · 2.2 KiB · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
Merge branch 'build/710-today-tui'oscabrielbefore adoption8f57dc3
lines 1–18why, one step back1import { RefNameText } from "@repo/protocol/domain/common";2import { DecisionSubject } from "@repo/protocol/domain/decision";3import type { Decision, Today } from "@repo/protocol/domain/decision";4import {5 CommitSha,6 DecisionId,7 Handle,8 ProjectName,9 ProposalId,10} from "@repo/protocol/ids";11import { DateTime } from "effect";1213const at = (iso: string) => DateTime.makeUnsafe(iso);1415const sha = (digit: string) => CommitSha.make(digit.repeat(40));1617export const okonkwo = Handle.make("okonkwo");18Merge build/1400-w14-foundation into mainoscabrielbefore adoption47dd2f8
line 19why, one step back19export const datekit = ProjectName.make("oscabriel/datekit");Merge branch 'build/710-today-tui'oscabrielbefore adoption8f57dc3
lines 20–71why, one step back2021/** An ask proposed for datekit, expiring tomorrow: last in expiry order. */22export const proposal: Decision = {23 deciders: [okonkwo],24 default: "accept",25 evidence: [{ label: "territory", value: "src/week" }],26 expiresAt: at("2026-10-09T09:00:00Z"),27 id: DecisionId.make("dec-000001"),28 openedAt: at("2026-10-07T09:00:00Z"),29 project: datekit,30 subject: DecisionSubject.cases.OpenProposal.make({31 proposal: ProposalId.make("prop-000001"),32 }),33};3435/** A stray push to datekit's main, expiring within the day: first. */36export const stray: Decision = {37 deciders: [okonkwo],38 default: "revert",39 evidence: [{ label: "pushed by", value: "a token outside the platform" }],40 expiresAt: at("2026-10-08T10:00:00Z"),41 id: DecisionId.make("dec-000002"),42 openedAt: at("2026-10-06T10:00:00Z"),43 project: datekit,44 subject: DecisionSubject.cases.StrayPush.make({45 after: sha("b"),46 before: sha("a"),47 ref: RefNameText.make("refs/heads/main"),48 }),49};5051/** A vouch for a newcomer, expiring this evening: second. */52export const vouch: Decision = {53 deciders: [okonkwo],54 default: "decline",55 evidence: [{ label: "first claim", value: "fix-week" }],56 expiresAt: at("2026-10-08T18:00:00Z"),57 id: DecisionId.make("dec-000003"),58 openedAt: at("2026-10-07T18:00:00Z"),59 project: datekit,60 subject: DecisionSubject.cases.Vouch.make({ handle: Handle.make("ada") }),61};6263export const today: Today = {64 budget: { finishes: 1, total: 5, used: 2 },65 decider: okonkwo,66 decisions: [proposal, vouch, stray],67 expiringSoon: [stray.id],68 newcomers: [Handle.make("ada"), Handle.make("grace")],69 overflow: 1,70 unattended: [],71};