Comparing version 0.1.0 to 0.1.2
@@ -159,3 +159,3 @@ 'use strict'; | ||
callback(err, body.person) | ||
callback(err, body) | ||
}.bind(this)) | ||
@@ -179,3 +179,5 @@ }.bind(this)) | ||
F1Register.prototype.registerPerson = function(registration, person, callback) { | ||
callback(null, util.format('Registered %j', registration)) | ||
var msg = util.format('Registered %j', registration) | ||
debug(msg) | ||
callback(null, msg) | ||
} | ||
@@ -194,5 +196,10 @@ | ||
this.createPerson(registration, function(err, person) { | ||
callback(err, registration, person) | ||
if (err) return callback(err) | ||
debug('New person `%s %s` created at id %s', registration.Name.First, | ||
registration.Name.Last, person.person['@id']) | ||
callback(null, registration, person) | ||
}) | ||
} else { | ||
debug('Person found') | ||
callback(null, registration, person) | ||
@@ -203,5 +210,6 @@ } | ||
F1Register.prototype.handleDuplicateRecords = function(body, callback) { | ||
if (Number(body.results['@count']) > 1) | ||
if (Number(body.results['@count']) > 1) { | ||
debug('Found returned duplicate records - registration will need to be handled manually') | ||
callback('Found returned duplicate records - registration will need to be handled manually') | ||
else | ||
} else | ||
callback(null, body) | ||
@@ -208,0 +216,0 @@ } |
{ | ||
"name": "f1foo", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "An integration between Wufoo's WebHooks and Fellowship One's REST API.", | ||
@@ -31,4 +31,4 @@ "keywords": [ | ||
"express": "~4.11.2", | ||
"fellowshipone": "~0.2.3", | ||
"lodash": "~3.0.1", | ||
"fellowshipone": "~0.2.7", | ||
"lodash": "~3.1.0", | ||
"morgan": "~1.5.1", | ||
@@ -48,3 +48,3 @@ "passport": "~0.2.1", | ||
"passport-anonymous": "~1.0.1", | ||
"should": "~4.6.3", | ||
"should": "~4.6.5", | ||
"sinon": "~1.12.2", | ||
@@ -54,4 +54,4 @@ "supertest": "~0.15.0" | ||
"optionalDependencies": { | ||
"newrelic": "^1.15.1" | ||
"newrelic": "^1.16.1" | ||
} | ||
} |
@@ -17,12 +17,2 @@ [![Build Status][travis-image]][travis-url] | ||
## Features | ||
- [x] Accepts POSTs from Wufoo webhooks, supports Handshake Key | ||
- [ ] auto-matching for existing Person records | ||
- when there's more than 1 record which matches first/last/e-mail, either do nothing, | ||
or notify someone (by e-mail?) | ||
- [ ] for non-existing Person records, either: | ||
- create a new record automatically from provided info, need to be able to (from the form, perhaps a hidden field) say whether the person is an event-only attendee or something else (newcomer? visitor? attendee?) | ||
- don't create a new record but notify someone by e-mail so they can optionally create a record manually for this person (?) | ||
## Installation | ||
@@ -29,0 +19,0 @@ |
@@ -283,3 +283,5 @@ 'use strict'; | ||
it('creates new person record when person is null', function(done) { | ||
_f1reg.expects('createPerson').yields() | ||
_f1reg.expects('createPerson').yields(null, { | ||
person: person | ||
}) | ||
@@ -475,3 +477,5 @@ f1reg.ensureCreated(sub, null, function(err, reg, person) { | ||
should(err).not.exist | ||
result.should.eql(person) | ||
result.should.eql({ | ||
person: person | ||
}) | ||
@@ -478,0 +482,0 @@ verifyAll() |
1423
52078
173
+ Addedlodash@3.1.0(transitive)
- Removedlodash@3.0.1(transitive)
Updatedfellowshipone@~0.2.7
Updatedlodash@~3.1.0