diff --git a/docs/plans/oh6-estimatevotes-cas-outbox.md b/docs/plans/oh6-estimatevotes-cas-outbox.md index cc5b0706..b1a422a5 100644 --- a/docs/plans/oh6-estimatevotes-cas-outbox.md +++ b/docs/plans/oh6-estimatevotes-cas-outbox.md @@ -13,7 +13,7 @@ Responsável: — ## Freshness audit (2026-08-01) - OH1 (#164) `done`/`in-prod`. Paths e assinaturas (`estimateVotesRecord`, `PledgeEstimateForm`, `estimateVotesSchema`, `estimatedAt` no hook) batem. -- `OPS_HYBRID` / `lib/campaignOps` ainda não existem (OH2 #163 in-progress em paralelo) — OH6 lê `OPS_HYBRID` via `next.config` `env` + helper local em `opsSync/` (sem abrir o pacote OH2). +- OH2 (#163) mergeou durante a entrega — OH6 reusa `resolveOpsHybridEnabled` de `lib/campaignOps/opsHybridFlag.ts` + `OPS_HYBRID` via `next.config` `env`. - `@tanstack/offline-transactions@1.0.42` exige collection TanStack DB — tracer usa `localOnlyCollectionOptions` (OH7 troca pelo mirror). ## Premissas diff --git a/src/components/campaign/opsSync/opsHybridEnabled.ts b/src/components/campaign/opsSync/opsHybridEnabled.ts deleted file mode 100644 index 9cfcb552..00000000 --- a/src/components/campaign/opsSync/opsHybridEnabled.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * OH6 tracer — compile-time `OPS_HYBRID` reader for the estimate outbox island. - * OH2 owns the canonical `src/lib/campaignOps/opsHybridFlag.ts`; this local - * helper avoids opening that package while OH2 lands in parallel. - */ -export const resolveOpsHybridEnabled = ( - env: NodeJS.ProcessEnv | Record = process.env, -): boolean => { - const raw = env.OPS_HYBRID?.trim().toLowerCase() - return raw === '1' || raw === 'true' -} diff --git a/tests/unit/opsEstimateOutbox.unit.spec.ts b/tests/unit/opsEstimateOutbox.unit.spec.ts index 8c674d92..f8253096 100644 --- a/tests/unit/opsEstimateOutbox.unit.spec.ts +++ b/tests/unit/opsEstimateOutbox.unit.spec.ts @@ -5,7 +5,6 @@ import { resolveEstimateTransactionPledgeKey, toOpsEstimateOutboxRow, } from '@/components/campaign/opsSync/opsEstimateOutboxModel' -import { resolveOpsHybridEnabled } from '@/components/campaign/opsSync/opsHybridEnabled' import type { OfflineTransaction } from '@tanstack/offline-transactions' const tx = (id: string, pledgeId: number, createdAtMs: number): OfflineTransaction => @@ -52,14 +51,3 @@ describe('opsEstimateOutboxModel (OH6)', () => { }) }) }) - -describe('resolveOpsHybridEnabled (OH6)', () => { - it('accepts 1/true and rejects absent/other values', () => { - expect(resolveOpsHybridEnabled({ OPS_HYBRID: '1' })).toBe(true) - expect(resolveOpsHybridEnabled({ OPS_HYBRID: 'true' })).toBe(true) - expect(resolveOpsHybridEnabled({ OPS_HYBRID: 'TRUE' })).toBe(true) - expect(resolveOpsHybridEnabled({ OPS_HYBRID: '0' })).toBe(false) - expect(resolveOpsHybridEnabled({ OPS_HYBRID: '' })).toBe(false) - expect(resolveOpsHybridEnabled({})).toBe(false) - }) -})