From f67a4c27e924fb1322b9b503d4da44af7389e06d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 03:50:05 +0000 Subject: [PATCH] =?UTF-8?q?OH14=20=E2=80=94=20knip:=20remove=20exports=20o?= =?UTF-8?q?rphaned=20by=20outbox-only=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../municipios/[slug]/pledgeFormActions.ts | 32 ++----------------- src/app/(campaign)/campanha/actions/demand.ts | 5 --- src/lib/formData.ts | 10 ------ src/lib/schemas/campaignDemand.ts | 9 ------ 4 files changed, 2 insertions(+), 54 deletions(-) diff --git a/src/app/(campaign)/campanha/(app)/municipios/[slug]/pledgeFormActions.ts b/src/app/(campaign)/campanha/(app)/municipios/[slug]/pledgeFormActions.ts index 9b522f3a..d137c814 100644 --- a/src/app/(campaign)/campanha/(app)/municipios/[slug]/pledgeFormActions.ts +++ b/src/app/(campaign)/campanha/(app)/municipios/[slug]/pledgeFormActions.ts @@ -4,17 +4,12 @@ import { revalidatePath } from 'next/cache' import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives' -import { declareVotes, estimateVotes } from '@/app/(campaign)/campanha/actions/votePledge' +import { declareVotes } from '@/app/(campaign)/campanha/actions/votePledge' import { - nullableFormText, requiredIntegerFormValue, requiredRelationshipFormValue, - voteEstimateScenarioFromForm, } from '@/lib/formData' -import { - VOTE_PLEDGE_DECLARE_SAFE_MESSAGES, - VOTE_PLEDGE_ESTIMATE_SAFE_MESSAGES, -} from '@/lib/schemas/votePledge' +import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge' import { runCampaignFormAction, type CampaignFormActionState, @@ -43,26 +38,3 @@ export const declareVotesFormAction = async ( genericMessage: 'Não foi possível registrar a declaração. Verifique seu acesso e tente novamente.', }) - -export const estimateVotesFormAction = async ( - _state: CampaignFormActionState, - formData: FormData, -): Promise => - runCampaignFormAction({ - execute: async () => { - const pledge = requiredRelationshipFormValue(formData, 'pledgeId') - const estimatedVotes = voteEstimateScenarioFromForm(formData, 'estimatedVotes') - const estimateNote = nullableFormText(formData, 'estimateNote') - - await estimateVotes({ - pledge, - estimatedVotes, - estimateNote, - }) - revalidatePath('/campanha/municipios/[slug]', 'page') - return { message: 'Estimativa registrada.' } - }, - safeMessages: VOTE_PLEDGE_ESTIMATE_SAFE_MESSAGES, - genericMessage: - 'Não foi possível registrar a estimativa. Verifique seu acesso e tente novamente.', - }) diff --git a/src/app/(campaign)/campanha/actions/demand.ts b/src/app/(campaign)/campanha/actions/demand.ts index 1bc967bd..2ca4ec25 100644 --- a/src/app/(campaign)/campanha/actions/demand.ts +++ b/src/app/(campaign)/campanha/actions/demand.ts @@ -206,11 +206,6 @@ export const createCampaignDemand = async (input: CampaignDemandCreateInput) => return createCampaignDemandRecord(payload, actor, input) } -export const transitionCampaignDemand = async (input: CampaignDemandTransitionInput) => { - const { payload, actor } = await getCampaignActionContext() - return transitionCampaignDemandRecord(payload, actor, input) -} - export const transitionCampaignDemandCas = async (input: CampaignDemandTransitionInput) => { const { payload, actor } = await getCampaignActionContext() return transitionCampaignDemandRecord(payload, actor, input, { cas: true }) diff --git a/src/lib/formData.ts b/src/lib/formData.ts index b1981455..f47c8552 100644 --- a/src/lib/formData.ts +++ b/src/lib/formData.ts @@ -93,16 +93,6 @@ export const requiredIntegerFormValue = ( return parsed } -export const optionalIntegerFormValue = ( - formData: FormData, - field: string, - options?: { minimum?: number; maximum?: number }, -): number | undefined => { - const entry = formEntry(formData, field) - if (!entry.present || !entry.value.trim()) return undefined - return requiredIntegerFormValue(formData, field, options) -} - const optionalNullableIntegerFormValue = ( formData: FormData, field: string, diff --git a/src/lib/schemas/campaignDemand.ts b/src/lib/schemas/campaignDemand.ts index 1ffc22be..f40787bf 100644 --- a/src/lib/schemas/campaignDemand.ts +++ b/src/lib/schemas/campaignDemand.ts @@ -1,5 +1,3 @@ -import { OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas' - export const campaignDemandKinds = [ 'material', 'servico', @@ -80,13 +78,6 @@ export const CAMPAIGN_DEMAND_RECEIPT_TYPE_MESSAGE = 'Envie uma imagem (JPEG, PNG export const CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE = 'O arquivo enviado está vazio.' export const CAMPAIGN_DEMAND_RECEIPT_SIZE_MESSAGE = 'O comprovante deve ter no máximo 10 MB.' -export const CAMPAIGN_DEMAND_TRANSITION_SAFE_MESSAGES = [ - CAMPAIGN_DEMAND_TRANSITION_STAFF_MESSAGE, - CAMPAIGN_DEMAND_ESCALATED_DECISION_MESSAGE, - CAMPAIGN_DEMAND_INVALID_STATUS_MESSAGE, - OPS_UPDATED_AT_CONFLICT_MESSAGE, -] as const - export const CAMPAIGN_DEMAND_RECEIPT_SAFE_MESSAGES = [ CAMPAIGN_DEMAND_RECEIPT_TYPE_MESSAGE, CAMPAIGN_DEMAND_RECEIPT_EMPTY_MESSAGE,