Nice spot on the confusion earlier – we’re aligned now. Here’s one single prompt you can paste straight into the Replit Agent to do all of D (add the 3-month nudges, wire them in like 12/9/6, and create example test payloads in the repo). ⸻ 🔧 Replit Agent Prompt – Add & Wire 3-Month EOT Nudges Paste all of this into the Replit AI in your Dealer Pulse project: You are working in my Dealer Pulse FastAPI project (Lia renewal engine). Please only edit code where necessary, keep all existing logic intact, and follow the existing patterns already used for 12-, 9- and 6-month EOT flows. ⸻ 1️⃣ Add 3-Month EOT Nudge Templates (NEW + USED) Open: app/lia_rules.py In the section where the EOT nudge templates are defined (for example for 12-month, 9-month, 6-month), add a new dictionary for 3-month nudges using the same style and naming conventions already in the file (e.g. similar to LIA_EOT_12_NUDGES or LIA_EOT_9_NUDGES). Create: LIA_EOT_3_NUDGES = { "NUDGE_1_3_NEW": ( "Hi [customer_name], just a quick reminder — you’re now close to the end of your agreement, so we’ll need to complete " "your end-of-contract check soon.\n\n" "This is also the point where your strongest loyalty support becomes available if you decide to upgrade.\n\n" "If you want me to hold the best-value options for you, just let me know what day you could pop in." ), "NUDGE_2_3_NEW": ( "Hi [customer_name], as you’re only a few months away from the end of your term, this is now the last window to secure " "an upgrade before stock availability and loyalty support change for the next quarter.\n\n" "Customers at this stage often save the most by acting now rather than at hand-back.\n\n" "Would you like me to check what the best-value new options look like for you before anything disappears?" ), "NUDGE_3_3_NEW": ( "Hi [customer_name], you’re now at the point where we normally schedule the end-of-contract review — it helps avoid any " "condition charges, confirms your settlement, and lets us apply any unused loyalty support before expiry.\n\n" "If you’d prefer, I can arrange for one of our advisors to give you a quick call and run through everything before you " "visit.\n\n" "Should I get someone to ring you?" ), "NUDGE_1_3_USED": ( "Hi [customer_name], just a quick reminder — as you’re close to the end of your agreement, we should complete your " "end-of-contract check soon.\n\n" "This helps confirm the vehicle’s value, avoid any potential charges, and makes sure you’re fully covered.\n\n" "If you’d like, I can check early swap options too — some customers find the upgrade more achievable at this point." ), "NUDGE_2_3_USED": ( "Hi [customer_name], you’re now in the final few months, so it’s really important we review your options properly.\n\n" "Doing nothing until the very end can mean missing out on loyalty support or paying more than necessary if you choose " "to keep the car.\n\n" "Would you like me to run a quick comparison between keeping, handing back, or moving into a newer model?" ), "NUDGE_3_3_USED": ( "Hi [customer_name], we’re now at the stage where we normally arrange the end-of-contract check — this protects you " "from unexpected charges and gives a clear view of your car’s true value.\n\n" "If you’d prefer, I can get one of our advisors to give you a quick call and run you through the options before you " "come in.\n\n" "Would that help?" ), } Place this next to the existing EOT nudge dictionaries (e.g. near LIA_EOT_12_NUDGES, LIA_EOT_9_NUDGES, LIA_EOT_6_NUDGES) and keep the style consistent. Make sure there are no duplicate keys and that the file still parses as valid Python. ⸻ 2️⃣ Wire 3-Month Nudges into the Existing Nudge Selector Still in app/lia_rules.py, find the helper(s) that: • choose the correct EOT nudge set based on payments_remaining, and/or • map a nudge_type like "NUDGE_1_12_NEW" / "NUDGE_1_9_NEW" to the right dictionary. For example, if there is something like: LIA_EOT_NUDGE_BY_STAGE = { "12": LIA_EOT_12_NUDGES, "9": LIA_EOT_9_NUDGES, "6": LIA_EOT_6_NUDGES, } …then extend it to include 3-month: LIA_EOT_NUDGE_BY_STAGE = { "12": LIA_EOT_12_NUDGES, "9": LIA_EOT_9_NUDGES, "6": LIA_EOT_6_NUDGES, "3": LIA_EOT_3_NUDGES, } Or, if the code uses a function like select_eot_nudges(payments_remaining, is_used_customer) or similar, update that function so that: • When payments_remaining is in the last 3 months window (e.g. <= 3 or whatever rule is already used for EOT_3), it returns LIA_EOT_3_NUDGES. Important: • Do not change function names or signatures. • Do not change existing behaviour for 18/12/9/6 months. • Just plug the new LIA_EOT_3_NUDGES into the same routing pattern already used for other stages. ⸻ 3️⃣ Ensure /api/lia/nudge Can Use the 3-Month Nudges Open: app/main.py or wherever the FastAPI endpoint for: @app.post("/api/lia/nudge", ...) is defined. In that endpoint, it should already: • inspect nudge_type (e.g. "NUDGE_1_12_NEW", "NUDGE_2_9_USED", etc) • look up the correct template from the nudge dictionaries. Please ensure that: • The new 3-month keys ("NUDGE_1_3_NEW", "NUDGE_2_3_NEW", "NUDGE_3_3_NEW", "NUDGE_1_3_USED", "NUDGE_2_3_USED", "NUDGE_3_3_USED") are fully supported by the same lookup logic. • No extra endpoints are added. • No existing behaviour is broken. If the nudge endpoint uses a generic lookup like: template = nudge_dict.get(nudge_type) then as long as LIA_EOT_3_NUDGES is correctly linked in, it should “just work”. Please confirm the wiring matches the patterns used for 12-, 9- and 6-month nudges. ⸻ 4️⃣ Add a Simple Test File With Example JSON Payloads Please create a small test file in the repo, for example: tests/lia_3m_nudge_examples.md with example JSON bodies I can use from Make.com or curl. Include six example payloads like below (you can reuse these directly): ## NUDGE_1_3_NEW POST /api/lia/nudge { "conversation_id": "11111111-1111-1111-1111-111111111111", "nudge_type": "NUDGE_1_3_NEW", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": false } ## NUDGE_2_3_NEW { "conversation_id": "11111111-1111-1111-1111-111111111111", "nudge_type": "NUDGE_2_3_NEW", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": false } ## NUDGE_3_3_NEW (Advisor Bridge) { "conversation_id": "11111111-1111-1111-1111-111111111111", "nudge_type": "NUDGE_3_3_NEW", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": false } ## NUDGE_1_3_USED { "conversation_id": "22222222-2222-2222-2222-222222222222", "nudge_type": "NUDGE_1_3_USED", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": true } ## NUDGE_2_3_USED { "conversation_id": "22222222-2222-2222-2222-222222222222", "nudge_type": "NUDGE_2_3_USED", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": true } ## NUDGE_3_3_USED (Advisor Bridge) { "conversation_id": "22222222-2222-2222-2222-222222222222", "nudge_type": "NUDGE_3_3_USED", "template_key": "EOT_3", "payments_remaining": 3, "is_used_customer": true } No need to wire these tests into pytest – it’s just a convenience file so I can quickly copy/paste the JSON into Make.com. ⸻ 5️⃣ Final Checks • Ensure app/lia_rules.py still imports correctly (no syntax errors). • Ensure the FastAPI app still runs (no import or NameError issues). • Do not change any unrelated logic, database calls, or routing. Please apply all of the above changes now. ⸻ When that’s done, we can sanity check with Make using those JSON bodies – but the heavy lifting will be sorted. If you want, after Replit finishes, send me a screenshot of the new LIA_EOT_3_NUDGES block and I’ll double-check the wording and flow.