Skip to content

Commit a3a476f

Browse files
committed
test create event
1 parent 43236b2 commit a3a476f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/domain/order.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ export async function returnShipment (order) {
830830
}
831831

832832
export function accountOrder (req, res) {}
833-
1
833+
834834
/**
835835
* @type {undoFunction}
836836
* Start process to return canceled order items to inventory.
@@ -947,8 +947,8 @@ export async function customHttpStatus (data) {
947947
}
948948

949949
export async function testContainsMany (data) {
950-
this.chat()
951-
return { status: 'ok' }
950+
console.log({ fn: testContainsMany.name, data })
951+
return { status: '👍', inventory: await this.inventory() }
952952
}
953953

954954
function fibonacci (x) {
@@ -977,3 +977,15 @@ export async function getFieldList () {
977977
console.log({ model: model[0] })
978978
return Object.keys(model[0])
979979
}
980+
981+
export async function createModelEvent () {
982+
return new Promise(resolve => {
983+
this.emit('createModel_ORDER', {
984+
cb: model => resolve(model),
985+
args: {
986+
a: 1,
987+
b: 2
988+
}
989+
})
990+
})
991+
}

src/domain/ports.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export {
77
customHttpStatus,
88
testContainsMany,
99
runFibonacciJs,
10-
getFieldList
10+
getFieldList,
11+
createModelEvent
1112
} from './order'
1213

1314
export { runFibonacciCust, doesFieldExist } from './customer'

0 commit comments

Comments
 (0)