@opencrvs/toolkit 2.0.0-rc.ff99998 → 2.0.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.
- package/dist/application-config/index.js +7 -1
- package/dist/commons/api/router.d.ts +11 -2
- package/dist/commons/events/FieldConfig.d.ts +1 -0
- package/dist/commons/events/FieldType.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
- package/dist/events/index.js +114 -57
- package/dist/notification/index.js +60 -1
- package/opencrvs-toolkit-2.0.0.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.ff99998.tgz +0 -0
|
@@ -206,6 +206,11 @@ var FieldTypesToHideInReview = [
|
|
|
206
206
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
207
207
|
FieldType.ALPHA_HIDDEN
|
|
208
208
|
];
|
|
209
|
+
var HiddenFieldTypes = [
|
|
210
|
+
FieldType.HTTP,
|
|
211
|
+
FieldType.QUERY_PARAM_READER,
|
|
212
|
+
FieldType.ALPHA_HIDDEN
|
|
213
|
+
];
|
|
209
214
|
|
|
210
215
|
// ../commons/src/events/FieldValue.ts
|
|
211
216
|
var z7 = __toESM(require("zod/v4"));
|
|
@@ -324,7 +329,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
324
329
|
// ../commons/src/events/FieldValue.ts
|
|
325
330
|
var TextValue = z7.string();
|
|
326
331
|
var HiddenFieldValue = z7.string();
|
|
327
|
-
var NonEmptyTextValue =
|
|
332
|
+
var NonEmptyTextValue = z7.string().trim().min(1);
|
|
328
333
|
var DateValue = z7.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
329
334
|
var AgeValue = z7.object({
|
|
330
335
|
age: z7.number(),
|
|
@@ -1495,6 +1500,7 @@ var NumberField = BaseField.extend({
|
|
|
1495
1500
|
configuration: import_v43.default.object({
|
|
1496
1501
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1497
1502
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1503
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1498
1504
|
prefix: TranslationConfig.optional(),
|
|
1499
1505
|
postfix: TranslationConfig.optional()
|
|
1500
1506
|
}).optional()
|
|
@@ -7374,9 +7374,18 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
7374
7374
|
output: void;
|
|
7375
7375
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
7376
7376
|
}>;
|
|
7377
|
-
|
|
7377
|
+
requestEmailChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
7378
7378
|
input: {
|
|
7379
|
-
|
|
7379
|
+
email: string;
|
|
7380
|
+
};
|
|
7381
|
+
output: {
|
|
7382
|
+
nonce: string;
|
|
7383
|
+
};
|
|
7384
|
+
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
7385
|
+
}>;
|
|
7386
|
+
requestPhoneChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
7387
|
+
input: {
|
|
7388
|
+
phoneNumber: string;
|
|
7380
7389
|
};
|
|
7381
7390
|
output: {
|
|
7382
7391
|
nonce: string;
|
|
@@ -267,6 +267,7 @@ declare const NumberField: z.ZodObject<{
|
|
|
267
267
|
configuration: z.ZodOptional<z.ZodObject<{
|
|
268
268
|
min: z.ZodOptional<z.ZodNumber>;
|
|
269
269
|
max: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
integer: z.ZodOptional<z.ZodBoolean>;
|
|
270
271
|
prefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
271
272
|
postfix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>>;
|
|
272
273
|
}, z.core.$strip>>;
|
|
@@ -75,4 +75,5 @@ export type FieldType = (typeof fieldTypes)[number];
|
|
|
75
75
|
*/
|
|
76
76
|
export declare const compositeFieldTypes: ("NAME" | "ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS" | "DATA" | "ID_READER")[];
|
|
77
77
|
export declare const FieldTypesToHideInReview: ("IMAGE_VIEW" | "PARAGRAPH" | "PAGE_HEADER" | "BULLET_LIST" | "DIVIDER" | "DATA" | "ALPHA_PRINT_BUTTON" | "HTTP" | "QUERY_PARAM_READER" | "ID_READER" | "LOADER" | "ALPHA_HIDDEN")[];
|
|
78
|
+
export declare const HiddenFieldTypes: ("HTTP" | "QUERY_PARAM_READER" | "ALPHA_HIDDEN")[];
|
|
78
79
|
//# sourceMappingURL=FieldType.d.ts.map
|
|
@@ -690,7 +690,7 @@ export declare const isHiddenFieldType: (field: {
|
|
|
690
690
|
value: undefined;
|
|
691
691
|
config: HiddenField;
|
|
692
692
|
};
|
|
693
|
-
export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton |
|
|
693
|
+
export type NonInteractiveFieldType = Divider | PageHeader | ImageViewField | Paragraph | Heading | BulletList | DataField | AlphaPrintButton | LinkButtonField | LoaderField | AutocompleteField;
|
|
694
694
|
export type InteractiveFieldType = Exclude<FieldConfig, NonInteractiveFieldType>;
|
|
695
695
|
export declare const isNonInteractiveFieldType: (field: FieldConfig) => field is NonInteractiveFieldType;
|
|
696
696
|
export {};
|
package/dist/events/index.js
CHANGED
|
@@ -151,6 +151,7 @@ __export(events_exports, {
|
|
|
151
151
|
FormPageConfig: () => FormPageConfig,
|
|
152
152
|
Fuzzy: () => Fuzzy,
|
|
153
153
|
GeographicalArea: () => GeographicalArea,
|
|
154
|
+
HiddenFieldTypes: () => HiddenFieldTypes,
|
|
154
155
|
HiddenFieldValue: () => HiddenFieldValue,
|
|
155
156
|
HttpFieldUpdateValue: () => HttpFieldUpdateValue,
|
|
156
157
|
HttpFieldValue: () => HttpFieldValue,
|
|
@@ -1219,6 +1220,11 @@ var FieldTypesToHideInReview = [
|
|
|
1219
1220
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
1220
1221
|
FieldType.ALPHA_HIDDEN
|
|
1221
1222
|
];
|
|
1223
|
+
var HiddenFieldTypes = [
|
|
1224
|
+
FieldType.HTTP,
|
|
1225
|
+
FieldType.QUERY_PARAM_READER,
|
|
1226
|
+
FieldType.ALPHA_HIDDEN
|
|
1227
|
+
];
|
|
1222
1228
|
|
|
1223
1229
|
// ../commons/src/events/FieldValue.ts
|
|
1224
1230
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -1345,7 +1351,7 @@ function plainDateToLocalDate(date) {
|
|
|
1345
1351
|
// ../commons/src/events/FieldValue.ts
|
|
1346
1352
|
var TextValue = z12.string();
|
|
1347
1353
|
var HiddenFieldValue = z12.string();
|
|
1348
|
-
var NonEmptyTextValue =
|
|
1354
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
1349
1355
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
1350
1356
|
var AgeValue = z12.object({
|
|
1351
1357
|
age: z12.number(),
|
|
@@ -2292,6 +2298,7 @@ var NumberField = BaseField.extend({
|
|
|
2292
2298
|
configuration: import_v43.default.object({
|
|
2293
2299
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
2294
2300
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
2301
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
2295
2302
|
prefix: TranslationConfig.optional(),
|
|
2296
2303
|
postfix: TranslationConfig.optional()
|
|
2297
2304
|
}).optional()
|
|
@@ -3908,7 +3915,7 @@ var isHiddenFieldType = (field3) => {
|
|
|
3908
3915
|
return field3.config.type === FieldType.ALPHA_HIDDEN;
|
|
3909
3916
|
};
|
|
3910
3917
|
var isNonInteractiveFieldType = (field3) => {
|
|
3911
|
-
return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.
|
|
3918
|
+
return field3.type === FieldType.DIVIDER || field3.type === FieldType.PAGE_HEADER || field3.type === FieldType.PARAGRAPH || field3.type === FieldType.HEADING || field3.type === FieldType.BULLET_LIST || field3.type === FieldType.DATA || field3.type === FieldType.ALPHA_PRINT_BUTTON || field3.type === FieldType.LINK_BUTTON || field3.type === FieldType.LOADER;
|
|
3912
3919
|
};
|
|
3913
3920
|
|
|
3914
3921
|
// ../commons/src/conditionals/validate.ts
|
|
@@ -6485,6 +6492,8 @@ var updateActions = ActionTypes.extract([
|
|
|
6485
6492
|
ActionType.ARCHIVE,
|
|
6486
6493
|
ActionType.PRINT_CERTIFICATE,
|
|
6487
6494
|
ActionType.REQUEST_CORRECTION,
|
|
6495
|
+
ActionType.APPROVE_CORRECTION,
|
|
6496
|
+
ActionType.REJECT_CORRECTION,
|
|
6488
6497
|
ActionType.CUSTOM
|
|
6489
6498
|
]);
|
|
6490
6499
|
function getActionUpdateMetadata(actions) {
|
|
@@ -6526,9 +6535,6 @@ function getLegalStatuses(actions) {
|
|
|
6526
6535
|
// ../commons/src/events/state/flags.ts
|
|
6527
6536
|
var import_lodash3 = require("lodash");
|
|
6528
6537
|
var import_date_fns3 = require("date-fns");
|
|
6529
|
-
function isEditInProgress(actions) {
|
|
6530
|
-
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6531
|
-
}
|
|
6532
6538
|
function findPendingCorrectionAction(writeActions2) {
|
|
6533
6539
|
let correctionRequestAction;
|
|
6534
6540
|
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
@@ -6543,29 +6549,6 @@ function findPendingCorrectionAction(writeActions2) {
|
|
|
6543
6549
|
}
|
|
6544
6550
|
return correctionRequestAction;
|
|
6545
6551
|
}
|
|
6546
|
-
function isCorrectionRequested(actions) {
|
|
6547
|
-
return findPendingCorrectionAction(actions) !== void 0;
|
|
6548
|
-
}
|
|
6549
|
-
function isDeclarationIncomplete(actions) {
|
|
6550
|
-
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
6551
|
-
}
|
|
6552
|
-
function isRejected(actions) {
|
|
6553
|
-
const resettingActionTypes = [
|
|
6554
|
-
ActionType.NOTIFY,
|
|
6555
|
-
ActionType.DECLARE,
|
|
6556
|
-
ActionType.EDIT,
|
|
6557
|
-
ActionType.REGISTER
|
|
6558
|
-
];
|
|
6559
|
-
return actions.reduce((prev, { type }) => {
|
|
6560
|
-
if (type === ActionType.REJECT) {
|
|
6561
|
-
return true;
|
|
6562
|
-
}
|
|
6563
|
-
if (resettingActionTypes.includes(type)) {
|
|
6564
|
-
return false;
|
|
6565
|
-
}
|
|
6566
|
-
return prev;
|
|
6567
|
-
}, false);
|
|
6568
|
-
}
|
|
6569
6552
|
function isPotentialDuplicate(actions) {
|
|
6570
6553
|
return actions.reduce((prev, { type }) => {
|
|
6571
6554
|
if (type === ActionType.DUPLICATE_DETECTED) {
|
|
@@ -6593,6 +6576,88 @@ function isFlagConditionMet(conditional, form, action) {
|
|
|
6593
6576
|
}
|
|
6594
6577
|
});
|
|
6595
6578
|
}
|
|
6579
|
+
function actionConfigRemovesFlag(action, flagId, actionsUpToAndIncluding, event2, eventConfiguration) {
|
|
6580
|
+
if (!isActionConfigType(action.type)) {
|
|
6581
|
+
return false;
|
|
6582
|
+
}
|
|
6583
|
+
const actionConfig = getActionConfig({
|
|
6584
|
+
eventConfiguration,
|
|
6585
|
+
actionType: action.type,
|
|
6586
|
+
customActionType: "customActionType" in action ? action.customActionType : void 0
|
|
6587
|
+
});
|
|
6588
|
+
const removeOperations = (actionConfig?.flags ?? []).filter(
|
|
6589
|
+
({ id, operation }) => id === flagId && operation === "remove"
|
|
6590
|
+
);
|
|
6591
|
+
if (removeOperations.length === 0) {
|
|
6592
|
+
return false;
|
|
6593
|
+
}
|
|
6594
|
+
const eventUpToThisAction = { ...event2, actions: actionsUpToAndIncluding };
|
|
6595
|
+
const declaration = aggregateActionDeclarations(eventUpToThisAction);
|
|
6596
|
+
const annotation = aggregateActionAnnotations(eventUpToThisAction);
|
|
6597
|
+
const form = { ...declaration, ...annotation };
|
|
6598
|
+
return removeOperations.some(
|
|
6599
|
+
({ conditional }) => conditional ? isFlagConditionMet(conditional, form, action) : true
|
|
6600
|
+
);
|
|
6601
|
+
}
|
|
6602
|
+
var INHERENT_FLAG_RULES = [
|
|
6603
|
+
{
|
|
6604
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
6605
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
6606
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
6607
|
+
},
|
|
6608
|
+
{
|
|
6609
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
6610
|
+
// other status-changing action (see getStatusFromActions).
|
|
6611
|
+
flag: InherentFlags.INCOMPLETE,
|
|
6612
|
+
setOn: [ActionType.NOTIFY],
|
|
6613
|
+
resetOn: [
|
|
6614
|
+
ActionType.CREATE,
|
|
6615
|
+
ActionType.DECLARE,
|
|
6616
|
+
ActionType.REGISTER,
|
|
6617
|
+
ActionType.ARCHIVE
|
|
6618
|
+
]
|
|
6619
|
+
},
|
|
6620
|
+
{
|
|
6621
|
+
flag: InherentFlags.REJECTED,
|
|
6622
|
+
setOn: [ActionType.REJECT],
|
|
6623
|
+
resetOn: [
|
|
6624
|
+
ActionType.NOTIFY,
|
|
6625
|
+
ActionType.DECLARE,
|
|
6626
|
+
ActionType.EDIT,
|
|
6627
|
+
ActionType.REGISTER
|
|
6628
|
+
]
|
|
6629
|
+
},
|
|
6630
|
+
{
|
|
6631
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
6632
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
6633
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
6634
|
+
},
|
|
6635
|
+
{
|
|
6636
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
6637
|
+
setOn: [ActionType.EDIT],
|
|
6638
|
+
resetOnAnyOtherAction: true
|
|
6639
|
+
}
|
|
6640
|
+
];
|
|
6641
|
+
function resolveInherentFlag(rule, acceptedActions, event2, eventConfiguration) {
|
|
6642
|
+
return acceptedActions.reduce((present, action, idx) => {
|
|
6643
|
+
if (rule.setOn.includes(action.type)) {
|
|
6644
|
+
return true;
|
|
6645
|
+
}
|
|
6646
|
+
if (rule.resetOnAnyOtherAction || (rule.resetOn ?? []).includes(action.type)) {
|
|
6647
|
+
return false;
|
|
6648
|
+
}
|
|
6649
|
+
if (actionConfigRemovesFlag(
|
|
6650
|
+
action,
|
|
6651
|
+
rule.flag,
|
|
6652
|
+
acceptedActions.slice(0, idx + 1),
|
|
6653
|
+
event2,
|
|
6654
|
+
eventConfiguration
|
|
6655
|
+
)) {
|
|
6656
|
+
return false;
|
|
6657
|
+
}
|
|
6658
|
+
return present;
|
|
6659
|
+
}, false);
|
|
6660
|
+
}
|
|
6596
6661
|
function resolveEventCustomFlags(event2, eventConfiguration) {
|
|
6597
6662
|
const actions = getAcceptedActions(event2).filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6598
6663
|
return actions.reduce((acc, action, idx) => {
|
|
@@ -6641,33 +6706,19 @@ function getActionStatusFlags(sortedActions) {
|
|
|
6641
6706
|
return flag2;
|
|
6642
6707
|
});
|
|
6643
6708
|
}
|
|
6644
|
-
function getInherentFlags(sortedActions) {
|
|
6709
|
+
function getInherentFlags(sortedActions, event2, eventConfiguration) {
|
|
6645
6710
|
const acceptedActions = sortedActions.filter(
|
|
6646
6711
|
({ status: status2 }) => status2 === ActionStatus.Accepted
|
|
6647
6712
|
);
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
}
|
|
6652
|
-
if (isDeclarationIncomplete(acceptedActions)) {
|
|
6653
|
-
inherentFlags.push(InherentFlags.INCOMPLETE);
|
|
6654
|
-
}
|
|
6655
|
-
if (isRejected(acceptedActions)) {
|
|
6656
|
-
inherentFlags.push(InherentFlags.REJECTED);
|
|
6657
|
-
}
|
|
6658
|
-
if (isPotentialDuplicate(acceptedActions)) {
|
|
6659
|
-
inherentFlags.push(InherentFlags.POTENTIAL_DUPLICATE);
|
|
6660
|
-
}
|
|
6661
|
-
if (isEditInProgress(acceptedActions)) {
|
|
6662
|
-
inherentFlags.push(InherentFlags.EDIT_IN_PROGRESS);
|
|
6663
|
-
}
|
|
6664
|
-
return inherentFlags;
|
|
6713
|
+
return INHERENT_FLAG_RULES.filter(
|
|
6714
|
+
(rule) => resolveInherentFlag(rule, acceptedActions, event2, eventConfiguration)
|
|
6715
|
+
).map(({ flag: flag2 }) => flag2);
|
|
6665
6716
|
}
|
|
6666
6717
|
function getEventFlags(event2, config) {
|
|
6667
6718
|
const sortedActions = event2.actions.filter(({ type }) => !isMetaAction(type)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
6668
6719
|
return [
|
|
6669
6720
|
...getActionStatusFlags(sortedActions),
|
|
6670
|
-
...getInherentFlags(sortedActions),
|
|
6721
|
+
...getInherentFlags(sortedActions, event2, config),
|
|
6671
6722
|
...resolveEventCustomFlags(event2, config)
|
|
6672
6723
|
];
|
|
6673
6724
|
}
|
|
@@ -7672,6 +7723,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
7672
7723
|
id: "signature.upload.modal.title",
|
|
7673
7724
|
defaultMessage: "Draw signature",
|
|
7674
7725
|
description: "Title for the modal to draw signature"
|
|
7726
|
+
},
|
|
7727
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
7728
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
7729
|
+
configuration: {
|
|
7730
|
+
maxFileSize: 5 * 1024 * 1024
|
|
7675
7731
|
}
|
|
7676
7732
|
}
|
|
7677
7733
|
]
|
|
@@ -10228,7 +10284,7 @@ function matchesJurisdictionFilter(locationIds, filter, user2) {
|
|
|
10228
10284
|
return locationIds.some((id) => id === user2.primaryOfficeId);
|
|
10229
10285
|
}
|
|
10230
10286
|
if (filter === JurisdictionFilter.enum.administrativeArea) {
|
|
10231
|
-
return user2.administrativeAreaId
|
|
10287
|
+
return !user2.administrativeAreaId || locationIds.some((id) => id === user2.administrativeAreaId);
|
|
10232
10288
|
}
|
|
10233
10289
|
return true;
|
|
10234
10290
|
}
|
|
@@ -10317,7 +10373,7 @@ function canAccessUserWithScope({
|
|
|
10317
10373
|
}
|
|
10318
10374
|
const hasAdministrativeAreaInHierarchy = userToAccess.administrativeHierarchy.some(
|
|
10319
10375
|
(id) => user2.administrativeAreaId === id
|
|
10320
|
-
) || user2.administrativeAreaId
|
|
10376
|
+
) || !user2.administrativeAreaId;
|
|
10321
10377
|
if (opts?.accessLevel === JurisdictionFilter.enum.administrativeArea && !hasAdministrativeAreaInHierarchy) {
|
|
10322
10378
|
return false;
|
|
10323
10379
|
}
|
|
@@ -10623,18 +10679,19 @@ var ACTION_FILTERS = {
|
|
|
10623
10679
|
function filterActionsByFlags(actions, flags) {
|
|
10624
10680
|
return actions.filter((action) => ACTION_FILTERS[action]?.(flags) ?? true);
|
|
10625
10681
|
}
|
|
10682
|
+
var REJECTED_ACTIONS = [
|
|
10683
|
+
ActionType.READ,
|
|
10684
|
+
ActionType.NOTIFY,
|
|
10685
|
+
ActionType.CUSTOM,
|
|
10686
|
+
ActionType.EDIT,
|
|
10687
|
+
ActionType.ARCHIVE
|
|
10688
|
+
];
|
|
10626
10689
|
function getAvailableActionsWithoutFlagFilters(status2, flags) {
|
|
10627
10690
|
if (flags.includes(InherentFlags.EDIT_IN_PROGRESS)) {
|
|
10628
10691
|
return [ActionType.NOTIFY, ActionType.DECLARE, ActionType.REGISTER];
|
|
10629
10692
|
}
|
|
10630
|
-
if (flags.includes(InherentFlags.REJECTED)) {
|
|
10631
|
-
return
|
|
10632
|
-
ActionType.READ,
|
|
10633
|
-
ActionType.NOTIFY,
|
|
10634
|
-
ActionType.CUSTOM,
|
|
10635
|
-
ActionType.EDIT,
|
|
10636
|
-
ActionType.ARCHIVE
|
|
10637
|
-
];
|
|
10693
|
+
if (flags.includes(InherentFlags.REJECTED) && status2 !== EventStatus.enum.ARCHIVED) {
|
|
10694
|
+
return REJECTED_ACTIONS;
|
|
10638
10695
|
}
|
|
10639
10696
|
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[status2];
|
|
10640
10697
|
}
|
|
@@ -770,6 +770,11 @@ var FieldTypesToHideInReview = [
|
|
|
770
770
|
FieldType.ALPHA_PRINT_BUTTON,
|
|
771
771
|
FieldType.ALPHA_HIDDEN
|
|
772
772
|
];
|
|
773
|
+
var HiddenFieldTypes = [
|
|
774
|
+
FieldType.HTTP,
|
|
775
|
+
FieldType.QUERY_PARAM_READER,
|
|
776
|
+
FieldType.ALPHA_HIDDEN
|
|
777
|
+
];
|
|
773
778
|
|
|
774
779
|
// ../commons/src/events/FieldValue.ts
|
|
775
780
|
var z12 = __toESM(require("zod/v4"));
|
|
@@ -888,7 +893,7 @@ var PlainDate = import_zod.z.string().date().brand("PlainDate").describe("Date i
|
|
|
888
893
|
// ../commons/src/events/FieldValue.ts
|
|
889
894
|
var TextValue = z12.string();
|
|
890
895
|
var HiddenFieldValue = z12.string();
|
|
891
|
-
var NonEmptyTextValue =
|
|
896
|
+
var NonEmptyTextValue = z12.string().trim().min(1);
|
|
892
897
|
var DateValue = z12.iso.date().describe("Date in the format YYYY-MM-DD");
|
|
893
898
|
var AgeValue = z12.object({
|
|
894
899
|
age: z12.number(),
|
|
@@ -1750,6 +1755,7 @@ var NumberField = BaseField.extend({
|
|
|
1750
1755
|
configuration: import_v43.default.object({
|
|
1751
1756
|
min: import_v43.default.number().optional().describe("Minimum value"),
|
|
1752
1757
|
max: import_v43.default.number().optional().describe("Maximum value"),
|
|
1758
|
+
integer: import_v43.default.boolean().optional().describe("When true, only whole numbers are allowed"),
|
|
1753
1759
|
prefix: TranslationConfig.optional(),
|
|
1754
1760
|
postfix: TranslationConfig.optional()
|
|
1755
1761
|
}).optional()
|
|
@@ -4697,12 +4703,53 @@ var updateActions = ActionTypes.extract([
|
|
|
4697
4703
|
ActionType.ARCHIVE,
|
|
4698
4704
|
ActionType.PRINT_CERTIFICATE,
|
|
4699
4705
|
ActionType.REQUEST_CORRECTION,
|
|
4706
|
+
ActionType.APPROVE_CORRECTION,
|
|
4707
|
+
ActionType.REJECT_CORRECTION,
|
|
4700
4708
|
ActionType.CUSTOM
|
|
4701
4709
|
]);
|
|
4702
4710
|
|
|
4703
4711
|
// ../commons/src/events/state/flags.ts
|
|
4704
4712
|
var import_lodash3 = require("lodash");
|
|
4705
4713
|
var import_date_fns3 = require("date-fns");
|
|
4714
|
+
var INHERENT_FLAG_RULES = [
|
|
4715
|
+
{
|
|
4716
|
+
flag: InherentFlags.CORRECTION_REQUESTED,
|
|
4717
|
+
setOn: [ActionType.REQUEST_CORRECTION],
|
|
4718
|
+
resetOn: [ActionType.APPROVE_CORRECTION, ActionType.REJECT_CORRECTION]
|
|
4719
|
+
},
|
|
4720
|
+
{
|
|
4721
|
+
// INCOMPLETE mirrors the NOTIFIED status: set by NOTIFY, cleared by any
|
|
4722
|
+
// other status-changing action (see getStatusFromActions).
|
|
4723
|
+
flag: InherentFlags.INCOMPLETE,
|
|
4724
|
+
setOn: [ActionType.NOTIFY],
|
|
4725
|
+
resetOn: [
|
|
4726
|
+
ActionType.CREATE,
|
|
4727
|
+
ActionType.DECLARE,
|
|
4728
|
+
ActionType.REGISTER,
|
|
4729
|
+
ActionType.ARCHIVE
|
|
4730
|
+
]
|
|
4731
|
+
},
|
|
4732
|
+
{
|
|
4733
|
+
flag: InherentFlags.REJECTED,
|
|
4734
|
+
setOn: [ActionType.REJECT],
|
|
4735
|
+
resetOn: [
|
|
4736
|
+
ActionType.NOTIFY,
|
|
4737
|
+
ActionType.DECLARE,
|
|
4738
|
+
ActionType.EDIT,
|
|
4739
|
+
ActionType.REGISTER
|
|
4740
|
+
]
|
|
4741
|
+
},
|
|
4742
|
+
{
|
|
4743
|
+
flag: InherentFlags.POTENTIAL_DUPLICATE,
|
|
4744
|
+
setOn: [ActionType.DUPLICATE_DETECTED],
|
|
4745
|
+
resetOn: [ActionType.MARK_AS_DUPLICATE, ActionType.MARK_AS_NOT_DUPLICATE]
|
|
4746
|
+
},
|
|
4747
|
+
{
|
|
4748
|
+
flag: InherentFlags.EDIT_IN_PROGRESS,
|
|
4749
|
+
setOn: [ActionType.EDIT],
|
|
4750
|
+
resetOnAnyOtherAction: true
|
|
4751
|
+
}
|
|
4752
|
+
];
|
|
4706
4753
|
|
|
4707
4754
|
// ../commons/src/events/defineConfig.ts
|
|
4708
4755
|
var IGNORED_EVENT_TYPES = [
|
|
@@ -5448,6 +5495,11 @@ var TENNIS_CLUB_DECLARATION_REVIEW = {
|
|
|
5448
5495
|
id: "signature.upload.modal.title",
|
|
5449
5496
|
defaultMessage: "Draw signature",
|
|
5450
5497
|
description: "Title for the modal to draw signature"
|
|
5498
|
+
},
|
|
5499
|
+
// Zod applies the schema default at parse time, but this fixture bypasses
|
|
5500
|
+
// parsing — GeneratedInputField accesses configuration.maxFileSize directly.
|
|
5501
|
+
configuration: {
|
|
5502
|
+
maxFileSize: 5 * 1024 * 1024
|
|
5451
5503
|
}
|
|
5452
5504
|
}
|
|
5453
5505
|
]
|
|
@@ -7241,6 +7293,13 @@ var ACTION_FILTERS = {
|
|
|
7241
7293
|
[ActionType.UNASSIGN]: (flags) => !flags.some((flag) => flag.endsWith(":requested")),
|
|
7242
7294
|
[ActionType.CUSTOM]: (flags) => !flags.some((flag) => flag.endsWith(":requested"))
|
|
7243
7295
|
};
|
|
7296
|
+
var REJECTED_ACTIONS = [
|
|
7297
|
+
ActionType.READ,
|
|
7298
|
+
ActionType.NOTIFY,
|
|
7299
|
+
ActionType.CUSTOM,
|
|
7300
|
+
ActionType.EDIT,
|
|
7301
|
+
ActionType.ARCHIVE
|
|
7302
|
+
];
|
|
7244
7303
|
|
|
7245
7304
|
// ../commons/src/events/FileUtils.ts
|
|
7246
7305
|
var import_lodash7 = require("lodash");
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|