Skip to content

Comments

Feat/report#6

Closed
vishwajeet-13 wants to merge 2 commits intoBuildWithHussain:mainfrom
vishwajeet-13:feat/report
Closed

Feat/report#6
vishwajeet-13 wants to merge 2 commits intoBuildWithHussain:mainfrom
vishwajeet-13:feat/report

Conversation

@vishwajeet-13
Copy link
Contributor

@vishwajeet-13 vishwajeet-13 commented Jan 17, 2026

Report

Summary by CodeRabbit

  • New Features
    • Added a new Registration Report for Zoom Webinar Registrations with the ability to filter by webinar, displaying detailed registration information including attendee email, name, registration source, join URLs, and UTM parameters.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

A new Registration Report feature is introduced for Zoom Webinar integrations. The report consists of a Python backend with data retrieval and column definitions, a JSON configuration file, and a JavaScript frontend filter definition. Additionally, a timestamp was updated in the Zoom Webinar Registration DocType.

Changes

Cohort / File(s) Summary
Zoom Webinar Registration Update
zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.json
Timestamp field updated to reflect modification date.
Registration Report Implementation
zoom_integration/zoom_integration/report/registration_report/registration_report.py, zoom_integration/zoom_integration/report/registration_report/registration_report.json, zoom_integration/zoom_integration/report/registration_report/registration_report.js
New report feature with Python backend defining execute(), get_columns(), and get_data() functions. Performs database queries to fetch webinar registrations and UTM parameters, merges data, and returns enriched records. JSON configuration establishes Script Report structure with System Manager and Zoom Manager access. JavaScript frontend defines required webinar filter.

Sequence Diagram

sequenceDiagram
    actor Client
    participant JS as registration_report.js
    participant Frappe as Frappe Framework
    participant Python as registration_report.py
    participant DB as Database

    Client->>JS: Select webinar filter
    JS->>Frappe: Submit filter (webinar_id)
    Frappe->>Python: Call execute(filters)
    Python->>Python: Call get_columns()
    Python->>Python: Call get_data(filters)
    Python->>DB: Query registrations by webinar
    DB-->>Python: Registration records
    Python->>DB: Query UTM parameters
    DB-->>Python: UTM data
    Python->>Python: Merge UTM data into registrations
    Python-->>Frappe: (columns, data)
    Frappe-->>Client: Render report with data
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A report blooms bright in the webinar garden,
With registrants gathered and data arranged,
The columns stand tall, the filters askew,
UTMs unite in harmonious rows—
Another feature hops into place! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feat/report' is too vague and generic. While it mentions 'report', it doesn't specify what the report does or its purpose (e.g., 'Registration Report', 'Webinar Registration Report'). Revise the title to be more descriptive, such as 'Add Webinar Registration Report' or 'Feat: Add Registration Report for Zoom Webinar', to clearly convey the main change and its purpose.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vishwajeet-13
Copy link
Contributor Author

