As part of the process of @adamps getting familiar with the code of this module, it makes sense for him to flesh out the readme documenting the features, etc.
We could end up with a readme that is much longer than common for Drupal modules, but that's a good thing.
Issue fork gift_aid-3504036
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jonathanshawComment #3
jonathanshawOne thing I want to explain here, because it's a bit odd, is how the 'context' for a Gift Aid declaration works.
There's a 'context' dynamic (i.e. can reference any entity type) entity reference (DER) field on the declaration entity type. This is for answering the question "who" is making the declaration.
The reason why this uses DER is that as this is contrib-land we don't know in principle how other sites are choosing to build their database of people. For example, they might be using Drupal's "user" entity type, but maybe they have some (Drupal or external) CRM system and they want to track gift aid declarations against the "contact" entity type from that.
The 'context' reference field allows a declaration to be associated with a particular entity, but allows for further chains of entity reference to be built.
A complex example explains the need more :
- an anonymous customer makes a donation and ticks gift aid at checkout. The context is the commerce order.
- at the end of checkout, they create a user account, which then gets set as the customer on the order.
- the site is using a CRM contact entity type as the actual canonical focus of their Gift Aid system, and the new user is linked up to an existing CRM contact with the same email
The problem is: how do we link the gift aid declaration with the CRM contact? The solution I've created is to use an event as part of the process of querying for declarations. You use web/modules/ahs/gift_aid/src/GiftAidRelatedContextsManager.php to find contexts that relate to other contexts, so that the order declaration can get added in when you are seeking declarations for the CRM contact.
Comment #4
adamps commented@jonathanshaw The project page says:
However I don't see any sub-module. Please can you clarify?
Comment #5
jonathanshawIt's in the latest version in the gift-aid branch, per my comment on #3504032: Migrate basic code.
Comment #7
adamps commentedI made a start. I feel that I can't really continue until the features are a bit more decided and stable.