Funktionen: Zustimmung in Textform auch per WhatsApp
Terminplaner, Webshop und Buchungskalender nehmen beim Aktivieren durch das Team den Weg whatsapp an (Nachweis: „per WhatsApp in Textform“). Die Analyse bleibt bei Chat oder E-Mail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b264d7f734
commit
02a3732e4a
5 files changed
+31
-7
No files matched your search
@@ -326,6 +326,10 @@ test('validateTextform: Datum, Zukunft, Fassung, Weg', () => {
|
||||
bad(undefined)
|
||||
assert.deepEqual(an.validateTextform({ date: '2026-10-02', channel: 'email' }, ctx), { date: '2026-10-02', channel: 'email' })
|
||||
assert.deepEqual(an.validateTextform({ date: '2026-10-05', channel: 'chat' }, ctx), { date: '2026-10-05', channel: 'chat' })
|
||||
// WhatsApp nur, wenn der Aufrufer es erlaubt (Funktionen), nicht bei der Analyse
|
||||
bad({ date: '2026-10-02', channel: 'whatsapp' })
|
||||
assert.deepEqual(an.validateTextform({ date: '2026-10-02', channel: 'whatsapp' }, { ...ctx, channels: an.FUNKTION_CHANNELS }), { date: '2026-10-02', channel: 'whatsapp' })
|
||||
assert.throws(() => an.validateTextform({ date: '2026-10-02', channel: 'telefon' }, { ...ctx, channels: an.FUNKTION_CHANNELS }), { status: 400 })
|
||||
})
|
||||
|
||||
test('Einschalten ohne Firma/Name oder mit ungültiger E-Mail: 409, nichts passiert', async () => {
|
||||
|
||||
@@ -129,6 +129,24 @@ test('unterkunft textform: ohne Angaben 400 ohne Nachweis, mit Angaben 200; Nach
|
||||
for (const a of k16[0].attachments) assert.equal(Buffer.from(a.content, 'base64').subarray(0, 4).toString(), '%PDF')
|
||||
})
|
||||
|
||||
test('unterkunft textform: Weg WhatsApp wird angenommen und im Nachweis genannt; unbekannter Weg 400', async (t) => {
|
||||
t.after(() => ukMit(MODUS.mode, MODUS.pilotEmails))
|
||||
ukMit('pilot', ['whatsapp@example.invalid'])
|
||||
const k = legeKunde({ email: 'whatsapp@example.invalid' })
|
||||
const v = config.unterkunft.fassung
|
||||
const telefon = await aktivieren(k, { textformDate: berlinTag(), textformChannel: 'telefon' })
|
||||
assert.equal(telefon.status, 400)
|
||||
assert.match(telefon.body.error, /Chat, E-Mail oder WhatsApp/)
|
||||
assert.equal(consents(k.projectId).length, 0)
|
||||
const tag = berlinTag()
|
||||
const ok = await aktivieren(k, { textformDate: tag, textformChannel: 'whatsapp' })
|
||||
assert.equal(ok.status, 200, JSON.stringify(ok.body))
|
||||
assert.equal(
|
||||
leseZustimmung(consents(k.projectId)[0]).texte[0].text,
|
||||
`Der Kunde hat am ${ttmmjjjj(tag)} per WhatsApp in Textform erklärt, dass er der Leistungsbeschreibung Buchungskalender und dem Auftragsverarbeitungsvertrag Buchungskalender (Fassung ${v}) zustimmt.`
|
||||
)
|
||||
})
|
||||
|
||||
test('unterkunft textform entfällt: Modus off, schon aktiv, Abschalten; ungültige Datumsangaben 400', async (t) => {
|
||||
t.after(() => ukMit(MODUS.mode, MODUS.pilotEmails))
|
||||
ukMit('off')
|
||||
|
||||
Reference in new issue
Block a user