@NagariaHussain

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@zoom_integration/zoom_integration/report/registration_report/registration_report.py`:
- Around line 16-21: The column label "User Email" doesn't match the linked user
field "user" from the Zoom Webinar Registration doctype; either rename the
column label to "User" to reflect the existing field, or change the report to
select the actual email by updating get_data() to join/select zwreg.email and
keep the label "User Email"; locate the column definition with "fieldname":
"user" and the get_data() SQL/query function and apply one of these two fixes
accordingly.
- Around line 118-127: The SQL in utm_query references a non-existent child
table 'tabUtm Parameters' so the query will fail; update the code to use the
existing child table used for key/value pairs (e.g., 'tabZoom Webinar Additional
Param') or create a new DocType named "Utm Parameters" as a child of Zoom
Webinar Registration. If refactoring, change utm_query to select parent, `key`,
value FROM the existing child table and keep the same WHERE clauses (parenttype
= 'Zoom Webinar Registration' AND parent IN %(parents)s), and confirm the field
names (`key` and value) match the actual fields on the "Zoom Webinar Additional
Param" DocType; if you create the DocType, ensure it's defined as a child table
linked to Zoom Webinar Registration with the expected fields so the existing
utm_query can run unchanged.
🧹 Nitpick comments (2)
zoom_integration/zoom_integration/report/registration_report/registration_report.py (2)

91-92: Consider validating the required filter.

If filters.get("webinar") is None, the query will attempt to match webinar = NULL, which may return no results or unexpected behavior. Since the JS defines this filter as required (reqd: 1), this is unlikely in normal usage, but defensive validation would be safer.

Suggested validation
 def get_data(filters):
+	if not filters.get("webinar"):
+		return []
 	values = {"webinar": filters.get("webinar")}

95-108: Consider filtering by docstatus.

The query fetches all registrations regardless of docstatus. Since Zoom Webinar Registration is submittable (is_submittable: 1), you may want to exclude draft or cancelled records.

Add docstatus filter
 		FROM `tabZoom Webinar Registration` zwreg
 		WHERE zwreg.webinar = %(webinar)s
+			AND zwreg.docstatus = 1
 		ORDER BY zwreg.user

Comment on lines +16 to +21
{
"label": _("User Email"),
"fieldname": "user",
"fieldtype": "Data",
"width": 200,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Column label mismatch with actual data.

The label says "User Email" but the fieldname user fetches the user field from Zoom Webinar Registration, which is a Link to the User doctype (not the email address itself). The DocType has a separate email field that contains the actual email.

Consider either:

  1. Change the label to "User" to match the actual data, or
  2. Fetch zwreg.email in the SQL query if you want to display the email address
Option 1: Fix the label
 		{
-			"label": _("User Email"),
+			"label": _("User"),
 			"fieldname": "user",
-			"fieldtype": "Data",
+			"fieldtype": "Link",
+			"options": "User",
 			"width": 200,
 		},
Option 2: Fetch email instead

Update the column definition:

 		{
 			"label": _("User Email"),
-			"fieldname": "user",
+			"fieldname": "email",
 			"fieldtype": "Data",
 			"width": 200,
 		},

And update the SQL query in get_data():

-			zwreg.user,
+			zwreg.email,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"label": _("User Email"),
"fieldname": "user",
"fieldtype": "Data",
"width": 200,
},
{
"label": _("User"),
"fieldname": "user",
"fieldtype": "Link",
"options": "User",
"width": 200,
},
🤖 Prompt for AI Agents
In
`@zoom_integration/zoom_integration/report/registration_report/registration_report.py`
around lines 16 - 21, The column label "User Email" doesn't match the linked
user field "user" from the Zoom Webinar Registration doctype; either rename the
column label to "User" to reflect the existing field, or change the report to
select the actual email by updating get_data() to join/select zwreg.email and
keep the label "User Email"; locate the column definition with "fieldname":
"user" and the get_data() SQL/query function and apply one of these two fixes
accordingly.

Comment on lines +118 to +127
utm_query = """
SELECT
parent,
`key`,
value
FROM `tabUtm Parameters`
WHERE
parenttype = 'Zoom Webinar Registration'
AND parent IN %(parents)s
"""
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for Utm Parameters doctype definition and references
echo "=== Searching for Utm Parameters references ==="
rg "Utm Parameters" --type=py --type=json -n

echo ""
echo "=== Searching for utm-related files ==="
fd "utm" -i

echo ""
echo "=== Looking for Zoom Webinar Registration doctype definition ==="
fd "zoom.*webinar.*registration" -i

Repository: BuildWithHussain/zoom_integration

Length of output: 810


🏁 Script executed:

cat zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.json

Repository: BuildWithHussain/zoom_integration

Length of output: 3765


🏁 Script executed:

#!/bin/bash
# Search for any utm-related doctype or field definition
rg -i "utm" --type=json --type=py -n

echo ""
echo "=== Searching for all table field definitions that use Table fieldtype ==="
rg "\"Table\"" --type=json -B 5 | grep -E "(fieldname|options|Table)" | head -40

Repository: BuildWithHussain/zoom_integration

Length of output: 3574


🏁 Script executed:

#!/bin/bash
# Find all doctype definitions
echo "=== All DocTypes in the repository ==="
find zoom_integration -name "*.json" -path "*/doctype/*" | grep -v test | xargs -I {} sh -c 'grep -l "\"doctype\": \"DocType\"" {} && echo "File: {}"' 2>/dev/null | grep -v "^File:" | sort

echo ""
echo "=== Check if Utm Parameters doctype exists ==="
find zoom_integration -name "*utm*.json" -o -name "*Utm*.json" 2>/dev/null

echo ""
echo "=== List all doctype directories ==="
ls -1 zoom_integration/zoom_integration/doctype/

Repository: BuildWithHussain/zoom_integration

Length of output: 903


🏁 Script executed:

cat zoom_integration/zoom_integration/doctype/zoom_webinar_additional_param/zoom_webinar_additional_param.json

Repository: BuildWithHussain/zoom_integration

Length of output: 1018


tabUtm Parameters table does not exist in the codebase.

The query will fail at runtime. The codebase only defines 6 DocTypes, and "Utm Parameters" is not among them. Either create this DocType as a child table for Zoom Webinar Registration, or refactor to use the existing "Zoom Webinar Additional Param" table (which already stores key-value pairs) for UTM data.

🤖 Prompt for AI Agents
In
`@zoom_integration/zoom_integration/report/registration_report/registration_report.py`
around lines 118 - 127, The SQL in utm_query references a non-existent child
table 'tabUtm Parameters' so the query will fail; update the code to use the
existing child table used for key/value pairs (e.g., 'tabZoom Webinar Additional
Param') or create a new DocType named "Utm Parameters" as a child of Zoom
Webinar Registration. If refactoring, change utm_query to select parent, `key`,
value FROM the existing child table and keep the same WHERE clauses (parenttype
= 'Zoom Webinar Registration' AND parent IN %(parents)s), and confirm the field
names (`key` and value) match the actual fields on the "Zoom Webinar Additional
Param" DocType; if you create the DocType, ensure it's defined as a child table
linked to Zoom Webinar Registration with the expected fields so the existing
utm_query can run unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant