@things-factory/biz-ui 4.3.770 → 4.3.798

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.
@@ -12,6 +12,7 @@ import { openImportPopUp } from '@things-factory/import-ui'
12
12
  import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell'
13
13
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
14
14
  import { isMobileDevice } from '@things-factory/utils'
15
+ import { RTM_OPTIONS } from '../../../operato-wms/client/pages/constants/order'
15
16
 
16
17
  export class ContactPointList extends localize(i18next)(PageView) {
17
18
  static get properties() {
@@ -158,6 +159,14 @@ export class ContactPointList extends localize(i18next)(PageView) {
158
159
  { type: 'gutter', gutterName: 'dirty' },
159
160
  { type: 'gutter', gutterName: 'sequence' },
160
161
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
162
+ {
163
+ type: 'string',
164
+ name: 'customerCode',
165
+ record: { editable: true },
166
+ header: i18next.t('field.customer_code'),
167
+ imex: { header: i18next.t('field.customer_code'), key: 'customerCode', width: 40, type: 'string' },
168
+ width: 150
169
+ },
161
170
  {
162
171
  type: 'string',
163
172
  name: 'name',
@@ -370,6 +379,20 @@ export class ContactPointList extends localize(i18next)(PageView) {
370
379
  },
371
380
  width: 200
372
381
  },
382
+ {
383
+ type: 'select',
384
+ name: 'rtm',
385
+ record: { editable: true, options: ['', ...RTM_OPTIONS.map(o => o.value)] },
386
+ header: i18next.t('field.rtm'),
387
+ imex: {
388
+ header: i18next.t('field.rtm'),
389
+ key: 'rtm',
390
+ width: 40,
391
+ type: 'array',
392
+ arrData: RTM_OPTIONS.map(option => ({ name: option.value, id: option.value }))
393
+ },
394
+ width: 150
395
+ },
373
396
  {
374
397
  name: 'type',
375
398
  record: { editable: true },
@@ -554,7 +577,9 @@ export class ContactPointList extends localize(i18next)(PageView) {
554
577
  'country',
555
578
  'billingAddress',
556
579
  'type',
557
- 'businessRestDay'
580
+ 'businessRestDay',
581
+ 'rtm',
582
+ 'customerCode'
558
583
  ]
559
584
  stringFields.forEach(field => {
560
585
  if (normalized[field] && typeof normalized[field] === 'object' && !Array.isArray(normalized[field])) {
@@ -656,6 +681,8 @@ export class ContactPointList extends localize(i18next)(PageView) {
656
681
  type
657
682
  releaseShelfLife
658
683
  businessRestDay
684
+ rtm
685
+ customerCode
659
686
  updatedAt
660
687
  bizplace {
661
688
  id
@@ -691,6 +718,11 @@ export class ContactPointList extends localize(i18next)(PageView) {
691
718
 
692
719
  this._validate()
693
720
 
721
+ const normalizedPatches = patches.map(patch => ({
722
+ ...patch,
723
+ rtm: patch.rtm || null
724
+ }))
725
+
694
726
  const response = await client.mutate({
695
727
  mutation: gql`
696
728
  mutation updateMultipleContactPoint($patches: [ContactPointPatch!]!) {
@@ -699,7 +731,7 @@ export class ContactPointList extends localize(i18next)(PageView) {
699
731
  }
700
732
  }
701
733
  `,
702
- variables: { patches },
734
+ variables: { patches: normalizedPatches },
703
735
  context: gqlContext()
704
736
  })
705
737
 
@@ -854,6 +886,16 @@ export class ContactPointList extends localize(i18next)(PageView) {
854
886
  }
855
887
  }
856
888
 
889
+ // Validate rtm: must be one of the allowed values (empty is allowed)
890
+ if (item.rtm && !RTM_OPTIONS.some(option => option.value === item.rtm)) {
891
+ throw new Error(i18next.t('text.invalid_rtm_value'))
892
+ }
893
+
894
+ // Validate customerCode: alphanumeric only (empty is allowed)
895
+ if (item.customerCode && !/^[a-zA-Z0-9]*$/.test(item.customerCode)) {
896
+ throw new Error(i18next.t('text.invalid_customer_code'))
897
+ }
898
+
857
899
  return item
858
900
  })
859
901
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/biz-ui",
3
- "version": "4.3.770",
3
+ "version": "4.3.798",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -23,14 +23,14 @@
23
23
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
24
24
  },
25
25
  "dependencies": {
26
- "@things-factory/biz-base": "^4.3.767",
26
+ "@things-factory/biz-base": "^4.3.798",
27
27
  "@things-factory/code-base": "^4.3.767",
28
28
  "@things-factory/form-ui": "^4.3.767",
29
29
  "@things-factory/grist-ui": "^4.3.770",
30
30
  "@things-factory/i18n-base": "^4.3.767",
31
- "@things-factory/import-ui": "^4.3.770",
31
+ "@things-factory/import-ui": "^4.3.790",
32
32
  "@things-factory/layout-base": "^4.3.767",
33
33
  "@things-factory/shell": "^4.3.767"
34
34
  },
35
- "gitHead": "0a56fbc916f4e50317ee050b680b84b9b870c4fb"
35
+ "gitHead": "d9c29bdfadad409e12de40cadabd329080f7501d"
36
36
  }
@@ -12,6 +12,10 @@
12
12
  "label.account_no": "account no",
13
13
  "text.invalid_form": "invalid form",
14
14
  "field.business_rest_day": "business rest day",
15
+ "field.rtm": "Route To Market",
16
+ "field.customer_code": "Customer Code",
17
+ "text.invalid_customer_code": "Customer Code must be alphanumeric only",
18
+ "text.invalid_rtm_value": "RTM must be one of: FTL NORMAL, FTL SPECIAL, LTL",
15
19
  "field.business_rest_day_required": "business rest day is required",
16
20
  "field.business_rest_day_must_be_string": "business rest day must be a string",
17
21