Last active
October 15, 2019 10:11
-
-
Save MarcoNicolodi/03a166aa49e6999567bdeaa93c7370d6 to your computer and use it in GitHub Desktop.
Anemic domain model work better for functional style programming;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const acceptProposal => (id, db, bus, logger) => { | |
const proposal = db.get(id); | |
proposal.acceptedAt = moment.now(); | |
proposal.status = ACCEPTED; | |
db.save(proposal); | |
bus.send({ type: ACCEPTED, payload: proposal.id}); | |
logger.sucess("Proposal accepted"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment