lml-main
Version:
This is now a mono repository published into many standalone packages.
52 lines • 1.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var moment = require("moment");
var faker_1 = require("faker");
exports.mockCourierAction = function (courierRefId, jobRefId, type, stopType) {
if (type === void 0) { type = 'ACCEPTED'; }
if (stopType === void 0) { stopType = 'collection'; }
switch (type) {
case 'STOP_MADE':
return {
type: type,
timestamp: moment().toISOString(),
courier: {
refId: courierRefId || faker_1.random.uuid(),
},
job: {
refId: jobRefId || faker_1.random.uuid(),
},
stop: {
refId: faker_1.random.uuid(),
type: stopType,
}
};
case 'ARRIVED_AT':
return {
type: type,
timestamp: moment().toISOString(),
courier: {
refId: courierRefId || faker_1.random.uuid(),
},
job: {
refId: jobRefId || faker_1.random.uuid(),
},
stop: {
refId: faker_1.random.uuid(),
type: stopType,
}
};
case 'ACCEPTED':
return {
type: type,
timestamp: moment().toISOString(),
courier: {
refId: courierRefId || faker_1.random.uuid(),
},
job: {
refId: jobRefId || faker_1.random.uuid(),
}
};
}
};
//# sourceMappingURL=courier-action.js.map