lml-main
Version:
This is now a mono repository published into many standalone packages.
102 lines • 3.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// import * as JobsReducer from '../../jobs/reducers'
// import * as JobsActions from '../../jobs/actions'
// import * as Action from 'action'
// import { CourierAssignmentsModel } from '../data/courier-assignments'
// import * as faker from 'faker'
exports.mkTestJob = (refId) => (Object.assign({
refId,
jobNumber: '',
readyAt: '',
pickupBy: '',
completeBy: '',
deleted: false,
customer: null,
instructions: '',
label: null,
manualAllocationOnly: false,
metadata: null,
vehicleType: '',
stops: [],
currentAllocation: null,
currentTag: null,
}));
// /**
// * see https://github.com/Marak/Faker.js
// */
// export const mkJobMetadata = (): JobsData.JobMetadataModel => ({
// accountManager: faker.random.uuid(),
// agent: {
// address: faker.address.city(),
// name: faker.name.firstName(),
// phone: faker.phone.phoneNumber(),
// },
// base: faker.random.uuid(),
// caller: faker.random.uuid(),
// department: faker.random.uuid(),
// fuelAllowance: faker.random.uuid(),
// items: faker.random.number(),
// pay: faker.random.uuid(),
// pinCode: faker.random.uuid(),
// prebooked: faker.random.boolean(),
// reference: faker.random.uuid(),
// service: {
// code: faker.random.uuid(),
// description: faker.random.uuid(),
// },
// units: faker.random.number(),
// vat: faker.random.uuid(),
// vehicle: {
// code: faker.random.uuid(),
// colour: faker.random.uuid(),
// description: faker.random.uuid(),
// group: {
// code: faker.random.uuid(),
// description: faker.random.uuid(),
// },
// inspectionDueDate: faker.random.uuid(),
// make: faker.random.uuid(),
// regoNumber: faker.random.uuid(),
// type: faker.random.uuid(),
// },
// weight: faker.random.uuid(),
// total: faker.random.uuid(),
// })
// export const mkTestCourierAssignments = (refIds: string[]): CourierAssignmentsModel => {
// const val: CourierAssignmentsModel = {}
// for (let i = 0; i < refIds.length; i++) {
// const id = refIds[i]
// val[id] = {
// callsign: `new-${id}`,
// courier: {
// refId: id,
// },
// }
// }
// return val
// }
// export const setAllocation = (job: JobsData.JobModel, courierRefId: string) => {
// job.currentAllocation = {
// refId: courierRefId,
// courier: {
// callSign: `old-${courierRefId}`,
// refId: courierRefId,
// },
// allocatedAt: '',
// type: '',
// }
// }
// export const setTag = (job: JobsData.JobModel, courierRefId: string) => {
// job.currentTag = {
// courier: {
// refId: courierRefId,
// },
// callSign: `old-${courierRefId}`,
// }
// }
// // export const setSMartMatches = (job: JobsData.JobModel, courierRefId: string) => {
// // job.smartMatches = [{ courierId: courierRefId, callsign: `old-${courierRefId}` }]
// // job.scrMatches = [courierRefId]
// // }
//# sourceMappingURL=mock-job.js.map