I accidentally changed id=>after when prototyping data for the _new_
deferred rating (not yet written). There were no tests for this code, which
was originally written in July of 2012 (see private lovullo.git repo), so it
was not caught until QA.
This only replaces the callbacks at the highest level and starts to move
toward proper error handling. The private methods do not yet properly
propagate errors.
This adds ratedata to the quote collection. We use the existing saveQuote
method so that this operation is atomic. We're also continuing to save to
the bucket for now so as not to break existing code, but the intent in the
future will be to remove all but necessary data that should be exposed to
the client.
This also gets rid of the RatingServiceStub module, which is not used by
anything else. I suspect that I originally added it to be shared by traits,
but that's no longer going to be the case (and the only remaining trait is
unfortunately untested atm, and will be going away).
This was an adventure, and was also used as a peer programming exercise to
introduce TypeScript to other programmers in the office.
This class has far too many dependencies, which made this difficult. The
approach was to create .d.ts files for dependencies and wait on moving those
over for now, otherwise the task will never get done.
The RatingServicePublic trait was left as such for the time being; I was
able to work around a bug that was making it difficult to mix it into a
prototype.
There were no logic changes; this was just type refactoring.
This changes the easejs interface for DataApi, which requires adding the
param to everything. The TS interface was created in a previous commit and
already contained this parameter. The idea is to remove the easejs
interface in the future, but traits are a barrier to that atm.
DocumentServer and controller demonstrate the mess that we have with regards
to instantiating dependencies. This needs to change---DocumentServer itself
was something that was started but never fully realized. It makes this
incredibly confusing, difficult to follow, and complicates important error
handling that ought to be taking place. It also discourages implementing
additional dependencies.
I'm not going to go through and provide a ChangeLog-style commit message for
this commit. I'm too exhausted by this crap.
If the submission failed, we probably want to try again next time around.
* src/server/service/RatingServiceSubmitNotify.js
(_maybeNotify): Extract logic from `#postProcessRaterData'. Only set
notification flag in absence of dapi error.
(postProcessRaterData): Use it.
* test/server/service/RatingServiceSubmitNotifyTest.js: Update tests
accordingly.
* src/server/db/MongoServerDao.js
(getDocumentField,setDocumentField): New methods.
* src/server/service/RatingServiceSubmitNotify.js
(postProcessRaterData): Only notify when notification flag is not set.
(_getNotifyState, _setNotified): New methods.
* test/server/service/RatingServiceSubmitNotifyTest.js: Modify accordingly.