@open-mercato/core 0.4.5-develop-2e9903a57a → 0.4.5-develop-eeccf7adf4
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/package.json +2 -2
- package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js +0 -9
- package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js +0 -22
- package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js +0 -21
- package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js +0 -15
- package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js +0 -11
- package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js +0 -11
- package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js +0 -14
- package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js +0 -26
- package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js +0 -16
- package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js +0 -32
- package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js +0 -26
- package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js +0 -30
- package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js +0 -41
- package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js +0 -25
- package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js +0 -20
- package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js +0 -76
- package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js +0 -20
- package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js +0 -12
- package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js +0 -28
- package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js +0 -33
- package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js +0 -30
- package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js +0 -65
- package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js +0 -28
- package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js +0 -34
- package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js +0 -27
- package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js +0 -44
- package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js +0 -53
- package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js +0 -26
- package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js +0 -47
- package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js +0 -33
- package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js +0 -30
- package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js +0 -36
- package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js +0 -113
- package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js +0 -25
- package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js +0 -35
- package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/api.js +0 -64
- package/dist/modules/core/__integration__/helpers/api.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/auth.js +0 -98
- package/dist/modules/core/__integration__/helpers/auth.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/authUi.js +0 -31
- package/dist/modules/core/__integration__/helpers/authUi.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/catalogFixtures.js +0 -49
- package/dist/modules/core/__integration__/helpers/catalogFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/crmFixtures.js +0 -73
- package/dist/modules/core/__integration__/helpers/crmFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/salesFixtures.js +0 -63
- package/dist/modules/core/__integration__/helpers/salesFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/salesUi.js +0 -464
- package/dist/modules/core/__integration__/helpers/salesUi.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js +0 -26
- package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js +0 -60
- package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js +0 -36
- package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js +0 -74
- package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js +0 -21
- package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-001.spec.js +0 -32
- package/dist/modules/customers/__integration__/TC-CRM-001.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-002.spec.js +0 -35
- package/dist/modules/customers/__integration__/TC-CRM-002.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-003.spec.js +0 -40
- package/dist/modules/customers/__integration__/TC-CRM-003.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-004.spec.js +0 -40
- package/dist/modules/customers/__integration__/TC-CRM-004.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-005.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-005.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-006.spec.js +0 -42
- package/dist/modules/customers/__integration__/TC-CRM-006.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-007.spec.js +0 -44
- package/dist/modules/customers/__integration__/TC-CRM-007.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-008.spec.js +0 -50
- package/dist/modules/customers/__integration__/TC-CRM-008.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-009.spec.js +0 -33
- package/dist/modules/customers/__integration__/TC-CRM-009.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-010.spec.js +0 -39
- package/dist/modules/customers/__integration__/TC-CRM-010.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-011.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-011.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-012.spec.js +0 -38
- package/dist/modules/customers/__integration__/TC-CRM-012.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-013.spec.js +0 -43
- package/dist/modules/customers/__integration__/TC-CRM-013.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-014.spec.js +0 -23
- package/dist/modules/customers/__integration__/TC-CRM-014.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-015.spec.js +0 -63
- package/dist/modules/customers/__integration__/TC-CRM-015.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-016.spec.js +0 -46
- package/dist/modules/customers/__integration__/TC-CRM-016.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-017.spec.js +0 -29
- package/dist/modules/customers/__integration__/TC-CRM-017.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-018.spec.js +0 -52
- package/dist/modules/customers/__integration__/TC-CRM-018.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-019.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-019.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-020.spec.js +0 -65
- package/dist/modules/customers/__integration__/TC-CRM-020.spec.js.map +0 -7
- package/dist/modules/progress/__integration__/TC-PROG-001.spec.js +0 -51
- package/dist/modules/progress/__integration__/TC-PROG-001.spec.js.map +0 -7
- package/dist/modules/resources/__integration__/TC-INT-007.spec.js +0 -88
- package/dist/modules/resources/__integration__/TC-INT-007.spec.js.map +0 -7
- package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js +0 -45
- package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-001.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-001.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-002.spec.js +0 -31
- package/dist/modules/sales/__integration__/TC-SALES-002.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-003.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-003.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-004.spec.js +0 -14
- package/dist/modules/sales/__integration__/TC-SALES-004.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-005.spec.js +0 -15
- package/dist/modules/sales/__integration__/TC-SALES-005.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-006.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-006.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-007.spec.js +0 -19
- package/dist/modules/sales/__integration__/TC-SALES-007.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-008.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-008.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-009.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-009.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-010.spec.js +0 -16
- package/dist/modules/sales/__integration__/TC-SALES-010.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-011.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-011.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-012.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-012.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-013.spec.js +0 -66
- package/dist/modules/sales/__integration__/TC-SALES-013.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-014.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-014.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-015.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-015.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-016.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-016.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-017.spec.js +0 -44
- package/dist/modules/sales/__integration__/TC-SALES-017.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-018.spec.js +0 -18
- package/dist/modules/sales/__integration__/TC-SALES-018.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-019.spec.js +0 -16
- package/dist/modules/sales/__integration__/TC-SALES-019.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-020.spec.js +0 -75
- package/dist/modules/sales/__integration__/TC-SALES-020.spec.js.map +0 -7
- package/dist/modules/staff/__integration__/TC-INT-006.spec.js +0 -64
- package/dist/modules/staff/__integration__/TC-INT-006.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js +0 -48
- package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js +0 -94
- package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js +0 -61
- package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js +0 -52
- package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js +0 -106
- package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js +0 -94
- package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js +0 -62
- package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js +0 -168
- package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/helpers/translationFixtures.js +0 -63
- package/dist/modules/translations/__integration__/helpers/translationFixtures.js.map +0 -7
- package/dist/modules/workflows/__integration__/TC-WF-001.spec.js +0 -73
- package/dist/modules/workflows/__integration__/TC-WF-001.spec.js.map +0 -7
- package/src/__tests__/module-decoupling.test.ts +0 -356
- package/src/modules/api_keys/api/__tests__/keys.route.test.ts +0 -244
- package/src/modules/attachments/api/__tests__/attachments.api.test.ts +0 -240
- package/src/modules/attachments/components/__tests__/AttachmentContentPreview.test.tsx +0 -45
- package/src/modules/attachments/data/__tests__/entities-ocr.test.ts +0 -15
- package/src/modules/attachments/lib/__tests__/ocr-config.test.ts +0 -27
- package/src/modules/attachments/lib/__tests__/textExtraction.test.ts +0 -64
- package/src/modules/audit_logs/api/__tests__/access.route.test.ts +0 -118
- package/src/modules/audit_logs/api/__tests__/redo.route.test.ts +0 -131
- package/src/modules/audit_logs/api/__tests__/undo.route.test.ts +0 -103
- package/src/modules/audit_logs/services/__tests__/actionLogService.test.ts +0 -26
- package/src/modules/auth/__integration__/TC-AUTH-001.spec.ts +0 -13
- package/src/modules/auth/__integration__/TC-AUTH-002.spec.ts +0 -30
- package/src/modules/auth/__integration__/TC-AUTH-003.spec.ts +0 -28
- package/src/modules/auth/__integration__/TC-AUTH-004.spec.ts +0 -21
- package/src/modules/auth/__integration__/TC-AUTH-005.spec.ts +0 -17
- package/src/modules/auth/__integration__/TC-AUTH-006.spec.ts +0 -17
- package/src/modules/auth/__integration__/TC-AUTH-007.spec.ts +0 -19
- package/src/modules/auth/__integration__/TC-AUTH-008.spec.ts +0 -31
- package/src/modules/auth/__integration__/TC-AUTH-009.spec.ts +0 -22
- package/src/modules/auth/__integration__/TC-AUTH-010.spec.ts +0 -39
- package/src/modules/auth/__integration__/TC-AUTH-011.spec.ts +0 -35
- package/src/modules/auth/__integration__/TC-AUTH-012.spec.ts +0 -36
- package/src/modules/auth/__integration__/TC-AUTH-013.spec.ts +0 -48
- package/src/modules/auth/__integration__/TC-AUTH-014.spec.ts +0 -31
- package/src/modules/auth/__integration__/TC-AUTH-015.spec.ts +0 -28
- package/src/modules/auth/__integration__/TC-AUTH-016.spec.ts +0 -109
- package/src/modules/auth/__tests__/cli-rotate-encryption.test.ts +0 -97
- package/src/modules/auth/__tests__/cli-setup-acl.test.ts +0 -148
- package/src/modules/auth/api/__tests__/feature-check.test.ts +0 -65
- package/src/modules/auth/api/__tests__/login.test.ts +0 -47
- package/src/modules/auth/commands/__tests__/roles.custom-fields.test.ts +0 -126
- package/src/modules/auth/commands/__tests__/users.custom-fields.test.ts +0 -147
- package/src/modules/auth/lib/__tests__/rateLimitCheck.test.ts +0 -224
- package/src/modules/auth/services/__tests__/authService.test.ts +0 -32
- package/src/modules/auth/services/__tests__/rbacService.test.ts +0 -814
- package/src/modules/business_rules/api/__tests__/execute.route.test.ts +0 -311
- package/src/modules/business_rules/api/__tests__/logs-detail.route.test.ts +0 -181
- package/src/modules/business_rules/api/__tests__/logs.route.test.ts +0 -261
- package/src/modules/business_rules/api/__tests__/rules-detail.route.test.ts +0 -115
- package/src/modules/business_rules/api/__tests__/rules.route.test.ts +0 -746
- package/src/modules/business_rules/api/__tests__/sets-detail.route.test.ts +0 -169
- package/src/modules/business_rules/api/__tests__/sets-members.route.test.ts +0 -367
- package/src/modules/business_rules/api/__tests__/sets.route.test.ts +0 -361
- package/src/modules/business_rules/api/__tests__/test-helpers.ts +0 -42
- package/src/modules/business_rules/components/utils/__tests__/formHelpers.test.ts +0 -69
- package/src/modules/business_rules/data/__tests__/validators.test.ts +0 -637
- package/src/modules/business_rules/lib/__tests__/action-executor.test.ts +0 -728
- package/src/modules/business_rules/lib/__tests__/expression-evaluator.test.ts +0 -592
- package/src/modules/business_rules/lib/__tests__/rule-engine.test.ts +0 -805
- package/src/modules/business_rules/lib/__tests__/rule-evaluator.test.ts +0 -436
- package/src/modules/catalog/__integration__/TC-CAT-001.spec.ts +0 -32
- package/src/modules/catalog/__integration__/TC-CAT-002.spec.ts +0 -19
- package/src/modules/catalog/__integration__/TC-CAT-003.spec.ts +0 -39
- package/src/modules/catalog/__integration__/TC-CAT-004.spec.ts +0 -41
- package/src/modules/catalog/__integration__/TC-CAT-005.spec.ts +0 -37
- package/src/modules/catalog/__integration__/TC-CAT-006.spec.ts +0 -40
- package/src/modules/catalog/__integration__/TC-CAT-007.spec.ts +0 -37
- package/src/modules/catalog/__integration__/TC-CAT-008.spec.ts +0 -76
- package/src/modules/catalog/__integration__/TC-CAT-009.spec.ts +0 -39
- package/src/modules/catalog/__integration__/TC-CAT-010.spec.ts +0 -36
- package/src/modules/catalog/__integration__/TC-CAT-011.spec.ts +0 -44
- package/src/modules/catalog/__integration__/TC-CAT-012.spec.ts +0 -35
- package/src/modules/catalog/api/__tests__/offers.route.test.ts +0 -161
- package/src/modules/catalog/api/__tests__/prices.route.test.ts +0 -39
- package/src/modules/catalog/api/__tests__/products.route.test.ts +0 -91
- package/src/modules/catalog/api/__tests__/utils.test.ts +0 -36
- package/src/modules/catalog/api/__tests__/variants.route.test.ts +0 -44
- package/src/modules/catalog/backend/catalog/products/__tests__/ProductsDataTable.test.tsx +0 -172
- package/src/modules/catalog/commands/__tests__/products.delete.test.ts +0 -146
- package/src/modules/catalog/commands/__tests__/products.update.test.ts +0 -142
- package/src/modules/catalog/commands/__tests__/registration.test.ts +0 -54
- package/src/modules/catalog/commands/__tests__/shared.test.ts +0 -129
- package/src/modules/catalog/components/__tests__/catalogComponentsRender.test.tsx +0 -373
- package/src/modules/catalog/components/products/__tests__/ProductImageCell.test.tsx +0 -51
- package/src/modules/catalog/components/products/__tests__/productForm.test.ts +0 -32
- package/src/modules/catalog/lib/__tests__/pricing.test.ts +0 -150
- package/src/modules/catalog/services/__tests__/catalogPricingService.test.ts +0 -21
- package/src/modules/configs/components/__tests__/CachePanel.test.tsx +0 -134
- package/src/modules/configs/components/__tests__/SystemStatusPanel.test.tsx +0 -93
- package/src/modules/configs/lib/__tests__/system-status.test.ts +0 -55
- package/src/modules/configs/lib/__tests__/upgrade-actions.test.ts +0 -135
- package/src/modules/core/__integration__/admin/TC-ADMIN-001.spec.ts +0 -70
- package/src/modules/core/__integration__/admin/TC-ADMIN-002.spec.ts +0 -83
- package/src/modules/core/__integration__/admin/TC-ADMIN-003.spec.ts +0 -50
- package/src/modules/core/__integration__/admin/TC-ADMIN-004.spec.ts +0 -77
- package/src/modules/core/__integration__/admin/TC-ADMIN-005.spec.ts +0 -49
- package/src/modules/core/__integration__/admin/TC-ADMIN-006.spec.ts +0 -59
- package/src/modules/core/__integration__/admin/TC-ADMIN-007.spec.ts +0 -68
- package/src/modules/core/__integration__/admin/TC-ADMIN-008.spec.ts +0 -127
- package/src/modules/core/__integration__/admin/TC-ADMIN-009.spec.ts +0 -48
- package/src/modules/core/__integration__/admin/TC-ADMIN-010.spec.ts +0 -57
- package/src/modules/core/__integration__/helpers/api.ts +0 -84
- package/src/modules/core/__integration__/helpers/auth.ts +0 -110
- package/src/modules/core/__integration__/helpers/authUi.ts +0 -33
- package/src/modules/core/__integration__/helpers/catalogFixtures.ts +0 -73
- package/src/modules/core/__integration__/helpers/crmFixtures.ts +0 -101
- package/src/modules/core/__integration__/helpers/salesFixtures.ts +0 -89
- package/src/modules/core/__integration__/helpers/salesUi.ts +0 -528
- package/src/modules/core/__integration__/integration/TC-INT-001.spec.ts +0 -34
- package/src/modules/core/__integration__/integration/TC-INT-002.spec.ts +0 -74
- package/src/modules/core/__integration__/integration/TC-INT-003.spec.ts +0 -43
- package/src/modules/core/__integration__/integration/TC-INT-004.spec.ts +0 -82
- package/src/modules/core/__integration__/integration/TC-INT-005.spec.ts +0 -29
- package/src/modules/currencies/backend/exchange-rates/__tests__/formatDateTimeLocal.test.ts +0 -78
- package/src/modules/currencies/data/__tests__/validators.test.ts +0 -100
- package/src/modules/currencies/services/__tests__/exchangeRateService.test.ts +0 -666
- package/src/modules/currencies/services/__tests__/rateFetchingService.basic.test.ts +0 -398
- package/src/modules/currencies/services/__tests__/rateFetchingService.errors.test.ts +0 -296
- package/src/modules/currencies/services/__tests__/rateFetchingService.providers.test.ts +0 -350
- package/src/modules/currencies/services/__tests__/rateFetchingService.setup.ts +0 -188
- package/src/modules/customers/__integration__/TC-CRM-001.spec.ts +0 -42
- package/src/modules/customers/__integration__/TC-CRM-002.spec.ts +0 -47
- package/src/modules/customers/__integration__/TC-CRM-003.spec.ts +0 -55
- package/src/modules/customers/__integration__/TC-CRM-004.spec.ts +0 -57
- package/src/modules/customers/__integration__/TC-CRM-005.spec.ts +0 -50
- package/src/modules/customers/__integration__/TC-CRM-006.spec.ts +0 -60
- package/src/modules/customers/__integration__/TC-CRM-007.spec.ts +0 -57
- package/src/modules/customers/__integration__/TC-CRM-008.spec.ts +0 -62
- package/src/modules/customers/__integration__/TC-CRM-009.spec.ts +0 -46
- package/src/modules/customers/__integration__/TC-CRM-010.spec.ts +0 -49
- package/src/modules/customers/__integration__/TC-CRM-011.spec.ts +0 -47
- package/src/modules/customers/__integration__/TC-CRM-012.spec.ts +0 -49
- package/src/modules/customers/__integration__/TC-CRM-013.spec.ts +0 -61
- package/src/modules/customers/__integration__/TC-CRM-014.spec.ts +0 -31
- package/src/modules/customers/__integration__/TC-CRM-015.spec.ts +0 -89
- package/src/modules/customers/__integration__/TC-CRM-016.spec.ts +0 -55
- package/src/modules/customers/__integration__/TC-CRM-017.spec.ts +0 -37
- package/src/modules/customers/__integration__/TC-CRM-018.spec.ts +0 -62
- package/src/modules/customers/__integration__/TC-CRM-019.spec.ts +0 -44
- package/src/modules/customers/__integration__/TC-CRM-020.spec.ts +0 -73
- package/src/modules/customers/api/__tests__/utils.test.ts +0 -61
- package/src/modules/customers/api/dashboard/widgets/new-deals/__tests__/route.test.ts +0 -54
- package/src/modules/customers/commands/__tests__/shared.test.ts +0 -263
- package/src/modules/customers/commands/__tests__/undo.custom-fields.test.ts +0 -1184
- package/src/modules/customers/components/detail/__tests__/ActivityForm.validation.test.ts +0 -37
- package/src/modules/customers/components/detail/__tests__/DealForm.validation.test.ts +0 -45
- package/src/modules/customers/components/detail/__tests__/InlineEditors.test.tsx +0 -166
- package/src/modules/customers/components/detail/__tests__/TaskForm.submit.test.ts +0 -21
- package/src/modules/customers/components/detail/hooks/__tests__/useCustomerDictionary.test.ts +0 -97
- package/src/modules/customers/lib/__tests__/customFieldRouting.test.ts +0 -107
- package/src/modules/customers/utils/__tests__/addressFormat.test.ts +0 -105
- package/src/modules/customers/utils/__tests__/phoneDuplicates.test.ts +0 -98
- package/src/modules/dashboards/__tests__/widgets.test.ts +0 -70
- package/src/modules/dashboards/lib/__tests__/aggregations.test.ts +0 -328
- package/src/modules/dashboards/lib/__tests__/formatters.test.ts +0 -128
- package/src/modules/directory/backend/directory/organizations/__tests__/create-submit.test.ts +0 -46
- package/src/modules/directory/backend/directory/organizations/__tests__/edit-submit.test.ts +0 -49
- package/src/modules/directory/components/__tests__/OrganizationSelect.test.tsx +0 -71
- package/src/modules/directory/components/__tests__/TenantSelect.test.tsx +0 -75
- package/src/modules/entities/__tests__/cli-decrypt-database.test.ts +0 -534
- package/src/modules/entities/__tests__/cli-rotate-encryption.test.ts +0 -123
- package/src/modules/entities/api/__tests__/encryption.api.test.ts +0 -57
- package/src/modules/entities/api/__tests__/records.get.custom-entity.test.ts +0 -43
- package/src/modules/entities/api/__tests__/records.validation.test.ts +0 -53
- package/src/modules/entities/backend/entities/user/__tests__/create-entity-submit.test.ts +0 -47
- package/src/modules/entities/backend/entities/user/__tests__/records-submit.test.ts +0 -104
- package/src/modules/feature_toggles/commands/__tests__/global.test.ts +0 -325
- package/src/modules/feature_toggles/commands/__tests__/overrides.test.ts +0 -186
- package/src/modules/feature_toggles/lib/__tests__/feature-flag-check.test.ts +0 -365
- package/src/modules/feature_toggles/lib/__tests__/queries.test.ts +0 -130
- package/src/modules/inbox_ops/api/emails/[id]/reprocess/__tests__/route.test.ts +0 -194
- package/src/modules/inbox_ops/api/proposals/[id]/__tests__/route.test.ts +0 -124
- package/src/modules/inbox_ops/api/proposals/[id]/accept-all/__tests__/route.test.ts +0 -154
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/__tests__/route.test.ts +0 -200
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/accept/__tests__/route.test.ts +0 -261
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/reject/__tests__/route.test.ts +0 -201
- package/src/modules/inbox_ops/api/proposals/[id]/reject/__tests__/route.test.ts +0 -123
- package/src/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/__tests__/route.test.ts +0 -232
- package/src/modules/inbox_ops/api/proposals/[id]/translate/__tests__/route.test.ts +0 -173
- package/src/modules/inbox_ops/api/proposals/__tests__/route.test.ts +0 -185
- package/src/modules/inbox_ops/api/webhook/__tests__/inbound.test.ts +0 -317
- package/src/modules/inbox_ops/data/__tests__/validators.test.ts +0 -463
- package/src/modules/inbox_ops/lib/__tests__/catalogLookup.test.ts +0 -143
- package/src/modules/inbox_ops/lib/__tests__/contactMatcher.test.ts +0 -158
- package/src/modules/inbox_ops/lib/__tests__/emailParser.test.ts +0 -191
- package/src/modules/inbox_ops/lib/__tests__/executionEngine.test.ts +0 -1419
- package/src/modules/inbox_ops/lib/__tests__/extractionPrompt.test.ts +0 -151
- package/src/modules/inbox_ops/lib/__tests__/priceValidator.test.ts +0 -259
- package/src/modules/inbox_ops/lib/__tests__/translationProvider.test.ts +0 -99
- package/src/modules/inbox_ops/subscribers/__tests__/extractionWorker.test.ts +0 -803
- package/src/modules/notifications/__tests__/deliver-notification.test.ts +0 -285
- package/src/modules/notifications/__tests__/deliveryStrategies.test.ts +0 -19
- package/src/modules/notifications/__tests__/notificationService.test.ts +0 -248
- package/src/modules/planner/__tests__/availabilityMerge.test.ts +0 -99
- package/src/modules/planner/__tests__/plannerAvailabilityService.test.ts +0 -89
- package/src/modules/planner/data/__tests__/validators.test.ts +0 -78
- package/src/modules/progress/__integration__/TC-PROG-001.spec.ts +0 -67
- package/src/modules/progress/__tests__/progressService.test.ts +0 -377
- package/src/modules/query_index/__tests__/hybrid-engine.test.ts +0 -365
- package/src/modules/query_index/__tests__/indexer.test.ts +0 -175
- package/src/modules/resources/__integration__/TC-INT-007.spec.ts +0 -110
- package/src/modules/resources/__integration__/helpers/resourcesFixtures.ts +0 -50
- package/src/modules/resources/data/__tests__/validators.test.ts +0 -65
- package/src/modules/sales/__integration__/TC-SALES-001.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-002.spec.ts +0 -38
- package/src/modules/sales/__integration__/TC-SALES-003.spec.ts +0 -18
- package/src/modules/sales/__integration__/TC-SALES-004.spec.ts +0 -19
- package/src/modules/sales/__integration__/TC-SALES-005.spec.ts +0 -21
- package/src/modules/sales/__integration__/TC-SALES-006.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-007.spec.ts +0 -23
- package/src/modules/sales/__integration__/TC-SALES-008.spec.ts +0 -11
- package/src/modules/sales/__integration__/TC-SALES-009.spec.ts +0 -12
- package/src/modules/sales/__integration__/TC-SALES-010.spec.ts +0 -20
- package/src/modules/sales/__integration__/TC-SALES-011.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-012.spec.ts +0 -12
- package/src/modules/sales/__integration__/TC-SALES-013.spec.ts +0 -73
- package/src/modules/sales/__integration__/TC-SALES-014.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-015.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-016.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-017.spec.ts +0 -60
- package/src/modules/sales/__integration__/TC-SALES-018.spec.ts +0 -25
- package/src/modules/sales/__integration__/TC-SALES-019.spec.ts +0 -22
- package/src/modules/sales/__integration__/TC-SALES-020.spec.ts +0 -107
- package/src/modules/sales/api/__tests__/channels.route.test.ts +0 -50
- package/src/modules/sales/api/__tests__/document-history.test.ts +0 -146
- package/src/modules/sales/api/__tests__/documents.factory.test.ts +0 -98
- package/src/modules/sales/api/__tests__/documents.routes.test.ts +0 -149
- package/src/modules/sales/api/__tests__/quotes.acceptance.test.ts +0 -209
- package/src/modules/sales/api/__tests__/timeline.test.tsx +0 -165
- package/src/modules/sales/api/dashboard/widgets/new-orders/__tests__/route.test.ts +0 -112
- package/src/modules/sales/api/dashboard/widgets/new-quotes/__tests__/route.test.ts +0 -116
- package/src/modules/sales/commands/__tests__/documents.cache.test.ts +0 -126
- package/src/modules/sales/commands/__tests__/documents.undo.test.ts +0 -170
- package/src/modules/sales/commands/__tests__/registration.test.ts +0 -141
- package/src/modules/sales/components/__tests__/salesComponentsRender.test.tsx +0 -456
- package/src/modules/sales/lib/__tests__/calculations.test.ts +0 -210
- package/src/modules/sales/services/__tests__/salesCalculationService.test.ts +0 -181
- package/src/modules/sales/services/__tests__/taxCalculationService.test.ts +0 -79
- package/src/modules/sales/widgets/dashboard/new-orders/__tests__/config.test.ts +0 -47
- package/src/modules/sales/widgets/dashboard/new-quotes/__tests__/config.test.ts +0 -47
- package/src/modules/staff/__integration__/TC-INT-006.spec.ts +0 -71
- package/src/modules/staff/data/__tests__/validators.test.ts +0 -60
- package/src/modules/translations/__integration__/TC-TRANS-001.spec.ts +0 -57
- package/src/modules/translations/__integration__/TC-TRANS-002.spec.ts +0 -114
- package/src/modules/translations/__integration__/TC-TRANS-003.spec.ts +0 -71
- package/src/modules/translations/__integration__/TC-TRANS-004.spec.ts +0 -66
- package/src/modules/translations/__integration__/TC-TRANS-005.spec.ts +0 -135
- package/src/modules/translations/__integration__/TC-TRANS-006.spec.ts +0 -113
- package/src/modules/translations/__integration__/TC-TRANS-007.spec.ts +0 -80
- package/src/modules/translations/__integration__/TC-TRANS-008.spec.ts +0 -209
- package/src/modules/translations/__integration__/helpers/translationFixtures.ts +0 -95
- package/src/modules/translations/api/__tests__/locales.test.ts +0 -67
- package/src/modules/translations/data/__tests__/validators.test.ts +0 -143
- package/src/modules/translations/lib/__tests__/extract-record-id.test.ts +0 -75
- package/src/modules/translations/lib/__tests__/helpers.test.ts +0 -215
- package/src/modules/translations/lib/__tests__/locale.test.ts +0 -115
- package/src/modules/translations/lib/__tests__/resolve-field-list.test.ts +0 -176
- package/src/modules/translations/lib/__tests__/translatable-fields.test.ts +0 -79
- package/src/modules/translations/widgets/__tests__/injection-table.test.ts +0 -83
- package/src/modules/workflows/__integration__/TC-WF-001.spec.ts +0 -114
- package/src/modules/workflows/api/__tests__/definitions.route.test.ts +0 -762
- package/src/modules/workflows/api/__tests__/instances.route.test.ts +0 -869
- package/src/modules/workflows/data/__tests__/validators.test.ts +0 -707
- package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +0 -1230
- package/src/modules/workflows/lib/__tests__/call-api.test.ts +0 -421
- package/src/modules/workflows/lib/__tests__/compensation.test.ts +0 -713
- package/src/modules/workflows/lib/__tests__/event-logger.test.ts +0 -615
- package/src/modules/workflows/lib/__tests__/integration.test.ts +0 -693
- package/src/modules/workflows/lib/__tests__/signals.test.ts +0 -566
- package/src/modules/workflows/lib/__tests__/step-handler.test.ts +0 -670
- package/src/modules/workflows/lib/__tests__/sub-workflow.test.ts +0 -934
- package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +0 -925
- package/src/modules/workflows/lib/__tests__/workflow-executor.test.ts +0 -684
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/** @jest-environment node */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
buildExtractionSystemPrompt,
|
|
5
|
-
buildExtractionUserPrompt,
|
|
6
|
-
REQUIRED_FEATURES_MAP,
|
|
7
|
-
} from '../extractionPrompt'
|
|
8
|
-
import type { ContactMatchResult } from '../contactMatcher'
|
|
9
|
-
|
|
10
|
-
describe('buildExtractionSystemPrompt', () => {
|
|
11
|
-
it('returns a string containing the role instruction', () => {
|
|
12
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
13
|
-
expect(result).toContain('email-to-ERP extraction agent')
|
|
14
|
-
expect(result).toContain('<role>')
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('includes contact matches when provided', () => {
|
|
18
|
-
const contacts: ContactMatchResult[] = [
|
|
19
|
-
{
|
|
20
|
-
participant: { name: 'John Doe', email: 'john@example.com', role: 'buyer' },
|
|
21
|
-
match: { contactId: 'c-001', contactType: 'person', contactName: 'John Doe', confidence: 0.95 },
|
|
22
|
-
},
|
|
23
|
-
]
|
|
24
|
-
const result = buildExtractionSystemPrompt(contacts, [])
|
|
25
|
-
expect(result).toContain('Pre-matched contacts from CRM')
|
|
26
|
-
expect(result).toContain('John Doe')
|
|
27
|
-
expect(result).toContain('john@example.com')
|
|
28
|
-
expect(result).toContain('c-001')
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('shows "No pre-matched contacts" when contacts list is empty', () => {
|
|
32
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
33
|
-
expect(result).toContain('No pre-matched contacts found in CRM')
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('includes catalog products when provided', () => {
|
|
37
|
-
const products = [
|
|
38
|
-
{ id: 'p-001', name: 'Widget A', sku: 'WA-100', price: '29.99' },
|
|
39
|
-
]
|
|
40
|
-
const result = buildExtractionSystemPrompt([], products)
|
|
41
|
-
expect(result).toContain('Catalog products')
|
|
42
|
-
expect(result).toContain('Widget A')
|
|
43
|
-
expect(result).toContain('WA-100')
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
it('shows "No catalog products" when products list is empty', () => {
|
|
47
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
48
|
-
expect(result).toContain('No catalog products available for matching')
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
it('includes channel ID when provided', () => {
|
|
52
|
-
const result = buildExtractionSystemPrompt([], [], 'ch-001')
|
|
53
|
-
expect(result).toContain('Default sales channel ID: ch-001')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('shows "No default sales channel" when channelId is not provided', () => {
|
|
57
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
58
|
-
expect(result).toContain('No default sales channel configured')
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('includes safety instructions', () => {
|
|
62
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
63
|
-
expect(result).toContain('<safety>')
|
|
64
|
-
expect(result).toContain('untrusted data')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('includes rules section', () => {
|
|
68
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
69
|
-
expect(result).toContain('<rules>')
|
|
70
|
-
expect(result).toContain('confidence')
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('includes required features mapping for all action types', () => {
|
|
74
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
75
|
-
expect(result).toContain('<required_features>')
|
|
76
|
-
expect(result).toContain('create_order')
|
|
77
|
-
expect(result).toContain('draft_reply')
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
describe('workingLanguage parameter', () => {
|
|
81
|
-
it('defaults to English when workingLanguage is not provided', () => {
|
|
82
|
-
const result = buildExtractionSystemPrompt([], [])
|
|
83
|
-
expect(result).toContain('in English even if')
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
it('uses German when workingLanguage is "de"', () => {
|
|
87
|
-
const result = buildExtractionSystemPrompt([], [], undefined, 'de')
|
|
88
|
-
expect(result).toContain('in German even if')
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
it('uses Spanish when workingLanguage is "es"', () => {
|
|
92
|
-
const result = buildExtractionSystemPrompt([], [], undefined, 'es')
|
|
93
|
-
expect(result).toContain('in Spanish even if')
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
it('uses Polish when workingLanguage is "pl"', () => {
|
|
97
|
-
const result = buildExtractionSystemPrompt([], [], undefined, 'pl')
|
|
98
|
-
expect(result).toContain('in Polish even if')
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
it('falls back to English for unknown language codes', () => {
|
|
102
|
-
const result = buildExtractionSystemPrompt([], [], undefined, 'xx')
|
|
103
|
-
expect(result).toContain('in English even if')
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
describe('buildExtractionUserPrompt', () => {
|
|
109
|
-
it('wraps email content in <email_content> XML delimiters', () => {
|
|
110
|
-
const content = 'Dear team, please process our order for 100 units.'
|
|
111
|
-
const result = buildExtractionUserPrompt(content)
|
|
112
|
-
expect(result).toContain('<email_content>')
|
|
113
|
-
expect(result).toContain('</email_content>')
|
|
114
|
-
expect(result).toContain(content)
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
it('includes output requirements', () => {
|
|
118
|
-
const result = buildExtractionUserPrompt('test content')
|
|
119
|
-
expect(result).toContain('<output_requirements>')
|
|
120
|
-
expect(result).toContain('summary')
|
|
121
|
-
expect(result).toContain('proposedActions')
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
it('includes task instruction', () => {
|
|
125
|
-
const result = buildExtractionUserPrompt('test')
|
|
126
|
-
expect(result).toContain('<task>')
|
|
127
|
-
expect(result).toContain('Extract actionable ERP proposals')
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
describe('REQUIRED_FEATURES_MAP', () => {
|
|
132
|
-
it('maps all 9 action types to required features', () => {
|
|
133
|
-
const expectedMappings: Record<string, string> = {
|
|
134
|
-
create_order: 'sales.orders.manage',
|
|
135
|
-
create_quote: 'sales.quotes.manage',
|
|
136
|
-
update_order: 'sales.orders.manage',
|
|
137
|
-
update_shipment: 'sales.shipments.manage',
|
|
138
|
-
create_contact: 'customers.people.manage',
|
|
139
|
-
create_product: 'catalog.products.manage',
|
|
140
|
-
link_contact: 'customers.people.manage',
|
|
141
|
-
log_activity: 'customers.activities.manage',
|
|
142
|
-
draft_reply: 'inbox_ops.replies.send',
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
expect(Object.keys(REQUIRED_FEATURES_MAP)).toHaveLength(9)
|
|
146
|
-
|
|
147
|
-
for (const [actionType, feature] of Object.entries(expectedMappings)) {
|
|
148
|
-
expect(REQUIRED_FEATURES_MAP[actionType as keyof typeof REQUIRED_FEATURES_MAP]).toBe(feature)
|
|
149
|
-
}
|
|
150
|
-
})
|
|
151
|
-
})
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/** @jest-environment node */
|
|
2
|
-
|
|
3
|
-
import { validatePrices } from '../priceValidator'
|
|
4
|
-
|
|
5
|
-
const mockFindWithDecryption = jest.fn()
|
|
6
|
-
|
|
7
|
-
jest.mock('@open-mercato/shared/lib/encryption/find', () => ({
|
|
8
|
-
findWithDecryption: (...args: unknown[]) => mockFindWithDecryption(...args),
|
|
9
|
-
}))
|
|
10
|
-
|
|
11
|
-
const mockEm = {} as any
|
|
12
|
-
const MockPriceClass = class {} as any
|
|
13
|
-
|
|
14
|
-
const scope = {
|
|
15
|
-
tenantId: 'tenant-1',
|
|
16
|
-
organizationId: 'org-1',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const deps = { catalogProductPriceClass: MockPriceClass }
|
|
20
|
-
|
|
21
|
-
describe('validatePrices', () => {
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
jest.clearAllMocks()
|
|
24
|
-
delete process.env.INBOX_OPS_PRICE_MISMATCH_THRESHOLD
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('returns empty array for non-order actions', async () => {
|
|
28
|
-
const result = await validatePrices(mockEm, [
|
|
29
|
-
{ actionType: 'create_contact', payload: {}, index: 0 },
|
|
30
|
-
{ actionType: 'log_activity', payload: {}, index: 1 },
|
|
31
|
-
], scope, deps)
|
|
32
|
-
|
|
33
|
-
expect(result).toEqual([])
|
|
34
|
-
expect(mockFindWithDecryption).not.toHaveBeenCalled()
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
it('detects warning-level price mismatch (5-20%)', async () => {
|
|
38
|
-
mockFindWithDecryption.mockResolvedValueOnce([
|
|
39
|
-
{ unitPriceNet: '100.00', currencyCode: 'EUR' },
|
|
40
|
-
])
|
|
41
|
-
|
|
42
|
-
const result = await validatePrices(mockEm, [
|
|
43
|
-
{
|
|
44
|
-
actionType: 'create_order',
|
|
45
|
-
payload: {
|
|
46
|
-
currencyCode: 'EUR',
|
|
47
|
-
lineItems: [
|
|
48
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '110', quantity: '1' },
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
index: 0,
|
|
52
|
-
},
|
|
53
|
-
], scope, deps)
|
|
54
|
-
|
|
55
|
-
expect(result).toHaveLength(1)
|
|
56
|
-
expect(result[0].type).toBe('price_mismatch')
|
|
57
|
-
expect(result[0].severity).toBe('warning')
|
|
58
|
-
expect(result[0].expectedValue).toBe('100.00')
|
|
59
|
-
expect(result[0].foundValue).toBe('110')
|
|
60
|
-
expect(result[0].actionIndex).toBe(0)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
it('detects error-level price mismatch (>20%)', async () => {
|
|
64
|
-
mockFindWithDecryption.mockResolvedValueOnce([
|
|
65
|
-
{ unitPriceNet: '100.00', currencyCode: 'EUR' },
|
|
66
|
-
])
|
|
67
|
-
|
|
68
|
-
const result = await validatePrices(mockEm, [
|
|
69
|
-
{
|
|
70
|
-
actionType: 'create_quote',
|
|
71
|
-
payload: {
|
|
72
|
-
currencyCode: 'EUR',
|
|
73
|
-
lineItems: [
|
|
74
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '150', quantity: '1' },
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
index: 0,
|
|
78
|
-
},
|
|
79
|
-
], scope, deps)
|
|
80
|
-
|
|
81
|
-
expect(result).toHaveLength(1)
|
|
82
|
-
expect(result[0].severity).toBe('error')
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
it('detects currency mismatch between order and catalog', async () => {
|
|
86
|
-
mockFindWithDecryption.mockResolvedValueOnce([
|
|
87
|
-
{ unitPriceNet: '100.00', currencyCode: 'USD' },
|
|
88
|
-
])
|
|
89
|
-
|
|
90
|
-
const result = await validatePrices(mockEm, [
|
|
91
|
-
{
|
|
92
|
-
actionType: 'create_order',
|
|
93
|
-
payload: {
|
|
94
|
-
currencyCode: 'EUR',
|
|
95
|
-
lineItems: [
|
|
96
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '100', quantity: '1' },
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
index: 0,
|
|
100
|
-
},
|
|
101
|
-
], scope, deps)
|
|
102
|
-
|
|
103
|
-
expect(result).toHaveLength(1)
|
|
104
|
-
expect(result[0].type).toBe('currency_mismatch')
|
|
105
|
-
expect(result[0].severity).toBe('warning')
|
|
106
|
-
expect(result[0].expectedValue).toBe('USD')
|
|
107
|
-
expect(result[0].foundValue).toBe('EUR')
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
it('skips line items without productId', async () => {
|
|
111
|
-
const result = await validatePrices(mockEm, [
|
|
112
|
-
{
|
|
113
|
-
actionType: 'create_order',
|
|
114
|
-
payload: {
|
|
115
|
-
lineItems: [
|
|
116
|
-
{ productName: 'Unknown item', unitPrice: '50', quantity: '1' },
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
index: 0,
|
|
120
|
-
},
|
|
121
|
-
], scope, deps)
|
|
122
|
-
|
|
123
|
-
expect(result).toEqual([])
|
|
124
|
-
expect(mockFindWithDecryption).not.toHaveBeenCalled()
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
it('skips line items without unitPrice', async () => {
|
|
128
|
-
const result = await validatePrices(mockEm, [
|
|
129
|
-
{
|
|
130
|
-
actionType: 'create_order',
|
|
131
|
-
payload: {
|
|
132
|
-
lineItems: [
|
|
133
|
-
{ productName: 'Widget A', productId: 'prod-1', quantity: '1' },
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
index: 0,
|
|
137
|
-
},
|
|
138
|
-
], scope, deps)
|
|
139
|
-
|
|
140
|
-
expect(result).toEqual([])
|
|
141
|
-
expect(mockFindWithDecryption).not.toHaveBeenCalled()
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
it('skips when catalog price is not found', async () => {
|
|
145
|
-
mockFindWithDecryption.mockResolvedValueOnce([])
|
|
146
|
-
|
|
147
|
-
const result = await validatePrices(mockEm, [
|
|
148
|
-
{
|
|
149
|
-
actionType: 'create_order',
|
|
150
|
-
payload: {
|
|
151
|
-
lineItems: [
|
|
152
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '50', quantity: '1' },
|
|
153
|
-
],
|
|
154
|
-
},
|
|
155
|
-
index: 0,
|
|
156
|
-
},
|
|
157
|
-
], scope, deps)
|
|
158
|
-
|
|
159
|
-
expect(result).toEqual([])
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
it('passes when price is within threshold', async () => {
|
|
163
|
-
mockFindWithDecryption.mockResolvedValueOnce([
|
|
164
|
-
{ unitPriceNet: '100.00', currencyCode: 'EUR' },
|
|
165
|
-
])
|
|
166
|
-
|
|
167
|
-
const result = await validatePrices(mockEm, [
|
|
168
|
-
{
|
|
169
|
-
actionType: 'create_order',
|
|
170
|
-
payload: {
|
|
171
|
-
currencyCode: 'EUR',
|
|
172
|
-
lineItems: [
|
|
173
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '102', quantity: '1' },
|
|
174
|
-
],
|
|
175
|
-
},
|
|
176
|
-
index: 0,
|
|
177
|
-
},
|
|
178
|
-
], scope, deps)
|
|
179
|
-
|
|
180
|
-
expect(result).toEqual([])
|
|
181
|
-
})
|
|
182
|
-
|
|
183
|
-
it('uses custom threshold from environment variable', async () => {
|
|
184
|
-
process.env.INBOX_OPS_PRICE_MISMATCH_THRESHOLD = '0.10'
|
|
185
|
-
|
|
186
|
-
mockFindWithDecryption.mockResolvedValueOnce([
|
|
187
|
-
{ unitPriceNet: '100.00', currencyCode: 'EUR' },
|
|
188
|
-
])
|
|
189
|
-
|
|
190
|
-
// 8% diff - under 10% custom threshold
|
|
191
|
-
const result = await validatePrices(mockEm, [
|
|
192
|
-
{
|
|
193
|
-
actionType: 'create_order',
|
|
194
|
-
payload: {
|
|
195
|
-
currencyCode: 'EUR',
|
|
196
|
-
lineItems: [
|
|
197
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '108', quantity: '1' },
|
|
198
|
-
],
|
|
199
|
-
},
|
|
200
|
-
index: 0,
|
|
201
|
-
},
|
|
202
|
-
], scope, deps)
|
|
203
|
-
|
|
204
|
-
expect(result).toEqual([])
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
it('handles multiple line items and multiple actions', async () => {
|
|
208
|
-
mockFindWithDecryption
|
|
209
|
-
.mockResolvedValueOnce([{ unitPriceNet: '10', currencyCode: 'EUR' }]) // prod-1: 10 vs 10 = ok
|
|
210
|
-
.mockResolvedValueOnce([{ unitPriceNet: '50', currencyCode: 'EUR' }]) // prod-2: 50 vs 100 = 100% diff
|
|
211
|
-
|
|
212
|
-
const result = await validatePrices(mockEm, [
|
|
213
|
-
{
|
|
214
|
-
actionType: 'create_order',
|
|
215
|
-
payload: {
|
|
216
|
-
currencyCode: 'EUR',
|
|
217
|
-
lineItems: [
|
|
218
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '10', quantity: '5' },
|
|
219
|
-
{ productName: 'Widget B', productId: 'prod-2', unitPrice: '100', quantity: '2' },
|
|
220
|
-
],
|
|
221
|
-
},
|
|
222
|
-
index: 0,
|
|
223
|
-
},
|
|
224
|
-
], scope, deps)
|
|
225
|
-
|
|
226
|
-
expect(result).toHaveLength(1)
|
|
227
|
-
expect(result[0].description).toContain('Widget B')
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
it('handles lookup errors gracefully', async () => {
|
|
231
|
-
mockFindWithDecryption.mockRejectedValueOnce(new Error('DB error'))
|
|
232
|
-
|
|
233
|
-
const result = await validatePrices(mockEm, [
|
|
234
|
-
{
|
|
235
|
-
actionType: 'create_order',
|
|
236
|
-
payload: {
|
|
237
|
-
lineItems: [
|
|
238
|
-
{ productName: 'Widget A', productId: 'prod-1', unitPrice: '50', quantity: '1' },
|
|
239
|
-
],
|
|
240
|
-
},
|
|
241
|
-
index: 0,
|
|
242
|
-
},
|
|
243
|
-
], scope, deps)
|
|
244
|
-
|
|
245
|
-
expect(result).toEqual([])
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
it('handles empty lineItems array', async () => {
|
|
249
|
-
const result = await validatePrices(mockEm, [
|
|
250
|
-
{
|
|
251
|
-
actionType: 'create_order',
|
|
252
|
-
payload: { lineItems: [] },
|
|
253
|
-
index: 0,
|
|
254
|
-
},
|
|
255
|
-
], scope, deps)
|
|
256
|
-
|
|
257
|
-
expect(result).toEqual([])
|
|
258
|
-
})
|
|
259
|
-
})
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/** @jest-environment node */
|
|
2
|
-
|
|
3
|
-
const mockGenerateObject = jest.fn()
|
|
4
|
-
jest.mock('ai', () => ({
|
|
5
|
-
generateObject: (...args: unknown[]) => mockGenerateObject(...args),
|
|
6
|
-
}))
|
|
7
|
-
|
|
8
|
-
jest.mock('@open-mercato/shared/lib/ai/opencode-provider', () => ({
|
|
9
|
-
resolveFirstConfiguredOpenCodeProvider: jest.fn(() => 'openai'),
|
|
10
|
-
resolveOpenCodeModel: jest.fn(() => ({ modelId: 'gpt-4o', modelWithProvider: 'openai:gpt-4o' })),
|
|
11
|
-
resolveOpenCodeProviderApiKey: jest.fn(() => 'test-key'),
|
|
12
|
-
resolveOpenCodeProviderId: jest.fn((id: string) => id || 'openai'),
|
|
13
|
-
}))
|
|
14
|
-
|
|
15
|
-
jest.mock('@open-mercato/core/modules/inbox_ops/lib/llmProvider', () => ({
|
|
16
|
-
createStructuredModel: jest.fn(async () => 'mock-model'),
|
|
17
|
-
resolveExtractionProviderId: jest.fn(() => 'openai'),
|
|
18
|
-
withTimeout: jest.fn(async (promise: Promise<unknown>) => promise),
|
|
19
|
-
}))
|
|
20
|
-
|
|
21
|
-
import { translateProposalContent } from '../translationProvider'
|
|
22
|
-
|
|
23
|
-
describe('translateProposalContent', () => {
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
jest.clearAllMocks()
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('calls generateObject with correct translation prompt', async () => {
|
|
29
|
-
mockGenerateObject.mockResolvedValueOnce({
|
|
30
|
-
object: {
|
|
31
|
-
summary: 'Kunde möchte 10 Widgets bestellen',
|
|
32
|
-
actions: { 'action-1': 'Bestellung erstellen' },
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const result = await translateProposalContent({
|
|
37
|
-
summary: 'Customer wants to order 10 widgets',
|
|
38
|
-
actionDescriptions: { 'action-1': 'Create order' },
|
|
39
|
-
sourceLanguage: 'en',
|
|
40
|
-
targetLocale: 'de',
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
expect(mockGenerateObject).toHaveBeenCalledWith(
|
|
44
|
-
expect.objectContaining({
|
|
45
|
-
model: 'mock-model',
|
|
46
|
-
system: expect.stringContaining('English'),
|
|
47
|
-
prompt: expect.stringContaining('Customer wants to order 10 widgets'),
|
|
48
|
-
temperature: 0,
|
|
49
|
-
}),
|
|
50
|
-
)
|
|
51
|
-
expect(mockGenerateObject.mock.calls[0][0].system).toContain('German')
|
|
52
|
-
|
|
53
|
-
expect(result.summary).toBe('Kunde möchte 10 Widgets bestellen')
|
|
54
|
-
expect(result.actions['action-1']).toBe('Bestellung erstellen')
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('preserves action ID mapping in the response', async () => {
|
|
58
|
-
const actionDescriptions = {
|
|
59
|
-
'id-aaa': 'Create contact for John',
|
|
60
|
-
'id-bbb': 'Create order for widgets',
|
|
61
|
-
'id-ccc': 'Log activity',
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
mockGenerateObject.mockResolvedValueOnce({
|
|
65
|
-
object: {
|
|
66
|
-
summary: 'Resumen traducido',
|
|
67
|
-
actions: {
|
|
68
|
-
'id-aaa': 'Crear contacto para John',
|
|
69
|
-
'id-bbb': 'Crear pedido de widgets',
|
|
70
|
-
'id-ccc': 'Registrar actividad',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
const result = await translateProposalContent({
|
|
76
|
-
summary: 'Translated summary',
|
|
77
|
-
actionDescriptions,
|
|
78
|
-
sourceLanguage: 'en',
|
|
79
|
-
targetLocale: 'es',
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
expect(Object.keys(result.actions)).toEqual(['id-aaa', 'id-bbb', 'id-ccc'])
|
|
83
|
-
expect(result.actions['id-aaa']).toBe('Crear contacto para John')
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
it('throws when API key is missing', async () => {
|
|
87
|
-
const { resolveOpenCodeProviderApiKey } = require('@open-mercato/shared/lib/ai/opencode-provider')
|
|
88
|
-
resolveOpenCodeProviderApiKey.mockReturnValueOnce(null)
|
|
89
|
-
|
|
90
|
-
await expect(
|
|
91
|
-
translateProposalContent({
|
|
92
|
-
summary: 'Test',
|
|
93
|
-
actionDescriptions: {},
|
|
94
|
-
sourceLanguage: 'en',
|
|
95
|
-
targetLocale: 'de',
|
|
96
|
-
}),
|
|
97
|
-
).rejects.toThrow('Missing API key')
|
|
98
|
-
})
|
|
99
|
-
})
|