fix(erpsetup): name the Frappe webhooks (#38)
ci / shared (push) Successful in 13s
ci / test (push) Successful in 23m20s
ci / image (push) Successful in 33s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit was merged in pull request #38.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-09-24 10:34:09 +00:00
1 parent 0a26331ffd
commit fb8a6b3902
2 files changed
+15 -1

No files matched your search

+11
View File
@@ -182,3 +182,14 @@ func TestWebhookBodiesAreValidJSONShapes(t *testing.T) {
}
}
}
func TestWebhookDocIsNamed(t *testing.T) {
seen := map[string]bool{}
for _, w := range webhooks("https://r.test/hook", "s") {
name, _ := w.doc()["name"].(string)
if name != "breakpilot-"+w.Event || seen[name] {
t.Fatalf("webhook %s: name %q", w.Event, name)
}
seen[name] = true
}
}
+4 -1
View File
@@ -79,7 +79,10 @@ type webhook struct {
func (w webhook) doc() map[string]any {
return map[string]any{
"doctype": "Webhook",
"doctype": "Webhook",
// Frappe names a Webhook by prompt: without a name the insert fails
// with "Please enter the document name".
"name": "breakpilot-" + w.Event,
"webhook_doctype": w.Doctype,
"webhook_docevent": w.DocEvent,
"condition": w.Condition,