@antelopejs/interface-dms 0.17.4 → 0.17.5-next.1111.gaba637e

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 (66) hide show
  1. package/CHANGELOG.md +0 -37
  2. package/dist/auth/index.d.ts +0 -42
  3. package/dist/auth/index.js +0 -40
  4. package/dist/auth/index.js.map +1 -1
  5. package/dist/base/data-types/default/options.d.ts +0 -30
  6. package/dist/base/data-types/default-types.d.ts +0 -10
  7. package/dist/base/data-types/default-types.js +0 -5
  8. package/dist/base/data-types/default-types.js.map +1 -1
  9. package/dist/base/form-schema.d.ts +0 -32
  10. package/dist/base/form-schema.js +0 -9
  11. package/dist/base/form-schema.js.map +1 -1
  12. package/dist/base/internal/column-badges.d.ts +2 -3
  13. package/dist/base/internal/column-badges.js +3 -4
  14. package/dist/base/internal/column-badges.js.map +1 -1
  15. package/dist/base/layouts.d.ts +1 -1
  16. package/dist/base/layouts.js.map +1 -1
  17. package/dist/base/table-view/internal/option-contract.d.ts +3 -3
  18. package/dist/base/table-view/internal/option-displays.d.ts +0 -30
  19. package/dist/base/table-view/internal/option-expandable.d.ts +0 -12
  20. package/dist/base/table-view/internal/validation.d.ts +4 -22
  21. package/dist/base/table-view/internal/validation.js +8 -29
  22. package/dist/base/table-view/internal/validation.js.map +1 -1
  23. package/dist/base/table-view/options.d.ts +0 -1
  24. package/dist/base/table-view/schema.d.ts +0 -2
  25. package/dist/base/table-view/schema.js +0 -8
  26. package/dist/base/table-view/schema.js.map +1 -1
  27. package/dist/base/table-view.d.ts +1 -1
  28. package/dist/base/table-view.js.map +1 -1
  29. package/dist/component-options/data-type.js +3 -3
  30. package/dist/component-options/data-type.js.map +1 -1
  31. package/dist/component-options/page-layout.d.ts +1 -29
  32. package/dist/component-options/page-layout.js +2 -8
  33. package/dist/component-options/page-layout.js.map +1 -1
  34. package/dist/page/internal/layout-filter.js +1 -1
  35. package/dist/page/internal/layout-filter.js.map +1 -1
  36. package/dist/request-tenant.d.ts +1 -2
  37. package/dist/request-tenant.js +1 -2
  38. package/dist/request-tenant.js.map +1 -1
  39. package/docs/1.core/12.frontend-modules-and-request-helpers.md +1 -21
  40. package/docs/1.core/5.tenancy.md +1 -1
  41. package/docs/2.auth/1.introduction.md +1 -1
  42. package/docs/2.auth/2.authentication.md +0 -68
  43. package/docs/3.base/11.page-layouts.md +1 -18
  44. package/docs/3.base/4.tables.md +3 -3
  45. package/docs/3.base/8.data-types.md +0 -7
  46. package/docs/5.html-render/2.built-in-emails.md +0 -2
  47. package/package.json +2 -2
  48. package/dist/base/data-types/default/identifiers.d.ts +0 -62
  49. package/dist/base/data-types/default/identifiers.js +0 -183
  50. package/dist/base/data-types/default/identifiers.js.map +0 -1
  51. package/dist/base/data-types/internal/legal-identifiers.d.ts +0 -36
  52. package/dist/base/data-types/internal/legal-identifiers.js +0 -191
  53. package/dist/base/data-types/internal/legal-identifiers.js.map +0 -1
  54. package/dist/base/table-view/internal/group-order.d.ts +0 -26
  55. package/dist/base/table-view/internal/group-order.js +0 -50
  56. package/dist/base/table-view/internal/group-order.js.map +0 -1
  57. package/dist/base/table-view/internal/grouped-pinned.d.ts +0 -6
  58. package/dist/base/table-view/internal/grouped-pinned.js +0 -19
  59. package/dist/base/table-view/internal/grouped-pinned.js.map +0 -1
  60. package/dist/component-options/internal/data-type-registry.d.ts +0 -14
  61. package/dist/component-options/internal/data-type-registry.js +0 -19
  62. package/dist/component-options/internal/data-type-registry.js.map +0 -1
  63. package/dist/period-request.d.ts +0 -66
  64. package/dist/period-request.js +0 -149
  65. package/dist/period-request.js.map +0 -1
  66. package/docs/3.base/16.identifier-types.md +0 -27
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.groupOrderSchema = exports.MAX_GROUP_ORDER_VALUES = void 0;
4
- exports.validateGroupOrder = validateGroupOrder;
5
- const zod_1 = require("zod");
6
- /**
7
- * The most values `grouped.order` lists: the list route reads one group at a
8
- * time.
9
- *
10
- * @internal
11
- */
12
- exports.MAX_GROUP_ORDER_VALUES = 50;
13
- /**
14
- * The values a group order lists: 1 to {@link MAX_GROUP_ORDER_VALUES} scalars.
15
- *
16
- * @internal
17
- */
18
- exports.groupOrderSchema = zod_1.z
19
- .array(zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()]))
20
- .min(1)
21
- .max(exports.MAX_GROUP_ORDER_VALUES);
22
- /**
23
- * `grouped.order` orders the groups of one value each: `"items"` on a single
24
- * `SelectType` column, else values listed once each.
25
- *
26
- * @internal
27
- */
28
- function validateGroupOrder(controllerName, grouped, typeId, type) {
29
- const { order, groupByField, by } = grouped;
30
- if (order === undefined)
31
- return;
32
- const where = `TableView grouped order on ${controllerName}`;
33
- if (by && by !== "value") {
34
- throw new Error(`${where} orders groups of one value each, and "${groupByField}" is grouped by ${by}`);
35
- }
36
- if (order === "items") {
37
- if (typeId !== "select" || type.options?.multiple) {
38
- throw new Error(`${where} follows the items of a SelectType, and "${groupByField}" is ${typeId ?? "untyped"}${type.options?.multiple ? " (multiple)" : ""}`);
39
- }
40
- return;
41
- }
42
- if (order.length === 0 || order.length > exports.MAX_GROUP_ORDER_VALUES) {
43
- throw new Error(`${where} lists ${order.length} values: give between 1 and ${exports.MAX_GROUP_ORDER_VALUES}`);
44
- }
45
- const seen = new Set(order.map((value) => JSON.stringify(value)));
46
- if (seen.size !== order.length) {
47
- throw new Error(`${where} lists a value twice`);
48
- }
49
- }
50
- //# sourceMappingURL=group-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"group-order.js","sourceRoot":"","sources":["../../../../src/base/table-view/internal/group-order.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AAGxB;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,OAAC;KAC9B,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClE,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,sBAAsB,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { TableViewOptions } from "../options";
2
- /**
3
- * The grouped display pins the rows `pinnedRows` accepts: it needs that rule.
4
- * @internal
5
- */
6
- export declare function validateGroupedPinned<T extends object>(controllerName: string, options: Pick<TableViewOptions<T>, "grouped" | "pinnedRows">): void;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateGroupedPinned = validateGroupedPinned;
4
- /**
5
- * The grouped display pins the rows `pinnedRows` accepts: it needs that rule.
6
- * @internal
7
- */
8
- function validateGroupedPinned(controllerName, options) {
9
- const { grouped } = options;
10
- if (!grouped?.pinned && grouped?.pinnedLabel === undefined)
11
- return;
12
- if (!grouped.pinned) {
13
- throw new Error(`TableView grouped on ${controllerName} names a pinnedLabel without pinned: true`);
14
- }
15
- if (!options.pinnedRows) {
16
- throw new Error(`TableView grouped on ${controllerName} pins rows, but declares no pinnedRows rule`);
17
- }
18
- }
19
- //# sourceMappingURL=grouped-pinned.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grouped-pinned.js","sourceRoot":"","sources":["../../../../src/base/table-view/internal/grouped-pinned.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,+BACE,cAAsB,EACtB,OAA4D;IAE5D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,WAAW,KAAK,SAAS;QAAE,OAAO;IACnE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,wBAAwB,cAAc,2CAA2C,CAClF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,wBAAwB,cAAc,6CAA6C,CACpF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { Class } from "@antelopejs/interface-core/decorators";
2
- import type { DataType } from "../data-type";
3
- /**
4
- * The registered data type classes, by id.
5
- *
6
- * @internal
7
- */
8
- export declare const dataTypes: Map<string, Class<DataType>>;
9
- /**
10
- * The ids of the registered data types, sorted: what a type id may name.
11
- *
12
- * @internal
13
- */
14
- export declare function registeredDataTypeIds(): string[];
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataTypes = void 0;
4
- exports.registeredDataTypeIds = registeredDataTypeIds;
5
- /**
6
- * The registered data type classes, by id.
7
- *
8
- * @internal
9
- */
10
- exports.dataTypes = new Map();
11
- /**
12
- * The ids of the registered data types, sorted: what a type id may name.
13
- *
14
- * @internal
15
- */
16
- function registeredDataTypeIds() {
17
- return [...exports.dataTypes.keys()].sort();
18
- }
19
- //# sourceMappingURL=data-type-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-type-registry.js","sourceRoot":"","sources":["../../../src/component-options/internal/data-type-registry.ts"],"names":[],"mappings":";;;;AAGA;;;;GAIG;AACU,QAAA,SAAS,GAAG,IAAI,GAAG,EAA2B,CAAC;AAE5D;;;;GAIG;AACH;IACE,OAAO,CAAC,GAAG,QAAA,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACtC,CAAC"}
@@ -1,66 +0,0 @@
1
- import { type RequestContext } from "@antelopejs/interface-api";
2
- import { type PeriodComparison, type PeriodPreset } from "./base/period-selector";
3
- /** Two instants, both included. */
4
- export interface PeriodWindow {
5
- readonly from: Date;
6
- readonly to: Date;
7
- }
8
- /**
9
- * The period a `PeriodSelector` sent with a block's request (a `KpiCard`, a
10
- * `ChartCard`, any block naming its `periodScope`), read by
11
- * {@link readPeriodRequest} or the {@link Period} decorator.
12
- *
13
- * The selector resolves its preset in the browser, in the browser's time
14
- * zone, and sends the windows as instants: the route reads those windows, and
15
- * never resolves a preset again, so its figures cover the days the reader
16
- * sees.
17
- */
18
- export interface PeriodRequest {
19
- /** The preset the reader picked; absent when the request names none. */
20
- readonly preset?: PeriodPreset;
21
- /** The window shown. Absent for `all`, which has no bounds. */
22
- readonly range?: PeriodWindow;
23
- /**
24
- * The window compared with: the period before, the same days a year
25
- * before, or a custom one, as `comparison` says. Absent when the reader
26
- * compares with nothing, and for `all`, which has nothing to compare with.
27
- */
28
- readonly compare?: PeriodWindow;
29
- /**
30
- * The comparison `compare` comes from. `none` exactly when `compare` is
31
- * absent, as a `KpiCard` hides its comparison exactly then.
32
- */
33
- readonly comparison: PeriodComparison;
34
- /**
35
- * The IANA time zone the browser resolved the period in, from the cookie
36
- * the dashboard writes; absent before the dashboard has written it, or
37
- * when the server does not know the zone. A route that groups by
38
- * calendar day groups in it.
39
- */
40
- readonly timeZone?: string;
41
- }
42
- /**
43
- * The period a `PeriodSelector` sent with the request: the query parameters
44
- * `from`, `to`, `compareFrom`, `compareTo`, `preset` and `comparison` its
45
- * blocks add to their `fetchUrl`, and the browser's time zone. A request
46
- * with none of them reads as `all` with no comparison.
47
- *
48
- * @param context The request context (`@Context()` in a controller)
49
- * @returns The period, its windows as `Date`s
50
- * @throws HTTPResult 400, with a sentence naming the fault, when a bound is
51
- * not an ISO instant, a window lacks a bound or ends before it starts, a
52
- * preset or a comparison is unknown, or the parameters contradict each
53
- * other (`all` with bounds, a preset without them, `none` with a window)
54
- */
55
- export declare function readPeriodRequest(context: Pick<RequestContext, "url" | "rawRequest">): PeriodRequest;
56
- /**
57
- * Parameter decorator handing a route the {@link PeriodRequest} its
58
- * `PeriodSelector` sent, through {@link readPeriodRequest}: a malformed
59
- * period answers 400 before the route runs.
60
- *
61
- * ```ts
62
- * @Get("kpi/revenue")
63
- * revenue(@Period() period: PeriodRequest) { ... }
64
- * ```
65
- */
66
- export declare const Period: () => import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator;
@@ -1,149 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Period = void 0;
4
- exports.readPeriodRequest = readPeriodRequest;
5
- const interface_api_1 = require("@antelopejs/interface-api");
6
- const decorators_1 = require("@antelopejs/interface-core/decorators");
7
- const period_selector_1 = require("./base/period-selector");
8
- const type_check_1 = require("./utils/internal/type-check");
9
- const HTTP_BAD_REQUEST = 400;
10
- const TIME_ZONE_COOKIE = "dms-time-zone";
11
- const COOKIE_SEPARATOR = ";";
12
- const COOKIE_ASSIGNMENT = "=";
13
- /** An instant as `Date.toISOString` writes it, or with an explicit offset. */
14
- const ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})$/;
15
- function refuse(sentence) {
16
- throw new interface_api_1.HTTPResult(HTTP_BAD_REQUEST, sentence);
17
- }
18
- function isOneOf(values, value) {
19
- return values.some((entry) => entry === value);
20
- }
21
- function readInstant(query, key) {
22
- const text = query.get(key);
23
- if (text === null)
24
- return undefined;
25
- const time = ISO_INSTANT.test(text) ? Date.parse(text) : Number.NaN;
26
- if (Number.isNaN(time)) {
27
- refuse(`The period's "${key}" must be an ISO instant such as 2026-10-01T00:00:00.000Z, not "${text}".`);
28
- }
29
- return new Date(time);
30
- }
31
- function readWindow(query, fromKey, toKey) {
32
- const from = readInstant(query, fromKey);
33
- const to = readInstant(query, toKey);
34
- if (!from && !to)
35
- return undefined;
36
- if (!from || !to) {
37
- refuse(`The period sends "${from ? fromKey : toKey}" without "${from ? toKey : fromKey}": a window needs both.`);
38
- }
39
- if (from.getTime() > to.getTime()) {
40
- refuse(`The period's "${fromKey}" falls after its "${toKey}".`);
41
- }
42
- return { from, to };
43
- }
44
- function readPreset(query) {
45
- const text = query.get("preset");
46
- if (text === null)
47
- return undefined;
48
- if (!isOneOf(period_selector_1.PERIOD_PRESETS, text)) {
49
- refuse(`The period names the preset "${text}", which is none of ${period_selector_1.PERIOD_PRESETS.join(", ")}.`);
50
- }
51
- return text;
52
- }
53
- function readComparison(query, compare) {
54
- const text = query.get("comparison");
55
- if (text !== null && !isOneOf(period_selector_1.PERIOD_COMPARISONS, text)) {
56
- refuse(`The period names the comparison "${text}", which is none of ${period_selector_1.PERIOD_COMPARISONS.join(", ")}.`);
57
- }
58
- if (!compare)
59
- return "none";
60
- if (text === "none") {
61
- refuse(`The period compares with nothing but sends "compareFrom" and "compareTo".`);
62
- }
63
- return text ?? "custom";
64
- }
65
- function checkPresetBounds(preset, range) {
66
- if (preset === "all" && range) {
67
- refuse(`The period "all" has no bounds, but it sends "from" and "to".`);
68
- }
69
- if (preset && preset !== "all" && !range) {
70
- refuse(`The period "${preset}" sends no "from" and "to": the selector sends the window it resolved.`);
71
- }
72
- }
73
- function isKnownTimeZone(timeZone) {
74
- try {
75
- new Intl.DateTimeFormat("en", { timeZone });
76
- return true;
77
- }
78
- catch {
79
- return false;
80
- }
81
- }
82
- /** The cookie's text: the dashboard writes it URI-encoded JSON (`%22Europe%2FBrussels%22`). */
83
- function decodedCookie(value) {
84
- try {
85
- const text = decodeURIComponent(value);
86
- if (!text.startsWith('"'))
87
- return text;
88
- const parsed = JSON.parse(text);
89
- return (0, type_check_1.isString)(parsed) ? parsed : undefined;
90
- }
91
- catch {
92
- return undefined;
93
- }
94
- }
95
- function readTimeZone(cookie) {
96
- if (!cookie)
97
- return undefined;
98
- for (const pair of cookie.split(COOKIE_SEPARATOR)) {
99
- const at = pair.indexOf(COOKIE_ASSIGNMENT);
100
- if (at === -1 || pair.slice(0, at).trim() !== TIME_ZONE_COOKIE)
101
- continue;
102
- const zone = decodedCookie(pair.slice(at + 1).trim());
103
- return zone && isKnownTimeZone(zone) ? zone : undefined;
104
- }
105
- return undefined;
106
- }
107
- /**
108
- * The period a `PeriodSelector` sent with the request: the query parameters
109
- * `from`, `to`, `compareFrom`, `compareTo`, `preset` and `comparison` its
110
- * blocks add to their `fetchUrl`, and the browser's time zone. A request
111
- * with none of them reads as `all` with no comparison.
112
- *
113
- * @param context The request context (`@Context()` in a controller)
114
- * @returns The period, its windows as `Date`s
115
- * @throws HTTPResult 400, with a sentence naming the fault, when a bound is
116
- * not an ISO instant, a window lacks a bound or ends before it starts, a
117
- * preset or a comparison is unknown, or the parameters contradict each
118
- * other (`all` with bounds, a preset without them, `none` with a window)
119
- */
120
- function readPeriodRequest(context) {
121
- const query = context.url.searchParams;
122
- const range = readWindow(query, "from", "to");
123
- const compare = readWindow(query, "compareFrom", "compareTo");
124
- const preset = readPreset(query);
125
- checkPresetBounds(preset, range);
126
- const comparison = readComparison(query, compare);
127
- const timeZone = readTimeZone(context.rawRequest.headers.cookie);
128
- return {
129
- ...(preset && { preset }),
130
- ...(range && { range }),
131
- ...(compare && { compare }),
132
- comparison,
133
- ...(timeZone && { timeZone }),
134
- };
135
- }
136
- /**
137
- * Parameter decorator handing a route the {@link PeriodRequest} its
138
- * `PeriodSelector` sent, through {@link readPeriodRequest}: a malformed
139
- * period answers 400 before the route runs.
140
- *
141
- * ```ts
142
- * @Get("kpi/revenue")
143
- * revenue(@Period() period: PeriodRequest) { ... }
144
- * ```
145
- */
146
- exports.Period = (0, decorators_1.MakeParameterAndPropertyDecorator)((target, key, index) => {
147
- (0, interface_api_1.SetParameterProvider)(target, key, index, readPeriodRequest);
148
- });
149
- //# sourceMappingURL=period-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"period-request.js","sourceRoot":"","sources":["../src/period-request.ts"],"names":[],"mappings":";;;;AAAA,6DAImC;AACnC,sEAA0F;AAC1F,4DAKgC;AAChC,4DAAuD;AA2CvD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,gBAAgB,GAAG,GAAG,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ACrB,IAAA,oCAAoB,EAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAC9D,CAAC,CACF,CAAC"}
@@ -1,27 +0,0 @@
1
- ---
2
- title: "Identifier data types"
3
- description: The default data types that read and check an IBAN, a BIC, a VAT number and a company number.
4
- mode: reference
5
- ---
6
-
7
- These are the [default data types](/docs/interfaces/base/data-types#the-default-types) that hold a legal or banking identifier. Each one takes its options object as its only constructor argument, and compares with `contains`, `is`, `is_not`, `not_contains`, `is_empty` and `is_not_empty`. A filter value is read like a typed value: `contains:BE68 5390` finds the stored `"BE68539007547034"`, and `is:0123.456.749` the stored company number `"0123456749"`, compared as text.
8
-
9
- | Class | Id | Options interface | Fields |
10
- | --- | --- | --- | --- |
11
- | `IbanType` | `iban` | `IbanTypeOptions` | `placeholder?`, `fallback?` |
12
- | `BicType` | `bic` | `BicTypeOptions` | `placeholder?`, `fallback?` |
13
- | `VatNumberType` | `vat_number` | `VatNumberTypeOptions` | `placeholder?`, `defaultCountry?`, `fallback?` |
14
- | `CompanyNumberType` | `company_number` | `CompanyNumberTypeOptions` | `country: CompanyNumberCountry` (`"BE"` \| `"FR"`), `placeholder?`, `fallback?` |
15
-
16
- ## What each type accepts
17
-
18
- `IbanType`, `BicType`, `VatNumberType` and `CompanyNumberType` read what a person types: spaces, dots, dashes and slashes are dropped and letters put in upper case. The schema transforms a valid value to that canonical form, so it is stored in that form. It refuses any other value with the issue message `$dms.field_errors.invalid_iban`, `invalid_bic`, `invalid_vat_number` or `invalid_company_number`. Their input, `FormComponents.InputIdentifier`, checks the same rules in the browser, and the dashboard shows an IBAN in groups of four and a company number as its country prints it. Its options, `FormComponents.InputIdentifierOptions`, depend on `identifier`: `"company_number"` requires `country`, only `"vat_number"` takes `defaultCountry`, and `"iban"` and `"bic"` take neither.
19
-
20
- - `IbanType` checks the two check digits (ISO 13616, modulo 97) and stores `"BE68539007547034"`. It does not check each country's IBAN length: a cut-short or mistyped number already fails the check digits.
21
- - `BicType` checks the shape of ISO 9362: a four-character party prefix, a two-letter country, a two-character location and an optional three-character branch.
22
- - `VatNumberType` stores the number as VIES writes it (`"BE0123456749"`). The number after the country code must have that country's shape, for the 27 EU countries (Greece as `EL`, and a typed `GR` is read as `EL`), Northern Ireland (`XI`) and Great Britain (`GB`). Belgium, Germany, France (a numeric key), Italy and Luxembourg also check the check digits. A number typed without its country code is read in `defaultCountry`, and is refused when no `defaultCountry` is set. The type does not ask VIES whether the number is registered.
23
- - `CompanyNumberType` requires `country` and throws when it is built with a country it does not read. `"BE"` reads an enterprise number of ten digits (`"0123456749"`, the last two being 97 minus the first eight modulo 97); a nine-digit number from before 2005 gets its leading zero. `"FR"` reads a SIREN of nine digits checked with the Luhn algorithm. A number typed with its country code in front (`"BE 0123.456.749"`) reads the same.
24
-
25
- ## Next steps
26
-
27
- - [Data types](/docs/interfaces/base/data-types): The `DataType` contract, the registry and the other default types.