fix(place-contrib): re-check consent inside the catch-up step and never share withdrawn history again

The catch-up read its state outside its transaction and could revive a
backfill a withdraw had just ended; switching a field off and on after a
withdrawal shared the withdrawn history again. The catch-up now resolves
the country the way a save does and reads one field map.
This commit is contained in:
Maurice
2026-11-05 13:02:26 +01:00
parent 9dd58fe32f
commit 2ec1199490
9 changed files with 213 additions and 40 deletions
+7
View File
@@ -114,6 +114,13 @@ export const placeContribConsentSchema = z.object({
* later catch up too. Absent on an agreement from 5.1.0.
*/
includesEarlier: z.boolean().optional(),
/**
* The fields an admin withdrew under this agreement (all of them after
* "withdraw everything"). Switching one of them on again shares what users
* type from then on, not the history taken back; a new agreement clears it.
* Absent until something was withdrawn.
*/
withdrawnFields: z.array(placeContribFieldSchema).optional(),
});
export type PlaceContribConsent = z.infer<typeof placeContribConsentSchema>;