create-erxes 0.1.7 → 0.1.9
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/dist/index.js +1 -1
- package/dist/templates/base/.agents/skills/ui-patterns/SKILL.md +20 -7
- package/dist/templates/base/api/AGENTS.md +12 -0
- package/dist/templates/base/api/package.json +2 -2
- package/dist/templates/base/api/src/__tests__/server.test.ts +11 -0
- package/dist/templates/base/api/src/core.ts +5 -2
- package/dist/templates/base/api/src/jobs.ts +40 -0
- package/dist/templates/base/api/src/server.ts +22 -1
- package/dist/templates/base/package.json +1 -1
- package/dist/templates/base/tools/check-rls.sql +2 -1
- package/dist/templates/base/ui/AGENTS.md +3 -0
- package/dist/templates/base/ui/package.json +2 -2
- package/dist/templates/migrate/.agents/skills/plugin-migrate/SKILL.md +65 -20
- package/dist/templates/migrate/DECISIONS.md +8 -0
- package/dist/templates/migrate/migration/core-map.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { mkdir, readFile, readdir, symlink, writeFile } from "node:fs/promises";
|
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
// package.json
|
|
12
|
-
var version = "0.1.
|
|
12
|
+
var version = "0.1.9";
|
|
13
13
|
// src/existing-plugins.ts
|
|
14
14
|
/** The old erxes plugins a new-core plugin can be migrated from (`backend/plugins/<name>_api`). */
|
|
15
15
|
const OLD_PLUGINS = [
|
|
@@ -10,6 +10,9 @@ reference: `contacts/customers` and `products` for lists and records,
|
|
|
10
10
|
built only from what plugins can import. When a page has to differ, say why in
|
|
11
11
|
a comment.
|
|
12
12
|
|
|
13
|
+
Read `ui/node_modules/erxes-ui/CATALOG.md` before writing a component: it lists
|
|
14
|
+
what erxes-ui already has, and the screen each kind of page copies.
|
|
15
|
+
|
|
13
16
|
## Page
|
|
14
17
|
|
|
15
18
|
- `PageContainer`, then `PageHeader`. `PageHeader.Start` holds the breadcrumb:
|
|
@@ -76,6 +79,15 @@ gives it its fields, and `api/src/modules/items/itemFilter.ts` applies them.
|
|
|
76
79
|
(the draft). `contacts`, given an id, gives the record's customers and companies as
|
|
77
80
|
query options, so other plugins' relation tabs show on it; `activity` names
|
|
78
81
|
a manifest `timelines` type for core's Activity tab.
|
|
82
|
+
- Every record type has an Activity tab, as customers do: declare the type in
|
|
83
|
+
the manifest's `timelines`, set `activity`, and publish what happens to the
|
|
84
|
+
record (created, changed fields, moved, assigned) as events with
|
|
85
|
+
core's core_publish_event SQL function in the change's transaction: a `summary`, a flat
|
|
86
|
+
payload, `entityType` (that `timelines` type) and `entityId` (the record's
|
|
87
|
+
id). Core puts each on the record's Activity tab, styled by the manifest's
|
|
88
|
+
`activityTypes`; `activities.create` is only for entries that are not
|
|
89
|
+
events. Notes come from core's tab itself. The panel opens on Detail; the record's own page opens on Activity, with
|
|
90
|
+
Detail beside it.
|
|
79
91
|
- Each slot gets `contentType` and `contentId` and reads the record itself; the
|
|
80
92
|
slots share one query (`ui/src/modules/items/ItemPanel.tsx`). The Detail
|
|
81
93
|
tab is `PanelSection`s of `PanelField` rows. Never an erxes-ui `Sheet`, a
|
|
@@ -84,13 +96,14 @@ gives it its fields, and `api/src/modules/items/itemFilter.ts` applies them.
|
|
|
84
96
|
draft with `openNew(contentType, defaults)`. `detailPath(id)` is a route of
|
|
85
97
|
the plugin's that renders `<RecordPage contentType contentId />`
|
|
86
98
|
(`ui/src/__Pascal__.tsx`): the expanded record.
|
|
87
|
-
- A plugin whose records belong to customers or companies lists them on
|
|
88
|
-
|
|
89
|
-
The component gets the host record
|
|
90
|
-
a record clicked there opens with
|
|
91
|
-
|
|
92
|
-
plugin
|
|
93
|
-
|
|
99
|
+
- A plugin whose records belong to customers or companies lists them on those
|
|
100
|
+
customers' and companies' panels with `CONFIG.relationTabs`:
|
|
101
|
+
`{ name, title, icon, hosts?, component }`. The component gets the host record
|
|
102
|
+
and its `customerIds` and `companyIds`; a record clicked there opens with
|
|
103
|
+
`useOpenRecord().open` on top in the same panel, and Back returns. Another
|
|
104
|
+
plugin's record (an order, a task) shows the tab only when `hosts` names its
|
|
105
|
+
type and the type gives `contacts`: name it only when a member working on that
|
|
106
|
+
record needs the list, never by default.
|
|
94
107
|
|
|
95
108
|
## Forms
|
|
96
109
|
|
|
@@ -17,6 +17,18 @@ Node 26 runs the TypeScript directly; imports carry `.ts` and `#/` is `src/`.
|
|
|
17
17
|
no org filter; only an insert sets `orgId`, from `context.member`.
|
|
18
18
|
- Call core (`core.forOrg(orgId)...`) outside `context.tx`; a failed core call
|
|
19
19
|
must not roll back the plugin's own change.
|
|
20
|
+
- What happens to a record is an event: publish it with core's core_publish_event SQL function
|
|
21
|
+
in `context.tx`, so it commits with the change, with a `summary`,
|
|
22
|
+
a flat payload, `entityType` (a type in the manifest's `timelines`) and
|
|
23
|
+
`entityId`. It appears on the record's Activity tab, and on the customer's or
|
|
24
|
+
company's too when it names `subjectType` and `subjectId`. A retried event
|
|
25
|
+
adds nothing. `activities.create` is for entries that are not events.
|
|
26
|
+
- Background work is a job in `src/jobs.ts`, which the manifest declares
|
|
27
|
+
(`jobs`, with an optional `cron` in UTC and `retry`). Queue one inside the
|
|
28
|
+
change that needs it, `enqueueJob(context.tx, { orgId, name, payload })` from
|
|
29
|
+
`@erxes/plugin-sdk`, so it exists only if the change commits. Core POSTs it
|
|
30
|
+
to `/api/jobs/<name>`, which `src/server.ts` checks with `verifyCoreJob`, and
|
|
31
|
+
retries until it answers 2xx. A job may run twice: key its effect by `jobId`.
|
|
20
32
|
- Tests: `vite-plus/test`, run with `call(procedure, input, { context: { member } })`.
|
|
21
33
|
`src/test/setup.ts` gives each file its own database, owned by a role without
|
|
22
34
|
BYPASSRLS, so row-level security is real in tests.
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"db:check": "drizzle-kit check"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@erxes/core-contract": "0.1.0-v2.
|
|
25
|
-
"@erxes/plugin-sdk": "0.1.0-v2.
|
|
24
|
+
"@erxes/core-contract": "0.1.0-v2.7",
|
|
25
|
+
"@erxes/plugin-sdk": "0.1.0-v2.6",
|
|
26
26
|
"@opentelemetry/instrumentation-express": "^0.73.0",
|
|
27
27
|
"@opentelemetry/instrumentation-http": "^0.301.1",
|
|
28
28
|
"@opentelemetry/instrumentation-pg": "^0.78.0",
|
|
@@ -35,6 +35,17 @@ describe('server', () => {
|
|
|
35
35
|
).toBe(401);
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
it("refuses a job without core's token", async () => {
|
|
39
|
+
const job = { jobId: 'j1', orgId: 'o1', name: 'items.count', attempt: 1, payload: {} };
|
|
40
|
+
|
|
41
|
+
const response = await fetch(`${base}/api/jobs/items.count`, {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
body: JSON.stringify(job),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(response.status).toBe(401);
|
|
47
|
+
});
|
|
48
|
+
|
|
38
49
|
it('lets web call it from the browser', async () => {
|
|
39
50
|
const response = await fetch(`${base}/api/rpc/items/list`, {
|
|
40
51
|
method: 'OPTIONS',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PluginManifest } from '@erxes/core-contract';
|
|
2
2
|
import { createCoreClient } from '@erxes/plugin-sdk';
|
|
3
3
|
import { config, PLUGIN } from '#/config.ts';
|
|
4
|
+
import { manifestJobs } from '#/jobs.ts';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Core, called as this plugin: `core.forOrg(orgId).customers.get({ id })`.
|
|
@@ -20,8 +21,9 @@ export const PERMISSIONS = {
|
|
|
20
21
|
} as const;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* What the plugin adds to core, sent on every start.
|
|
24
|
-
* starts with `__id__
|
|
24
|
+
* What the plugin adds to core, sent on every start. Every permission,
|
|
25
|
+
* event and kind it names starts with `__id__.`; job names are its own.
|
|
26
|
+
* A new scope waits for the owner's approval.
|
|
25
27
|
*/
|
|
26
28
|
export const manifest = {
|
|
27
29
|
title: '__title__',
|
|
@@ -34,4 +36,5 @@ export const manifest = {
|
|
|
34
36
|
{ action: PERMISSIONS.view, label: 'View items', group: '__title__' },
|
|
35
37
|
{ action: PERMISSIONS.manage, label: 'Create and change items', group: '__title__' },
|
|
36
38
|
],
|
|
39
|
+
jobs: manifestJobs,
|
|
37
40
|
} satisfies PluginManifest;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PluginJobDelivery } from '@erxes/core-contract';
|
|
2
|
+
import { withOrg } from '#/db/client.ts';
|
|
3
|
+
import { items } from '#/db/schema.ts';
|
|
4
|
+
import { logger } from '#/logger.ts';
|
|
5
|
+
|
|
6
|
+
interface Job {
|
|
7
|
+
/** A cron schedule in UTC: core runs the job for each organisation that has the plugin. */
|
|
8
|
+
cron?: string;
|
|
9
|
+
/** Throws to retry. A job can run more than once, so make it safe to repeat. */
|
|
10
|
+
run: (job: PluginJobDelivery) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The plugin's jobs, by name. Core POSTs each to `/api/jobs/<name>` and
|
|
15
|
+
* retries until it answers 2xx. Queue one in a procedure's transaction:
|
|
16
|
+
* `await enqueueJob(context.tx, { orgId, name: 'items.count', payload: {} })`.
|
|
17
|
+
*/
|
|
18
|
+
const JOBS: Record<string, Job> = {
|
|
19
|
+
'items.count': {
|
|
20
|
+
cron: '0 3 * * *',
|
|
21
|
+
run: async (job) => {
|
|
22
|
+
const count = await withOrg(job.orgId, (tx) => tx.$count(items));
|
|
23
|
+
|
|
24
|
+
logger.info({ orgId: job.orgId, count }, 'items counted');
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The manifest's `jobs`. */
|
|
30
|
+
export const manifestJobs = Object.entries(JOBS).map(([name, { cron }]) =>
|
|
31
|
+
cron ? { name, cron } : { name },
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const runJob = async (job: PluginJobDelivery) => {
|
|
35
|
+
const found = JOBS[job.name];
|
|
36
|
+
|
|
37
|
+
if (!found) throw new Error(`No job ${job.name}`);
|
|
38
|
+
|
|
39
|
+
await found.run(job);
|
|
40
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { bearerOf, verifyPluginSession } from '@erxes/plugin-sdk';
|
|
1
|
+
import { bearerOf, verifyCoreJob, verifyPluginSession } from '@erxes/plugin-sdk';
|
|
2
2
|
import { onError, ORPCError } from '@orpc/server';
|
|
3
3
|
import { RPCHandler } from '@orpc/server/node';
|
|
4
4
|
import cors from 'cors';
|
|
5
5
|
import express from 'express';
|
|
6
6
|
import { pinoHttp } from 'pino-http';
|
|
7
7
|
import { config, PLUGIN } from '#/config.ts';
|
|
8
|
+
import { runJob } from '#/jobs.ts';
|
|
8
9
|
import { logger } from '#/logger.ts';
|
|
9
10
|
import { router } from '#/router.ts';
|
|
10
11
|
|
|
@@ -52,6 +53,26 @@ export const createApp = () => {
|
|
|
52
53
|
if (!matched) next();
|
|
53
54
|
});
|
|
54
55
|
|
|
56
|
+
// Core's jobs (`api/src/jobs.ts`). The token signs the raw body, so it stays text.
|
|
57
|
+
app.post('/api/jobs/:name', express.text({ type: '*/*' }), async (req, res) => {
|
|
58
|
+
const body = typeof req.body === 'string' ? req.body : '';
|
|
59
|
+
|
|
60
|
+
const job = await verifyCoreJob(req.headers.authorization, body, {
|
|
61
|
+
coreUrl: config.coreUrl,
|
|
62
|
+
plugin: PLUGIN,
|
|
63
|
+
}).catch(() => null);
|
|
64
|
+
|
|
65
|
+
if (!job) {
|
|
66
|
+
res.sendStatus(401);
|
|
67
|
+
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// A throw answers 500 and core retries it.
|
|
72
|
+
await runJob(job);
|
|
73
|
+
res.sendStatus(204);
|
|
74
|
+
});
|
|
75
|
+
|
|
55
76
|
if (config.uiDir) app.use('/ui', express.static(config.uiDir));
|
|
56
77
|
|
|
57
78
|
return app;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"image:context": "pnpm build && rm -rf .runtime && pnpm --filter @__id__/api deploy --prod .runtime"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@erxes/lint": "0.1.
|
|
19
|
+
"@erxes/lint": "0.1.3",
|
|
20
20
|
"@types/node": "^26.6.6",
|
|
21
21
|
"knip": "^6.45.1",
|
|
22
22
|
"react-doctor": "0.9.23",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
-- checks: its tables have no row level security, a job carries its
|
|
21
21
|
-- organisation in its data, and failed jobs are read by the scope's
|
|
22
22
|
-- organisation. So no plugin role and not PUBLIC may use it; plugins queue
|
|
23
|
-
-- work through core_events and its insert trigger
|
|
23
|
+
-- work through core_events and its insert trigger, and their own jobs
|
|
24
|
+
-- through core_enqueue_job().
|
|
24
25
|
create temp table no_org_id (table_name text primary key, tenant_key text, reason text not null);
|
|
25
26
|
insert into no_org_id values (format('__drizzle_migrations_%s', :'scope'), null, 'The migration log.');
|
|
26
27
|
\ir no-org-id.sql
|
|
@@ -13,6 +13,9 @@ and renders `./__id__` (the `__Pascal__` export) under `/__id__/*`.
|
|
|
13
13
|
- Build pages from `erxes-ui` components and its root export. The host provides
|
|
14
14
|
React, the router, the query client and erxes-ui, and web's stylesheet styles
|
|
15
15
|
erxes-ui's components.
|
|
16
|
+
- Read `node_modules/erxes-ui/CATALOG.md` before writing a component, hook or
|
|
17
|
+
helper. It lists every erxes-ui export with what it is for, and the core screen
|
|
18
|
+
each kind of page copies.
|
|
16
19
|
- Any Tailwind class works, on erxes-ui's tokens (`bg-muted`, `text-sm`,
|
|
17
20
|
`md:grid-cols-2`). `src/styles.css` builds the plugin's own utilities, and
|
|
18
21
|
`src/__Pascal__.tsx` passes them to `addPluginStyles`, which adds only the
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"build": "rsbuild build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@erxes/core-contract": "0.1.0-v2.
|
|
11
|
+
"@erxes/core-contract": "0.1.0-v2.7",
|
|
12
12
|
"@orpc/client": "1.16.2",
|
|
13
13
|
"@orpc/tanstack-query": "1.16.2",
|
|
14
14
|
"@tabler/icons-react": "3.34.0",
|
|
15
15
|
"@tanstack/react-query": "^5.107.1",
|
|
16
|
-
"erxes-ui": "npm:@erxes/ui@4.0.0-v2.
|
|
16
|
+
"erxes-ui": "npm:@erxes/ui@4.0.0-v2.10",
|
|
17
17
|
"jotai": "^3.0.2",
|
|
18
18
|
"nuqs": "^2.10.3",
|
|
19
19
|
"react": "19.3.1",
|
|
@@ -3,10 +3,14 @@ name: plugin-migrate
|
|
|
3
3
|
description: Port the old erxes plugin this repo was made from onto the new core. Use when working through MIGRATION.md, porting a module, or when someone asks how far the migration is.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
We're rewriting to fix the architecture. A port that carries over the old
|
|
7
|
+
bugs, tech debt and workarounds wasted the rewrite. Once customer data is in,
|
|
8
|
+
big changes get hard, so give each table and screen its long-term shape the
|
|
9
|
+
first time.
|
|
10
|
+
|
|
11
|
+
Every old feature stays. Port what it does, never its code. Where the old
|
|
12
|
+
plugin got something wrong, such as a missing check, a race or a workaround
|
|
13
|
+
for the old core, the new one does it right.
|
|
10
14
|
|
|
11
15
|
If scaffolding skipped installation, first run `pnpm migrate:inventory -- --from <old-checkout> --plugin <old-plugin> --ref <ref>`
|
|
12
16
|
and `pnpm migrate:checklist`. These commands generate the port's working files:
|
|
@@ -20,6 +24,37 @@ migration/schema-draft.ts Draft tables to port
|
|
|
20
24
|
`migration/core-map.ts` says what each old core call becomes. Use synthetic
|
|
21
25
|
data only. The inventory reads code, never a database.
|
|
22
26
|
|
|
27
|
+
## Never carry these over
|
|
28
|
+
|
|
29
|
+
| Old | New |
|
|
30
|
+
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `subdomain` passed around, org filters written by hand | The org comes from the token, and row level security scopes every query. |
|
|
32
|
+
| Row mappers that reshape query results | The procedure's `.output()` picks the row's fields. A value the row lacks comes from the query. |
|
|
33
|
+
| String errors the UI matches on | A typed oRPC error for each failure the UI acts on. |
|
|
34
|
+
| `console` calls | `api/src/logger.ts`, with the facts as fields. |
|
|
35
|
+
| Several writes per action outside one transaction | One transaction per action. |
|
|
36
|
+
| Uniqueness checked in code | A unique index that includes `org_id`. |
|
|
37
|
+
| Status strings compared across the code | A `text({ enum })` column and one function that owns the allowed moves. |
|
|
38
|
+
| Branches on provider kind | One adapter interface. Shared code never names a provider. |
|
|
39
|
+
| Per-provider copies of core data, such as customers | Core owns customers and companies. The plugin stores their ids. |
|
|
40
|
+
| Secrets in plain text, such as tokens and passwords | Encrypted at rest, with the key read in `api/src/config.ts`. |
|
|
41
|
+
|
|
42
|
+
## When core lacks something
|
|
43
|
+
|
|
44
|
+
Don't build around it. Check `migration/core-map.ts` and `@erxes/core-contract`
|
|
45
|
+
first. If core doesn't have it, file an issue in the plugin's repo that says
|
|
46
|
+
what the old plugin did and what core would need, and add a `DECISIONS.md`
|
|
47
|
+
row. Port the rest of the module. A workaround is never the answer, because
|
|
48
|
+
it needs a data migration once core ships the feature.
|
|
49
|
+
|
|
50
|
+
## Decisions
|
|
51
|
+
|
|
52
|
+
`DECISIONS.md` gets one row per difference from the old plugin, with Old, New
|
|
53
|
+
and Why: a fixed bug, a changed shape, a feature left out or waiting for core.
|
|
54
|
+
The row goes in the module's commit.
|
|
55
|
+
|
|
56
|
+
## Steps
|
|
57
|
+
|
|
23
58
|
1. Read the checklist. Port the module with the fewest unticked items first;
|
|
24
59
|
`Plugin-wide` goes last.
|
|
25
60
|
2. Tables. Move the module's draft tables into
|
|
@@ -52,27 +87,37 @@ data only. The inventory reads code, never a database.
|
|
|
52
87
|
drafted with their import from old core's `departments`, `branches` and the
|
|
53
88
|
members' `departmentIds` and `branchIds`. The ids stay the same, so the old
|
|
54
89
|
records' `departmentIds` still match.
|
|
55
|
-
5. Pages. One per UI route, under `ui/src/modules/<module
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
the
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
90
|
+
5. Pages. One per UI route, under `ui/src/modules/<module>/`. No old screen
|
|
91
|
+
is copied. The old screen shows what the feature does, and the new one
|
|
92
|
+
follows core's screens through the `ui-patterns` skill and
|
|
93
|
+
`ui/node_modules/erxes-ui/CATALOG.md`. The catalog's Pages table names the
|
|
94
|
+
components and the screen to copy for each kind of page, and its other
|
|
95
|
+
sections list what erxes-ui already has. Import those, never a copy of
|
|
96
|
+
your own. A record with a status gets a list grouped by status,
|
|
97
|
+
erxes-ui's `RecordList`. Member pickers and names become erxes-ui's
|
|
98
|
+
`SelectMember` and `MemberInline`; a picker of other records is
|
|
99
|
+
erxes-ui's `EntityPicker` over the plugin's own query. For erxes-ui
|
|
100
|
+
components whose props changed, see its old-to-new table,
|
|
101
|
+
`packages/ui/MIGRATION.md` in the erxes repo (branch `postgre`). A feature
|
|
102
|
+
that's left out gets a `DECISIONS.md` row.
|
|
103
|
+
6. Check feature parity, not layout parity, in the browser with the `verify`
|
|
104
|
+
skill. Every old action, field and filter must be reachable on the
|
|
105
|
+
new page. Run at most 2 parity runs per module. Wording, spacing, order and
|
|
106
|
+
colour go in the PR body as a list, never into another fix round. When the
|
|
107
|
+
same failure happens twice, stop and report it with the output.
|
|
64
108
|
7. Tick an item once it works on the new core and its old bugs and
|
|
65
109
|
workarounds are gone. When an item needs something core doesn't offer
|
|
66
|
-
(marked **gap**, or one you find),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
8. Commit the module: schema, migration, procedures,
|
|
70
|
-
together.
|
|
110
|
+
(marked **gap**, or one you find), follow "When core lacks something",
|
|
111
|
+
tick the item and end its line with `(filed <issue url>)`. The feature
|
|
112
|
+
waits for core.
|
|
113
|
+
8. Commit the module: schema, migration, procedures, pages, ticks and its
|
|
114
|
+
`DECISIONS.md` rows together.
|
|
71
115
|
9. Copy data once all modules are in: `pnpm migrate:import` with `MONGO_URL`,
|
|
72
116
|
`DATA_URL` and `ORG_ID` set. Its `Skipped` list must be empty or explained.
|
|
73
117
|
|
|
74
118
|
Rerun `pnpm migrate:inventory` and `pnpm migrate:checklist` only to pick up
|
|
75
119
|
new old-side code; ticks survive the rerun.
|
|
76
120
|
|
|
77
|
-
Done when every checklist item is ticked, each gap with its issue
|
|
78
|
-
|
|
121
|
+
Done when every checklist item is ticked, each gap with its issue link and
|
|
122
|
+
decision row, and `vp run check`, `vp run test`, `pnpm check:rls` and
|
|
123
|
+
`pnpm build` pass.
|
|
@@ -156,8 +156,8 @@ export const CORE_CALLS: Record<string, Equivalent> = {
|
|
|
156
156
|
'country and currency: organizations.current (sdk)',
|
|
157
157
|
),
|
|
158
158
|
'activityLog.createActivityLog': sdk(
|
|
159
|
-
'
|
|
160
|
-
'
|
|
159
|
+
'core_publish_event() in the same transaction',
|
|
160
|
+
'summary, entityType (a manifest timelines type) and entityId put it on the record; subjectType and subjectId on a customer or company; activities.create only for entries that are not events',
|
|
161
161
|
),
|
|
162
162
|
'notifications.send': sdk('notifications.create', 'scope notifications:write; team members only'),
|
|
163
163
|
'core.sendEmail': sdk(
|
|
@@ -197,7 +197,7 @@ export const HELPERS: Record<string, Equivalent> = {
|
|
|
197
197
|
sendAutomationTrigger: START_AUTOMATIONS,
|
|
198
198
|
sendAutomationDeferredCompletion: owned(
|
|
199
199
|
'the action answers at once ({ queued: true, jobId })',
|
|
200
|
-
'the plugin keeps the final result on its own job row, and on the timeline
|
|
200
|
+
'the plugin keeps the final result on its own job row, and on the timeline as an event naming the record',
|
|
201
201
|
),
|
|
202
202
|
};
|
|
203
203
|
|