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
class Order { | |
public id: string; | |
// Used to keep track of new events for this aggregate | |
private _events: Event[] = []; | |
private version: number = -1; | |
private shippingAddress: Address; | |
private billingAddress: Address; | |
private items: Item[]; | |
private shippingMethod: string; |
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
// express http endpoint | |
app.get('/orders', (req, res) => { | |
res.send([ | |
{ | |
id: 'smallTotalOrderId', | |
status: 'shipped', | |
datePlaced: '2000-10-31T01:30:00.000Z', | |
total: '0.99', | |
}, | |
{ |