@opencxh/domain 1.301.0 → 1.302.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/purchase/feed.d.ts +40 -2
- package/dist/index.cjs +17 -17
- package/dist/index.js +689 -679
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { OfferAvailability, SupplierOffer } from './types';
|
|
|
6
6
|
* turned into a product or an offer by itself.
|
|
7
7
|
*/
|
|
8
8
|
/** The columns a feed can fill. `vendorSku` or `gtin` is the key; the rest is optional. */
|
|
9
|
-
export type FeedColumn = "vendorSku" | "gtin" | "description" | "cost" | "list" | "currency" | "stock" | "leadDays";
|
|
9
|
+
export type FeedColumn = "vendorSku" | "gtin" | "description" | "brand" | "group" | "cost" | "list" | "currency" | "stock" | "leadDays";
|
|
10
10
|
export declare const FEED_COLUMNS: readonly FeedColumn[];
|
|
11
11
|
/** Per column, the header it is read from. Set once (the AI proposes, a person approves). */
|
|
12
12
|
export type FeedMapping = Partial<Record<FeedColumn, string>>;
|
|
@@ -52,6 +52,9 @@ export interface FeedRow {
|
|
|
52
52
|
vendorSku?: string;
|
|
53
53
|
gtin?: string;
|
|
54
54
|
description?: string;
|
|
55
|
+
/** Brand and product group: only to filter the unknown lines before they are imported. */
|
|
56
|
+
brand?: string;
|
|
57
|
+
group?: string;
|
|
55
58
|
costCents?: Cents;
|
|
56
59
|
listCents?: Cents;
|
|
57
60
|
currency?: string;
|
|
@@ -108,6 +111,8 @@ export interface FeedUnmatched {
|
|
|
108
111
|
vendorSku?: string;
|
|
109
112
|
gtin?: string;
|
|
110
113
|
description?: string;
|
|
114
|
+
brand?: string;
|
|
115
|
+
group?: string;
|
|
111
116
|
costCents?: Cents;
|
|
112
117
|
/** An article we have, with no offer from this supplier yet: "make an offer" is one click. */
|
|
113
118
|
productId?: string;
|
|
@@ -126,7 +131,40 @@ export interface FeedOutcome {
|
|
|
126
131
|
*/
|
|
127
132
|
export declare function feedOutcome(matches: readonly FeedMatch[], offers: readonly SupplierOffer[], now: number, jumpPercent?: number): FeedOutcome;
|
|
128
133
|
/**
|
|
129
|
-
* A first mapping from the header alone:
|
|
134
|
+
* A first mapping from the header alone: every exact word first, then a header that starts with
|
|
135
|
+
* one — so "Productgroep" is the group before "product" claims it as the description.
|
|
130
136
|
* No AI, no guessing beyond the list — what it leaves open, the AI or a person fills.
|
|
131
137
|
*/
|
|
132
138
|
export declare function guessFeedMapping(header: readonly string[]): FeedMapping;
|
|
139
|
+
/**
|
|
140
|
+
* How lines from a feed become articles: the choices made once for every new article in an import.
|
|
141
|
+
* The name comes from the description, the EAN and the price from the line.
|
|
142
|
+
*/
|
|
143
|
+
export interface FeedImportDefaults {
|
|
144
|
+
categoryKey?: string;
|
|
145
|
+
unitKey?: string;
|
|
146
|
+
kind: "goods" | "service";
|
|
147
|
+
/** Our article number: none, or the supplier's. */
|
|
148
|
+
sku: "none" | "vendor";
|
|
149
|
+
sellable: boolean;
|
|
150
|
+
}
|
|
151
|
+
/** One line to import; `productId` links it to an article we have instead of making one. */
|
|
152
|
+
export interface FeedImportItem {
|
|
153
|
+
line: number;
|
|
154
|
+
productId?: string;
|
|
155
|
+
}
|
|
156
|
+
/** An import from a run's unknown lines, as a screen shows it. */
|
|
157
|
+
export interface FeedImportStatus {
|
|
158
|
+
state: "running" | "done";
|
|
159
|
+
total: number;
|
|
160
|
+
products: number;
|
|
161
|
+
offers: number;
|
|
162
|
+
/** A line not imported, with the reason's code (`sku_taken`, `feed_import_no_price`, …). */
|
|
163
|
+
skipped: {
|
|
164
|
+
line: number;
|
|
165
|
+
code: string;
|
|
166
|
+
text: string;
|
|
167
|
+
}[];
|
|
168
|
+
startedAt: number;
|
|
169
|
+
finishedAt?: number;
|
|
170
|
+
}
|