@defra/forms-model 3.0.604 → 3.0.606

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 (31) hide show
  1. package/dist/module/components/component-types.js +6 -0
  2. package/dist/module/components/component-types.js.map +1 -1
  3. package/dist/module/components/enums.js +1 -0
  4. package/dist/module/components/enums.js.map +1 -1
  5. package/dist/module/components/types.js.map +1 -1
  6. package/dist/module/form/form-audit/consolidation.js +3 -3
  7. package/dist/module/form/form-audit/consolidation.js.map +1 -1
  8. package/dist/module/form/form-definition/index.js +9 -1
  9. package/dist/module/form/form-definition/index.js.map +1 -1
  10. package/dist/types/components/component-types.d.ts.map +1 -1
  11. package/dist/types/components/enums.d.ts +2 -1
  12. package/dist/types/components/enums.d.ts.map +1 -1
  13. package/dist/types/components/types.d.ts +9 -2
  14. package/dist/types/components/types.d.ts.map +1 -1
  15. package/dist/types/form/form-audit/consolidation.d.ts +1 -1
  16. package/dist/types/form/form-audit/consolidation.d.ts.map +1 -1
  17. package/dist/types/form/form-definition/index.d.ts.map +1 -1
  18. package/package.json +1 -1
  19. package/schemas/component-schema-v2.json +13 -0
  20. package/schemas/component-schema.json +13 -0
  21. package/schemas/form-definition-schema.json +39 -0
  22. package/schemas/form-definition-v2-schema.json +65 -0
  23. package/schemas/list-schema-v2.json +26 -0
  24. package/schemas/list-schema.json +26 -0
  25. package/schemas/page-schema-v2.json +39 -0
  26. package/schemas/page-schema.json +13 -0
  27. package/src/components/component-types.ts +7 -0
  28. package/src/components/enums.ts +2 -1
  29. package/src/components/types.ts +10 -0
  30. package/src/form/form-audit/consolidation.ts +9 -3
  31. package/src/form/form-definition/index.ts +16 -1
@@ -160,5 +160,11 @@ export const ComponentTypes = Object.freeze([{
160
160
  hint: '',
161
161
  options: {},
162
162
  schema: {}
163
+ }, {
164
+ name: 'PaymentField',
165
+ title: 'Payment field',
166
+ type: ComponentType.PaymentField,
167
+ hint: '',
168
+ options: {}
163
169
  }]);
