Formulaire public : encart de paiement de la cotisation via Yapla
FormTemplate.yapla_url (lien vers la page de cotisation Yapla, doit commencer par http(s)://, PATCH .../form comme description/is_open) fait apparaître un encart « Payer ma cotisation » sous la case WILLING_TO_PAY_FEE, sur le formulaire public. Configurable depuis le panneau « Personnalisation » de l'écran /inscriptions. La case reste une simple déclaration : rien ne vérifie que le paiement a eu lieu. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8f8350aa1b
commit
5f80f167c8
@@ -99,18 +99,31 @@ async function checkPublicForm() {
|
||||
if (config.positions.length !== positions.length) {
|
||||
throw new Error('formulaire public : postes manquants dans la config publique');
|
||||
}
|
||||
if (config.has_logo !== false || config.description !== null) {
|
||||
throw new Error('formulaire public : logo/description devraient être vides par défaut');
|
||||
if (config.has_logo !== false || config.description !== null || config.yapla_url !== null) {
|
||||
throw new Error('formulaire public : logo/description/lien Yapla devraient être vides par défaut');
|
||||
}
|
||||
// Le recadrage carré (canvas) et l'upload du logo (FileReader) sont des
|
||||
// API navigateur — non testables sous Node (voir scripts/smoke.tsx tel
|
||||
// qu'exécuté ici) ; seul le texte d'introduction est vérifiable ici.
|
||||
// qu'exécuté ici) ; seul le texte d'introduction et le lien Yapla sont
|
||||
// vérifiables ici.
|
||||
await api.forms.setOpen(e, { description: 'Bienvenue au festival de test !' });
|
||||
const configWithDescription = await api.forms.getPublicConfig(e);
|
||||
if (configWithDescription.description !== 'Bienvenue au festival de test !') {
|
||||
throw new Error("formulaire public : le texte d'introduction ne revient pas correctement");
|
||||
}
|
||||
|
||||
let invalidYaplaUrlRejectedWith = 'non';
|
||||
try {
|
||||
await api.forms.setOpen(e, { yapla_url: 'yapla.com/exemple' });
|
||||
} catch (err) {
|
||||
invalidYaplaUrlRejectedWith = err instanceof ApiError ? err.code : String(err);
|
||||
}
|
||||
await api.forms.setOpen(e, { yapla_url: 'https://www.yapla.com/fr/exemple' });
|
||||
const configWithYapla = await api.forms.getPublicConfig(e);
|
||||
if (configWithYapla.yapla_url !== 'https://www.yapla.com/fr/exemple') {
|
||||
throw new Error('formulaire public : le lien Yapla ne revient pas correctement');
|
||||
}
|
||||
|
||||
const sameDay = artists.filter((a) => a.performance_date === artists[0]?.performance_date);
|
||||
let tooManyArtistsRejectedWith = 'non';
|
||||
if (sameDay.length >= 2) {
|
||||
@@ -157,6 +170,8 @@ async function checkPublicForm() {
|
||||
{
|
||||
formOpenByDefault: config.is_open,
|
||||
descriptionRoundTrips: configWithDescription.description,
|
||||
invalidYaplaUrlRejectedWith,
|
||||
yaplaUrlRoundTrips: configWithYapla.yapla_url,
|
||||
tooManyPositionsRejectedWith,
|
||||
tooManyArtistsRejectedWith,
|
||||
createdVolunteerName: `${created.first_name} ${created.last_name}`,
|
||||
|
||||
Reference in New Issue
Block a user