Bradley M. Kuhn
02dd863c53
getPostalAddresses: implementation
...
It's straightforward but has no unit tests, and should have some.
2016-01-18 21:20:43 -08:00
Bradley M. Kuhn
82ec41cc33
Verify getRequest works after failed fulfill.
...
getRequest() should return expected values after failed fulfillRequest()
call
2016-01-18 21:13:21 -08:00
Bradley M. Kuhn
ded2028069
Allow missing entityId in Ledger output.
...
The ledger data can, in fact, sometimes have a missing entityId for
various reasons. For now, these donations should just be ignored.
Perhaps in future a warning of some sort should be generated.
2016-01-18 21:10:47 -08:00
Bradley M. Kuhn
00da4c3cd8
Commit forgotten test!
2016-01-07 13:35:13 -08:00
Bradley M. Kuhn
c7d11b8593
Correct totals again.
...
I am pretty sure these are right now.
2016-01-07 13:35:01 -08:00
Bradley M. Kuhn
965fe7a022
Correct test count.
2016-01-07 13:34:48 -08:00
Bradley M. Kuhn
dba498c528
donorTotalGaveInPeriod: test badly formatted dates
...
It should die if the dates aren't formatted right.
2016-01-07 13:07:04 -08:00
Bradley M. Kuhn
003af81ce7
donorTotalGaveInPeriod: improve tests.
...
Actually, the amount on that one test was wrong, and I think we actually
do want to test the border cases a bit better.
2016-01-07 13:06:40 -08:00
Bradley M. Kuhn
e14c0b048d
donorTotalGaveInPeriod: tests defining basic API.
2016-01-07 12:53:04 -08:00
Bradley M. Kuhn
5901e567d3
Date test was written should not be hard coded.
...
The date should use the today, while that still has the "run the tests
at almost midnight UTC" race condition, at least it will usually be
right. :)
2016-01-07 12:52:29 -08:00
Bradley M. Kuhn
f3b7ebc6e3
getEmailAddresses: tests and implementation.
2015-12-31 01:59:50 -08:00
Bradley M. Kuhn
b174fec8c3
Add FIXME for API call I want.
2015-12-30 21:47:29 -08:00
Bradley M. Kuhn
39faafcab6
supporterExpirationDate: fix reverse sort bug.
...
These two new tests:
ok 222 - supporterExpirationDate(): same donation amount in year...
ok 223 - supporterExpirationDate(): ...returns the latter date.
did not pass without this change. The list for annuals in
supporterExpirationDate() was sorted in the wrong order, producing
erroneous results.
2015-12-30 21:26:48 -08:00
Bradley M. Kuhn
dbeb98d0f2
findDonor: empty criteria finds everyone.
...
Rather than die() when the criteria list is empty, instead return the
entire list.
2015-12-30 20:53:28 -08:00
Bradley M. Kuhn
97f08a7bd8
supporterExpirationDate: tests & implementation
2015-12-30 20:11:57 -08:00
Bradley M. Kuhn
7e424200c7
donorFirstGave: tests and initial implementation.
2015-12-30 19:32:31 -08:00
Bradley M. Kuhn
7d4ca1f746
Correct id in this test.
2015-12-30 19:01:19 -08:00
Bradley M. Kuhn
f3a4ba8ef5
Add actual test command.
2015-12-30 18:59:41 -08:00
Bradley M. Kuhn
89a30119c7
Correct method name.
2015-12-30 18:59:34 -08:00
Bradley M. Kuhn
de51b50759
Correct data to quote $'s.
2015-12-30 18:59:23 -08:00
Bradley M. Kuhn
2676dfba22
setPublicAck: initial tests and docs.
2015-12-30 17:53:54 -08:00
Bradley M. Kuhn
dcdfa51d23
setPublicAck: initial tests and docs.
2015-12-30 17:47:56 -08:00
Bradley M. Kuhn
21fa4a1379
getPublicAck: Additional die tests.
2015-12-30 17:42:56 -08:00
Bradley M. Kuhn
59d824e6b8
isSupporter: tests, implementation & docs.
2015-12-30 17:19:10 -08:00
Bradley M. Kuhn
21080cc4d5
getDisplayName: tests, implementation, and docs.
2015-12-30 17:12:58 -08:00
Bradley M. Kuhn
a07235f74d
Declare variable in the right place.
2015-12-30 17:02:50 -08:00
Bradley M. Kuhn
ec7e50e8e0
getPublicAck: initial tests spec out API.
2015-12-30 16:51:04 -08:00
Bradley M. Kuhn
a8dbc5ad76
lastGave(): initial tests to define API
2015-12-30 16:33:03 -08:00
Bradley M. Kuhn
724cb77605
new: additional arguments related to ledger.
...
I'll need a full command line here, as it turns out, and also regular
expressions to use for searching for monthly vs. annual donations.
2015-12-30 12:08:33 -08:00
Bradley M. Kuhn
0ca9d394e2
getLedgerEntityId: tests showing basic API & docs
...
These tests show the basic API for the getLedgerEntityId() method.
Documentation for the method also included.
2015-12-30 11:31:09 -08:00
Bradley M. Kuhn
2e9938738f
Add license notice at top of these files.
2015-12-30 11:09:47 -08:00
Bradley M. Kuhn
4cd05c9508
Remove blank line.
2015-12-30 06:10:12 -08:00
Bradley M. Kuhn
7e6e96d95f
findDonor: API change: return multiple entries
...
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.
2015-12-30 06:08:39 -08:00
Bradley M. Kuhn
e10f8ed61a
addEmailAddress: test for duplicate adds.
...
These tests verify that duplicate adds do not try to add the same email
address again. These tests currently fail.
2015-12-30 06:00:10 -08:00
Bradley M. Kuhn
6d1825240a
addEmailAddress: permit shared email addresses.
...
An existing email address can exist already. If it does, just map it to
the new donor_id as well.
2015-12-30 05:49:12 -08:00
Bradley M. Kuhn
736f022005
_lookupEmailAddress: replace _lookupEmailAddressId
...
Actually, I will ultimately need the whole record for my purposes, so
rework this function to return everything.
2015-12-30 05:41:10 -08:00
Bradley M. Kuhn
4d2fc22de1
_lookupEmailAddressId: implement helper function
...
This helper function will be needed for a few changes I'm about to make.
2015-12-30 05:33:05 -08:00
Bradley M. Kuhn
2ef0dad053
findDonor: initial set of unit tests.
...
These tests spec out what findDonor() should do.
2015-12-30 05:02:39 -08:00
Bradley M. Kuhn
9c8db6b84f
fulfillRequest: allow requestTypeId per getRequest
...
getRequest() now allows requestTypeId, so fulfillRequest() can as well.
Add tests for that, and don't die if requestType isn't given.
2015-12-30 04:12:21 -08:00
Bradley M. Kuhn
d6ce8225d9
getRequest: test documentation better detailed
...
Add a bit more detail in the test description to note we're using
requestType, not requestTypeId parameter in this test.
2015-12-30 04:05:21 -08:00
Bradley M. Kuhn
5b8453d9ae
getRequest: Modify test to support requestTypeId
...
Now that requestTypeId parameter is valid, one of these tests should use
it.
2015-12-30 04:04:48 -08:00
Bradley M. Kuhn
1760f60759
getRequest: re-implement to take hash argument
...
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.
2015-12-30 04:04:37 -08:00
Bradley M. Kuhn
10030b3488
_verifyRequestTypeId =>_lookupRequestTypeById
...
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.
2015-12-30 03:55:28 -08:00
Bradley M. Kuhn
9de60c3c5e
Use donorId rather than supporterId as main handle
...
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.
2015-12-30 03:13:41 -08:00
Bradley M. Kuhn
95ef1fce28
Change table to donor; add is_supporter field.
...
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.
2015-12-30 03:10:07 -08:00
Bradley M. Kuhn
794d34a79f
Test begin work/commit nesting in a few places.
...
I discovered a bug where _beginWork() and _commit() calls were not
properly matched. These tests are added to find them.
2015-12-20 18:51:46 -08:00
Bradley M. Kuhn
69a5ffdbf6
get/setPreferredEmailAddress: initial tests.
2015-12-20 17:57:30 -08:00
Bradley M. Kuhn
2dafc3c544
Correct test; it used incorrect variable
2015-12-20 17:10:18 -08:00
Bradley M. Kuhn
cb1ce38650
fulfillRequest: test had incorrect return value.
...
fulfillRequest() returns the id, not a hash of values.
2015-12-20 17:07:44 -08:00
Bradley M. Kuhn
3ff735584c
This test did not belong here.
...
I believe this was due to a bad cut-and-paste in a previous commit.
2015-12-20 17:05:20 -08:00