All tests now pass:
ok 15 - getLedgerEntityId: fails when rows are not returned but _verifyId() somehow passed
ok 16 - getLedgerEntityId: fails when rows are not returned but _verifyId() somehow passed
ok 17 - getLedgerEntityId: lives when valid id is given...
ok 18 - getLedgerEntityId: ...and return value is correct.
This seems to work and all existing tests for it pass:
ok 134 - findDonor: no search criteria dies
ok 135 - findDonor: 1 lookup of known missing succeeds ...
ok 136 - findDonor: ... but finds nothing.
ok 137 - findDonor: 2 lookup of known missing succeeds ...
ok 138 - findDonor: ... but finds nothing.
ok 139 - findDonor: 1 and'ed criteria succeeds ...
ok 140 - findDonor: ... but finds nothing.
ok 141 - findDonor: 2 and'ed criteria succeeds ...
ok 142 - findDonor: ... but finds nothing.
ok 143 - findDonor: 1 valid multiple criteria succeeds ...
ok 144 - findDonor: ... and finds right entry.
ok 145 - findDonor: 2 valid multiple criteria succeeds ...
ok 146 - findDonor: ... and finds right entry.
ok 147 - findDonor: 3 valid multiple criteria succeeds ...
ok 148 - findDonor: ... and finds right entry.
ok 149 - findDonor: single criteria find expecting multiple records succeeds...
ok 150 - findDonor: ... and finds the right entires.
Since the emailAddress criterion could find more than one entry, this
change has findDonor returning a list rather than a scalar integer and
thus finding multiple items are ok.
Tests are more extensive now that this API change is in effect.
This should succeed as the previous tests show. They now pass:
ok 21 - addEmailAddress: fails adding existing email address with mismatched type.
ok 22 - addEmailAddress: succeeds when adding email that already exists...
ok 23 - addEmailAddress: ... and returns same id.
Instead of a bunch of serial arguments, reimplement getRequest() to take
a hash of parameters.
In the process, add support for requestTypeId to be included.
I found need to have _verifyRequestTypeId() actually return the
request_type in a reimplementation of getRequest() that I'm working on,
so I've made this change.
I found need to have _verifyRequestTypeId() actually return the
request_type in a reimplementation of getRequest() that I'm working on,
so I've made this change. Some tests are failing because of the use of
_verifyRequestTypeId(). Next commit will address that.
Since we converted to making this a more general donor database, change
the handle used for an individual in the database from supporterId to
donorId.
Note that I left addSupporter() method name untouched because it does
automatically assume you mean a supporter, not a mere donor. Later, an
addDonor() method should likely be added.
Up until now, this software has been focused on just Supporters, but
really there is no reason this should not be a general donor database.
Therefore, don't use the name supporter in the database, and add a
field.
public_ack is now allowed to be NULL, because the idea being we don't
have an answer from all who donate whether or not they want public
acknowledgment.
the is_supporter boolean is added to record whether or not they came
through the supporter program.
This is the location where there was unbalanced _beginWork()/_commit()
calls. In future, when writing tests, it's probably good to check this
often in the tests.
These tests now pass:
ok 106 - setPreferredEmailAddress: dies for undefined id
ok 107 - setPreferredEmailAddress: dies for non-numeric id
ok 108 - setPreferredEmailAddress: email address undefined fails
ok 109 - setPreferredEmailAddress: email address with extra @ fails to add.
ok 112 - setPreferredEmailAddress: email address not found in database does not die....
ok 113 - setPreferredEmailAddress: ....but returns undef
ok 116 - setPreferredEmailAddress: setting preferred email address succeeds....
ok 117 - setPreferredEmailAddress: ... and returns correct email_address_id on success