164
170
  //# sourceMappingURL=component-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-types.js","names":["ComponentType","ComponentTypes","Object","freeze","name","title","type","TextField","hint","options","schema","MultilineTextField","YesNoField","DatePartsField","MonthYearField","SelectField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","FileUploadField","Html","content","InsetText","Markdown","Details","List","DeclarationField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Defaults for creating new components\n */\nexport const ComponentTypes: readonly ComponentDef[] = Object.freeze([\n {\n name: 'TextField',\n title: 'Text field',\n type: ComponentType.TextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n title: 'Multiline text field',\n type: ComponentType.MultilineTextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n title: 'Yes/No field',\n type: ComponentType.YesNoField,\n hint: '',\n options: {}\n },\n {\n name: 'DatePartsField',\n title: 'Date field',\n type: ComponentType.DatePartsField,\n hint: '',\n options: {}\n },\n {\n name: 'MonthYearField',\n title: 'Month & year field',\n type: ComponentType.MonthYearField,\n hint: '',\n options: {}\n },\n {\n name: 'SelectField',\n title: 'Select field',\n type: ComponentType.SelectField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'AutocompleteField',\n title: 'Autocomplete field',\n type: ComponentType.AutocompleteField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'RadiosField',\n title: 'Radios field',\n type: ComponentType.RadiosField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'CheckboxesField',\n title: 'Checkboxes field',\n type: ComponentType.CheckboxesField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'NumberField',\n title: 'Number field',\n type: ComponentType.NumberField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n title: 'UK address field',\n type: ComponentType.UkAddressField,\n hint: '',\n options: {}\n },\n {\n name: 'TelephoneNumberField',\n title: 'Telephone number field',\n type: ComponentType.TelephoneNumberField,\n hint: '',\n options: {}\n },\n {\n name: 'EmailAddressField',\n title: 'Email address field',\n type: ComponentType.EmailAddressField,\n hint: 'For example, ‘name@example.com’',\n options: {}\n },\n {\n name: 'FileUploadField',\n title: 'File upload field',\n type: ComponentType.FileUploadField,\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n title: 'Html',\n type: ComponentType.Html,\n content: '',\n options: {}\n },\n {\n name: 'InsetText',\n title: 'Inset text',\n type: ComponentType.InsetText,\n content: ''\n },\n {\n name: 'Markdown',\n title: 'Markdown',\n type: ComponentType.Markdown,\n content: '',\n options: {}\n },\n {\n name: 'Details',\n title: 'Details',\n type: ComponentType.Details,\n content: '',\n options: {}\n },\n {\n name: 'List',\n title: 'List',\n type: ComponentType.List,\n list: '',\n options: {}\n },\n {\n name: 'DeclarationField',\n title: 'Declaration',\n type: ComponentType.DeclarationField,\n hint: '',\n content: '',\n options: {}\n },\n {\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n type: ComponentType.EastingNorthingField,\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {}\n },\n {\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n type: ComponentType.OsGridRefField,\n hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',\n options: {}\n },\n {\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n type: ComponentType.NationalGridFieldNumberField,\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678',\n options: {}\n },\n {\n name: 'LatLongField',\n title: 'Latitude and longitude',\n type: ComponentType.LatLongField,\n hint: 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767',\n options: {}\n },\n {\n name: 'HiddenField',\n title: 'Hidden field',\n type: ComponentType.HiddenField,\n hint: '',\n options: {},\n schema: {}\n }\n])\n"],"mappings":"AAAA,SAASA,aAAa;AAGtB;AACA;AACA;AACA,OAAO,MAAMC,cAAuC,GAAGC,MAAM,CAACC,MAAM,CAAC,CACnE;EACEC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACO,SAAS;EAC7BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAEN,aAAa,CAACW,kBAAkB;EACtCH,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACY,UAAU;EAC9BJ,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACa,cAAc;EAClCL,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,oBAAoB;EAC3BC,IAAI,EAAEN,aAAa,CAACc,cAAc;EAClCN,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACe,WAAW;EAC/BP,IAAI,EAAE,EAAE;EACRQ,IAAI,EAAE,EAAE;EACRP,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,mBAAmB;EACzBC,K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,CAAC,EACD;EACEL,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,qCAAqC;EAC5CC,IAAI,EAAEN,aAAa,CAACiC,cAAc;EAClCzB,IAAI,EAAE,kHAAkH;EACxHC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,8BAA8B;EACpCC,KAAK,EAAE,4BAA4B;EACnCC,IAAI,EAAEN,aAAa,CAACkC,4BAA4B;EAChD1B,IAAI,EAAE,+FAA+F;EACrGC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,wBAAwB;EAC/BC,IAAI,EAAEN,aAAa,CAACmC,YAAY;EAChC3B,IAAI,EAAE,sIAAsI;EAC5IC,OAAO,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACoC,WAAW;EAC/B5B,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"component-types.js","names":["ComponentType","ComponentTypes","Object","freeze","name","title","type","TextField","hint","options","schema","MultilineTextField","YesNoField","DatePartsField","MonthYearField","SelectField","list","AutocompleteField","RadiosField","CheckboxesField","NumberField","UkAddressField","TelephoneNumberField","EmailAddressField","FileUploadField","Html","content","InsetText","Markdown","Details","List","DeclarationField","EastingNorthingField","OsGridRefField","NationalGridFieldNumberField","LatLongField","HiddenField","PaymentField"],"sources":["../../../src/components/component-types.ts"],"sourcesContent":["import { ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\n\n/**\n * Defaults for creating new components\n */\nexport const ComponentTypes: readonly ComponentDef[] = Object.freeze([\n {\n name: 'TextField',\n title: 'Text field',\n type: ComponentType.TextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'MultilineTextField',\n title: 'Multiline text field',\n type: ComponentType.MultilineTextField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'YesNoField',\n title: 'Yes/No field',\n type: ComponentType.YesNoField,\n hint: '',\n options: {}\n },\n {\n name: 'DatePartsField',\n title: 'Date field',\n type: ComponentType.DatePartsField,\n hint: '',\n options: {}\n },\n {\n name: 'MonthYearField',\n title: 'Month & year field',\n type: ComponentType.MonthYearField,\n hint: '',\n options: {}\n },\n {\n name: 'SelectField',\n title: 'Select field',\n type: ComponentType.SelectField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'AutocompleteField',\n title: 'Autocomplete field',\n type: ComponentType.AutocompleteField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'RadiosField',\n title: 'Radios field',\n type: ComponentType.RadiosField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'CheckboxesField',\n title: 'Checkboxes field',\n type: ComponentType.CheckboxesField,\n hint: '',\n list: '',\n options: {}\n },\n {\n name: 'NumberField',\n title: 'Number field',\n type: ComponentType.NumberField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'UkAddressField',\n title: 'UK address field',\n type: ComponentType.UkAddressField,\n hint: '',\n options: {}\n },\n {\n name: 'TelephoneNumberField',\n title: 'Telephone number field',\n type: ComponentType.TelephoneNumberField,\n hint: '',\n options: {}\n },\n {\n name: 'EmailAddressField',\n title: 'Email address field',\n type: ComponentType.EmailAddressField,\n hint: 'For example, ‘name@example.com’',\n options: {}\n },\n {\n name: 'FileUploadField',\n title: 'File upload field',\n type: ComponentType.FileUploadField,\n options: {},\n schema: {}\n },\n {\n name: 'Html',\n title: 'Html',\n type: ComponentType.Html,\n content: '',\n options: {}\n },\n {\n name: 'InsetText',\n title: 'Inset text',\n type: ComponentType.InsetText,\n content: ''\n },\n {\n name: 'Markdown',\n title: 'Markdown',\n type: ComponentType.Markdown,\n content: '',\n options: {}\n },\n {\n name: 'Details',\n title: 'Details',\n type: ComponentType.Details,\n content: '',\n options: {}\n },\n {\n name: 'List',\n title: 'List',\n type: ComponentType.List,\n list: '',\n options: {}\n },\n {\n name: 'DeclarationField',\n title: 'Declaration',\n type: ComponentType.DeclarationField,\n hint: '',\n content: '',\n options: {}\n },\n {\n name: 'EastingNorthingField',\n title: 'Easting and northing',\n type: ComponentType.EastingNorthingField,\n hint: 'For example, Easting: 248741, Northing: 63688',\n options: {}\n },\n {\n name: 'OsGridRefField',\n title: 'Ordnance Survey (OS) grid reference',\n type: ComponentType.OsGridRefField,\n hint: 'An OS grid reference number is made up of 2 letters followed by either 6, 8 or 10 numbers, for example, TQ123456',\n options: {}\n },\n {\n name: 'NationalGridFieldNumberField',\n title: 'National Grid field number',\n type: ComponentType.NationalGridFieldNumberField,\n hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, NG 1234 5678',\n options: {}\n },\n {\n name: 'LatLongField',\n title: 'Latitude and longitude',\n type: ComponentType.LatLongField,\n hint: 'For Great Britain, the latitude will be a number between 49.850 and 60.859. The longitude will be a number between -13.687 and 1.767',\n options: {}\n },\n {\n name: 'HiddenField',\n title: 'Hidden field',\n type: ComponentType.HiddenField,\n hint: '',\n options: {},\n schema: {}\n },\n {\n name: 'PaymentField',\n title: 'Payment field',\n type: ComponentType.PaymentField,\n hint: '',\n options: {}\n }\n])\n"],"mappings":"AAAA,SAASA,aAAa;AAGtB;AACA;AACA;AACA,OAAO,MAAMC,cAAuC,GAAGC,MAAM,CAACC,MAAM,CAAC,CACnE;EACEC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAEN,aAAa,CAACO,SAAS;EAC7BC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,sBAAsB;EAC7BC,IAAI,EAAEN,aAAa,CAACW,kBAAkB;EACtCH,IAAI,EAAE,EAAE;EACRC,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O,EAAE,CAAC;AACZ,CAAC,EACD;EACEL,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,cAAc;EACrBC,IAAI,EAAEN,aAAa,CAACoC,WAAW;EAC/B5B,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC,CAAC;EACXC,MAAM,EAAE,CAAC;AACX,CAAC,EACD;EACEN,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAEN,aAAa,CAACqC,YAAY;EAChC7B,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,CAAC;AACZ,CAAC,CACF,CAAC","ignoreList":[]}
