mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 03:03:06 +00:00
Rename the operational unit "Praça"/"Núcleo" to "Município" (code identifier `municipality`) and land the 2026-07-23 course changes: - New `candidate` role with unrestricted visibility (`isCampaignStaff` now includes it) alongside coordinator/advisor; leader is locked down to the supporter contact tool only. - Demandas become staff-only; dobradinhas modeled via a `stateDeputy` entity. - Camaçari consolidated to a single município (ZE 170/171 aggregated); Salvador keeps its 19 zone municípios. - Map moves to the staff dashboard; `/campanha/municipios` is list/overview. - Vote pledges keep the declared vs estimated (scenario) asymmetry; leaders never see estimates. Destructive migration for the campaign vertical (drops nucleus/plaza-era tables, wipes campaign rows, seeds 435 municípios). Public-site data untouched. Includes the post-delivery /simplify cleanups: shared reloadStaffActor / reloadCoordinatorActor helpers, req.context cache for getFreshCampaignUser, parallelized dashboard loads, candidate dashboard-copy fix, and dead leader-dashboard / roleKind code removal.
32 lines
875 B
TypeScript
32 lines
875 B
TypeScript
import type { Field } from 'payload'
|
|
|
|
import { canManageCampaignStaffField, canReadCampaignStaffField } from '@/utilities/campaignAccess'
|
|
import { voteEstimateScenarioLabels } from '@/utilities/voteEstimate'
|
|
|
|
/** Shared staff-only trio for pledge estimates and municipality expected totals. */
|
|
export const voteEstimateScenarioGroupFields = (): Field[] => [
|
|
{
|
|
name: 'pessimistic',
|
|
type: 'number',
|
|
label: voteEstimateScenarioLabels.pessimistic,
|
|
min: 0,
|
|
},
|
|
{
|
|
name: 'central',
|
|
type: 'number',
|
|
label: voteEstimateScenarioLabels.central,
|
|
min: 0,
|
|
},
|
|
{
|
|
name: 'optimistic',
|
|
type: 'number',
|
|
label: voteEstimateScenarioLabels.optimistic,
|
|
min: 0,
|
|
},
|
|
]
|
|
|
|
export const voteEstimateScenarioGroupAccess = {
|
|
read: canReadCampaignStaffField,
|
|
create: canManageCampaignStaffField,
|
|
update: canManageCampaignStaffField,
|
|
} as const
|