Spaces:
Running
Running
Commit History
-
Fix: CE_PROD_SUFFIX / CE_SUFFIX now drive the CE's producer code
Reported from the admin panel: on "Ceded Accounts - CE as Producer", CE_PROD_SUFFIX = 2 flipped the ABE Status column to Non-ABE but the Code column stayed BRAJO1; toggling back to 1 moved the label again and never the code. BRAJO1 + Non-ABE contradict each other in Epic (...1 is ABE, ...2 is Non-ABE), so the code carried into the PDF and the approval record was wrong on every CE-as-producer agreement. Cause: Round 5 moved the CE picker onto the client_executives table, so ce_record always resolves and rules_engine printed ce_record.code verbatim (every seed row ends in 1). The ABE label on the same row was computed from the constant instead — hence one column obeyed the admin panel and the other could not. The prefix+suffix branch that used to apply the suffix had become dead code. Fix: _apply_ce_suffix() re-suffixes at render time, so the summary Code column, PDF/DOCX year table, signer block, participants list and Approval.producer_code all derive from the same ce_suf as the ABE l…129db36
-
Mentor agreements: roll Mentee/Mentor rows into the MENTO code row
For MENTO3-6, the Commission & Production Credit Summary table now shows two rows during Unvalidated Years: the MENTO code at 20% commission / 100% production credit, plus the CE layer. The Mentee (P1) and Mentor (P2) rows are filtered from the display only. Implemented entirely inside compute_summary(), which is the single source of year_tables for all four surfaces (form preview, producer approval view, PDF, DOCX) - so no template, route or generator needed changing. The producer records, tiers and participants list are untouched, so both producers still receive approval emails, still appear in the PDF "Commission Agreement" and "Approvals" sections, and still block finalization. No DB writes, no schema change, no seed change and no boot migration: existing submissions keep their frozen summary_data snapshot, so finalized agreements still render exactly what was approved. The MENTO row reads its rate off the Unvalidated tier rather than hardcoding 20, so admin panel edits flow thr…f17f7f1
-
Round 7: add "No Client Executive" CE layer to locked-pair agreements
Mentor agreements MENTO3-6 and the Bond Partner Agreement (Webb/Herron) now carry the same CE workflow as CL/Bond accounts: a mandatory CE dropdown defaulting to "No Client Executive" (NOCEA1), with the option to attach a real CE. - rules_engine: stop hard-disabling CE for locked pairs (include_ce no longer gated on `not is_locked_pair`). CCP remains disabled for locked pairs. NOCEA1 still deducts nothing / no approval; a real CE takes the standard 2% split across the locked producers and becomes an approver — all via the existing Round 5 machinery. - form.html: ce:true on the 5 locked-pair entries; updateCEMode + getFormData + draft-load route locked pairs through the mandatory NOCEA1 dropdown. CCP stays off. - Reuses the Round 5 NOCEA1 placeholder + ce_dept_required_mode; no DB migration (NOCEA1 already exists in the live client_executives table). - Tests: _smoke_round7.py (new) covers NOCEA1 default, real-CE 2% split + approver, and CCP-still-suppressed for MENTO4 + Bon…5937f90 -
Round 6: fix Middle Market originator, Fitch Irick Streer, retire Emerging Markets
Addresses Elliot Wallace's feedback on the live commission-intake app: 1. Middle Market Referral/Origination: no Originating Producer field. Root cause — form/engine keyed behavior on the exact internal agreement `name`, which the admin tier editor can rename, dropping the originator slot. Now recognized by name OR display_name OR the "Referral / Origination Fee Agreement" prefix (rules_engine _is_referral_orig + form.html getVisibility display fallback). 2. Standalone "Emerging Markets Agreement" retired (only applies inside EMB now): deactivated server-side (kept for historical submissions), key removed from the form visibility map. EMB's identically-named tier label is independent/unaffected. 3. Fitch Irick showed only Wayne Dean, no John Streer. Root cause — an admin tier-edit dropped the P2 tier; the engine forces both codes but Streer's row/approval only render when a P2 tier exists. start.py gains idempotent, surgical self-healing migrations: restore …88b25ae
-
Round 5 pre-launch: 2 new agreement types, NOCEA1 CE, employee list, email + admin fixes
- 1A: add CommissionAgreement.display_name; Referral displays as "- Middle Market" (internal name unchanged); add "Referral / Origination Fee Agreement - EMB" - 1B: add Fitch Irick (FITC-IRICK) via FIXED_PAIR_AGREEMENTS — Wayne Dean + John Streer locked, CE/CCP still available; seed both producers as standing approvers - 2: NOCEA1 "No Client Executive" placeholder (0%/0%, no deduction, no email, auto-approved participant); CL/Bond get a mandatory CE dropdown defaulting to NOCEA1, other depts keep optional checkbox with NOCEA1 selectable - 3: replace dummy employee dropdown with real 112-person SWIA roster (idempotent) - 4: data-persistence safeguards — DO-NOT-RUN-IN-PROD guards on seed reset, Dockerfile, and producer/client upsert; all Round 5 migrations additive+idempotent - 5: Resend retry/backoff; final signed PDF now emailed to ALL parties (CM, producers, originator, CCP, real CE excl. NOCEA1, payroll); reset-send logging - 6: admin-created …108b32b
-
Separate Client Executive list from Producers
- New ClientExecutive table (code/name/email/is_active), persisted in /data - Idempotent CE seed from ce_seed.json on empty table (7 SWIA CEs loaded); superadmin edits never overwritten on reboot - Admin "Manage Client Executives" page: add/edit/toggle/delete + bulk paste - Form CE pickers + rules_engine resolve CE name/code/email from the new table; CE's own email attaches to the approval Non-destructive — old logic kept as fallbacks, nothing removed: - engine reads ce_code OR legacy ce_prefix (old drafts still resolve) - CE-table lookup falls back to Producer lookup if code not found - CE <select> falls back to producers when CE list is empty - ABE suffix logic unchanged Verified: compute_summary output byte-identical across all 20 agreements. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>3c9f702
-
v2.2: Round 4 — 4 Mentor agreements (MENTO3-6) + Bond Partner (Webb/Herron)
5 new agreement types with locked P1+P2 pairs and no CE/CCP layers. Mentor agreements emit Unvalidated/Validated year tables with a Mentor Code row in Unvalidated and a suffix-1 ABE transition to Standard Agreement in Validated. Bond Partner is a single "All Years" 15/50 split for Webb/Herron. - models: +locked_pair Boolean on commission_agreements - rules_engine: LOCKED_PAIR_AGREEMENTS dict forces P1/P2 codes, suppresses CE/CCP/Originator, injects Mentor Code row, ABE override for Validated - seed_db: +5 agreements with locked_pair=True, +10 producer rows - start.py: idempotent v2.2 schema + data migration; re-activates locked-pair producers after refresh_data.json import so they're not silently disabled - form.html: +p2_locked_display; AGREEMENT_VISIBILITY extended with lockedPair entries; updateFieldVisibility/resetProducerFields handle dual lock with Mentee/Mentor role labels - main.py: version 2.1.0 → 2.2.0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.…99a1207
-
v2.1: SWIA rebrand, bell-ringer + accounting email removal, House Standard split, domain self-signup, superadmin self-service
Round 3 refinements + bell-ringer removal + domain login + superadmin operational autonomy. Branding - App title -> "SWIA Commission Agreement Intake" (v2.1.0) - Email subjects/templates updated; PDF/DOCX internal heading kept Bell ringer fully removed - Drop BellRingerThreshold table, intake_submissions.bell_ringer_triggered column - Idempotent migrations in start.py for existing DBs - Stripped from form, rules engine, PDF, DOCX, email, approval routing, admin panel - email_routing_rules row purged Email routing - Drop accounting@snellingswalters.com from seed and existing DBs - Final-PDF email no longer mentions bell ringer in subject/body Self-signup (Phase 3) - New /signup page restricted to @snellingswalters.com domain - Auto-creates active user, hands token, redirects to dashboard - Login page now links to /signup and /forgot-password Round 3 refinements - Rejection workflow: reason captured (>=10 chars), submitter emailed via send_rejection_notification, "Edit & Resubmit" c…8933003
-
Major feature update: DOCX generation, preview columns, bug fixes, dashboard enhancements
Activities completed: 1. Preview table: added Name & Code columns (7-col layout: Role|Name|Code|ABE|Agreement|Comm%|ProdCredit) 2. House Agreement: layers now deduct from 100% base (was incorrectly adding on top) 3. House Agreement: P1 hidden from commission table (kept in approval workflow) 4. Life Origination: fixed to apply All Years at 20% (was Year 1 only) 5. CE as Producer: required People Picker mode for Ceded Accounts, CCP deducts from CE 6. Submit safeguard: modal preview before submission with Confirm/Go Back buttons 7. Word document generation: populates DRAFT/FINAL .docx templates with full form data 8. Dashboard: agreement type, effective date, commission preview, approval timeline, status filters, soft-delete (hide) for finalized submissions 9. Email fallback: generates FirstInitial+LastName@snellingswalters.com when not in DB 10. Employee originator: expanded to 20 employees with search filter Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>ab38dce
-
Refactor commission intake: per-year tables, dept-only bell ringer, ABE status
Implements all changes from commission_intake_refactor_prompt.md: - rules_engine: per-year table output, P1-only deduction for Closer/Referral, fixed-code agreements (Gebhardt/Beacham), dept-only bell ringer thresholds, ABE status tracking, participants list for approval workflow - form.html: agreement type as primary driver (Section 2), dynamic field visibility via AGREEMENT_VISIBILITY config, CE/CCP as checkbox+picker, originator section for Referral, Gebhardt/Beacham auto-fill+lock, per-year preview tables, draft saving integration - form_routes: removed market_segment from template, updated bell ringer to dept-only, uses participants list for approval creation - pdf_generator: per-year tables (Role/Agreement Type/Commission%/Production%/ ABE Status), removed dollar amounts and market segment - approve.html: per-year table format matching new summary_data structure - seed_db: dept-only bell ringer thresholds (CL/CON/EB/PL/VAN), removed market_segment dropdown options…7ca810d
-
Fix admin panel auth, form title, commission data, and validation
- CRITICAL: Add auth token to ALL admin template fetch() calls (agreements, agreement_edit, constants, bell_ringers, dropdowns, email_rules, users). Previously only producer_emails had it, causing all admin saves to fail with 401 Unauthorized. - Add ?token= parameter to all admin navigation links so auth persists when navigating between admin pages. - Rename "Producer Intake Form" to "Commission Agreement Intake Form" throughout (base.html, form.html, README.md). - Move Department Code and Market Segment before Bell Ringer badge so bell ringer auto-populates correctly. - Add tooltip to Bell Ringer badge explaining it auto-populates. - Fix Referral/Origination Fee tier label: "Year 1-2" -> "Year 1 & Year 2". - Fix Life Origination Fee: "All Years" at 20% -> "Year 1" at 20%, "Year 2+" Ended. - Add CCP + Bond Agreement incompatibility validation (client + server side). - Add data migration in start.py to fix existing DB records on redeploy. Co-Authored-By: Claude Opus 4.6 <no…9aaf067
-
Upload 2 files
Verified signature69fabe9 -
Update app/rules_engine.py
Verified signaturefcdf0a5 -
Update app/rules_engine.py
Verified signatureb547fed
-
Upload folder using huggingface_hub
Verified signature996fcf9