Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 3.3.3
-
Fix Version/s: 4.4.0
-
Component/s: CiviMember
-
Labels:None
Description
I have a use case that doesn't fit the current import/update options in the membership import form, so I'm coding a solution and want to know what the best way to do this would be in order for it to be considered as a core patch.
Here's what I'm dealing with:
- The organisation is a continuing professional development provider, who can only provide services to registered practitioners, with practitioner status determined by an outside body.
- This outside body provides a weekly CSV file with all current members and their professional statuses.
- The CSV does not show expired memberships, just current ones, so people who die or get struck off just vanish from the weekly import
- memberships are lifelong until the person vanishes from the list
- sometimes the status changes e.g. from student to full practitioner
What I need to do:
- Import all memberships (OK once I have fixed
CRM-7513) - Import any new memberships on a weekly basis, ignoring people who were imported in previous weeks (basically importing the same list twice, but with a few extra rows the second time). Duplicates should be ignored only if their status has not changed, otherwise, a new membership needs making and the previous one set to expire
- Expire any existing memberships that are not one the list anymore by setting their status to 'expired' or similar.
The current logic in /CRM/Member/Import/Parser/Membership.php is:
If (we are doing an update)
else
{ // check we can match exactly one contact using dedupe rule // make a new membership }I think the best way to fix this would be to make a new setting so we have (Import/Update/Update from membership list) or something, with the following assumptions:
- the list will be authoritative for the membership types it mentions - any memberships of that type not on the list anymore should expire
- There will only be one membership of that type per contact, which will be either renewed on import if it is of finite length, or left alone if it's lifetime.
- New memberships should be added if they don't exist yet, allowing both update and import in the same operation.
Does this sound OK and do you have any advice for how to do this?