mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
OH10: fix fixtures, bypass comment, drop unsupported metadata
Align list view-model test fixtures with updatedAt, justify the CAS advisor read bypass, and remove createOfflineAction metadata the TanStack API does not accept. Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
a517638e3c
commit
26bda9e430
4 changed files with 9 additions and 7 deletions
|
|
@ -297,6 +297,8 @@ export const assignMunicipalityAdvisorsRecord = async (
|
|||
await acquireTextAdvisoryLocks(payload, req, [`municipality-advisors:${municipality}`])
|
||||
|
||||
if (enforceCas && baseUpdatedAt !== undefined) {
|
||||
// Intentional admin bypass: unrestricted role verified above; advisors
|
||||
// field access would otherwise hide `updatedAt` from some actors.
|
||||
const current = await payload.findByID({
|
||||
collection: 'municipality',
|
||||
id: municipality,
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ const municipalityUpdatesCollection = createRowCollection<OpsMunicipalityUpdate>
|
|||
'ops-municipality-updates',
|
||||
)
|
||||
|
||||
export { municipalityUpdatesCollection }
|
||||
|
||||
let goalsMirror: OpsGoals | null = null
|
||||
let revisedAtMirror: string = new Date(0).toISOString()
|
||||
let schemaVersionMirror: number = OPS_MIRROR_SCHEMA_VERSION
|
||||
|
|
|
|||
|
|
@ -381,7 +381,6 @@ export const enqueueDeclareVotes = async (input: {
|
|||
|
||||
const run = executor.createOfflineAction<typeof input>({
|
||||
mutationFnName: DECLARE_MUTATION_FN,
|
||||
metadata: { declareKey: id },
|
||||
onMutate: (variables) => {
|
||||
const next: OpsDeclareVotesOutboxRow = {
|
||||
id,
|
||||
|
|
@ -428,7 +427,6 @@ export const enqueueMunicipalityUpdate = async (input: {
|
|||
const executor = await getOpsMunicipalityOfflineExecutor()
|
||||
const run = executor.createOfflineAction<typeof input>({
|
||||
mutationFnName: MUNICIPALITY_UPDATE_MUTATION_FN,
|
||||
metadata: { clientId: input.clientId },
|
||||
onMutate: (variables) => {
|
||||
const next: OpsMunicipalityUpdateOutboxRow = {
|
||||
id: variables.clientId,
|
||||
|
|
@ -465,7 +463,6 @@ export const enqueuePoliticalTrend = async (input: {
|
|||
const executor = await getOpsMunicipalityOfflineExecutor()
|
||||
const run = executor.createOfflineAction<typeof input>({
|
||||
mutationFnName: TREND_MUTATION_FN,
|
||||
metadata: { municipalityId: input.municipalityId },
|
||||
onMutate: (variables) => {
|
||||
const next: OpsPoliticalTrendOutboxRow = {
|
||||
municipalityId: variables.municipalityId,
|
||||
|
|
@ -503,7 +500,6 @@ export const enqueueEngagementLevel = async (input: {
|
|||
const executor = await getOpsMunicipalityOfflineExecutor()
|
||||
const run = executor.createOfflineAction<typeof input>({
|
||||
mutationFnName: ENGAGEMENT_MUTATION_FN,
|
||||
metadata: { municipalityId: input.municipalityId },
|
||||
onMutate: (variables) => {
|
||||
const next: OpsEngagementLevelOutboxRow = {
|
||||
municipalityId: variables.municipalityId,
|
||||
|
|
@ -537,7 +533,6 @@ export const enqueueAdvisorsAssignment = async (input: {
|
|||
const executor = await getOpsMunicipalityOfflineExecutor()
|
||||
const run = executor.createOfflineAction<typeof input>({
|
||||
mutationFnName: ADVISORS_MUTATION_FN,
|
||||
metadata: { municipalityId: input.municipalityId },
|
||||
onMutate: (variables) => {
|
||||
const next: OpsAdvisorsOutboxRow = {
|
||||
municipalityId: variables.municipalityId,
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'alta',
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: { pessimistic: null, central: 1500, optimistic: null },
|
||||
politicalTrendStatus: 'favoravel',
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -237,6 +238,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'normal',
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -377,6 +379,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'alta',
|
||||
lastUpdateAt: staleSignal,
|
||||
lastSignalAt: staleSignal,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -421,6 +424,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'normal',
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -462,6 +466,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'normal',
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -509,6 +514,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'alta',
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
@ -582,6 +588,7 @@ describe('campaign visual foundation', () => {
|
|||
priority: 'normal' as const,
|
||||
lastUpdateAt: null,
|
||||
lastSignalAt: null,
|
||||
updatedAt: '2026-08-01T00:00:00.000Z',
|
||||
expectedVotes: toVoteEstimateScenarioViewModel(null),
|
||||
politicalTrendStatus: null,
|
||||
politicalTrendNote: null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue