@reventlessdev/reventless-gwt 1.0.0-alpha.243 → 1.0.0-alpha.245
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/package.json +5 -5
- package/src/Automation_GWT.res +100 -15
- package/src/Automation_GWT.res.mjs +94 -7
- package/src/Flow_GWT.res.mjs +1 -1
- package/tests/AutomationDeadlineGwtTest.res +2 -0
- package/tests/AutomationDeadlineGwtTest.res.mjs +25 -1
- package/tests/AutomationFromSliceGwtTest.res +3 -0
- package/tests/AutomationFromSliceGwtTest.res.mjs +31 -2
- package/tests/AutomationRescheduleGwtTest.res +264 -0
- package/tests/AutomationRescheduleGwtTest.res.mjs +723 -0
- package/tests/AutomationScheduleGwtTest.res +140 -0
- package/tests/AutomationScheduleGwtTest.res.mjs +356 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.0.0-alpha.245 (2026-10-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 1.0.0-alpha.244 (2026-10-16)
|
|
15
|
+
|
|
16
|
+
* feat!(automation): schedules set by events ([53bc436](https://github.com/ReventlessDev/reventless-core/commit/53bc4363dffce81ef36475728bf0dae704716021))
|
|
17
|
+
* feat!(automation): declared schedules tick an automation ([420acd2](https://github.com/ReventlessDev/reventless-core/commit/420acd2233aadf700141a31d9d3e0fdc8074bef7))
|
|
18
|
+
|
|
19
|
+
### BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
* a hand-written AutomationSlice.Mapping.Make the PPX does
|
|
22
|
+
not see must define `let reschedule = _ => []`.
|
|
23
|
+
* a hand-written AutomationSlice spec the PPX does not see must
|
|
24
|
+
declare `let schedule = None`.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# 1.0.0-alpha.243 (2026-10-15)
|
|
7
29
|
|
|
8
30
|
* feat!: an automation's process takes ~now, and collect the event's recorded time ([8c8f3f5](https://github.com/ReventlessDev/reventless-core/commit/8c8f3f570474b1658b605b726077debc7d6a1dc7))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-gwt",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.245",
|
|
4
4
|
"description": "Given-When-Then DSLs and test harness for Reventless slice testing",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"sury": "11.0.0",
|
|
17
17
|
"@reventlessdev/rescript-effect": "1.0.0-alpha.0",
|
|
18
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.295",
|
|
19
18
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.12",
|
|
20
19
|
"@reventlessdev/rescript-node": "2.0.0-alpha.22",
|
|
21
|
-
"@reventlessdev/reventless-
|
|
22
|
-
"@reventlessdev/reventless-
|
|
20
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.297",
|
|
21
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.194",
|
|
22
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.166"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"rescript": "12.3.1",
|
|
26
26
|
"sury-ppx": "11.0.0",
|
|
27
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
27
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.102"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"rescript": "^12.3.1"
|
package/src/Automation_GWT.res
CHANGED
|
@@ -237,6 +237,8 @@ module FromSlice = (
|
|
|
237
237
|
type scenario = {
|
|
238
238
|
todos: array<(string, Spec.todoItem)>,
|
|
239
239
|
commands: array<(string, Spec.command)>,
|
|
240
|
+
/** The slice's schedule rows after the events, by key. */
|
|
241
|
+
schedules: dict<AutomationSlice_Schedules.row>,
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
let encTodos = (arr: array<(string, Spec.todoItem)>) =>
|
|
@@ -309,18 +311,54 @@ module FromSlice = (
|
|
|
309
311
|
| (l, None) => l
|
|
310
312
|
}
|
|
311
313
|
)
|
|
312
|
-
let
|
|
313
|
-
events->Array.
|
|
314
|
+
let routeEach = (events: array<sourced>, context) =>
|
|
315
|
+
events->Array.map(e => (
|
|
316
|
+
e,
|
|
314
317
|
Route.route(
|
|
315
318
|
e.payload,
|
|
316
319
|
~sourceName=e.sourceName,
|
|
317
320
|
~sourceId=e.sourceId,
|
|
318
321
|
context->withRecordedAt(e.recordedAt),
|
|
322
|
+
),
|
|
323
|
+
))
|
|
324
|
+
let routeAll = (events: array<sourced>, context) =>
|
|
325
|
+
routeEach(events, context)->Array.flatMap(((_, routed)) => routed)
|
|
326
|
+
|
|
327
|
+
/** Folds the events' `reschedule` into the rows as the runtime does; a tick
|
|
328
|
+
removes the once-only schedule it fired. A time that cannot fire changes
|
|
329
|
+
nothing, as at run time. */
|
|
330
|
+
let foldSchedules = (
|
|
331
|
+
rows,
|
|
332
|
+
routedEvents: array<(sourced, array<AutomationSlice_Route.routed<Spec.todoItem>>)>,
|
|
333
|
+
~now,
|
|
334
|
+
) =>
|
|
335
|
+
routedEvents->Array.forEach(((e, routed)) => {
|
|
336
|
+
let recordedAt = e.recordedAt->Option.getOr(now)
|
|
337
|
+
routed->Array.forEach(r =>
|
|
338
|
+
r.rescheduled->Array.forEach(
|
|
339
|
+
change => {
|
|
340
|
+
let _ = rows->AutomationSlice_Schedules.apply(change, ~setBy="scenario", ~recordedAt)
|
|
341
|
+
},
|
|
342
|
+
)
|
|
319
343
|
)
|
|
320
|
-
|
|
344
|
+
if e.sourceName == Reventless.Clock.name {
|
|
345
|
+
rows->AutomationSlice_Schedules.fired(~key=e.sourceId)
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
// The declared time is in the rows before any event, as a deploy put it there.
|
|
350
|
+
let declaredRows = (~now) => {
|
|
351
|
+
let rows = Dict.make()
|
|
352
|
+
rows->AutomationSlice_Schedules.declare(Spec.schedule, ~now)
|
|
353
|
+
rows
|
|
354
|
+
}
|
|
321
355
|
/** Applies routed events as the runtime's to-do list does: the first writer of
|
|
322
356
|
an id wins, and a resolve completes only a row that already exists. */
|
|
323
|
-
let sweep = (
|
|
357
|
+
let sweep = (
|
|
358
|
+
routed: array<AutomationSlice_Route.routed<Spec.todoItem>>,
|
|
359
|
+
~now,
|
|
360
|
+
~schedules=declaredRows(~now),
|
|
361
|
+
) => {
|
|
324
362
|
let rows: array<(string, Spec.todoItem, ref<bool>)> = []
|
|
325
363
|
routed->Array.forEach(r => {
|
|
326
364
|
r.collected->Array.forEach(((id, item)) =>
|
|
@@ -338,16 +376,34 @@ module FromSlice = (
|
|
|
338
376
|
)
|
|
339
377
|
})
|
|
340
378
|
let todos = rows->Array.filterMap(((id, item, done)) => done.contents ? None : Some((id, item)))
|
|
341
|
-
{
|
|
379
|
+
{
|
|
380
|
+
todos,
|
|
381
|
+
commands: todos->Array.filterMap(((id, item)) => Automation.process(id, item, ~now)),
|
|
382
|
+
schedules,
|
|
383
|
+
}
|
|
342
384
|
}
|
|
343
|
-
let whenSweep = (events, ~context=testContext, ~now=?) =>
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
)
|
|
385
|
+
let whenSweep = (events, ~context=testContext, ~now=?) => {
|
|
386
|
+
let now = switch (now, latestRecorded(events)) {
|
|
387
|
+
| (Some(now), _) | (None, Some(now)) => now
|
|
388
|
+
| (None, None) => clockNow()
|
|
389
|
+
}
|
|
390
|
+
let routedEvents = routeEach(events, context)
|
|
391
|
+
let schedules = declaredRows(~now)
|
|
392
|
+
schedules->foldSchedules(routedEvents, ~now)
|
|
393
|
+
sweep(routedEvents->Array.flatMap(((_, routed)) => routed), ~now, ~schedules)
|
|
394
|
+
}
|
|
395
|
+
/** A tick from one of the slice's schedules, as the `Clock` source delivers it:
|
|
396
|
+
`key` defaults to the declared schedule's. */
|
|
397
|
+
let tick = (~key=Reventless.Clock.defaultKey, at) => {
|
|
398
|
+
sourceName: Reventless.Clock.name,
|
|
399
|
+
sourceId: key,
|
|
400
|
+
payload: Reventless.Clock.Tick({key, at})->Message.encode(Reventless.Clock.eventSchema),
|
|
401
|
+
recordedAt: Some(at),
|
|
402
|
+
}
|
|
403
|
+
/** The given events, then a tick at `at`, swept at `at`: what the slice does when its
|
|
404
|
+
schedule comes due. A tick delivered twice makes one item. */
|
|
405
|
+
let whenTick = (events, ~key=?, ~at, ~context=testContext) =>
|
|
406
|
+
whenSweep(events->Array.concat([tick(~key?, at)]), ~context, ~now=at)
|
|
351
407
|
let thenCommands = (scenario, expected) =>
|
|
352
408
|
scenario.commands == expected
|
|
353
409
|
? Outcome.pass
|
|
@@ -358,8 +414,37 @@ module FromSlice = (
|
|
|
358
414
|
}),
|
|
359
415
|
)
|
|
360
416
|
let andThenEvents = (scenario, events, ~context=testContext) => {
|
|
361
|
-
let
|
|
362
|
-
|
|
417
|
+
let routedEvents = routeEach(events, context)
|
|
418
|
+
let resolved =
|
|
419
|
+
routedEvents->Array.flatMap(((_, routed)) => routed)->Array.filterMap(r => r.resolved)
|
|
420
|
+
let schedules = scenario.schedules->Dict.copy
|
|
421
|
+
schedules->foldSchedules(routedEvents, ~now=latestRecorded(events)->Option.getOr(clockNow()))
|
|
422
|
+
{
|
|
423
|
+
...scenario,
|
|
424
|
+
todos: scenario.todos->Array.filter(((id, _)) => !(resolved->Array.includes(id))),
|
|
425
|
+
schedules,
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/** The slice's schedules after the scenario, by key: the declared time unless an
|
|
429
|
+
event replaced or cleared it, and every time an event set. An `After` an event
|
|
430
|
+
set is counted from when the event was recorded. */
|
|
431
|
+
let thenSchedules = (scenario, expected: array<(string, Reventless.Schedule.time)>) => {
|
|
432
|
+
let enc = ((key, time)) =>
|
|
433
|
+
JSON.Encode.object(
|
|
434
|
+
Dict.fromArray([
|
|
435
|
+
("key", key->JSON.Encode.string),
|
|
436
|
+
("time", time->Message.encode(Reventless.Schedule.timeSchema)),
|
|
437
|
+
]),
|
|
438
|
+
)
|
|
439
|
+
let byKey = rows => rows->Array.toSorted(((a, _), (b, _)) => String.compare(a, b))
|
|
440
|
+
let actual =
|
|
441
|
+
scenario.schedules
|
|
442
|
+
->Dict.valuesToArray
|
|
443
|
+
->Array.filterMap(row => row->AutomationSlice_Schedules.timeOf->Option.map(t => (row.key, t)))
|
|
444
|
+
->byKey
|
|
445
|
+
->Array.map(enc)
|
|
446
|
+
let expected = expected->byKey->Array.map(enc)
|
|
447
|
+
actual == expected ? Outcome.pass : Outcome.fail(QueryRowsMismatch({expected, actual}))
|
|
363
448
|
}
|
|
364
449
|
let thenScenarioTodos = (scenario, expected) => thenTodos(scenario.todos, expected)
|
|
365
450
|
}
|
|
@@ -4,12 +4,16 @@ import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
|
4
4
|
import * as Clock from "effect/Clock";
|
|
5
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Clock$Reventless from "@reventlessdev/reventless-spec/src/components/Clock.res.mjs";
|
|
7
8
|
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
8
9
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
10
|
+
import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
|
|
11
|
+
import * as Schedule$Reventless from "@reventlessdev/reventless-spec/src/types/Schedule.res.mjs";
|
|
9
12
|
import * as Outcome$ReventlessGwt from "./Outcome.res.mjs";
|
|
10
13
|
import * as JestBind$ReventlessGwt from "./JestBind.res.mjs";
|
|
11
14
|
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
12
15
|
import * as AutomationSlice_Route$ReventlessCore from "@reventlessdev/reventless-core/src/components/AutomationSlice/AutomationSlice_Route.res.mjs";
|
|
16
|
+
import * as AutomationSlice_Schedules$ReventlessCore from "@reventlessdev/reventless-core/src/components/AutomationSlice/AutomationSlice_Schedules.res.mjs";
|
|
13
17
|
|
|
14
18
|
function clockNow() {
|
|
15
19
|
return Effect.runSync(Clock.currentTimeMillis);
|
|
@@ -298,8 +302,32 @@ function FromSlice(Spec) {
|
|
|
298
302
|
return match;
|
|
299
303
|
}
|
|
300
304
|
});
|
|
301
|
-
let
|
|
302
|
-
|
|
305
|
+
let routeEach = (events, context) => events.map(e => [
|
|
306
|
+
e,
|
|
307
|
+
Route.route(e.payload, e.sourceName, e.sourceId, withRecordedAt(context, e.recordedAt))
|
|
308
|
+
]);
|
|
309
|
+
let routeAll = (events, context) => routeEach(events, context).flatMap(param => param[1]);
|
|
310
|
+
let foldSchedules = (rows, routedEvents, now) => {
|
|
311
|
+
routedEvents.forEach(param => {
|
|
312
|
+
let e = param[0];
|
|
313
|
+
let recordedAt = Stdlib_Option.getOr(e.recordedAt, now);
|
|
314
|
+
param[1].forEach(r => {
|
|
315
|
+
r.rescheduled.forEach(change => {
|
|
316
|
+
AutomationSlice_Schedules$ReventlessCore.apply(rows, change, "scenario", recordedAt);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
if (e.sourceName === Clock$Reventless.name) {
|
|
320
|
+
return AutomationSlice_Schedules$ReventlessCore.fired(rows, e.sourceId);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
let declaredRows = now => {
|
|
325
|
+
let rows = {};
|
|
326
|
+
AutomationSlice_Schedules$ReventlessCore.declare(rows, Spec.schedule, now);
|
|
327
|
+
return rows;
|
|
328
|
+
};
|
|
329
|
+
let sweep = (routed, now, schedulesOpt) => {
|
|
330
|
+
let schedules = schedulesOpt !== undefined ? schedulesOpt : declaredRows(now);
|
|
303
331
|
let rows = [];
|
|
304
332
|
routed.forEach(r => {
|
|
305
333
|
r.collected.forEach(param => {
|
|
@@ -336,15 +364,37 @@ function FromSlice(Spec) {
|
|
|
336
364
|
});
|
|
337
365
|
return {
|
|
338
366
|
todos: todos,
|
|
339
|
-
commands: Stdlib_Array.filterMap(todos, param => Automation.process(param[0], param[1], now))
|
|
367
|
+
commands: Stdlib_Array.filterMap(todos, param => Automation.process(param[0], param[1], now)),
|
|
368
|
+
schedules: schedules
|
|
340
369
|
};
|
|
341
370
|
};
|
|
342
371
|
let whenSweep = (events, contextOpt, now) => {
|
|
343
372
|
let context = contextOpt !== undefined ? contextOpt : testContext;
|
|
344
373
|
let match = latestRecorded(events);
|
|
345
|
-
|
|
374
|
+
let now$1 = now !== undefined ? now : (
|
|
346
375
|
match !== undefined ? match : Effect.runSync(Clock.currentTimeMillis)
|
|
347
|
-
)
|
|
376
|
+
);
|
|
377
|
+
let routedEvents = routeEach(events, context);
|
|
378
|
+
let schedules = declaredRows(now$1);
|
|
379
|
+
foldSchedules(schedules, routedEvents, now$1);
|
|
380
|
+
return sweep(routedEvents.flatMap(param => param[1]), now$1, schedules);
|
|
381
|
+
};
|
|
382
|
+
let tick = (keyOpt, at) => {
|
|
383
|
+
let key = keyOpt !== undefined ? keyOpt : Clock$Reventless.defaultKey;
|
|
384
|
+
return {
|
|
385
|
+
sourceName: Clock$Reventless.name,
|
|
386
|
+
sourceId: key,
|
|
387
|
+
payload: Message$ReventlessCore.encode({
|
|
388
|
+
TAG: "Tick",
|
|
389
|
+
key: key,
|
|
390
|
+
at: at
|
|
391
|
+
}, Clock$Reventless.eventSchema),
|
|
392
|
+
recordedAt: at
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
let whenTick = (events, key, at, contextOpt) => {
|
|
396
|
+
let context = contextOpt !== undefined ? contextOpt : testContext;
|
|
397
|
+
return whenSweep(events.concat([tick(key, at)]), context, at);
|
|
348
398
|
};
|
|
349
399
|
let thenCommands = (scenario, expected) => {
|
|
350
400
|
if (Primitive_object.equal(scenario.commands, expected)) {
|
|
@@ -359,12 +409,43 @@ function FromSlice(Spec) {
|
|
|
359
409
|
};
|
|
360
410
|
let andThenEvents = (scenario, events, contextOpt) => {
|
|
361
411
|
let context = contextOpt !== undefined ? contextOpt : testContext;
|
|
362
|
-
let
|
|
412
|
+
let routedEvents = routeEach(events, context);
|
|
413
|
+
let resolved = Stdlib_Array.filterMap(routedEvents.flatMap(param => param[1]), r => r.resolved);
|
|
414
|
+
let schedules = Object.assign({}, scenario.schedules);
|
|
415
|
+
foldSchedules(schedules, routedEvents, Stdlib_Option.getOr(latestRecorded(events), Effect.runSync(Clock.currentTimeMillis)));
|
|
363
416
|
return {
|
|
364
417
|
todos: scenario.todos.filter(param => !resolved.includes(param[0])),
|
|
365
|
-
commands: scenario.commands
|
|
418
|
+
commands: scenario.commands,
|
|
419
|
+
schedules: schedules
|
|
366
420
|
};
|
|
367
421
|
};
|
|
422
|
+
let thenSchedules = (scenario, expected) => {
|
|
423
|
+
let enc = param => Object.fromEntries([
|
|
424
|
+
[
|
|
425
|
+
"key",
|
|
426
|
+
param[0]
|
|
427
|
+
],
|
|
428
|
+
[
|
|
429
|
+
"time",
|
|
430
|
+
Message$ReventlessCore.encode(param[1], Schedule$Reventless.timeSchema)
|
|
431
|
+
]
|
|
432
|
+
]);
|
|
433
|
+
let byKey = rows => rows.toSorted((param, param$1) => Primitive_string.compare(param[0], param$1[0]));
|
|
434
|
+
let actual = byKey(Stdlib_Array.filterMap(Object.values(scenario.schedules), row => Stdlib_Option.map(AutomationSlice_Schedules$ReventlessCore.timeOf(row), t => [
|
|
435
|
+
row.key,
|
|
436
|
+
t
|
|
437
|
+
]))).map(enc);
|
|
438
|
+
let expected$1 = byKey(expected).map(enc);
|
|
439
|
+
if (Primitive_object.equal(actual, expected$1)) {
|
|
440
|
+
return Outcome$ReventlessGwt.pass;
|
|
441
|
+
} else {
|
|
442
|
+
return Outcome$ReventlessGwt.fail({
|
|
443
|
+
TAG: "QueryRowsMismatch",
|
|
444
|
+
expected: expected$1,
|
|
445
|
+
actual: actual
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
};
|
|
368
449
|
let thenScenarioTodos = (scenario, expected) => thenTodos(scenario.todos, expected);
|
|
369
450
|
return {
|
|
370
451
|
Route: Route,
|
|
@@ -385,11 +466,17 @@ function FromSlice(Spec) {
|
|
|
385
466
|
givenEvents: givenEvents,
|
|
386
467
|
atTime: atTime,
|
|
387
468
|
latestRecorded: latestRecorded,
|
|
469
|
+
routeEach: routeEach,
|
|
388
470
|
routeAll: routeAll,
|
|
471
|
+
foldSchedules: foldSchedules,
|
|
472
|
+
declaredRows: declaredRows,
|
|
389
473
|
sweep: sweep,
|
|
390
474
|
whenSweep: whenSweep,
|
|
475
|
+
tick: tick,
|
|
476
|
+
whenTick: whenTick,
|
|
391
477
|
thenCommands: thenCommands,
|
|
392
478
|
andThenEvents: andThenEvents,
|
|
479
|
+
thenSchedules: thenSchedules,
|
|
393
480
|
thenScenarioTodos: thenScenarioTodos
|
|
394
481
|
};
|
|
395
482
|
};
|
package/src/Flow_GWT.res.mjs
CHANGED
|
@@ -525,7 +525,7 @@ function AutomationSlice(Spec) {
|
|
|
525
525
|
let whenReacts = async flowP => {
|
|
526
526
|
let s = await flowP;
|
|
527
527
|
let routed = s.log.flatMap(entry => Stdlib_Array.filterMap(A.Route.dispatches, d => d.handle(entry.json, Stdlib_Option.getOr(entry.aggregateId, ""), A.testContext)));
|
|
528
|
-
let match = A.sweep(routed, Automation_GWT$ReventlessGwt.clockNow());
|
|
528
|
+
let match = A.sweep(routed, Automation_GWT$ReventlessGwt.clockNow(), undefined);
|
|
529
529
|
return {
|
|
530
530
|
log: s.log,
|
|
531
531
|
outcome: s.outcome,
|
|
@@ -16,6 +16,7 @@ module CancelUnshipped = {
|
|
|
16
16
|
let maxRetries = 3
|
|
17
17
|
let heartbeatInterval = 60
|
|
18
18
|
let targetName = "Order"
|
|
19
|
+
let schedule = None
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
let day = 24. *. 60. *. 60. *. 1000.
|
|
@@ -51,6 +52,7 @@ module CancelUnshipped_Automation = {
|
|
|
51
52
|
| Orders.OrderShipped({orderId}) => Some(orderId)
|
|
52
53
|
| OrderPlaced(_) => None
|
|
53
54
|
}
|
|
55
|
+
let reschedule = _ => []
|
|
54
56
|
},
|
|
55
57
|
)
|
|
56
58
|
|
|
@@ -33,6 +33,7 @@ let CancelUnshipped = {
|
|
|
33
33
|
maxRetries: 3,
|
|
34
34
|
heartbeatInterval: 60,
|
|
35
35
|
targetName: "Order",
|
|
36
|
+
schedule: undefined,
|
|
36
37
|
authorizationOf: authorizationOf,
|
|
37
38
|
commandTransition: commandTransition,
|
|
38
39
|
traits: traits
|
|
@@ -91,13 +92,18 @@ function resolve(event) {
|
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
|
|
95
|
+
function reschedule(param) {
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
let FromOrders = AutomationSlice$Reventless.Mapping.Make({
|
|
95
100
|
Id: Id$Reventless.$$String,
|
|
96
101
|
name: name,
|
|
97
102
|
eventSchema: eventSchema
|
|
98
103
|
})(CancelUnshipped)({
|
|
99
104
|
collect: collect,
|
|
100
|
-
resolve: resolve
|
|
105
|
+
resolve: resolve,
|
|
106
|
+
reschedule: reschedule
|
|
101
107
|
});
|
|
102
108
|
|
|
103
109
|
let mappings = [FromOrders];
|
|
@@ -225,12 +231,24 @@ let thenNoCommand = include.thenNoCommand;
|
|
|
225
231
|
|
|
226
232
|
let latestRecorded = include.latestRecorded;
|
|
227
233
|
|
|
234
|
+
let routeEach = include.routeEach;
|
|
235
|
+
|
|
228
236
|
let routeAll = include.routeAll;
|
|
229
237
|
|
|
238
|
+
let foldSchedules = include.foldSchedules;
|
|
239
|
+
|
|
240
|
+
let declaredRows = include.declaredRows;
|
|
241
|
+
|
|
230
242
|
let sweep = include.sweep;
|
|
231
243
|
|
|
244
|
+
let tick = include.tick;
|
|
245
|
+
|
|
246
|
+
let whenTick = include.whenTick;
|
|
247
|
+
|
|
232
248
|
let andThenEvents = include.andThenEvents;
|
|
233
249
|
|
|
250
|
+
let thenSchedules = include.thenSchedules;
|
|
251
|
+
|
|
234
252
|
let thenScenarioTodos = include.thenScenarioTodos;
|
|
235
253
|
|
|
236
254
|
export {
|
|
@@ -256,11 +274,17 @@ export {
|
|
|
256
274
|
givenEvents,
|
|
257
275
|
atTime,
|
|
258
276
|
latestRecorded,
|
|
277
|
+
routeEach,
|
|
259
278
|
routeAll,
|
|
279
|
+
foldSchedules,
|
|
280
|
+
declaredRows,
|
|
260
281
|
sweep,
|
|
261
282
|
whenSweep,
|
|
283
|
+
tick,
|
|
284
|
+
whenTick,
|
|
262
285
|
thenCommands,
|
|
263
286
|
andThenEvents,
|
|
287
|
+
thenSchedules,
|
|
264
288
|
thenScenarioTodos,
|
|
265
289
|
O,
|
|
266
290
|
}
|
|
@@ -18,6 +18,7 @@ module ShipPaid = {
|
|
|
18
18
|
let maxRetries = 3
|
|
19
19
|
let heartbeatInterval = 60
|
|
20
20
|
let targetName = "Order"
|
|
21
|
+
let schedule = None
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
module ShipPaid_Automation = {
|
|
@@ -57,6 +58,7 @@ module ShipPaid_Automation = {
|
|
|
57
58
|
| Orders.OrderCancelled({orderId}) => Some(orderId)
|
|
58
59
|
| OrderPlaced(_) => None
|
|
59
60
|
}
|
|
61
|
+
let reschedule = _ => []
|
|
60
62
|
},
|
|
61
63
|
)
|
|
62
64
|
|
|
@@ -74,6 +76,7 @@ module ShipPaid_Automation = {
|
|
|
74
76
|
| Payments.Refunded(_) => None
|
|
75
77
|
| Captured(_) => None
|
|
76
78
|
}
|
|
79
|
+
let reschedule = _ => []
|
|
77
80
|
},
|
|
78
81
|
)
|
|
79
82
|
|
|
@@ -38,6 +38,7 @@ let ShipPaid = {
|
|
|
38
38
|
maxRetries: 3,
|
|
39
39
|
heartbeatInterval: 60,
|
|
40
40
|
targetName: "Order",
|
|
41
|
+
schedule: undefined,
|
|
41
42
|
authorizationOf: authorizationOf,
|
|
42
43
|
commandTransition: commandTransition,
|
|
43
44
|
traits: traits
|
|
@@ -106,13 +107,18 @@ function resolve(event) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
function reschedule(param) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
|
|
109
114
|
let FromOrders = AutomationSlice$Reventless.Mapping.Make({
|
|
110
115
|
Id: Id$Reventless.$$String,
|
|
111
116
|
name: name,
|
|
112
117
|
eventSchema: eventSchema
|
|
113
118
|
})(ShipPaid)({
|
|
114
119
|
collect: collect,
|
|
115
|
-
resolve: resolve
|
|
120
|
+
resolve: resolve,
|
|
121
|
+
reschedule: reschedule
|
|
116
122
|
});
|
|
117
123
|
|
|
118
124
|
function collect$1(event, sourceId, _ctx) {
|
|
@@ -132,13 +138,18 @@ function resolve$1(event) {
|
|
|
132
138
|
|
|
133
139
|
}
|
|
134
140
|
|
|
141
|
+
function reschedule$1(param) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
|
|
135
145
|
let FromPayments = AutomationSlice$Reventless.Mapping.Make({
|
|
136
146
|
Id: Id$Reventless.$$String,
|
|
137
147
|
name: name$1,
|
|
138
148
|
eventSchema: eventSchema$1
|
|
139
149
|
})(ShipPaid)({
|
|
140
150
|
collect: collect$1,
|
|
141
|
-
resolve: resolve$1
|
|
151
|
+
resolve: resolve$1,
|
|
152
|
+
reschedule: reschedule$1
|
|
142
153
|
});
|
|
143
154
|
|
|
144
155
|
let mappings = [
|
|
@@ -325,10 +336,22 @@ let atTime = include.atTime;
|
|
|
325
336
|
|
|
326
337
|
let latestRecorded = include.latestRecorded;
|
|
327
338
|
|
|
339
|
+
let routeEach = include.routeEach;
|
|
340
|
+
|
|
328
341
|
let routeAll = include.routeAll;
|
|
329
342
|
|
|
343
|
+
let foldSchedules = include.foldSchedules;
|
|
344
|
+
|
|
345
|
+
let declaredRows = include.declaredRows;
|
|
346
|
+
|
|
330
347
|
let sweep = include.sweep;
|
|
331
348
|
|
|
349
|
+
let tick = include.tick;
|
|
350
|
+
|
|
351
|
+
let whenTick = include.whenTick;
|
|
352
|
+
|
|
353
|
+
let thenSchedules = include.thenSchedules;
|
|
354
|
+
|
|
332
355
|
export {
|
|
333
356
|
ShipPaid,
|
|
334
357
|
ShipPaid_Automation,
|
|
@@ -350,11 +373,17 @@ export {
|
|
|
350
373
|
givenEvents,
|
|
351
374
|
atTime,
|
|
352
375
|
latestRecorded,
|
|
376
|
+
routeEach,
|
|
353
377
|
routeAll,
|
|
378
|
+
foldSchedules,
|
|
379
|
+
declaredRows,
|
|
354
380
|
sweep,
|
|
355
381
|
whenSweep,
|
|
382
|
+
tick,
|
|
383
|
+
whenTick,
|
|
356
384
|
thenCommands,
|
|
357
385
|
andThenEvents,
|
|
386
|
+
thenSchedules,
|
|
358
387
|
thenScenarioTodos,
|
|
359
388
|
O,
|
|
360
389
|
P,
|