@adminiumjs/manifest 0.3.17 → 0.3.18
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/adjust.d.ts +322 -0
- package/dist/adjust.d.ts.map +1 -0
- package/dist/adjust.js +512 -0
- package/dist/adjust.js.map +1 -0
- package/dist/automations.d.ts +2309 -0
- package/dist/automations.d.ts.map +1 -0
- package/dist/automations.js +384 -0
- package/dist/automations.js.map +1 -0
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +1 -0
- package/dist/compose.js.map +1 -1
- package/dist/documents.d.ts +82 -1
- package/dist/documents.d.ts.map +1 -1
- package/dist/documents.js +36 -6
- package/dist/documents.js.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/key-bytes.d.ts +27 -0
- package/dist/key-bytes.d.ts.map +1 -0
- package/dist/key-bytes.js +48 -0
- package/dist/key-bytes.js.map +1 -0
- package/dist/ledger-indexes.d.ts +19 -0
- package/dist/ledger-indexes.d.ts.map +1 -0
- package/dist/ledger-indexes.js +74 -0
- package/dist/ledger-indexes.js.map +1 -0
- package/dist/ledgers.d.ts +691 -0
- package/dist/ledgers.d.ts.map +1 -0
- package/dist/ledgers.js +778 -0
- package/dist/ledgers.js.map +1 -0
- package/dist/look-up.d.ts +73 -0
- package/dist/look-up.d.ts.map +1 -0
- package/dist/look-up.js +140 -0
- package/dist/look-up.js.map +1 -0
- package/dist/marketplace-wire.d.ts +2 -2
- package/dist/outbox.d.ts +29 -3
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +94 -15
- package/dist/outbox.js.map +1 -1
- package/dist/page-config.d.ts +99 -0
- package/dist/page-config.d.ts.map +1 -0
- package/dist/page-config.js +197 -0
- package/dist/page-config.js.map +1 -0
- package/dist/plan-context.d.ts +8 -18
- package/dist/plan-context.d.ts.map +1 -1
- package/dist/plan-context.js +53 -51
- package/dist/plan-context.js.map +1 -1
- package/dist/plan-model.d.ts +8 -1
- package/dist/plan-model.d.ts.map +1 -1
- package/dist/plan.d.ts +1 -1
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +6 -3
- package/dist/plan.js.map +1 -1
- package/dist/public-access.d.ts +33 -5
- package/dist/public-access.d.ts.map +1 -1
- package/dist/public-access.js +82 -4
- package/dist/public-access.js.map +1 -1
- package/dist/refs.d.ts +2 -0
- package/dist/refs.d.ts.map +1 -1
- package/dist/refs.js +5 -0
- package/dist/refs.js.map +1 -1
- package/dist/roles.d.ts +46 -0
- package/dist/roles.d.ts.map +1 -1
- package/dist/roles.js +50 -0
- package/dist/roles.js.map +1 -1
- package/dist/sample.d.ts +70 -1
- package/dist/sample.d.ts.map +1 -1
- package/dist/sample.js +208 -5
- package/dist/sample.js.map +1 -1
- package/dist/schema.d.ts +9657 -2440
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +751 -52
- package/dist/schema.js.map +1 -1
- package/dist/state-actions.d.ts +185 -0
- package/dist/state-actions.d.ts.map +1 -0
- package/dist/state-actions.js +223 -0
- package/dist/state-actions.js.map +1 -0
- package/dist/states.d.ts +66 -0
- package/dist/states.d.ts.map +1 -1
- package/dist/states.js +31 -0
- package/dist/states.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +22 -6
- package/dist/validate.js.map +1 -1
- package/dist/words.d.ts +33 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +208 -0
- package/dist/words.js.map +1 -0
- package/package.json +2 -2
package/dist/adjust.js
ADDED
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* THE PRICE QUESTION.
|
|
4
|
+
*
|
|
5
|
+
* An order's price may be lowered by an add-on that keeps offers, discount
|
|
6
|
+
* codes and vouchers. The host says where the question is asked and where
|
|
7
|
+
* the answer goes — `adjust`, on the order's table: which rows are its lines,
|
|
8
|
+
* which columns hold a line's price, quantity and discount, who the customer
|
|
9
|
+
* is, which codes were typed. The add-on says what it reads to answer —
|
|
10
|
+
* `addOn.adjuster`: its offers, its codes, the rows it keeps of what was
|
|
11
|
+
* applied.
|
|
12
|
+
*
|
|
13
|
+
* Adminium asks, checks the answer and writes it: every discount column is
|
|
14
|
+
* Adminium's own, and no browser ever sets one.
|
|
15
|
+
*
|
|
16
|
+
* This file holds the words and what one manifest can check of them. Pure,
|
|
17
|
+
* and nothing imported from the manifest's own schema file.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
import { ledgerReadSchema, postingMappingSchema, readFromSchema } from './ledgers.js';
|
|
21
|
+
import { refSchema, scalarSchema } from './refs.js';
|
|
22
|
+
const addOnKey = z.string().regex(/^[a-z][a-z0-9-]{1,79}$/, 'an add-on key');
|
|
23
|
+
const stateName = z.string().min(1).max(40);
|
|
24
|
+
/** The most line parts one price rule reads. */
|
|
25
|
+
export const ADJUST_PARTS_MAX = 3;
|
|
26
|
+
// ── the host's rule ──────────────────────────────────────────────────────────
|
|
27
|
+
/** What a line is, to an offer: the item it sells, its category, its type, or a tag. */
|
|
28
|
+
const whatSchema = z.object({ column: refSchema, as: z.enum(['item', 'category', 'type', 'tag']) }).strict();
|
|
29
|
+
const onlySchema = z.union([z.object({ column: refSchema, eq: scalarSchema }).strict(), z.object({ column: refSchema, in: z.array(scalarSchema).min(1).max(16) }).strict()]);
|
|
30
|
+
/** Lines kept in a child table of the order. */
|
|
31
|
+
const tablePartSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
table: refSchema,
|
|
34
|
+
via: refSchema,
|
|
35
|
+
price: refSchema,
|
|
36
|
+
/** Absent: the quantity is 1 and `price` is the line's amount. */
|
|
37
|
+
quantity: refSchema.optional(),
|
|
38
|
+
discount: refSchema,
|
|
39
|
+
what: z.array(whatSchema).min(1).max(4),
|
|
40
|
+
/** A line no offer reduces (a gift card being loaded). */
|
|
41
|
+
excludes: z.object({ column: refSchema, set: z.literal(true) }).strict().optional(),
|
|
42
|
+
/** A line a code pays for: the link that says which. */
|
|
43
|
+
paidBy: z.object({ column: refSchema }).strict().optional(),
|
|
44
|
+
/** Only such rows are lines. */
|
|
45
|
+
only: onlySchema.optional(),
|
|
46
|
+
/** A row with this column filled is no line (a voided one). */
|
|
47
|
+
unlessSet: refSchema.optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
/** The order row is its own one line (a stay priced by the night). */
|
|
51
|
+
const selfPartSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
self: z.literal(true),
|
|
54
|
+
price: refSchema,
|
|
55
|
+
quantity: refSchema.optional(),
|
|
56
|
+
discount: refSchema,
|
|
57
|
+
what: z.array(whatSchema).max(4),
|
|
58
|
+
/** A price by the night: the stay's dates, and the column that carries the nightly price rule. */
|
|
59
|
+
nights: z.object({ from: refSchema, to: refSchema, rate: refSchema }).strict().optional(),
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
export const adjustPartSchema = z.union([tablePartSchema, selfPartSchema]);
|
|
63
|
+
export const adjustSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
by: z.object({ addOn: addOnKey }).strict(),
|
|
66
|
+
/** The rule is live only while this feature's add-ons are there. */
|
|
67
|
+
needs: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a feature id').optional(),
|
|
68
|
+
lines: z.array(adjustPartSchema).min(1).max(ADJUST_PARTS_MAX),
|
|
69
|
+
order: z
|
|
70
|
+
.object({
|
|
71
|
+
/** The order's own reduction: the sum of its lines'. Adminium writes it. */
|
|
72
|
+
discount: refSchema,
|
|
73
|
+
/** Who is buying, when that was proved: the link to them, their address, the yes/no Adminium sets when it was. */
|
|
74
|
+
customer: z
|
|
75
|
+
.object({ link: refSchema, address: refSchema, proved: refSchema, counts: z.object({ column: refSchema, in: z.array(scalarSchema).min(1).max(16) }).strict().optional() })
|
|
76
|
+
.strict()
|
|
77
|
+
.optional(),
|
|
78
|
+
/** A reduction staff give by hand: its kind, value and reason, and who gave it (Adminium writes that). */
|
|
79
|
+
staff: z.object({ kind: refSchema, value: refSchema, reason: refSchema, by: refSchema }).strict().optional(),
|
|
80
|
+
currency: postingMappingSchema.optional(),
|
|
81
|
+
})
|
|
82
|
+
.strict(),
|
|
83
|
+
/** The codes typed on the order: a child table, the column typed into, and the links Adminium fills. */
|
|
84
|
+
codes: z.object({ table: refSchema, via: refSchema, typed: refSchema, code: refSchema, voucher: refSchema, removed: refSchema.optional() }).strict().optional(),
|
|
85
|
+
/** The posting of this table that records what was used. */
|
|
86
|
+
uses: z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a posting id').optional(),
|
|
87
|
+
/** From here on the price is never worked out again. */
|
|
88
|
+
frozen: z
|
|
89
|
+
.union([z.object({ to: z.array(stateName).min(1).max(16) }).strict(), z.object({ column: refSchema, in: z.array(scalarSchema).min(1).max(16) }).strict(), z.object({ column: refSchema, set: z.literal(true) }).strict()])
|
|
90
|
+
.optional(),
|
|
91
|
+
/** The money column a desk's or a guest's expected total is compared with. */
|
|
92
|
+
expect: refSchema.optional(),
|
|
93
|
+
/** Money given back: the refund rows, the columns Adminium decides on them, and what the order cost. */
|
|
94
|
+
refunds: z
|
|
95
|
+
.object({
|
|
96
|
+
table: refSchema,
|
|
97
|
+
via: refSchema,
|
|
98
|
+
amount: refSchema,
|
|
99
|
+
tax: refSchema.optional(),
|
|
100
|
+
of: refSchema,
|
|
101
|
+
taxOf: refSchema.optional(),
|
|
102
|
+
against: refSchema.optional(),
|
|
103
|
+
lines: z.object({ table: refSchema, via: refSchema, line: refSchema, quantity: refSchema }).strict().optional(),
|
|
104
|
+
})
|
|
105
|
+
.strict()
|
|
106
|
+
.optional(),
|
|
107
|
+
})
|
|
108
|
+
.strict()
|
|
109
|
+
.refine((adjust) => adjust.lines.filter((part) => 'self' in part).length <= 1, { message: 'the order row is its own line at most once', path: ['lines'] });
|
|
110
|
+
// ── the add-on's side ────────────────────────────────────────────────────────
|
|
111
|
+
/** A read of the adjuster's own tables: a ledger read, whose keys may also be the moment (`now`) or the typed codes (`input.codes`). */
|
|
112
|
+
export const adjusterReadSchema = ledgerReadSchema
|
|
113
|
+
.omit({ by: true })
|
|
114
|
+
.extend({ by: z.array(z.object({ column: refSchema, from: z.union([readFromSchema, z.literal('now'), z.array(z.union([readFromSchema, z.literal('now')])).min(1).max(3)]) }).strict()).max(3) })
|
|
115
|
+
.strict();
|
|
116
|
+
const whereSchema = z.object({ column: refSchema, eq: scalarSchema.optional(), in: z.array(scalarSchema).min(1).max(16).optional() }).strict();
|
|
117
|
+
export const adjusterSchema = z
|
|
118
|
+
.object({
|
|
119
|
+
/** What is read before the question is put: offers, their rules, their limits. */
|
|
120
|
+
offers: z.array(adjusterReadSchema).max(6),
|
|
121
|
+
/** Discount codes: found by the typed text; never starting with a reserved word. */
|
|
122
|
+
codes: z
|
|
123
|
+
.object({ table: refSchema, column: refSchema, where: z.array(whereSchema).max(3).optional(), reserved: z.array(z.string().regex(/^[A-Z]{2,4}$/, 'two to four capital letters')).min(1).max(8).optional() })
|
|
124
|
+
.strict(),
|
|
125
|
+
/** Vouchers and packs: found by the typed text with its prefix cut. */
|
|
126
|
+
vouchers: z.object({ table: refSchema, column: refSchema, prefixes: z.array(z.string().regex(/^[A-Z]{2,4}-$/, 'a prefix such as VC-')).min(1).max(4) }).strict(),
|
|
127
|
+
/** The rows Adminium rewrites with what was applied, by the source row and line. */
|
|
128
|
+
applied: z
|
|
129
|
+
.object({
|
|
130
|
+
table: refSchema,
|
|
131
|
+
source: z.object({ table: refSchema, row: refSchema, line: refSchema }).strict(),
|
|
132
|
+
columns: z.object({ offer: refSchema, code: refSchema, voucher: refSchema, name: refSchema, kind: refSchema, amount: refSchema, reason: refSchema, typed: refSchema, at: refSchema }).strict(),
|
|
133
|
+
})
|
|
134
|
+
.strict(),
|
|
135
|
+
/** Read only for a proved customer: the groups they are in, and what they used before. */
|
|
136
|
+
person: z
|
|
137
|
+
.object({
|
|
138
|
+
groups: z.object({ table: refSchema, member: refSchema, group: refSchema }).strict(),
|
|
139
|
+
uses: z.object({ table: refSchema, customer: refSchema, offer: refSchema, state: refSchema, counted: z.array(scalarSchema).min(1).max(8) }).strict(),
|
|
140
|
+
orders: z.literal(true).optional(),
|
|
141
|
+
})
|
|
142
|
+
.strict()
|
|
143
|
+
.optional(),
|
|
144
|
+
/** What each role may give by hand. */
|
|
145
|
+
ceilings: z.object({ table: refSchema, role: refSchema, maxPercent: refSchema, maxAmount: refSchema, comp: refSchema.optional() }).strict().optional(),
|
|
146
|
+
/** The customer reaches the add-on as a keyed hash, never as an address. */
|
|
147
|
+
customerKey: z.literal('hash'),
|
|
148
|
+
})
|
|
149
|
+
.strict();
|
|
150
|
+
const MONEY = ['money', 'decimal'];
|
|
151
|
+
const NUMBERS = ['int', 'bigint', 'decimal', 'money', 'float'];
|
|
152
|
+
/**
|
|
153
|
+
* The columns a price rule makes Adminium's own, by table: the order's
|
|
154
|
+
* discount, who gave a staff reduction, whether the customer was proved;
|
|
155
|
+
* each line's discount; the links a typed code fills; a refund's amount and
|
|
156
|
+
* tax.
|
|
157
|
+
*/
|
|
158
|
+
export function adjustDecidedColumns(table, adjust) {
|
|
159
|
+
const out = new Map();
|
|
160
|
+
const add = (of, column) => {
|
|
161
|
+
if (column === undefined)
|
|
162
|
+
return;
|
|
163
|
+
out.set(of, [...(out.get(of) ?? []), column]);
|
|
164
|
+
};
|
|
165
|
+
add(table, adjust.order.discount);
|
|
166
|
+
add(table, adjust.order.staff?.by);
|
|
167
|
+
add(table, adjust.order.customer?.proved);
|
|
168
|
+
for (const part of adjust.lines)
|
|
169
|
+
add('self' in part ? table : part.table, part.discount);
|
|
170
|
+
if (adjust.codes !== undefined) {
|
|
171
|
+
add(adjust.codes.table, adjust.codes.code);
|
|
172
|
+
add(adjust.codes.table, adjust.codes.voucher);
|
|
173
|
+
}
|
|
174
|
+
if (adjust.refunds !== undefined) {
|
|
175
|
+
add(adjust.refunds.table, adjust.refunds.amount);
|
|
176
|
+
add(adjust.refunds.table, adjust.refunds.tax);
|
|
177
|
+
}
|
|
178
|
+
return out;
|
|
179
|
+
}
|
|
180
|
+
/** Everything wrong with a table's price rule that this manifest can see. */
|
|
181
|
+
export function adjustIssues(table, adjust, ctx, at) {
|
|
182
|
+
const out = [];
|
|
183
|
+
const here = (...rest) => at('adjust', ...rest);
|
|
184
|
+
const column = (of, ref) => of?.columns.find((candidate) => candidate.ref === ref);
|
|
185
|
+
const need = (of, ref, path) => {
|
|
186
|
+
const found = column(of, ref);
|
|
187
|
+
if (found === undefined)
|
|
188
|
+
out.push({ path, message: `"${of.ref}" has no column "${ref}"` });
|
|
189
|
+
return found;
|
|
190
|
+
};
|
|
191
|
+
/** A child of the order through `via`. */
|
|
192
|
+
const child = (ref, via, path) => {
|
|
193
|
+
const found = ctx.tables.get(ref);
|
|
194
|
+
if (found === undefined) {
|
|
195
|
+
out.push({ path: [...path, 'table'], message: `"${ref}" is not one of this manifest's tables` });
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
const link = column(found, via);
|
|
199
|
+
if (link === undefined || link.type !== 'fk' || link.references !== table.ref) {
|
|
200
|
+
out.push({ path: [...path, 'via'], message: `"${ref}.${via}" is not a foreign key to "${table.ref}", so its rows are no part of the order` });
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
return found;
|
|
204
|
+
};
|
|
205
|
+
// 1. Who answers.
|
|
206
|
+
const own = adjust.by.addOn === ctx.key;
|
|
207
|
+
if (own ? ctx.kind !== 'add-on' : !ctx.named.has(adjust.by.addOn)) {
|
|
208
|
+
out.push({ path: here('by', 'addOn'), message: own ? 'a price is adjusted by an add-on, not by the app itself' : `"${adjust.by.addOn}" is not an add-on this manifest names: add it to addOns.requires or addOns.suggests` });
|
|
209
|
+
}
|
|
210
|
+
if (adjust.needs !== undefined) {
|
|
211
|
+
const feature = ctx.features.get(adjust.needs);
|
|
212
|
+
if (feature === undefined)
|
|
213
|
+
out.push({ path: here('needs'), message: `"${adjust.needs}" is not one of the app's addOns.features` });
|
|
214
|
+
else if (!feature.includes(adjust.by.addOn))
|
|
215
|
+
out.push({ path: here('needs'), message: `the feature "${adjust.needs}" does not need "${adjust.by.addOn}", so it cannot switch this rule` });
|
|
216
|
+
}
|
|
217
|
+
// 3. A discount column: a number with its scale, empty or zero to start with, ruled by nothing else.
|
|
218
|
+
const scales = new Set();
|
|
219
|
+
const discount = (of, ref, path) => {
|
|
220
|
+
const found = need(of, ref, path);
|
|
221
|
+
if (found === undefined)
|
|
222
|
+
return;
|
|
223
|
+
if (!MONEY.includes(found.type) || found.scale === undefined)
|
|
224
|
+
out.push({ path, message: `"${of.ref}.${ref}" holds a reduction: a money or decimal column with a "scale"` });
|
|
225
|
+
else
|
|
226
|
+
scales.add(String(found.scale));
|
|
227
|
+
if (found.nullable !== true && found.default !== 0)
|
|
228
|
+
out.push({ path, message: `"${of.ref}.${ref}" starts with no reduction: make it nullable, or give it "default": 0` });
|
|
229
|
+
if (found.rules !== undefined && Object.keys(found.rules).length > 0)
|
|
230
|
+
out.push({ path, message: `"${of.ref}.${ref}" is written by Adminium from the add-on's answer: it takes no rule of its own` });
|
|
231
|
+
};
|
|
232
|
+
discount(table, adjust.order.discount, here('order', 'discount'));
|
|
233
|
+
// 2, 4, 5. The lines.
|
|
234
|
+
const partTables = new Set();
|
|
235
|
+
adjust.lines.forEach((part, p) => {
|
|
236
|
+
const path = here('lines', p);
|
|
237
|
+
const of = 'self' in part ? table : child(part.table, part.via, path);
|
|
238
|
+
if (of === undefined)
|
|
239
|
+
return;
|
|
240
|
+
if (!('self' in part)) {
|
|
241
|
+
partTables.add(part.table);
|
|
242
|
+
// What makes every writer of a line hold the order first: the order adds the lines up.
|
|
243
|
+
const totals = table.columns.some((candidate) => {
|
|
244
|
+
const rollup = candidate.rules?.['rollup'];
|
|
245
|
+
return rollup?.from === part.table && rollup.via === part.via;
|
|
246
|
+
});
|
|
247
|
+
if (!totals)
|
|
248
|
+
out.push({ path, message: `"${table.ref}" adds up no column of "${part.table}" through "${part.via}": an order totals its lines (a rollup), or its price cannot be kept in step with them` });
|
|
249
|
+
}
|
|
250
|
+
discount(of, part.discount, [...path, 'discount']);
|
|
251
|
+
const price = need(of, part.price, [...path, 'price']);
|
|
252
|
+
if (price !== undefined && !NUMBERS.includes(price.type))
|
|
253
|
+
out.push({ path: [...path, 'price'], message: `"${of.ref}.${part.price}" is not a number` });
|
|
254
|
+
if (part.quantity !== undefined) {
|
|
255
|
+
const quantity = need(of, part.quantity, [...path, 'quantity']);
|
|
256
|
+
if (quantity !== undefined && !['int', 'bigint', 'decimal'].includes(quantity.type))
|
|
257
|
+
out.push({ path: [...path, 'quantity'], message: `"${of.ref}.${part.quantity}" is not a whole or a decimal number` });
|
|
258
|
+
}
|
|
259
|
+
part.what.forEach((what, w) => {
|
|
260
|
+
const found = need(of, what.column, [...path, 'what', w, 'column']);
|
|
261
|
+
if (found === undefined)
|
|
262
|
+
return;
|
|
263
|
+
const link = found.type === 'fk' || found.rules?.['addOnLink'] !== undefined;
|
|
264
|
+
if (what.as === 'tag' ? !['text', 'enum'].includes(found.type) : !link) {
|
|
265
|
+
out.push({ path: [...path, 'what', w], message: what.as === 'tag' ? `a tag is a text or an enum column; "${of.ref}.${what.column}" is ${found.type}` : `"${of.ref}.${what.column}" says which ${what.as} a line is: a foreign key, or a link into an add-on's table` });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
if ('self' in part) {
|
|
269
|
+
if (part.nights !== undefined) {
|
|
270
|
+
need(of, part.nights.from, [...path, 'nights', 'from']);
|
|
271
|
+
need(of, part.nights.to, [...path, 'nights', 'to']);
|
|
272
|
+
const rule = column(of, part.nights.rate)?.rules?.['perNight'];
|
|
273
|
+
if (part.nights.rate !== part.price)
|
|
274
|
+
out.push({ path: [...path, 'nights', 'rate'], message: `a stay's price by the night is its "price" column: "rate" names "${part.price}"` });
|
|
275
|
+
else if (rule === undefined || rule.from !== part.nights.from || rule.to !== part.nights.to) {
|
|
276
|
+
out.push({ path: [...path, 'nights'], message: `"${of.ref}.${part.nights.rate}" carries no price by the night over "${part.nights.from}" to "${part.nights.to}"` });
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (part.excludes !== undefined)
|
|
282
|
+
need(of, part.excludes.column, [...path, 'excludes', 'column']);
|
|
283
|
+
if (part.paidBy !== undefined)
|
|
284
|
+
need(of, part.paidBy.column, [...path, 'paidBy', 'column']);
|
|
285
|
+
if (part.only !== undefined)
|
|
286
|
+
need(of, part.only.column, [...path, 'only', 'column']);
|
|
287
|
+
if (part.unlessSet !== undefined)
|
|
288
|
+
need(of, part.unlessSet, [...path, 'unlessSet']);
|
|
289
|
+
});
|
|
290
|
+
if (scales.size > 1)
|
|
291
|
+
out.push({ path: here('lines'), message: `an order's reduction and its lines' keep one scale: ${[...scales].join(', ')}` });
|
|
292
|
+
// 6. Who is buying, and who gave a reduction by hand.
|
|
293
|
+
const customer = adjust.order.customer;
|
|
294
|
+
if (customer !== undefined) {
|
|
295
|
+
const link = need(table, customer.link, here('order', 'customer', 'link'));
|
|
296
|
+
const people = link?.type === 'fk' && link.references !== undefined ? ctx.tables.get(link.references) : undefined;
|
|
297
|
+
if (link !== undefined && people === undefined)
|
|
298
|
+
out.push({ path: here('order', 'customer', 'link'), message: `"${table.ref}.${customer.link}" is not a foreign key to one of this manifest's tables` });
|
|
299
|
+
if (people !== undefined) {
|
|
300
|
+
const address = need(people, customer.address, here('order', 'customer', 'address'));
|
|
301
|
+
if (address !== undefined && address.type !== 'text')
|
|
302
|
+
out.push({ path: here('order', 'customer', 'address'), message: `"${people.ref}.${customer.address}" is not a text column holding an address` });
|
|
303
|
+
}
|
|
304
|
+
const proved = need(table, customer.proved, here('order', 'customer', 'proved'));
|
|
305
|
+
if (proved !== undefined && (proved.type !== 'bool' || proved.nullable !== true || (proved.rules !== undefined && Object.keys(proved.rules).length > 0))) {
|
|
306
|
+
out.push({ path: here('order', 'customer', 'proved'), message: `"${table.ref}.${customer.proved}" is a nullable yes/no with no rule of its own: Adminium sets it when the customer was proved` });
|
|
307
|
+
}
|
|
308
|
+
if (customer.counts !== undefined)
|
|
309
|
+
need(table, customer.counts.column, here('order', 'customer', 'counts', 'column'));
|
|
310
|
+
}
|
|
311
|
+
const staff = adjust.order.staff;
|
|
312
|
+
if (staff !== undefined) {
|
|
313
|
+
const kind = need(table, staff.kind, here('order', 'staff', 'kind'));
|
|
314
|
+
if (kind !== undefined && (kind.type !== 'enum' || !['percent', 'amount'].every((value) => (kind.enum ?? []).includes(value)))) {
|
|
315
|
+
out.push({ path: here('order', 'staff', 'kind'), message: `"${table.ref}.${staff.kind}" is an enum holding "percent" and "amount" (and "comp" where staff may give one)` });
|
|
316
|
+
}
|
|
317
|
+
const value = need(table, staff.value, here('order', 'staff', 'value'));
|
|
318
|
+
if (value !== undefined && !MONEY.includes(value.type))
|
|
319
|
+
out.push({ path: here('order', 'staff', 'value'), message: `"${table.ref}.${staff.value}" is a decimal` });
|
|
320
|
+
const reason = need(table, staff.reason, here('order', 'staff', 'reason'));
|
|
321
|
+
if (reason !== undefined && reason.type !== 'text' && reason.rules?.['addOnLink'] === undefined)
|
|
322
|
+
out.push({ path: here('order', 'staff', 'reason'), message: `"${table.ref}.${staff.reason}" is text, or a link into the add-on's reasons` });
|
|
323
|
+
const by = need(table, staff.by, here('order', 'staff', 'by'));
|
|
324
|
+
if (by !== undefined && (by.type !== 'text' || (by.rules !== undefined && Object.keys(by.rules).length > 0)))
|
|
325
|
+
out.push({ path: here('order', 'staff', 'by'), message: `"${table.ref}.${staff.by}" is text with no rule of its own: Adminium writes who gave the reduction` });
|
|
326
|
+
// A browser never says how much staff took off.
|
|
327
|
+
const open = ctx.publicWritable(table.ref);
|
|
328
|
+
for (const ref of [staff.kind, staff.value, staff.reason]) {
|
|
329
|
+
if (open.has(ref))
|
|
330
|
+
out.push({ path: here('order', 'staff'), message: `"${table.ref}.${ref}" is a reduction staff give: no public entry may write it` });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
// 7. The codes typed on the order.
|
|
334
|
+
const codes = adjust.codes;
|
|
335
|
+
if (codes !== undefined) {
|
|
336
|
+
const of = child(codes.table, codes.via, here('codes'));
|
|
337
|
+
if (of !== undefined) {
|
|
338
|
+
const typed = need(of, codes.typed, here('codes', 'typed'));
|
|
339
|
+
if (typed !== undefined && (typed.type !== 'text' || typed.maxLength === undefined || typed.maxLength > 64))
|
|
340
|
+
out.push({ path: here('codes', 'typed'), message: `a code is typed into a text column of up to 64 characters` });
|
|
341
|
+
for (const name of ['code', 'voucher']) {
|
|
342
|
+
const found = need(of, codes[name], here('codes', name));
|
|
343
|
+
const link = found?.rules?.['addOnLink'];
|
|
344
|
+
if (found !== undefined && (found.nullable !== true || link?.addOn !== adjust.by.addOn)) {
|
|
345
|
+
out.push({ path: here('codes', name), message: `"${of.ref}.${codes[name]}" is the link Adminium fills when the typed code is found: a nullable column with rules.addOnLink into "${adjust.by.addOn}"` });
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (codes.removed !== undefined) {
|
|
349
|
+
const removed = need(of, codes.removed, here('codes', 'removed'));
|
|
350
|
+
if (removed !== undefined && (removed.nullable !== true || !['timestamptz', 'bool'].includes(removed.type)))
|
|
351
|
+
out.push({ path: here('codes', 'removed'), message: `"${of.ref}.${codes.removed}" is a nullable timestamp or yes/no: a row with it set is kept as history` });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// 8. Where uses are recorded.
|
|
356
|
+
if (adjust.uses !== undefined) {
|
|
357
|
+
const posting = (table.postings ?? []).find((candidate) => candidate.id === adjust.uses);
|
|
358
|
+
if (posting === undefined)
|
|
359
|
+
out.push({ path: here('uses'), message: `"${adjust.uses}" is not a posting of "${table.ref}": uses are recorded by a posting of the order's own table` });
|
|
360
|
+
else if (posting.into.addOn !== adjust.by.addOn)
|
|
361
|
+
out.push({ path: here('uses'), message: `the posting "${adjust.uses}" goes into "${posting.into.addOn}", not into "${adjust.by.addOn}", which answers the price` });
|
|
362
|
+
}
|
|
363
|
+
// 9. From when the price stands.
|
|
364
|
+
const frozen = adjust.frozen;
|
|
365
|
+
if (frozen !== undefined) {
|
|
366
|
+
if ('to' in frozen) {
|
|
367
|
+
if (table.states === undefined)
|
|
368
|
+
out.push({ path: here('frozen'), message: `"${table.ref}" declares no states: name a column and its values instead` });
|
|
369
|
+
}
|
|
370
|
+
else
|
|
371
|
+
need(table, frozen.column, here('frozen', 'column'));
|
|
372
|
+
}
|
|
373
|
+
// 10, 11. The figure a price check compares, and that it moves with the reduction.
|
|
374
|
+
if (adjust.expect !== undefined) {
|
|
375
|
+
const expected = need(table, adjust.expect, here('expect'));
|
|
376
|
+
if (expected !== undefined) {
|
|
377
|
+
if (!MONEY.includes(expected.type))
|
|
378
|
+
out.push({ path: here('expect'), message: `"${table.ref}.${adjust.expect}" is not a money column` });
|
|
379
|
+
// Through any number of formulas: the total reads the net, the net reads the reduction.
|
|
380
|
+
const seen = new Set();
|
|
381
|
+
const reaches = (ref) => {
|
|
382
|
+
if (ref === adjust.order.discount)
|
|
383
|
+
return true;
|
|
384
|
+
if (seen.has(ref))
|
|
385
|
+
return false;
|
|
386
|
+
seen.add(ref);
|
|
387
|
+
return (ctx.formulaReads(table.ref, ref) ?? []).some(reaches);
|
|
388
|
+
};
|
|
389
|
+
if (!reaches(adjust.expect)) {
|
|
390
|
+
out.push({ path: here('expect'), message: `"${table.ref}.${adjust.expect}" is not worked out from "${adjust.order.discount}", so a price check on it would check nothing: make it a formula over the order's reduction (net = subtotal − discount; total = net + tax)` });
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// 12. Money given back.
|
|
395
|
+
const refunds = adjust.refunds;
|
|
396
|
+
if (refunds !== undefined) {
|
|
397
|
+
const of = child(refunds.table, refunds.via, here('refunds'));
|
|
398
|
+
if (of !== undefined) {
|
|
399
|
+
need(of, refunds.amount, here('refunds', 'amount'));
|
|
400
|
+
if (refunds.tax !== undefined)
|
|
401
|
+
need(of, refunds.tax, here('refunds', 'tax'));
|
|
402
|
+
if (refunds.against !== undefined) {
|
|
403
|
+
const against = need(of, refunds.against, here('refunds', 'against'));
|
|
404
|
+
if (against !== undefined && against.type !== 'fk')
|
|
405
|
+
out.push({ path: here('refunds', 'against'), message: `"${of.ref}.${refunds.against}" is not a foreign key to the payment it gives back` });
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
for (const name of ['of', 'taxOf']) {
|
|
409
|
+
const ref = refunds[name];
|
|
410
|
+
if (ref === undefined)
|
|
411
|
+
continue;
|
|
412
|
+
const found = need(table, ref, here('refunds', name));
|
|
413
|
+
if (found !== undefined && !MONEY.includes(found.type))
|
|
414
|
+
out.push({ path: here('refunds', name), message: `"${table.ref}.${ref}" is not a money column` });
|
|
415
|
+
}
|
|
416
|
+
if (refunds.lines !== undefined) {
|
|
417
|
+
const returned = ctx.tables.get(refunds.lines.table);
|
|
418
|
+
if (returned === undefined)
|
|
419
|
+
out.push({ path: here('refunds', 'lines', 'table'), message: `"${refunds.lines.table}" is not one of this manifest's tables` });
|
|
420
|
+
else {
|
|
421
|
+
need(returned, refunds.lines.via, here('refunds', 'lines', 'via'));
|
|
422
|
+
need(returned, refunds.lines.quantity, here('refunds', 'lines', 'quantity'));
|
|
423
|
+
const line = need(returned, refunds.lines.line, here('refunds', 'lines', 'line'));
|
|
424
|
+
if (line !== undefined && (line.type !== 'fk' || line.references === undefined || !partTables.has(line.references))) {
|
|
425
|
+
out.push({ path: here('refunds', 'lines', 'line'), message: `"${returned.ref}.${refunds.lines.line}" names the line returned: a foreign key to one of the rule's line tables` });
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return out;
|
|
431
|
+
}
|
|
432
|
+
/** Everything wrong with an add-on's `adjuster` that its own manifest can see. */
|
|
433
|
+
export function adjusterIssues(adjuster, tables) {
|
|
434
|
+
const out = [];
|
|
435
|
+
const at = (...rest) => ['addOn', 'adjuster', ...rest];
|
|
436
|
+
const own = (ref, path) => {
|
|
437
|
+
const found = tables.get(ref);
|
|
438
|
+
if (found === undefined)
|
|
439
|
+
out.push({ path, message: `"${ref}" is not one of this add-on's own tables: an adjuster reads and writes its own tables and no others` });
|
|
440
|
+
return found;
|
|
441
|
+
};
|
|
442
|
+
const need = (of, ref, path) => {
|
|
443
|
+
const found = of?.columns.find((candidate) => candidate.ref === ref);
|
|
444
|
+
if (of !== undefined && found === undefined)
|
|
445
|
+
out.push({ path, message: `"${of.ref}" has no column "${ref}"` });
|
|
446
|
+
return found;
|
|
447
|
+
};
|
|
448
|
+
const reads = new Map();
|
|
449
|
+
adjuster.offers.forEach((read, r) => {
|
|
450
|
+
const table = own(read.table, at('offers', r, 'table'));
|
|
451
|
+
read.by.forEach((by, b) => {
|
|
452
|
+
need(table, by.column, at('offers', r, 'by', b, 'column'));
|
|
453
|
+
for (const from of Array.isArray(by.from) ? by.from : [by.from]) {
|
|
454
|
+
const [head] = from.split('.');
|
|
455
|
+
if (from === 'now' || from === 'input.codes' || head === 'setting')
|
|
456
|
+
continue;
|
|
457
|
+
if (head === undefined || !reads.has(head))
|
|
458
|
+
out.push({ path: at('offers', r, 'by', b, 'from'), message: `"${from}": an adjuster's read is keyed by "now", "input.codes", a setting or a column of an earlier read` });
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
if (read.by.length === 0 && read.limit === undefined)
|
|
462
|
+
out.push({ path: at('offers', r), message: `the read "${read.as}" has no key: bound it with a "limit"` });
|
|
463
|
+
reads.set(read.as, table);
|
|
464
|
+
});
|
|
465
|
+
need(own(adjuster.codes.table, at('codes', 'table')), adjuster.codes.column, at('codes', 'column'));
|
|
466
|
+
need(own(adjuster.vouchers.table, at('vouchers', 'table')), adjuster.vouchers.column, at('vouchers', 'column'));
|
|
467
|
+
// A discount code may never look like a voucher's or a card's: every routing prefix is a reserved start.
|
|
468
|
+
const reserved = new Set(adjuster.codes.reserved ?? []);
|
|
469
|
+
adjuster.vouchers.prefixes.forEach((prefix, p) => {
|
|
470
|
+
if (!reserved.has(prefix.replace(/-$/, '')))
|
|
471
|
+
out.push({ path: at('vouchers', 'prefixes', p), message: `"${prefix}" routes a typed code to a voucher, so no discount code may start with it: add "${prefix.replace(/-$/, '')}" to codes.reserved` });
|
|
472
|
+
});
|
|
473
|
+
const applied = own(adjuster.applied.table, at('applied', 'table'));
|
|
474
|
+
if (applied !== undefined) {
|
|
475
|
+
if (applied.states !== undefined || applied.capacity !== undefined)
|
|
476
|
+
out.push({ path: at('applied', 'table'), message: `"${applied.ref}" is rewritten by Adminium on every save: it carries no states and no limit` });
|
|
477
|
+
const source = need(applied, adjuster.applied.source.table, at('applied', 'source', 'table'));
|
|
478
|
+
if (source !== undefined && source.rules?.['tableRef'] !== true)
|
|
479
|
+
out.push({ path: at('applied', 'source', 'table'), message: `"${applied.ref}.${source.ref}" holds a table's stored name: give it rules.tableRef` });
|
|
480
|
+
need(applied, adjuster.applied.source.row, at('applied', 'source', 'row'));
|
|
481
|
+
need(applied, adjuster.applied.source.line, at('applied', 'source', 'line'));
|
|
482
|
+
for (const [name, ref] of Object.entries(adjuster.applied.columns)) {
|
|
483
|
+
const found = need(applied, ref, at('applied', 'columns', name));
|
|
484
|
+
const rules = Object.keys(found?.rules ?? {}).filter((rule) => rule !== 'addOnLink' && rule !== 'tableRef');
|
|
485
|
+
if (rules.length > 0)
|
|
486
|
+
out.push({ path: at('applied', 'columns', name), message: `"${applied.ref}.${ref}" is written by Adminium from the answer: it takes no ${rules.join(', ')} rule` });
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (adjuster.person !== undefined) {
|
|
490
|
+
const groups = own(adjuster.person.groups.table, at('person', 'groups', 'table'));
|
|
491
|
+
need(groups, adjuster.person.groups.member, at('person', 'groups', 'member'));
|
|
492
|
+
need(groups, adjuster.person.groups.group, at('person', 'groups', 'group'));
|
|
493
|
+
const uses = own(adjuster.person.uses.table, at('person', 'uses', 'table'));
|
|
494
|
+
for (const name of ['customer', 'offer', 'state'])
|
|
495
|
+
need(uses, adjuster.person.uses[name], at('person', 'uses', name));
|
|
496
|
+
}
|
|
497
|
+
if (adjuster.ceilings !== undefined) {
|
|
498
|
+
const ceilings = own(adjuster.ceilings.table, at('ceilings', 'table'));
|
|
499
|
+
const role = need(ceilings, adjuster.ceilings.role, at('ceilings', 'role'));
|
|
500
|
+
if (role !== undefined && role.type !== 'text')
|
|
501
|
+
out.push({ path: at('ceilings', 'role'), message: `"${ceilings?.ref ?? ''}.${role.ref}" names a role: text` });
|
|
502
|
+
need(ceilings, adjuster.ceilings.maxPercent, at('ceilings', 'maxPercent'));
|
|
503
|
+
need(ceilings, adjuster.ceilings.maxAmount, at('ceilings', 'maxAmount'));
|
|
504
|
+
if (adjuster.ceilings.comp !== undefined) {
|
|
505
|
+
const comp = need(ceilings, adjuster.ceilings.comp, at('ceilings', 'comp'));
|
|
506
|
+
if (comp !== undefined && comp.type !== 'bool')
|
|
507
|
+
out.push({ path: at('ceilings', 'comp'), message: `"${ceilings?.ref ?? ''}.${comp.ref}" says whether the role may give a comp: a yes/no` });
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return out;
|
|
511
|
+
}
|
|
512
|
+
//# sourceMappingURL=adjust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjust.js","sourceRoot":"","sources":["../src/adjust.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,cAAc,EAAgB,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAuB,MAAM,WAAW,CAAC;AAEzE,MAAM,QAA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