fix(erpsetup): name the Frappe webhooks
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m25s
ci / image (pull_request) Skipped

Live ERPNext names a Webhook by prompt and rejected the insert with
"Please enter the document name". Each webhook is now created as
breakpilot-<event>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-09-24 12:09:33 +02:00
1 parent 0a26331ffd
commit 73728dd868
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,