Change handling of web evidence

Created on 4 July 2025, 3 days ago

Problem/Motivation

I think we can improve on our handling of 'web' evidence in a number of ways.

(1) The name 'web' in the trio oral/written/web has been bugging me a little, I suspect 'online' is better.

(2) The 'user' evidence type should be renamed 'web' and moved out of the gift_aid_user submodule. It should have 3 fields:
- url (absolute, with querystring)
- authenticated user
- label

(3) The 'commerce_order' evidence type should have fields:
- order
- order customer
- order email
(because the order entity is not revisionable so without this the reason why we associated the gift aid declaration with a user entity and possibly other past donations has no solid audit trail)

(4) The gift_aid_commerce submodule should add 2 pieces of evidence:
- a 'web' evidence type
- an 'order' evidence type

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom jonathanshaw Stroud, UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jonathanshaw
  • 🇬🇧United Kingdom jonathanshaw Stroud, UK
  • 🇬🇧United Kingdom jonathanshaw Stroud, UK
  • 🇬🇧United Kingdom adamps

    1) Originally I had explanations on evidence. I moved it because evidence is also used for cancellation and CoA which don't need explanations. If we put it back then we need to handle that.

    2) Please can you explain why? The term "Web" is currently used as the method for all self-declarations. To use it again for a specific one of them could be confusing.
    - URL: currently the URL is entirely determined from the User. This isonly needed if we use one evidence type for multiple scenarios, which I don't understand the advantage of.
    - User: already present via the reference to Donor, but I guess we could put it again.
    - See 1). But if we do add it, then I suggest put it as a base field because it will apply to all the evidence types.
    - Label of what?

    3) Sure, we could, but I don't really understand why. It seems to be entirely duplication of information, which I'm not especially fond of (what if staff edits one place but not the other?).

  • 🇬🇧United Kingdom jonathanshaw Stroud, UK

    Originally I had explanations on evidence. I moved it because evidence is also used for cancellation and CoA which don't need explanations. If we put it back then we need to handle that.

    What I'm thinking is:
    if there's a recording or scan the explanation is captured in that file, or with an email it's captured in the email text. So it's in the evidence anyway for offline declarations.
    It's only self-declarations on the website where it'd be good to capture the precise explanation used. In which case putting it on the associated evidence type seems sensible.
    It's true the explanation field on the web evidence type wouldn't make sense when used for COA/cancellation. But as this type of evidence is always programatically created, not exposed to users, that hardly matters.

    2) Please can you explain why?

    I'm seeing this as an evidence type that is relevant to any kind of form submission or programmatic generation of evidence: declarations, cancellations, change of address.

    The term "Web" is currently used as the method for all self-declarations.

    I suspect it won't be once we've finished refining our ideas in Declaration types Active .

    - User: already present via the reference to Donor, but I guess we could put it again.
    

    I'm thinking of this with a belt-and-braces audit hat: it'd be good to have evidence about who was submitting a form, even if we currently think that the form will only be used for self-submission with a user donor context.

    I guess the counter argument is that we already have this in the revision_user field on the revision. That's a strong point, but I wonder if we get better audit UX more easily if add it on the evidence type too.

    - URL: currently the URL is entirely determined from the User. This is only needed if we use one evidence type for multiple scenarios, which I don't understand the advantage of.

    If this evidence type is used for cancellation and COA as well, then it involves different urls. Additionally, future use cases or custom code could create new forms and want to create evidence associated with their use. So adding the exact url seemed like a good audit idea, rather than relying on the assumption that the evidence could only be generated in one circumstance.

    - Label of what?

    I was imagining that it might help to provide a human-readable explanation of the context that generated the evidence: "Checkout", "User self-declaration", "User change own address". Might make the display of evidence in the evidence field easier to make sense of.

    3) Sure, we could, but I don't really understand why. It seems to be entirely duplication of information, which I'm not especially fond of (what if staff edits one place but not the other?).

    I agree we have a choice with commerce order. Either
    (a) Add the url (and maybe authenticated user) field(s) to the order evidence type to enrich the audit trail there
    (b) Add 2 pieces of evidence when creating an order declaration.
    I'm not sure which is better.

  • 🇬🇧United Kingdom adamps

    Thanks.

    My strongest feeling is a concern about putting the User entity on the evidence. In various cases it could end up hanging around pointing to the wrong user:

    The first two are handled by code so I guess we could make the code change both places. But still, it seems to be creating trouble and work for no clear benefit. If you would like to display a link to the user on the evidence view, then I'm very happy with that - in effect it is a calculated field.

    For the URL and label, with the current design both are redundant information. The label is equal to the description on the evidence type. The URL could be determined. So my feeling is similar to above - both of these are in effect calculated fields, and we don't need to store the value in the database. However I'm less concerned about doing so because there isn't a clear way for the information to become outdated.

  • 🇬🇧United Kingdom jonathanshaw Stroud, UK

    The label is equal to the description on the evidence type. The URL could be determined.

    I'm imagining 'web' evidence would be recorded for self declaration, self cancellation, and self COA (which could itself possibly have multiple triggers).

    So my idea for URL is to help distinguish these.

    The label is redundant, and we can easily skip it for now. I think it might make the evidence trail easier to understand at a glance but in truth it's probably a premature idea at this point.

    About user, I think I've been getting confused and imagining web evidence being generated by staff submissions. Which isn't actually in our current plan.

    Arguably the question of providing evidence of how we knew who the submitting user was is still relevant for audit, but I think we can safely ignore that as it is inferable from circumstances.

  • 🇬🇧United Kingdom jonathanshaw Stroud, UK

    I'm becoming persuaded of your point in the declaration types issue, that if we have those then we don't need this evidence type at all.

    Postponing this issue on that for now.

Production build 0.71.5 2024