Commit graph

391 commits

Author SHA1 Message Date
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
cf8cc36045 Giving limit for donor to receive t-shirt.
Analysis of IRS rules indicate that sometimes, a thank-you gift can't be
sent unless the percentage the gift is of the donation meets a certain
threshold.

This change allows the caller of this script to implement that sort of
threshold.
2016-01-08 13:10:20 -08:00
Bradley M. Kuhn
e43b6e34ae donorTotalGaveInPeriod: First implementation.
This passes all tests:

ok 224 - donorTotalGaveInPeriod(): dies with undefined donorId
ok 225 - donorTotalGaveInPeriod(): dies with non-numeric donorId
ok 226 - donorTotalGaveInPeriod(): dies with non-existent id
ok 227 - donorTotalGaveInPeriod():  dies with non ISO-8601 string in startDate
ok 228 - donorTotalGaveInPeriod():  dies with non ISO-8601 string in endDate
ok 229 - donorTotalGaveInPeriod(): dies if given an argument that is not recognized
ok 230 - donorTotalGaveInPeriod(): total for a donor with no period named succeeds...
ok 231 - donorTotalGaveInPeriod(): ...and returned value is correct.
ok 232 - donorTotalGaveInPeriod(): check for total with both start and end date succeeds...
ok 233 - donorTotalGaveInPeriod(): ...and returned value is correct.
ok 234 - donorTotalGaveInPeriod(): check for total with just a start date succeeds...
ok 235 - donorTotalGaveInPeriod(): ...and returned value is correct.
ok 236 - donorTotalGaveInPeriod(): check for total with just a end date succeeds...
ok 237 - donorTotalGaveInPeriod(): ...and returned value is correct.
2016-01-07 13:36:21 -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
97e772b89c Parallel hashes made no sense here.
Since the main index is size, no reason not to have a single hash that
is so-keyed, and have subhash with two keys for checklist and labels.
2016-01-07 12:42:51 -08:00
Bradley M. Kuhn
dd8d8cba37 Reverse shortened postal address printed.
Packers find that reversing the postal address makes people easier to
find when matching up labels.
2016-01-07 12:38:53 -08:00
Bradley M. Kuhn
a4fdb4ea99 Correct sorting to print by size.
Packers indicate that packing by size rather than any other method is
better.
2016-01-07 12:33:52 -08:00
Bradley M. Kuhn
ed6b1decb0 This should really be input to the script.
But changing it here for the moment.
2016-01-06 22:22:44 -08:00
Bradley M. Kuhn
dbea255aee Properly handle counting.
Fix an off-by-one error on the size counts and otherwise handle counting
well.
2016-01-06 21:46:58 -08:00
Bradley M. Kuhn
e35ee8b953 Script to calculate our renewal rate. 2016-01-03 14:14:04 -08:00
Bradley M. Kuhn
da75edccf2 Handle other donor info. 2016-01-03 13:17:00 -08:00
Bradley M. Kuhn
6d7bae7e02 Correct printout of email addresses for renewal. 2016-01-03 12:26:49 -08:00
Bradley M. Kuhn
d151b992c4 First past script to print t-shirt labels. 2016-01-02 11:21:17 -08:00
Bradley M. Kuhn
f985b1c1ef Modifications to the email notification. 2016-01-02 10:47:29 -08:00
Bradley M. Kuhn
a57ed11bd5 Additional verbosity that says what we did. 2016-01-02 10:47:22 -08:00
Bradley M. Kuhn
b85575c625 Don't warn, just print to STDERR with verbosity. 2016-01-02 10:47:09 -08:00
Bradley M. Kuhn
964755c3e3 This takes a hash as argument. 2016-01-02 10:36:35 -08:00
Bradley M. Kuhn
215ac05484 Fixed spelling on hash key. 2016-01-02 10:35:05 -08:00
Bradley M. Kuhn
2d52ce2cd1 Need to use Supporters! 2016-01-02 10:33:57 -08:00
Bradley M. Kuhn
09f25e9fc9 send-t-shirt.plx: First hack at it. 2016-01-02 10:33:35 -08:00
Bradley M. Kuhn
dcbc823f0b need $emailTo variable. 2015-12-31 02:24:32 -08:00
Bradley M. Kuhn
5e226a3483 Rename variable. 2015-12-31 02:24:26 -08:00
Bradley M. Kuhn
db43a3ed71 First draft of renewal-notices script. 2015-12-31 02:16:30 -08:00
Bradley M. Kuhn
f3b7ebc6e3 getEmailAddresses: tests and implementation. 2015-12-31 01:59:50 -08:00
Bradley M. Kuhn
4bd5ab4fd1 Wrote add-email-address.plx script. 2015-12-31 00:38:59 -08:00
Bradley M. Kuhn
8b233299c8 Properly use these strings. 2015-12-31 00:00:11 -08:00
Bradley M. Kuhn
8cc77b8dec mode change on file 2015-12-30 22:48:19 -08:00
Bradley M. Kuhn
a4eb7ac8ac First draft at add script. 2015-12-30 22:47:55 -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
a57415ff6d donorLastGave: initial implementation. 2015-12-30 19:01:03 -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
f57ac7d3f0 Remove dead code. 2015-12-30 18:13:30 -08:00
Bradley M. Kuhn
1c6441e135 setPublicAck: Implementation
ok 48 - setPublicAck: fails supporterId invalid
ok 49 - setPublicAck: fails supporterId is string
ok 50 - setPublicAck: fails supporterId is undef
ok 51 - setPublicAck: 1 failed calls changed nothing.
ok 52 - setPublicAck: 1 failed calls changed nothing.
ok 53 - setPublicAck: 1 failed calls changed nothing.
ok 54 - setPublicAck: lives when valid id is given for undefining...
ok 55 - setPublicAck: ...and suceeds in changing value.
ok 56 - setPublicAck: lives when valid id is given for off...
ok 57 - setPublicAck: ...and suceeds in changing value.
ok 58 - setPublicAck: lives when valid id is given for on...
ok 59 - setPublicAck: ...and suceeds in changing value.
2015-12-30 17:54:37 -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