Commit graph

28 commits

Author SHA1 Message Date
Bradley M. Kuhn
c4668b81d6 addEmailAddress: supporter_email_address_mapping
Properly map email address to supporter when email address is added.

Test now passes:
   ok 12 - addSuporter: email address mapping is created on addSupporter() w/ email address included
2015-12-16 18:13:28 -08:00
Bradley M. Kuhn
3f3f8b7090 Did I have some other language on the brain?
$self is the standard name for the current object in Perl, of course. :)
2015-12-16 18:07:46 -08:00
Bradley M. Kuhn
6e10f76d5a Wrap addSupporter operations in transaction
All of the addSupporter must now succeed (including sub-operations like
addEmailAddress).

This causes one failing test to now pass:
   ok 55 - addSupporter: fails if email_address given but email cannot be inserted
2015-12-14 17:30:44 -08:00
Bradley M. Kuhn
2a374b957e Correct off-by-one error in counter.
The counter should be incremented/decremented after testing its value,
not before.
2015-12-14 17:20:17 -08:00
Bradley M. Kuhn
45570a5db0 Wrap dbh->begin_work & dbh->commit
I want to be able to nest begin_work()/commit() calls.  Years ago (in
the mid-1990s), when I did database programming, this is how we handled
this scenario.  I have no idea if there is now a "better way" to do
this, but some quick net searches found nothing that is recommended, but
I admittedly didn't search that hard.

This should work for our needs.
2015-12-14 17:16:35 -08:00
Bradley M. Kuhn
69945c2704 Implementation of getRequestConfigurations
A basic implementation of getRequestConfigurations and tests to go with
it.

Also added here is the test to verify that no items are added when
duplicates are included.
2015-12-13 14:06:22 -08:00
Bradley M. Kuhn
4331093cee Basic implementation of addRequestConfigurations
Adjusted one test slightly: there was a missing argument.  Also,
corrected test count.

While implementing, I realized a failure mode that forces a rollback:
duplication on the input list of configurations.  Tests are now needed
for that.
2015-12-13 13:37:52 -08:00
Bradley M. Kuhn
735db56d47 Begin implementation of addRequestConfigurations
Includes some modifications to reuse data from previous tests.
2015-12-13 13:04:27 -08:00
Bradley M. Kuhn
8fd03e8e6f Fail causes on getRequestConfigurations. 2015-12-13 12:50:08 -08:00
Bradley M. Kuhn
19d513280f addRequestType and getRequestType methods.
Including tests for both.
2015-12-13 12:16:14 -08:00
Bradley M. Kuhn
bf4d5d8b23 Fix number of arguments on _verifyId in prototype. 2015-12-13 12:15:50 -08:00
Bradley M. Kuhn
b34de3c1da Verify email address format with external module. 2015-12-11 18:32:59 -08:00
Bradley M. Kuhn
9e2359ed72 Test to verify addEmailAddress returns a valid id. 2015-12-11 18:23:24 -08:00
Bradley M. Kuhn
5b07fe6af9 Actual email address add code; tests stay same. 2015-12-11 18:19:25 -08:00
Bradley M. Kuhn
b1436e037e addEmailAddress: call addAddressType underneath
address_type is added automatically from the addEmailAddress call.
Since addAddressType does a lookup first, this should not cause
duplicates.
2015-12-09 19:56:22 -08:00
Bradley M. Kuhn
a3aafac44a addAddressType: initial implementation & unit test 2015-12-09 19:48:59 -08:00
Bradley M. Kuhn
b0d7639bc3 Remove stray use command, likely bad paste. 2015-12-09 19:37:36 -08:00
Bradley M. Kuhn
ba6843e21e Begin work on addEmailAddress method.
Basic stub and a few tests.
2015-12-09 19:17:46 -08:00
Bradley M. Kuhn
587144f03e _verifyId method: initial implementation.
Internal method for use to verify that an id we have really is in the
database.

For use before other operations.
2015-12-09 18:39:18 -08:00
Bradley M. Kuhn
de7b145ac3 Some documentation for existing methods. 2015-12-09 18:37:26 -08:00
Bradley M. Kuhn
03b1ac5436 Add local variables for Emacs. 2015-12-09 18:36:57 -08:00
Bradley M. Kuhn
70ad0b8b30 Initial basic support for creating a new Supporter.
This is incomplete as of yet, since it doesn't properly set up other
tables.
2015-12-09 15:44:05 -08:00
Bradley M. Kuhn
3d672d1f68 Correct arguments to method; add public_ack 2015-12-06 19:24:10 -08:00
Bradley M. Kuhn
fc22b9a3cc Begin writing addSupporter method.
ledger_entity_id is required.
2015-12-06 18:56:59 -08:00
Bradley M. Kuhn
fa52370f53 Initial creation code and tests. 2015-12-06 18:28:49 -08:00
Bradley M. Kuhn
99c637f167 This is already version 0.2 2015-12-06 17:27:25 -08:00
Bradley M. Kuhn
be753d5b3d Wrote basic documentation. 2015-12-06 17:27:13 -08:00
Bradley M. Kuhn
97df181a76 Generated stubs for Supporters module.
Generated this by running: h2xs -AXc -n Supporters
2015-12-06 17:20:14 -08:00