@@ -24,6 +24,7 @@ export let ComponentType = /*#__PURE__*/function (ComponentType) {
24
24
  ComponentType["NationalGridFieldNumberField"] = "NationalGridFieldNumberField";
25
25
  ComponentType["LatLongField"] = "LatLongField";
26
26
  ComponentType["HiddenField"] = "HiddenField";
27
+ ComponentType["PaymentField"] = "PaymentField";
27
28
  return ComponentType;
28
29
  }({});
29
30
  export const PreviewTypeEnum = {
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["ComponentType","PreviewTypeEnum","Question","ListSortable"],"sources":["../../../src/components/enums.ts"],"sourcesContent":["export enum ComponentType {\n TextField = 'TextField',\n MultilineTextField = 'MultilineTextField',\n YesNoField = 'YesNoField',\n DatePartsField = 'DatePartsField',\n MonthYearField = 'MonthYearField',\n SelectField = 'SelectField',\n AutocompleteField = 'AutocompleteField',\n RadiosField = 'RadiosField',\n CheckboxesField = 'CheckboxesField',\n NumberField = 'NumberField',\n UkAddressField = 'UkAddressField',\n TelephoneNumberField = 'TelephoneNumberField',\n EmailAddressField = 'EmailAddressField',\n Html = 'Html',\n InsetText = 'InsetText',\n Details = 'Details',\n List = 'List',\n Markdown = 'Markdown',\n FileUploadField = 'FileUploadField',\n DeclarationField = 'DeclarationField',\n EastingNorthingField = 'EastingNorthingField',\n OsGridRefField = 'OsGridRefField',\n NationalGridFieldNumberField = 'NationalGridFieldNumberField',\n LatLongField = 'LatLongField',\n HiddenField = 'HiddenField'\n}\n\nexport const PreviewTypeEnum = {\n ...ComponentType,\n Question: 'Question',\n ListSortable: 'ListSortable'\n} as Record<string, string>\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AA4BzB,OAAO,MAAMC,eAAe,GAAG;EAC7B,GAAGD,aAAa;EAChBE,QAAQ,EAAE,UAAU;EACpBC,YAAY,EAAE;AAChB,CAA2B","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["ComponentType","PreviewTypeEnum","Question","ListSortable"],"sources":["../../../src/components/enums.ts"],"sourcesContent":["export enum ComponentType {\n TextField = 'TextField',\n MultilineTextField = 'MultilineTextField',\n YesNoField = 'YesNoField',\n DatePartsField = 'DatePartsField',\n MonthYearField = 'MonthYearField',\n SelectField = 'SelectField',\n AutocompleteField = 'AutocompleteField',\n RadiosField = 'RadiosField',\n CheckboxesField = 'CheckboxesField',\n NumberField = 'NumberField',\n UkAddressField = 'UkAddressField',\n TelephoneNumberField = 'TelephoneNumberField',\n EmailAddressField = 'EmailAddressField',\n Html = 'Html',\n InsetText = 'InsetText',\n Details = 'Details',\n List = 'List',\n Markdown = 'Markdown',\n FileUploadField = 'FileUploadField',\n DeclarationField = 'DeclarationField',\n EastingNorthingField = 'EastingNorthingField',\n OsGridRefField = 'OsGridRefField',\n NationalGridFieldNumberField = 'NationalGridFieldNumberField',\n LatLongField = 'LatLongField',\n HiddenField = 'HiddenField',\n PaymentField = 'PaymentField'\n}\n\nexport const PreviewTypeEnum = {\n ...ComponentType,\n Question: 'Question',\n ListSortable: 'ListSortable'\n} as Record<string, string>\n"],"mappings":"AAAA,WAAYA,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AA6BzB,OAAO,MAAMC,eAAe,GAAG;EAC7B,GAAGD,aAAa;EAChBE,QAAQ,EAAE,UAAU;EACpBC,YAAY,EAAE;AAChB,CAA2B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["import { type LanguageMessages } from 'joi'\n\nimport {\n type ComponentType,\n type PreviewTypeEnum\n} from '~/src/components/enums.js'\nimport {\n type ListTypeContent,\n type ListTypeOption\n} from '~/src/form/form-definition/types.js'\n\nexport type ConditionalComponentType = Exclude<\n ConditionalComponentsDef['type'],\n ContentComponentsDef\n>\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\n\ninterface FormFieldBase {\n id?: string\n type: FormComponentsDef['type']\n shortDescription?: string\n name: string\n title: string\n hint?: string\n options: {\n required?: boolean\n optionalText?: boolean\n classes?: string\n customValidationMessages?: LanguageMessages\n instructionText?: string\n }\n}\n\ninterface ListFieldBase extends FormFieldBase {\n type:\n | ComponentType.AutocompleteField\n | ComponentType.CheckboxesField\n | ComponentType.RadiosField\n | ComponentType.SelectField\n list: string\n options: FormFieldBase['options'] & {\n type?: ListTypeContent\n }\n}\n\ninterface ContentFieldBase {\n id?: string\n type:\n | ComponentType.Details\n | ComponentType.Html\n | ComponentType.Markdown\n | ComponentType.InsetText\n | ComponentType.List\n name: string\n title: string\n options?: {\n required?: undefined\n optionalText?: undefined\n }\n}\n\ninterface DateFieldBase extends FormFieldBase {\n type: ComponentType.DatePartsField | ComponentType.MonthYearField\n name: string\n title: string\n hint?: string\n options: FormFieldBase['options'] & {\n maxDaysInPast?: number\n maxDaysInFuture?: number\n }\n}\n\n// Text Fields\nexport interface TextFieldComponent extends FormFieldBase {\n type: ComponentType.TextField\n options: FormFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends FormFieldBase {\n type: ComponentType.EmailAddressField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface NumberFieldComponent extends FormFieldBase {\n type: ComponentType.NumberField\n options: FormFieldBase['options'] & {\n prefix?: string\n suffix?: string\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n }\n schema: {\n max?: number\n min?: number\n precision?: number\n minPrecision?: number\n minLength?: number\n maxLength?: number\n }\n}\n\nexport interface TelephoneNumberFieldComponent extends FormFieldBase {\n type: ComponentType.TelephoneNumberField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface FileUploadFieldComponent extends FormFieldBase {\n type: ComponentType.FileUploadField\n name: string\n title: string\n hint?: string\n options: FormFieldBase['options'] & {\n accept?: string\n }\n schema: {\n max?: number\n min?: number\n length?: number\n }\n}\n\nexport interface YesNoFieldComponent extends FormFieldBase {\n type: ComponentType.YesNoField\n options: FormFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface DeclarationFieldComponent extends FormFieldBase {\n type: ComponentType.DeclarationField\n content: string\n options: FormFieldBase['options'] & {\n condition?: string\n declarationConfirmationLabel?: string\n }\n}\n\nexport interface MultilineTextFieldComponent extends FormFieldBase {\n type: ComponentType.MultilineTextField\n options: FormFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n }\n}\n\nexport interface UkAddressFieldComponent extends FormFieldBase {\n type: ComponentType.UkAddressField\n options: FormFieldBase['options'] & {\n hideTitle?: boolean\n usePostcodeLookup?: boolean\n }\n}\n\n// Precise Location Fields\nexport interface EastingNorthingFieldComponent extends FormFieldBase {\n type: ComponentType.EastingNorthingField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n schema?: {\n easting?: {\n min?: number\n max?: number\n }\n northing?: {\n min?: number\n max?: number\n }\n }\n}\n\nexport interface OsGridRefFieldComponent extends FormFieldBase {\n type: ComponentType.OsGridRefField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface NationalGridFieldNumberFieldComponent extends FormFieldBase {\n type: ComponentType.NationalGridFieldNumberField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface LatLongFieldComponent extends FormFieldBase {\n type: ComponentType.LatLongField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n schema?: {\n latitude?: {\n min?: number\n max?: number\n }\n longitude?: {\n min?: number\n max?: number\n }\n }\n}\n\nexport interface HiddenFieldComponent extends FormFieldBase {\n type: ComponentType.HiddenField\n options: FormFieldBase['options'] & {\n condition?: string\n }\n}\n\n// Date Fields\nexport interface DatePartsFieldComponent extends DateFieldBase {\n type: ComponentType.DatePartsField\n options: DateFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: ComponentType.MonthYearField\n options: DateFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: ComponentType.Details\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: ComponentType.Html\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface MarkdownComponent extends ContentFieldBase {\n type: ComponentType.Markdown\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: ComponentType.InsetText\n content: string\n}\n\nexport interface ListComponent extends ContentFieldBase {\n type: ComponentType.List\n hint?: string\n list: string\n options: ContentFieldBase['options'] & {\n type?: ListTypeOption\n classes?: string\n hideTitle?: boolean\n bold?: boolean\n }\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: ComponentType.AutocompleteField\n options: ListFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: ComponentType.CheckboxesField\n options: ListFieldBase['options'] & {\n bold?: boolean\n condition?: string\n }\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: ComponentType.RadiosField\n options: ListFieldBase['options'] & {\n bold?: boolean\n condition?: string\n }\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: ComponentType.SelectField\n options: ListFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n }\n}\n\nexport type ComponentDef = FormComponentsDef | ContentComponentsDef\n\n// Components that render form fields\nexport type FormComponentsDef =\n | InputFieldsComponentsDef\n | SelectionComponentsDef\n\n// Components that render inputs\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | MonthYearFieldComponent\n | DatePartsFieldComponent\n | UkAddressFieldComponent\n | FileUploadFieldComponent\n | DeclarationFieldComponent\n | EastingNorthingFieldComponent\n | OsGridRefFieldComponent\n | NationalGridFieldNumberFieldComponent\n | LatLongFieldComponent\n | HiddenFieldComponent\n\n// Components that render content\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | MarkdownComponent\n | InsetTextComponent\n | ListComponent\n\n// Components that render lists\nexport type ListComponentsDef =\n | Exclude<SelectionComponentsDef, YesNoFieldComponent>\n | ListComponent\n\n// Components that have selection fields\nexport type SelectionComponentsDef =\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | YesNoFieldComponent\n\n// Components that have condition support\nexport type ConditionalComponentsDef = Exclude<\n ComponentDef,\n | InsetTextComponent\n | ListComponent\n | MonthYearFieldComponent\n | UkAddressFieldComponent\n | FileUploadFieldComponent\n>\n\nexport type PreviewType = keyof typeof PreviewTypeEnum\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/types.ts"],"sourcesContent":["import { type LanguageMessages } from 'joi'\n\nimport {\n type ComponentType,\n type PreviewTypeEnum\n} from '~/src/components/enums.js'\nimport {\n type ListTypeContent,\n type ListTypeOption\n} from '~/src/form/form-definition/types.js'\n\nexport type ConditionalComponentType = Exclude<\n ConditionalComponentsDef['type'],\n ContentComponentsDef\n>\n\n/**\n * Types for Components JSON structure which are expected by engine and turned into actual form input/content/lists\n */\n\ninterface FormFieldBase {\n id?: string\n type: FormComponentsDef['type']\n shortDescription?: string\n name: string\n title: string\n hint?: string\n options: {\n required?: boolean\n optionalText?: boolean\n classes?: string\n customValidationMessages?: LanguageMessages\n instructionText?: string\n }\n}\n\ninterface ListFieldBase extends FormFieldBase {\n type:\n | ComponentType.AutocompleteField\n | ComponentType.CheckboxesField\n | ComponentType.RadiosField\n | ComponentType.SelectField\n list: string\n options: FormFieldBase['options'] & {\n type?: ListTypeContent\n }\n}\n\ninterface ContentFieldBase {\n id?: string\n type:\n | ComponentType.Details\n | ComponentType.Html\n | ComponentType.Markdown\n | ComponentType.InsetText\n | ComponentType.List\n name: string\n title: string\n options?: {\n required?: undefined\n optionalText?: undefined\n }\n}\n\ninterface DateFieldBase extends FormFieldBase {\n type: ComponentType.DatePartsField | ComponentType.MonthYearField\n name: string\n title: string\n hint?: string\n options: FormFieldBase['options'] & {\n maxDaysInPast?: number\n maxDaysInFuture?: number\n }\n}\n\n// Text Fields\nexport interface TextFieldComponent extends FormFieldBase {\n type: ComponentType.TextField\n options: FormFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n }\n}\n\nexport interface EmailAddressFieldComponent extends FormFieldBase {\n type: ComponentType.EmailAddressField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface NumberFieldComponent extends FormFieldBase {\n type: ComponentType.NumberField\n options: FormFieldBase['options'] & {\n prefix?: string\n suffix?: string\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n }\n schema: {\n max?: number\n min?: number\n precision?: number\n minPrecision?: number\n minLength?: number\n maxLength?: number\n }\n}\n\nexport interface TelephoneNumberFieldComponent extends FormFieldBase {\n type: ComponentType.TelephoneNumberField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface FileUploadFieldComponent extends FormFieldBase {\n type: ComponentType.FileUploadField\n name: string\n title: string\n hint?: string\n options: FormFieldBase['options'] & {\n accept?: string\n }\n schema: {\n max?: number\n min?: number\n length?: number\n }\n}\n\nexport interface YesNoFieldComponent extends FormFieldBase {\n type: ComponentType.YesNoField\n options: FormFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface DeclarationFieldComponent extends FormFieldBase {\n type: ComponentType.DeclarationField\n content: string\n options: FormFieldBase['options'] & {\n condition?: string\n declarationConfirmationLabel?: string\n }\n}\n\nexport interface MultilineTextFieldComponent extends FormFieldBase {\n type: ComponentType.MultilineTextField\n options: FormFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n customValidationMessage?: string\n rows?: number\n maxWords?: number\n }\n schema: {\n max?: number\n min?: number\n length?: number\n regex?: string\n }\n}\n\nexport interface UkAddressFieldComponent extends FormFieldBase {\n type: ComponentType.UkAddressField\n options: FormFieldBase['options'] & {\n hideTitle?: boolean\n usePostcodeLookup?: boolean\n }\n}\n\n// Precise Location Fields\nexport interface EastingNorthingFieldComponent extends FormFieldBase {\n type: ComponentType.EastingNorthingField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n schema?: {\n easting?: {\n min?: number\n max?: number\n }\n northing?: {\n min?: number\n max?: number\n }\n }\n}\n\nexport interface OsGridRefFieldComponent extends FormFieldBase {\n type: ComponentType.OsGridRefField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface NationalGridFieldNumberFieldComponent extends FormFieldBase {\n type: ComponentType.NationalGridFieldNumberField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n}\n\nexport interface LatLongFieldComponent extends FormFieldBase {\n type: ComponentType.LatLongField\n options: FormFieldBase['options'] & {\n condition?: string\n customValidationMessage?: string\n }\n schema?: {\n latitude?: {\n min?: number\n max?: number\n }\n longitude?: {\n min?: number\n max?: number\n }\n }\n}\n\nexport interface HiddenFieldComponent extends FormFieldBase {\n type: ComponentType.HiddenField\n options: FormFieldBase['options'] & {\n condition?: string\n }\n}\n\n// Date Fields\nexport interface DatePartsFieldComponent extends DateFieldBase {\n type: ComponentType.DatePartsField\n options: DateFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface MonthYearFieldComponent extends DateFieldBase {\n type: ComponentType.MonthYearField\n options: DateFieldBase['options'] & {\n customValidationMessage?: string\n }\n}\n\nexport interface PaymentFieldComponent extends FormFieldBase {\n type: ComponentType.PaymentField\n options: FormFieldBase['options'] & {\n amount?: number\n description?: string\n }\n}\n\n// Content Fields\nexport interface DetailsComponent extends ContentFieldBase {\n type: ComponentType.Details\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface HtmlComponent extends ContentFieldBase {\n type: ComponentType.Html\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface MarkdownComponent extends ContentFieldBase {\n type: ComponentType.Markdown\n content: string\n options: ContentFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface InsetTextComponent extends ContentFieldBase {\n type: ComponentType.InsetText\n content: string\n}\n\nexport interface ListComponent extends ContentFieldBase {\n type: ComponentType.List\n hint?: string\n list: string\n options: ContentFieldBase['options'] & {\n type?: ListTypeOption\n classes?: string\n hideTitle?: boolean\n bold?: boolean\n }\n}\n\nexport interface AutocompleteFieldComponent extends ListFieldBase {\n type: ComponentType.AutocompleteField\n options: ListFieldBase['options'] & {\n condition?: string\n }\n}\n\nexport interface CheckboxesFieldComponent extends ListFieldBase {\n type: ComponentType.CheckboxesField\n options: ListFieldBase['options'] & {\n bold?: boolean\n condition?: string\n }\n}\n\nexport interface RadiosFieldComponent extends ListFieldBase {\n type: ComponentType.RadiosField\n options: ListFieldBase['options'] & {\n bold?: boolean\n condition?: string\n }\n}\n\nexport interface SelectFieldComponent extends ListFieldBase {\n type: ComponentType.SelectField\n options: ListFieldBase['options'] & {\n autocomplete?: string\n condition?: string\n }\n}\n\nexport type ComponentDef = FormComponentsDef | ContentComponentsDef\n\n// Components that render form fields\nexport type FormComponentsDef =\n | InputFieldsComponentsDef\n | SelectionComponentsDef\n\n// Components that render inputs\nexport type InputFieldsComponentsDef =\n | TextFieldComponent\n | EmailAddressFieldComponent\n | NumberFieldComponent\n | MultilineTextFieldComponent\n | TelephoneNumberFieldComponent\n | MonthYearFieldComponent\n | DatePartsFieldComponent\n | UkAddressFieldComponent\n | FileUploadFieldComponent\n | DeclarationFieldComponent\n | EastingNorthingFieldComponent\n | OsGridRefFieldComponent\n | NationalGridFieldNumberFieldComponent\n | LatLongFieldComponent\n | HiddenFieldComponent\n | PaymentFieldComponent\n\n// Components that render content\nexport type ContentComponentsDef =\n | DetailsComponent\n | HtmlComponent\n | MarkdownComponent\n | InsetTextComponent\n | ListComponent\n\n// Components that render lists\nexport type ListComponentsDef =\n | Exclude<SelectionComponentsDef, YesNoFieldComponent>\n | ListComponent\n\n// Components that have selection fields\nexport type SelectionComponentsDef =\n | AutocompleteFieldComponent\n | CheckboxesFieldComponent\n | RadiosFieldComponent\n | SelectFieldComponent\n | YesNoFieldComponent\n\n// Components that have condition support\nexport type ConditionalComponentsDef = Exclude<\n ComponentDef,\n | InsetTextComponent\n | ListComponent\n | MonthYearFieldComponent\n | UkAddressFieldComponent\n | FileUploadFieldComponent\n | PaymentFieldComponent\n>\n\nexport type PreviewType = keyof typeof PreviewTypeEnum\n"],"mappings":"","ignoreList":[]}
@@ -53,7 +53,7 @@ export const fieldConfigs = {
53
53
  * Support contact field configurations for change detection.
54
54
  * Used when checking FORM_SUPPORT_CONTACT_UPDATED events.
55
55
  */
56
- export const supportContactFields = [createSupportContactField('phone number', 'phone'), createSupportContactField('email address', 'email.address'), createSupportContactField('online contact link', 'online.url')];
56
+ export const supportContactFields = [createSupportContactField('phone number', 'phone'), createSupportContactField('email address', 'email.address'), createSupportContactField('email response time', 'email.responseTime'), createSupportContactField('online contact link', 'online.url'), createSupportContactField('online contact text', 'online.text')];
57
57
 
58
58
  /**
59
59
  * Event types that are always considered valid (don't need change comparison).
@@ -64,9 +64,9 @@ export const alwaysValidEvents = new Set([AuditEventMessageType.FORM_CREATED, Au
64
64
  /**
65
65
  * Type guard to check if an audit record is consolidated.
66
66
  * @param record - The audit record to check
67
- * @returns True if the record has consolidation metadata
67
+ * @returns True if the record has consolidation metadata with count > 1
68
68
  */
69
69
  export function isConsolidatedRecord(record) {
70
- return 'consolidatedCount' in record && record.consolidatedCount > 1;
70
+ return 'consolidatedCount' in record && typeof record.consolidatedCount === 'number' && record.consolidatedCount > 1;
71
71
  }
72
72
  //# sourceMappingURL=consolidation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consolidation.js","names":["AuditEventMessageType","createFieldConfig","label","verb","fieldName","prevPath","newPath","createSupportContactField","contactPath","fieldConfigs","FORM_TITLE_UPDATED","FORM_ORGANISATION_UPDATED","FORM_TEAM_NAME_UPDATED","FORM_TEAM_EMAIL_UPDATED","FORM_NOTIFICATION_EMAIL_UPDATED","FORM_PRIVACY_NOTICE_UPDATED","FORM_SUBMISSION_GUIDANCE_UPDATED","FORM_SUPPORT_PHONE_UPDATED","FORM_SUPPORT_EMAIL_UPDATED","FORM_SUPPORT_ONLINE_UPDATED","supportContactFields","alwaysValidEvents","Set","FORM_CREATED","FORM_UPDATED","FORM_LIVE_CREATED_FROM_DRAFT","FORM_DRAFT_CREATED_FROM_LIVE","FORM_DRAFT_DELETED","FORM_MIGRATED","FORM_JSON_UPLOADED","FORM_JSON_DOWNLOADED","FORM_SUBMISSION_EXCEL_REQUESTED","FORM_CSAT_EXCEL_REQUESTED","isConsolidatedRecord","record","consolidatedCount"],"sources":["../../../../src/form/form-audit/consolidation.ts"],"sourcesContent":["import { AuditEventMessageType } from '~/src/form/form-audit/enums.js'\nimport {\n type AuditRecord,\n type ConsolidatedAuditRecord\n} from '~/src/form/form-audit/types.js'\n\n/**\n * Field configuration for audit events with change tracking.\n * Used by change detection logic to compare previous and new values.\n */\nexport interface FieldConfig {\n label: string\n verb: 'Updated' | 'Changed'\n prevPath: string\n newPath: string\n}\n\n/**\n * Support contact field configuration for change detection.\n */\nexport interface SupportContactFieldConfig {\n label: string\n prevPath: string\n newPath: string\n}\n\n/**\n * Creates a field configuration for audit events.\n */\nfunction createFieldConfig(\n label: string,\n verb: 'Updated' | 'Changed',\n fieldName: string\n): FieldConfig {\n return {\n label,\n verb,\n prevPath: `changes.previous.${fieldName}`,\n newPath: `changes.new.${fieldName}`\n }\n}\n\n/**\n * Creates a support contact field configuration.\n */\nfunction createSupportContactField(\n label: string,\n contactPath: string\n): SupportContactFieldConfig {\n return {\n label,\n prevPath: `changes.previous.contact.${contactPath}`,\n newPath: `changes.new.contact.${contactPath}`\n }\n}\n\n/**\n * Field configurations for audit events with change tracking.\n * Maps event types to their data paths and display labels.\n */\nexport const fieldConfigs: Record<string, FieldConfig> = {\n [AuditEventMessageType.FORM_TITLE_UPDATED]: createFieldConfig(\n 'the form name',\n 'Updated',\n 'title'\n ),\n [AuditEventMessageType.FORM_ORGANISATION_UPDATED]: createFieldConfig(\n 'the lead organisation',\n 'Changed',\n 'organisation'\n ),\n [AuditEventMessageType.FORM_TEAM_NAME_UPDATED]: createFieldConfig(\n 'the team name',\n 'Changed',\n 'teamName'\n ),\n [AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED]: createFieldConfig(\n 'the shared team address',\n 'Updated',\n 'teamEmail'\n ),\n [AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED]: createFieldConfig(\n 'where submitted forms are sent',\n 'Updated',\n 'notificationEmail'\n ),\n [AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED]: createFieldConfig(\n 'the privacy notice link',\n 'Updated',\n 'privacyNoticeUrl'\n ),\n [AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED]: createFieldConfig(\n 'the next steps guidance',\n 'Updated',\n 'submissionGuidance'\n ),\n [AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED]: createFieldConfig(\n 'the support phone number',\n 'Updated',\n 'phone'\n ),\n [AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED]: createFieldConfig(\n 'the support email address',\n 'Updated',\n 'address'\n ),\n [AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED]: createFieldConfig(\n 'the support contact link',\n 'Updated',\n 'url'\n )\n}\n\n/**\n * Support contact field configurations for change detection.\n * Used when checking FORM_SUPPORT_CONTACT_UPDATED events.\n */\nexport const supportContactFields: SupportContactFieldConfig[] = [\n createSupportContactField('phone number', 'phone'),\n createSupportContactField('email address', 'email.address'),\n createSupportContactField('online contact link', 'online.url')\n]\n\n/**\n * Event types that are always considered valid (don't need change comparison).\n * These events represent actions rather than field updates.\n */\nexport const alwaysValidEvents = new Set<string>([\n AuditEventMessageType.FORM_CREATED,\n AuditEventMessageType.FORM_UPDATED,\n AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT,\n AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE,\n AuditEventMessageType.FORM_DRAFT_DELETED,\n AuditEventMessageType.FORM_MIGRATED,\n AuditEventMessageType.FORM_JSON_UPLOADED,\n AuditEventMessageType.FORM_JSON_DOWNLOADED,\n AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,\n AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED\n])\n\n/**\n * Type guard to check if an audit record is consolidated.\n * @param record - The audit record to check\n * @returns True if the record has consolidation metadata\n */\nexport function isConsolidatedRecord(\n record: AuditRecord | ConsolidatedAuditRecord\n): record is ConsolidatedAuditRecord {\n return 'consolidatedCount' in record && record.consolidatedCount > 1\n}\n"],"mappings":"AAAA,SAASA,qBAAqB;;AAM9B;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAOA;AACA;AACA;AACA,SAASC,iBAAiBA,CACxBC,KAAa,EACbC,IAA2B,EAC3BC,SAAiB,EACJ;EACb,OAAO;IACLF,KAAK;IACLC,IAAI;IACJE,QAAQ,EAAE,oBAAoBD,SAAS,EAAE;IACzCE,OAAO,EAAE,eAAeF,SAAS;EACnC,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASG,yBAAyBA,CAChCL,KAAa,EACbM,WAAmB,EACQ;EAC3B,OAAO;IACLN,KAAK;IACLG,QAAQ,EAAE,4BAA4BG,WAAW,EAAE;IACnDF,OAAO,EAAE,uBAAuBE,WAAW;EAC7C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAyC,GAAG;EACvD,CAACT,qBAAqB,CAACU,kBAAkB,GAAGT,iBAAiB,CAC3D,eAAe,EACf,SAAS,EACT,OACF,CAAC;EACD,CAACD,qBAAqB,CAACW,yBAAyB,GAAGV,iBAAiB,CAClE,uBAAuB,EACvB,SAAS,EACT,cACF,CAAC;EACD,CAAC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6B,kBAAkB,EACxC7B,qBAAqB,CAAC8B,oBAAoB,EAC1C9B,qBAAqB,CAAC+B,+BAA+B,EACrD/B,qBAAqB,CAACgC,yBAAyB,CAChD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,MAA6C,EACV;EACnC,OAAO,mBAAmB,IAAIA,MAAM,IAAIA,MAAM,CAACC,iBAAiB,GAAG,CAAC;AACtE","ignoreList":[]}
1
+ {"version":3,"file":"consolidation.js","names":["AuditEventMessageType","createFieldConfig","label","verb","fieldName","prevPath","newPath","createSupportContactField","contactPath","fieldConfigs","FORM_TITLE_UPDATED","FORM_ORGANISATION_UPDATED","FORM_TEAM_NAME_UPDATED","FORM_TEAM_EMAIL_UPDATED","FORM_NOTIFICATION_EMAIL_UPDATED","FORM_PRIVACY_NOTICE_UPDATED","FORM_SUBMISSION_GUIDANCE_UPDATED","FORM_SUPPORT_PHONE_UPDATED","FORM_SUPPORT_EMAIL_UPDATED","FORM_SUPPORT_ONLINE_UPDATED","supportContactFields","alwaysValidEvents","Set","FORM_CREATED","FORM_UPDATED","FORM_LIVE_CREATED_FROM_DRAFT","FORM_DRAFT_CREATED_FROM_LIVE","FORM_DRAFT_DELETED","FORM_MIGRATED","FORM_JSON_UPLOADED","FORM_JSON_DOWNLOADED","FORM_SUBMISSION_EXCEL_REQUESTED","FORM_CSAT_EXCEL_REQUESTED","isConsolidatedRecord","record","consolidatedCount"],"sources":["../../../../src/form/form-audit/consolidation.ts"],"sourcesContent":["import { AuditEventMessageType } from '~/src/form/form-audit/enums.js'\nimport {\n type AuditRecord,\n type ConsolidatedAuditRecord\n} from '~/src/form/form-audit/types.js'\n\n/**\n * Field configuration for audit events with change tracking.\n * Used by change detection logic to compare previous and new values.\n */\nexport interface FieldConfig {\n label: string\n verb: 'Updated' | 'Changed'\n prevPath: string\n newPath: string\n}\n\n/**\n * Support contact field configuration for change detection.\n */\nexport interface SupportContactFieldConfig {\n label: string\n prevPath: string\n newPath: string\n}\n\n/**\n * Creates a field configuration for audit events.\n */\nfunction createFieldConfig(\n label: string,\n verb: 'Updated' | 'Changed',\n fieldName: string\n): FieldConfig {\n return {\n label,\n verb,\n prevPath: `changes.previous.${fieldName}`,\n newPath: `changes.new.${fieldName}`\n }\n}\n\n/**\n * Creates a support contact field configuration.\n */\nfunction createSupportContactField(\n label: string,\n contactPath: string\n): SupportContactFieldConfig {\n return {\n label,\n prevPath: `changes.previous.contact.${contactPath}`,\n newPath: `changes.new.contact.${contactPath}`\n }\n}\n\n/**\n * Field configurations for audit events with change tracking.\n * Maps event types to their data paths and display labels.\n */\nexport const fieldConfigs: Record<string, FieldConfig> = {\n [AuditEventMessageType.FORM_TITLE_UPDATED]: createFieldConfig(\n 'the form name',\n 'Updated',\n 'title'\n ),\n [AuditEventMessageType.FORM_ORGANISATION_UPDATED]: createFieldConfig(\n 'the lead organisation',\n 'Changed',\n 'organisation'\n ),\n [AuditEventMessageType.FORM_TEAM_NAME_UPDATED]: createFieldConfig(\n 'the team name',\n 'Changed',\n 'teamName'\n ),\n [AuditEventMessageType.FORM_TEAM_EMAIL_UPDATED]: createFieldConfig(\n 'the shared team address',\n 'Updated',\n 'teamEmail'\n ),\n [AuditEventMessageType.FORM_NOTIFICATION_EMAIL_UPDATED]: createFieldConfig(\n 'where submitted forms are sent',\n 'Updated',\n 'notificationEmail'\n ),\n [AuditEventMessageType.FORM_PRIVACY_NOTICE_UPDATED]: createFieldConfig(\n 'the privacy notice link',\n 'Updated',\n 'privacyNoticeUrl'\n ),\n [AuditEventMessageType.FORM_SUBMISSION_GUIDANCE_UPDATED]: createFieldConfig(\n 'the next steps guidance',\n 'Updated',\n 'submissionGuidance'\n ),\n [AuditEventMessageType.FORM_SUPPORT_PHONE_UPDATED]: createFieldConfig(\n 'the support phone number',\n 'Updated',\n 'phone'\n ),\n [AuditEventMessageType.FORM_SUPPORT_EMAIL_UPDATED]: createFieldConfig(\n 'the support email address',\n 'Updated',\n 'address'\n ),\n [AuditEventMessageType.FORM_SUPPORT_ONLINE_UPDATED]: createFieldConfig(\n 'the support contact link',\n 'Updated',\n 'url'\n )\n}\n\n/**\n * Support contact field configurations for change detection.\n * Used when checking FORM_SUPPORT_CONTACT_UPDATED events.\n */\nexport const supportContactFields: SupportContactFieldConfig[] = [\n createSupportContactField('phone number', 'phone'),\n createSupportContactField('email address', 'email.address'),\n createSupportContactField('email response time', 'email.responseTime'),\n createSupportContactField('online contact link', 'online.url'),\n createSupportContactField('online contact text', 'online.text')\n]\n\n/**\n * Event types that are always considered valid (don't need change comparison).\n * These events represent actions rather than field updates.\n */\nexport const alwaysValidEvents = new Set<string>([\n AuditEventMessageType.FORM_CREATED,\n AuditEventMessageType.FORM_UPDATED,\n AuditEventMessageType.FORM_LIVE_CREATED_FROM_DRAFT,\n AuditEventMessageType.FORM_DRAFT_CREATED_FROM_LIVE,\n AuditEventMessageType.FORM_DRAFT_DELETED,\n AuditEventMessageType.FORM_MIGRATED,\n AuditEventMessageType.FORM_JSON_UPLOADED,\n AuditEventMessageType.FORM_JSON_DOWNLOADED,\n AuditEventMessageType.FORM_SUBMISSION_EXCEL_REQUESTED,\n AuditEventMessageType.FORM_CSAT_EXCEL_REQUESTED\n])\n\n/**\n * Type guard to check if an audit record is consolidated.\n * @param record - The audit record to check\n * @returns True if the record has consolidation metadata with count > 1\n */\nexport function isConsolidatedRecord(\n record: AuditRecord | ConsolidatedAuditRecord\n): record is ConsolidatedAuditRecord {\n return (\n 'consolidatedCount' in record &&\n typeof record.consolidatedCount === 'number' &&\n record.consolidatedCount > 1\n )\n}\n"],"mappings":"AAAA,SAASA,qBAAqB;;AAM9B;AACA;AACA;AACA;;AAQA;AACA;AACA;;AAOA;AACA;AACA;AACA,SAASC,iBAAiBA,CACxBC,KAAa,EACbC,IAA2B,EAC3BC,SAAiB,EACJ;EACb,OAAO;IACLF,KAAK;IACLC,IAAI;IACJE,QAAQ,EAAE,oBAAoBD,SAAS,EAAE;IACzCE,OAAO,E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A,OAAO,MAAMmB,oBAAiD,GAAG,CAC/Db,yBAAyB,CAAC,cAAc,EAAE,OAAO,CAAC,EAClDA,yBAAyB,CAAC,eAAe,EAAE,eAAe,CAAC,EAC3DA,yBAAyB,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,EACtEA,yBAAyB,CAAC,qBAAqB,EAAE,YAAY,CAAC,EAC9DA,yBAAyB,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAChE;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMc,iBAAiB,GAAG,IAAIC,GAAG,CAAS,CAC/CtB,qBAAqB,CAACuB,YAAY,EAClCvB,qBAAqB,CAACwB,YAAY,EAClCxB,qBAAqB,CAACyB,4BAA4B,EAClDzB,qBAAqB,CAAC0B,4BAA4B,EAClD1B,qBAAqB,CAAC2B,kBAAkB,EACxC3B,qBAAqB,CAAC4B,aAAa,EACnC5B,qBAAqB,CAAC6B,kBAAkB,EACxC7B,qBAAqB,CAAC8B,oBAAoB,EAC1C9B,qBAAqB,CAAC+B,+BAA+B,EACrD/B,qBAAqB,CAACgC,yBAAyB,CAChD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,MAA6C,EACV;EACnC,OACE,mBAAmB,IAAIA,MAAM,IAC7B,OAAOA,MAAM,CAACC,iBAAiB,KAAK,QAAQ,IAC5CD,MAAM,CAACC,iBAAiB,GAAG,CAAC;AAEhC","ignoreList":[]}
@@ -223,7 +223,15 @@ export const componentSchema = Joi.object().description('Form component definiti
223
223
  maxDaysInPast: Joi.number().empty('').description('Maximum days in the past allowed for date inputs'),
224
224
  maxDaysInFuture: Joi.number().empty('').description('Maximum days in the future allowed for date inputs'),
225
225
  customValidationMessage: Joi.string().trim().allow('').description('Custom error message for validation failures'),
226
- customValidationMessages: Joi.object().unknown(true).optional().description('Custom error messages keyed by validation rule name')
226
+ customValidationMessages: Joi.object().unknown(true).optional().description('Custom error messages keyed by validation rule name'),
227
+ amount: Joi.when('type', {
228
+ is: Joi.string().trim().valid(ComponentType.PaymentField).required(),
229
+ then: Joi.number().min(0.3).max(100000).required().description('Payment amount in GBP (£0.30 - £100,000)')
230
+ }).description('Payment amount - for PaymentField only'),
231
+ description: Joi.when('type', {
232
+ is: Joi.string().trim().valid(ComponentType.PaymentField).required(),
233
+ then: Joi.string().max(230).required().description('Payment description (max 230 chars)')
234
+ }).description('Payment description - for PaymentField only')
227
235
  }).default({}).unknown(true).description('Component-specific configuration options'),
228
236
  schema: Joi.object({
229
237
  min: Joi.number().empty('').description('Minimum value or length for validation'),