Spaces:
Running
Running
Update app/rules_engine.py
Browse files- app/rules_engine.py +10 -3
app/rules_engine.py
CHANGED
|
@@ -111,7 +111,8 @@ def compute_summary(db: Session, form_data: dict) -> dict:
|
|
| 111 |
p1pfx = form_data.get("producer1_prefix")
|
| 112 |
p2pfx = form_data.get("producer2_prefix")
|
| 113 |
cepfx = form_data.get("ce_prefix")
|
| 114 |
-
|
|
|
|
| 115 |
is_ce = R["ce_as_producer"]
|
| 116 |
has_p2 = R["P2"] is not None
|
| 117 |
|
|
@@ -208,11 +209,17 @@ def compute_summary(db: Session, form_data: dict) -> dict:
|
|
| 208 |
else:
|
| 209 |
rows.append(_na_row("Client Executive", "Not selected"))
|
| 210 |
|
|
|
|
| 211 |
# ROW: Complex Claims
|
| 212 |
if has_cc:
|
|
|
|
|
|
|
|
|
|
| 213 |
rows.append({
|
| 214 |
-
"role": "Complex Claims",
|
| 215 |
-
"
|
|
|
|
|
|
|
| 216 |
"agreement": "Complex Claims Program",
|
| 217 |
"commission": CC_COMM,
|
| 218 |
"commission_dollar": _dollar(CC_COMM, rev),
|
|
|
|
| 111 |
p1pfx = form_data.get("producer1_prefix")
|
| 112 |
p2pfx = form_data.get("producer2_prefix")
|
| 113 |
cepfx = form_data.get("ce_prefix")
|
| 114 |
+
cc_value = form_data.get("complex_claims") # "PARMI2", "EMPOR2", or None/empty
|
| 115 |
+
has_cc = bool(cc_value)
|
| 116 |
is_ce = R["ce_as_producer"]
|
| 117 |
has_p2 = R["P2"] is not None
|
| 118 |
|
|
|
|
| 209 |
else:
|
| 210 |
rows.append(_na_row("Client Executive", "Not selected"))
|
| 211 |
|
| 212 |
+
# ROW: Complex Claims
|
| 213 |
# ROW: Complex Claims
|
| 214 |
if has_cc:
|
| 215 |
+
# cc_value is "PARMI2" (Mike Parsa) or "EMPOR2" (Other Employees)
|
| 216 |
+
cc_label_map = {"PARMI2": "Mike Parsa", "EMPOR2": "Other Employees"}
|
| 217 |
+
cc_display_name = cc_label_map.get(cc_value, "")
|
| 218 |
rows.append({
|
| 219 |
+
"role": "Complex Claims",
|
| 220 |
+
"sub_role": "",
|
| 221 |
+
"code": cc_value,
|
| 222 |
+
"name": cc_display_name,
|
| 223 |
"agreement": "Complex Claims Program",
|
| 224 |
"commission": CC_COMM,
|
| 225 |
"commission_dollar": _dollar(CC_COMM, rev),
|