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
// primary-care-api-billing/src/persistence/mongoose/Invoice/queries.js | |
// Set invoice status to BALANCED if paid | |
if( invoiceDoc.status === 'ISSUED' && invoiceDoc.balance.paid) { | |
invoiceDoc.status = 'BALANCED'; | |
} | |
// Save and return | |
console.trace(JSON.stringify(await invoiceDoc.save())) // eslint-disable-line no-console | |
return invoiceDoc |
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
-module (where2). | |
-export ([nub/1]). | |
-include_lib("eunit/include/eunit.hrl"). | |
% Specification for nub | |
-spec nub([T]) -> [T]. | |
% List comprehension solution | |
nub([H|T]) -> | |
[H] ++ nub([X || X <- T, X =/= H]); |