digicust_types 1.8.513 → 1.8.515
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/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.js +1 -0
- package/lib/contracts/line-item-merge-settings.d.ts +39 -0
- package/lib/contracts/line-item-merge-settings.js +2 -0
- package/lib/models/digicust/documents/document-code-source-context.d.ts +18 -0
- package/lib/models/digicust/documents/document-code-source-context.js +2 -0
- package/lib/models/digicust/documents/document-types/digicust-document.model.d.ts +5 -0
- package/lib/models/digicust/execution-strategy/execution-strategy.model.d.ts +8 -2
- package/lib/models/digicust/execution-strategy/material-enrichment-merge-config.d.ts +5 -0
- package/lib/models/digicust/execution-strategy/material-enrichment-merge-config.js +2 -0
- package/lib/models/digicust/execution-strategy/merge-line-item-mode.enum.d.ts +2 -1
- package/lib/models/digicust/execution-strategy/merge-line-item-mode.enum.js +3 -1
- package/lib/models/digicust/line-item/line-item.model.d.ts +4 -2
- package/lib/models/digicust/module/index.d.ts +1 -0
- package/lib/models/digicust/module/index.js +17 -0
- package/lib/models/digicust/module/module.model.d.ts +49 -0
- package/lib/models/digicust/module/module.model.js +27 -0
- package/lib/models/digicust/multerfile.model.d.ts +1 -0
- package/package.json +1 -1
package/lib/contracts/index.d.ts
CHANGED
package/lib/contracts/index.js
CHANGED
@@ -30,3 +30,4 @@ __exportStar(require("./start-dakosy-submission.dto"), exports); // starts dakos
|
|
30
30
|
__exportStar(require("./start-data-integration.dto"), exports); // starts data integration
|
31
31
|
__exportStar(require("./start-taric-import.dto"), exports); // starts taric import
|
32
32
|
__exportStar(require("./start-data-extraction-callback.dto"), exports); // starts data extraction callback
|
33
|
+
__exportStar(require("./line-item-merge-settings"), exports); // line item merge settings
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { DigicustDocumentType } from "../models";
|
2
|
+
/** Switch between legacy hard-coded precedence and rules mode. */
|
3
|
+
export type MergeMode = "legacy" | "rules";
|
4
|
+
/** Optional reducer hook – string id now, function later when SDK grows. */
|
5
|
+
export type MergeReducerId = string;
|
6
|
+
/** One field's precedence & reducer rule. */
|
7
|
+
export interface MergeFieldRule {
|
8
|
+
/**
|
9
|
+
* Document types ranked from highest to lowest precedence.
|
10
|
+
* Single value allowed as shorthand.
|
11
|
+
*/
|
12
|
+
source: DigicustDocumentType | DigicustDocumentType[];
|
13
|
+
/** Optional reducer id (e.g. 'sum', 'first', 'concat'). */
|
14
|
+
reducer?: MergeReducerId;
|
15
|
+
}
|
16
|
+
/** Top-level settings object injected into the Line-item merger. */
|
17
|
+
export interface LineItemMergeSettings {
|
18
|
+
/** Default = 'legacy' if omitted. */
|
19
|
+
mode?: MergeMode;
|
20
|
+
/**
|
21
|
+
* Document types that, if present with items, short-circuit the merge
|
22
|
+
* and are returned verbatim (replaces hard-coded early returns).
|
23
|
+
*/
|
24
|
+
earlyReturn?: DigicustDocumentType[];
|
25
|
+
/**
|
26
|
+
* Ordered list; the first type that actually exists in the documents
|
27
|
+
* becomes the baseline "container" set.
|
28
|
+
*/
|
29
|
+
baselinePriority?: DigicustDocumentType[];
|
30
|
+
/**
|
31
|
+
* Document types that may supply candidates to merge *into* baseline.
|
32
|
+
* If omitted, the implementation uses its internal default list.
|
33
|
+
*/
|
34
|
+
mergeSources?: DigicustDocumentType[];
|
35
|
+
/** Per-field rules – if a field is absent here, default precedence applies. */
|
36
|
+
fields?: Record<string, MergeFieldRule>;
|
37
|
+
/** Optional map for custom reducer ids → implementation name (future). */
|
38
|
+
reducers?: Record<string, MergeReducerId>;
|
39
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DocumentCodeSource } from "./document-code-source.enum";
|
2
|
+
import { ConditionModel } from "../execution-strategy/condition.model";
|
3
|
+
export interface DocumentCodeSourceContext {
|
4
|
+
source: DocumentCodeSource;
|
5
|
+
taricQueryParams?: {
|
6
|
+
itemId?: string;
|
7
|
+
countryCode?: string;
|
8
|
+
procedureMode?: string;
|
9
|
+
certificateType?: string;
|
10
|
+
};
|
11
|
+
ruleMetadata?: {
|
12
|
+
name?: string;
|
13
|
+
id?: string;
|
14
|
+
conditions?: ConditionModel[];
|
15
|
+
};
|
16
|
+
computationParams?: any;
|
17
|
+
materialId?: string;
|
18
|
+
}
|
@@ -20,6 +20,11 @@ export interface DigicustDocumentModel {
|
|
20
20
|
userDocumentStatus?: UserDocumentStatus;
|
21
21
|
subDocumentStatus?: SubDocumentStatus;
|
22
22
|
classificationStatus?: ClassificationStatus;
|
23
|
+
/**
|
24
|
+
* Special file format that requires different processing than normal OCR.
|
25
|
+
* Examples: 'xlsx', 'xml', 'csv' for structured data files.
|
26
|
+
*/
|
27
|
+
specialFileFormat?: "xlsx" | "xml" | "csv";
|
23
28
|
userEdited?: boolean;
|
24
29
|
isPseudonymized?: boolean;
|
25
30
|
processing?: ProcessingModel;
|
@@ -2,7 +2,8 @@ import { CustomsTariffNumberNormalizationSettings, DigicustDocumentType, Event,
|
|
2
2
|
import { UserInputTemplate } from "../userInputTemplate";
|
3
3
|
import { Submission } from "./sftp-config.model";
|
4
4
|
import { UploadWidget } from "./uploadWidget";
|
5
|
-
import {
|
5
|
+
import { MaterialEnrichmentMergeConfig } from "./material-enrichment-merge-config";
|
6
|
+
import { LineItemMergeSettings } from "../../../contracts/line-item-merge-settings";
|
6
7
|
/**
|
7
8
|
* Execution strategies are customer-configurable plans on how to process a specific case.
|
8
9
|
*/
|
@@ -157,7 +158,6 @@ export interface ExecutionStrategy {
|
|
157
158
|
removeStakeholderContactInformation?: {
|
158
159
|
active?: boolean;
|
159
160
|
};
|
160
|
-
mergeLineItemMode?: MergeLineItemModeEnum;
|
161
161
|
ignoreLineItemsFromInvoice?: boolean;
|
162
162
|
ignoreLineItemsFromTransitDeclaration?: boolean;
|
163
163
|
ignoreLineItemsWithoutInvoice?: boolean;
|
@@ -328,6 +328,11 @@ export interface ExecutionStrategy {
|
|
328
328
|
*/
|
329
329
|
omitLineItemDescription?: boolean;
|
330
330
|
emailSenderAsRepresentativeEmail?: boolean;
|
331
|
+
/**
|
332
|
+
* Optional – if absent the merger operates in legacy mode.
|
333
|
+
* Safe to add to existing JSON without breaking old clients.
|
334
|
+
*/
|
335
|
+
lineItemMergeSettings?: LineItemMergeSettings;
|
331
336
|
};
|
332
337
|
dataValidation?: {
|
333
338
|
active?: boolean;
|
@@ -511,6 +516,7 @@ export interface ExecutionStrategy {
|
|
511
516
|
disableMaterialNumberMatching?: boolean;
|
512
517
|
sendMasterDataTariffNumberOnly?: boolean;
|
513
518
|
sendMasterDataDescriptionOnly?: boolean;
|
519
|
+
materialEnrichmentMergeConfig?: MaterialEnrichmentMergeConfig;
|
514
520
|
tariffNumberMatchingConfiguration?: {
|
515
521
|
stakeholderFilters?: ("shipper" | "consignee" | "recipient" | "beneficiary" | "applicant" | "declarant" | "importer" | "exporter" | "buyer" | "agent" | "broker" | "carrier" | "warehouse" | "obligater")[];
|
516
522
|
matchShipperCountry?: boolean;
|
@@ -2,7 +2,8 @@ export declare enum MergeLineItemModeEnum {
|
|
2
2
|
standard = "standard",
|
3
3
|
extended = "extended",
|
4
4
|
pickInvoiceItems = "pickInvoiceItems",
|
5
|
-
|
5
|
+
pickPackingListItems = "pickPackingListItems",
|
6
|
+
mergeMultiplePackingLists = "mergeMultiplePackingLists",
|
6
7
|
pickDeliveryNoteItems = "pickDeliveryNoteItems",
|
7
8
|
pickExportDeclarationItems = "pickExportDeclarationItems"
|
8
9
|
}
|
@@ -10,7 +10,9 @@ var MergeLineItemModeEnum;
|
|
10
10
|
// Pick only invoice items without merging, if any invoice items exist (else fallback to "standard" behavior)
|
11
11
|
MergeLineItemModeEnum["pickInvoiceItems"] = "pickInvoiceItems";
|
12
12
|
// Pick only packagelist items without merging, if any packinglists exist (else fallback to "standard" behavior)
|
13
|
-
MergeLineItemModeEnum["
|
13
|
+
MergeLineItemModeEnum["pickPackingListItems"] = "pickPackingListItems";
|
14
|
+
// Merge only multiple packinglist's items with each other, picking the first packingList as the base-line for the others
|
15
|
+
MergeLineItemModeEnum["mergeMultiplePackingLists"] = "mergeMultiplePackingLists";
|
14
16
|
// Pick only deliverynote items without merging, if any deliverynotes exist (else fallback to "standard" behavior)
|
15
17
|
MergeLineItemModeEnum["pickDeliveryNoteItems"] = "pickDeliveryNoteItems";
|
16
18
|
// Pick only exportDeclaration/turkishExportDeclaration items without merging, if any deliverynotes exist (else fallback to "standard" behavior)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Adjustment, Container, DigicustDocumentModel, DocumentTypeCode, MatchingMetadataModel, MaterialMatchInput, MaterialMatchResult, Package, PreferenceState, Procedure, AddressModel, CompanyModel, Currency, CustomsTariffNumber, Meta, Money, Quantity, Weight, WeightUnit, Bbox, UnitOfMeasurement, MasterDataCreationType, CustomsDuty, ImportSalesTax, AdditionDeduction, Translatable, TypeOfBusiness, CountrySpecificLineItem, DateTimeModel, PackageType, VOC } from "..";
|
1
|
+
import { Adjustment, Container, DigicustDocumentModel, DocumentTypeCode, MatchingMetadataModel, MaterialMatchInput, MaterialMatchResult, Package, PreferenceState, Procedure, AddressModel, CompanyModel, Currency, CustomsTariffNumber, Meta, Money, Quantity, Weight, WeightUnit, Bbox, UnitOfMeasurement, MasterDataCreationType, CustomsDuty, ImportSalesTax, AdditionDeduction, Translatable, TypeOfBusiness, CountrySpecificLineItem, DateTimeModel, PackageType, VOC, MaterialMatchByTariffNumberInput } from "..";
|
2
2
|
import { ItemFraudDetectionDetails } from "../fraud/item-fraud-detection";
|
3
3
|
import { LineItemDescriptionModel } from "./line-item-description.model";
|
4
4
|
/**
|
@@ -105,6 +105,7 @@ export interface LineItemModel {
|
|
105
105
|
containers?: Container[];
|
106
106
|
chassisNumber?: Meta<string>;
|
107
107
|
materialId?: string;
|
108
|
+
secondaryMaterialId?: string;
|
108
109
|
creationType?: MasterDataCreationType;
|
109
110
|
materialMatchingType?: "materialNumber" | "tariffNumber";
|
110
111
|
bbox?: Bbox;
|
@@ -112,7 +113,8 @@ export interface LineItemModel {
|
|
112
113
|
dangerousGoods?: {
|
113
114
|
UNNumber?: Meta<string>;
|
114
115
|
}[];
|
115
|
-
matchingMetadata?: MatchingMetadataModel<MaterialMatchInput, MaterialMatchResult>;
|
116
|
+
matchingMetadata?: MatchingMetadataModel<MaterialMatchInput, MaterialMatchResult> | MatchingMetadataModel<MaterialMatchByTariffNumberInput, MaterialMatchResult>;
|
117
|
+
secondaryMatchingMetadata?: MatchingMetadataModel<MaterialMatchInput, MaterialMatchResult> | MatchingMetadataModel<MaterialMatchByTariffNumberInput, MaterialMatchResult>;
|
116
118
|
countrySpecific?: CountrySpecificLineItem;
|
117
119
|
beforeNormalization?: {
|
118
120
|
totalNetWeight?: Weight;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./module.model";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./module.model"), exports);
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/**
|
2
|
+
* Identifies a module. Modules are different "programs" in the frontend
|
3
|
+
*/
|
4
|
+
export interface ModuleModel {
|
5
|
+
id?: string;
|
6
|
+
alias?: string;
|
7
|
+
type?: ModuleType;
|
8
|
+
active?: boolean;
|
9
|
+
executionStrategies?: {
|
10
|
+
Default?: ModuleExecStrategy;
|
11
|
+
Declaration?: ModuleExecStrategy;
|
12
|
+
PreDeclaration?: ModuleExecStrategy;
|
13
|
+
SimplifiedProcedure?: ModuleExecStrategy;
|
14
|
+
WriteupProcedure?: ModuleExecStrategy;
|
15
|
+
T1Transit?: ModuleExecStrategy;
|
16
|
+
T2Transit?: ModuleExecStrategy;
|
17
|
+
MasterData?: ModuleExecStrategy;
|
18
|
+
StakeHolderData?: ModuleExecStrategy;
|
19
|
+
};
|
20
|
+
}
|
21
|
+
interface ModuleExecStrategy {
|
22
|
+
title?: string;
|
23
|
+
executionStrategyId?: string;
|
24
|
+
alias?: string;
|
25
|
+
active?: boolean;
|
26
|
+
}
|
27
|
+
export declare enum ModuleType {
|
28
|
+
import = "Import",
|
29
|
+
export = "Export",
|
30
|
+
warehouseProcedure = "Warehouse Procedure",
|
31
|
+
transitProcedure = "Transit Procedure",
|
32
|
+
dataExtraction = "Data Extraction",
|
33
|
+
documentClassification = "Document Classification",
|
34
|
+
productClassification = "Product Classification",
|
35
|
+
statistics = "Statistics",
|
36
|
+
masterModule = "Master Module"
|
37
|
+
}
|
38
|
+
export declare enum ModuleCategory {
|
39
|
+
default = "Default",
|
40
|
+
declaration = "Declaration",
|
41
|
+
preDeclaration = "Pre Declaration",
|
42
|
+
simplifiedProcedure = "Simplified Procedure",
|
43
|
+
writeupProcedure = "Writeup Procedure",
|
44
|
+
t1Transit = "T1 Transit",
|
45
|
+
t2Transit = "T2 Transit",
|
46
|
+
masterData = "Master Data",
|
47
|
+
stakeHolderData = "StakeHolder Data"
|
48
|
+
}
|
49
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ModuleCategory = exports.ModuleType = void 0;
|
4
|
+
var ModuleType;
|
5
|
+
(function (ModuleType) {
|
6
|
+
ModuleType["import"] = "Import";
|
7
|
+
ModuleType["export"] = "Export";
|
8
|
+
ModuleType["warehouseProcedure"] = "Warehouse Procedure";
|
9
|
+
ModuleType["transitProcedure"] = "Transit Procedure";
|
10
|
+
ModuleType["dataExtraction"] = "Data Extraction";
|
11
|
+
ModuleType["documentClassification"] = "Document Classification";
|
12
|
+
ModuleType["productClassification"] = "Product Classification";
|
13
|
+
ModuleType["statistics"] = "Statistics";
|
14
|
+
ModuleType["masterModule"] = "Master Module";
|
15
|
+
})(ModuleType || (exports.ModuleType = ModuleType = {}));
|
16
|
+
var ModuleCategory;
|
17
|
+
(function (ModuleCategory) {
|
18
|
+
ModuleCategory["default"] = "Default";
|
19
|
+
ModuleCategory["declaration"] = "Declaration";
|
20
|
+
ModuleCategory["preDeclaration"] = "Pre Declaration";
|
21
|
+
ModuleCategory["simplifiedProcedure"] = "Simplified Procedure";
|
22
|
+
ModuleCategory["writeupProcedure"] = "Writeup Procedure";
|
23
|
+
ModuleCategory["t1Transit"] = "T1 Transit";
|
24
|
+
ModuleCategory["t2Transit"] = "T2 Transit";
|
25
|
+
ModuleCategory["masterData"] = "Master Data";
|
26
|
+
ModuleCategory["stakeHolderData"] = "StakeHolder Data";
|
27
|
+
})(ModuleCategory || (exports.ModuleCategory = ModuleCategory = {}));
|