@ddd-ts-kit/scheduling 0.1.1 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +6 -6
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -29,9 +29,9 @@ and timeout (`schedule(work, delayMs)`); this one knows jobs, schedules and inst
29
29
  // src/contexts/billing/application/scheduling/send-payment-reminders.job.ts
30
30
  import { CommandBus, systemActor } from '@ddd-ts-kit/kernel';
31
31
  import { Scheduled, type JobExecution, type ScheduledJob } from '@ddd-ts-kit/kernel/declarations';
32
- import { SendPaymentReminders } from '@/contexts/billing/application/commands/send-payment-reminders/send-payment-reminders.command.js';
32
+ import { SendPaymentReminders } from '@/contexts/billing/application/commands/send-payment-reminders/send-payment-reminders.command';
33
33
 
34
- @Scheduled('billing.send-payment-reminders', { cron: '0 7 * * 1-5', timeZone: 'Europe/Paris' }, [CommandBus])
34
+ @Scheduled('billing.send-payment-reminders', { cron: '0 7 * * 1-5', timeZone: 'Europe/Paris' })
35
35
  export class SendPaymentRemindersJob implements ScheduledJob {
36
36
  constructor(private readonly commands: CommandBus) {}
37
37
 
@@ -47,10 +47,10 @@ export class SendPaymentRemindersJob implements ScheduledJob {
47
47
  - **The name** is `<context>.<job-name>`, in lower case, written as a string literal and unique
48
48
  in the application: it is the system actor the job runs as, the key of its lock, its label in
49
49
  the metrics and the key of its settings. It survives the renaming of the class.
50
- - **The dependency list** names the ports of the constructor parameters in order, and the
51
- compiler checks it, as for every declaration of the kit. A port is an abstract class, and the
52
- class is what is listed: `[CommandBus]`. A job receives buses and ports. It does not receive
53
- a repository: what it would do with one is a use case.
50
+ - **Its dependencies** are what its constructor takes, each parameter typed by a port, as for
51
+ every declaration of the kit: `constructor(private readonly commands: CommandBus) {}`, with
52
+ no list in the decorator. A job receives buses and ports. It does not receive a repository:
53
+ what it would do with one is a use case.
54
54
  - **`run(execution)`** receives:
55
55
 
56
56
  | Field | |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts-kit/scheduling",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Scheduled jobs that only trigger use cases: interval and cron schedules, one run across instances, no overlap, each run in its own execution scope.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@ddd-ts-kit/kernel": "0.1.1"
33
+ "@ddd-ts-kit/kernel": "0.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@ddd-ts-kit/testing": "0.1.1"
36
+ "@ddd-ts-kit/testing": "0.2.0"
37
37
  }
38
38
  }