Skip to content

feat(ingest): add Ellucian Advance gift reader - #321

Merged
shivamlalakiya merged 2 commits into
PhilanthroPy-Project:mainfrom
Utkarsh3725:add-ellucian-crm-gift-reader
Nov 4, 2026
Merged

shivamlalakiya merged 2 commits into
PhilanthroPy-Project:mainfrom
Utkarsh3725:add-ellucian-crm-gift-reader

Conversation

@Utkarsh3725

Copy link
Copy Markdown
Contributor

What & why

Adds an Ellucian CRM Advance gift export reader for donor-level gift aggregation.

The bridge normalizes Advance export/API-style labels such as Entity ID, Date, Legal, Type, and Allocation onto the shared ingest schema, drops pledge-like commitment rows by default, and
delegates the donor roll-up to the existing CiviCRM aggregator.

Closes #241

Checklist

  • make ci passes locally (lint -> collection -> tests -> coverage >= 92%)
  • New/changed public API has docstrings and is exported in the subpackage __init__.py
  • Tests added or updated
  • CHANGELOG.md updated under [Unreleased]
  • Added yourself to CONTRIBUTORS.md (skip if you would rather not be listed)

Testing

python3 -m py_compile philanthropy/ingest/_ellucian_advance.py philanthropy/ingest/__init__.py philanthropy/ingest/_read_gifts.py philanthropy/cli.py tests/test_ellucian_advance.py tests/test_read_gifts.py
git diff --check
python3 -m pytest tests/test_ellucian_advance.py tests/test_read_gifts.py
python3 -m pytest tests/test_public_api_contract.py tests/test_documented_contracts.py -q
python3 -c "from philanthropy.ingest import ellucian_advance_gifts_to_features, read_ellucian_advance_gifts; print('OK')"

make ci passed lint, mypy, and doctests locally, then stopped during test collection because this environment is missing hypothesis.

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for this, the structure matches the other bridges well and CI is green. A few things need fixing before it can merge, the first one is the important one.

1. The default pledge filter doesn't match the vocabulary in the cited source. The Transaction List help page this module cites describes Type as "the transaction type (gift, pledge payment), or pledge type (straight pledge, grant, bequest intention)", and says the donor type follows in parentheses (primary, joint, covering account, ...). So a real export's pledge rows look like Straight Pledge (Primary) or Bequest Intention (Primary). After normalisation those become straightpledgeprimary / bequestintentionprimary, which never equal pledge / plannedgift / recurringpledge, so every pledge in a real Advance export is summed as a gift by default. That's exactly the double-count this bridge exists to prevent, and the tests don't catch it because the fixtures use the bare Pledge label rather than the documented one. Suggested fix: strip the trailing (...) donor-type suffix before matching, add Straight Pledge, Bequest Intention and Grant (pledge-type grants are commitments) to the default, and add a test using the documented Straight Pledge (Primary) form alongside Pledge Payment (Primary) being kept.

2. Date carries the receipt number. Same page: Date is "the date of record ... followed by # and the unique Receipt Number". If an export keeps that 01/10/2025 #0001234 form, the date won't parse. Either strip the #... suffix or confirm (and note in the docstring) that the CSV export splits it into its own column.

3. "id": "contact_id" is too broad. A bare ID column in a transaction export is as likely to be the receipt/transaction id as the entity id, and if both ID and Entity ID are present _normalise_headers keeps whichever comes first, so donors could end up keyed by receipt number. I'd drop the bare id alias (and probably donor_id, which nothing in the cited pages uses) and keep entity_id / id_number.

4. Docstrings. ellucian_advance_gifts_to_features and read_ellucian_advance_gifts are one-liners, while the sibling bridges (_npsp.py, _raisers_edge.py) document Parameters / Returns / Raises / Warns and carry a doctest example. Please bring these up to the same shape, including what exclude_transaction_types=None does.

5. Rebase needed. #315 (Nonprofit Cloud bridge) just merged and touches the same lines in cli.py (_FEATURE_SOURCES, _read_raw_gifts, _cmd_features), ingest/__init__.py, _read_gifts.py and tests/test_read_gifts.py, so this will conflict. When you rebase, the features --source help text in _build_parser also has a per-source sentence about what is dropped; worth adding one for ellucian_advance.

Happy to re-review once these are in.

@shivamlalakiya

shivamlalakiya commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Checking in on this one. The review comment above is still open (no new commits since), and the branch now conflicts with main: GIFT_SOURCES, _REGISTRY, the read_gifts docstring, and philanthropy/ingest/__init__.py have since gained the nonprofit_cloud and blackbaud_crm sources. When you pick it back up, please rebase on main (keeping the new sources and adding yours alongside them) and address the review points. If you no longer have time for it, just say so and the issue can go back up for grabs.

Merge main (Nonprofit Cloud, Blackbaud CRM and Little Green Light now in
the registry) and drop the cli.py edits: once PhilanthroPy-Project#338 lands, features
--source reads GIFT_SOURCES directly, so no per-source CLI dispatch is
needed.

Review fixes, checked against the Advance help pages cited in the module:

- The Transaction List's Type column reads "Straight Pledge (Primary)":
  a pledge type plus the donor type in parentheses. Matching now strips
  the parenthesised suffix, and the default excludes the pledge types the
  help pages name (Straight Pledge, Bequest Intention/Expectancy, EFT,
  Payroll Deduction, Telefund Pledge, Verbal Pledge). Before this, every
  real pledge row was summed as a gift. Grant stays in: Advance uses it as
  both a pledge type and a received-gift type.
- Date carries "#<receipt number>" after the date; it is stripped before
  parsing.
- Only entity_id / id_number key donors. The bare "id" and the unsourced
  donor_id / constituent_id aliases are gone, so a receipt ID can no
  longer become the donor key. Only Legal (hard credit) is summed.
- Full Parameters / Returns / Raises / Warns / Examples docstrings.
- Tests use the documented "(Primary)" and "#receipt" forms.
@shivamlalakiya
shivamlalakiya merged commit e691817 into PhilanthroPy-Project:main Nov 4, 2026
23 of 24 checks passed
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.

feat: add an Ellucian CRM Advance gift export reader (ingest preset)

2 participants