store-scrapper-js-common 1.0.68 → 1.0.72
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/index.d.ts +3 -3
- package/dist/entities/index.js +2 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/keyword.d.ts +11 -0
- package/dist/entities/keyword.js +11 -0
- package/dist/entities/keyword.js.map +1 -1
- package/dist/entities/prices-stats.d.ts +1 -0
- package/dist/entities/prices-stats.js +5 -0
- package/dist/entities/prices-stats.js.map +1 -1
- package/dist/entities/product.d.ts +16 -2
- package/dist/entities/product.js +7 -1
- package/dist/entities/product.js.map +1 -1
- package/dist/entities/store.d.ts +8 -0
- package/dist/entities/store.js +15 -1
- package/dist/entities/store.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/index.ts +8 -4
- package/src/entities/keyword.ts +15 -0
- package/src/entities/prices-stats.ts +4 -0
- package/src/entities/product.ts +25 -2
- package/src/entities/store.ts +13 -0
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StoreQueueConfig, Store, CountryEnum } from './store';
|
|
2
|
-
import { Product, UpdateReasonEnum, CurrencyEnum } from './product';
|
|
1
|
+
import { StoreQueueConfig, Store, CountryEnum, PriorityEnum } from './store';
|
|
2
|
+
import { Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice } from './product';
|
|
3
3
|
import { Price } from './price';
|
|
4
4
|
import { Category } from './category';
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
@@ -7,4 +7,4 @@ import { Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM } from './
|
|
|
7
7
|
import { User } from './user';
|
|
8
8
|
import { AlertConditions } from './alert-conditions';
|
|
9
9
|
export declare const Entities: (typeof Price | typeof Keyword | typeof Product | typeof Store | typeof User)[];
|
|
10
|
-
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, CurrencyEnum, UpdateReasonEnum, };
|
|
10
|
+
export { Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM, CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum, CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes, };
|
package/dist/entities/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateReasonEnum = exports.CurrencyEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
3
|
+
exports.UpdateReasonEnum = exports.CurrencyEnum = exports.PriorityEnum = exports.CountryEnum = exports.AlertConditions = exports.User = exports.CATEGORY_ENUM = exports.CONDITION_ENUM = exports.CONDITION_FIELD_ENUM = exports.Keyword = exports.AbstractBase = exports.Category = exports.Price = exports.Product = exports.Store = exports.Entities = void 0;
|
|
4
4
|
const store_1 = require("./store");
|
|
5
5
|
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return store_1.Store; } });
|
|
6
6
|
Object.defineProperty(exports, "CountryEnum", { enumerable: true, get: function () { return store_1.CountryEnum; } });
|
|
7
|
+
Object.defineProperty(exports, "PriorityEnum", { enumerable: true, get: function () { return store_1.PriorityEnum; } });
|
|
7
8
|
const product_1 = require("./product");
|
|
8
9
|
Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return product_1.Product; } });
|
|
9
10
|
Object.defineProperty(exports, "UpdateReasonEnum", { enumerable: true, get: function () { return product_1.UpdateReasonEnum; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["entities/index.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAkBf,sFAnBkB,aAAK,OAmBlB;AACmE,4FApB/C,mBAAW,OAoB+C;AAAE,6FApB/C,oBAAY,OAoB+C;AAlBnG,uCAEmB;AAeV,wFAhBP,iBAAO,OAgBO;AAEA,iGAlBL,0BAAgB,OAkBK;AAA9B,6FAlB2B,sBAAY,OAkB3B;AAhBd,mCAAgC;AAcd,sFAdT,aAAK,OAcS;AAbvB,yCAAsC;AAab,yFAbhB,mBAAQ,OAagB;AAZjC,mDAA+C;AAYZ,6FAZ1B,4BAAY,OAY0B;AAX/C,uCAEmB;AAS8B,wFAV/C,iBAAO,OAU+C;AACtC,8FAXP,uBAAa,OAWO;AAA7B,+FAXwB,wBAAc,OAWxB;AAD0C,qGAVhB,8BAAoB,OAUgB;AAR9E,iCAA8B;AASG,qFATxB,WAAI,OASwB;AARrC,yDAAqD;AAQd,gGAR9B,kCAAe,OAQ8B;AANzC,QAAA,QAAQ,GAAG;IACtB,aAAK,EAAE,iBAAO,EAAE,aAAK,EAAE,iBAAO,EAAE,WAAI;CACrC,CAAC","sourcesContent":["import {\n StoreQueueConfig, Store, CountryEnum, PriorityEnum,\n} from './store';\nimport {\n Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,\n} from './product';\nimport { Price } from './price';\nimport { Category } from './category';\nimport { AbstractBase } from './abstract-base';\nimport {\n Keyword, CATEGORY_ENUM, CONDITION_ENUM, CONDITION_FIELD_ENUM,\n} from './keyword';\nimport { User } from './user';\nimport { AlertConditions } from './alert-conditions';\n\nexport const Entities = [\n Store, Product, Price, Keyword, User,\n];\n\nexport {\n Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,\n CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,\n CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes,\n};\n"]}
|
|
@@ -12,7 +12,9 @@ export declare enum CONDITION_FIELD_ENUM {
|
|
|
12
12
|
}
|
|
13
13
|
export declare enum CATEGORY_ENUM {
|
|
14
14
|
NOTEBOOKS = "NOTEBOOKS",
|
|
15
|
+
NOTEBOOKS_MACBOOK = "NOTEBOOKS_MACBOOK",
|
|
15
16
|
SMARTPHONES = "SMARTPHONES",
|
|
17
|
+
SMARTPHONES_IPHONE = "SMARTPHONES_IPHONE",
|
|
16
18
|
SMARTWATCHES = "SMARTWATCHES",
|
|
17
19
|
TABLETS = "TABLETS",
|
|
18
20
|
TV = "TV",
|
|
@@ -26,6 +28,15 @@ export declare enum CATEGORY_ENUM {
|
|
|
26
28
|
KITCHEN = "KITCHEN",
|
|
27
29
|
GAMES = "GAMES",
|
|
28
30
|
DRINKABLE = "DRINKABLE",
|
|
31
|
+
DRINKABLE_WHISKY = "DRINKABLE_WHISKY",
|
|
32
|
+
DRINKABLE_BEER = "DRINKABLE_BEER",
|
|
33
|
+
DRINKABLE_WINE = "DRINKABLE_WINE",
|
|
34
|
+
DRINKABLE_VODKA = "DRINKABLE_VODKA",
|
|
35
|
+
DRINKABLE_COGNAC = "DRINKABLE_COGNAC",
|
|
36
|
+
DRINKABLE_GIN = "DRINKABLE_GIN",
|
|
37
|
+
DRINKABLE_TEQUILA = "DRINKABLE_TEQUILA",
|
|
38
|
+
DRINKABLE_RUM = "DRINKABLE_RUM",
|
|
39
|
+
DRINKABLE_PISCO = "DRINKABLE_PISCO",
|
|
29
40
|
DORMITORY = "DORMITORY",
|
|
30
41
|
PHOTOGRAPHY = "PHOTOGRAPHY",
|
|
31
42
|
HEADPHONES = "HEADPHONES",
|
package/dist/entities/keyword.js
CHANGED
|
@@ -28,7 +28,9 @@ var CONDITION_FIELD_ENUM;
|
|
|
28
28
|
var CATEGORY_ENUM;
|
|
29
29
|
(function (CATEGORY_ENUM) {
|
|
30
30
|
CATEGORY_ENUM["NOTEBOOKS"] = "NOTEBOOKS";
|
|
31
|
+
CATEGORY_ENUM["NOTEBOOKS_MACBOOK"] = "NOTEBOOKS_MACBOOK";
|
|
31
32
|
CATEGORY_ENUM["SMARTPHONES"] = "SMARTPHONES";
|
|
33
|
+
CATEGORY_ENUM["SMARTPHONES_IPHONE"] = "SMARTPHONES_IPHONE";
|
|
32
34
|
CATEGORY_ENUM["SMARTWATCHES"] = "SMARTWATCHES";
|
|
33
35
|
CATEGORY_ENUM["TABLETS"] = "TABLETS";
|
|
34
36
|
CATEGORY_ENUM["TV"] = "TV";
|
|
@@ -42,6 +44,15 @@ var CATEGORY_ENUM;
|
|
|
42
44
|
CATEGORY_ENUM["KITCHEN"] = "KITCHEN";
|
|
43
45
|
CATEGORY_ENUM["GAMES"] = "GAMES";
|
|
44
46
|
CATEGORY_ENUM["DRINKABLE"] = "DRINKABLE";
|
|
47
|
+
CATEGORY_ENUM["DRINKABLE_WHISKY"] = "DRINKABLE_WHISKY";
|
|
48
|
+
CATEGORY_ENUM["DRINKABLE_BEER"] = "DRINKABLE_BEER";
|
|
49
|
+
CATEGORY_ENUM["DRINKABLE_WINE"] = "DRINKABLE_WINE";
|
|
50
|
+
CATEGORY_ENUM["DRINKABLE_VODKA"] = "DRINKABLE_VODKA";
|
|
51
|
+
CATEGORY_ENUM["DRINKABLE_COGNAC"] = "DRINKABLE_COGNAC";
|
|
52
|
+
CATEGORY_ENUM["DRINKABLE_GIN"] = "DRINKABLE_GIN";
|
|
53
|
+
CATEGORY_ENUM["DRINKABLE_TEQUILA"] = "DRINKABLE_TEQUILA";
|
|
54
|
+
CATEGORY_ENUM["DRINKABLE_RUM"] = "DRINKABLE_RUM";
|
|
55
|
+
CATEGORY_ENUM["DRINKABLE_PISCO"] = "DRINKABLE_PISCO";
|
|
45
56
|
CATEGORY_ENUM["DORMITORY"] = "DORMITORY";
|
|
46
57
|
CATEGORY_ENUM["PHOTOGRAPHY"] = "PHOTOGRAPHY";
|
|
47
58
|
CATEGORY_ENUM["HEADPHONES"] = "HEADPHONES";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword.js","sourceRoot":"/","sources":["entities/keyword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,mDAA+C;AAE/C,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,4CAA0B,CAAA;IAC1B,wCAAsB,CAAA;IACtB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;AACrB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,sDAA8B,CAAA;IAC9B,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"keyword.js","sourceRoot":"/","sources":["entities/keyword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,mDAA+C;AAE/C,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,4CAA0B,CAAA;IAC1B,wCAAsB,CAAA;IACtB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;AACrB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,sDAA8B,CAAA;IAC9B,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAED,IAAY,aAmCX;AAnCD,WAAY,aAAa;IACrB,wCAAuB,CAAA;IACvB,wDAAuC,CAAA;IAEvC,4CAA2B,CAAA;IAC3B,0DAAyC,CAAA;IAEzC,8CAA6B,CAAA;IAC7B,oCAAmB,CAAA;IACnB,0BAAS,CAAA;IACT,gCAAe,CAAA;IACf,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,kDAAiC,CAAA;IACjC,sDAAqC,CAAA;IACrC,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IAEf,wCAAuB,CAAA;IACvB,sDAAqC,CAAA;IACrC,kDAAiC,CAAA;IACjC,kDAAiC,CAAA;IACjC,oDAAmC,CAAA;IACnC,sDAAqC,CAAA;IACrC,gDAA+B,CAAA;IAC/B,wDAAuC,CAAA;IACvC,gDAA+B,CAAA;IAC/B,oDAAmC,CAAA;IAEnC,wCAAuB,CAAA;IACvB,4CAA2B,CAAA;IAC3B,0CAAyB,CAAA;IACzB,0DAAyC,CAAA;AAC7C,CAAC,EAnCW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAmCxB;AAGD,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,4BAAY;CA2BxC,CAAA;AAzBG;IADC,gBAAM,EAAE;;yCACe;AAGxB;IADC,gBAAM,EAAE;;wCACQ;AAGjB;IADC,gBAAM,EAAE;;0CACkB;AAG3B;IADC,gBAAM,EAAE;;sCACoB;AAG7B;IADC,gBAAM,EAAE;;wCACQ;AAGjB;IADC,gBAAM,EAAE;;6CACc;AAGvB;IADC,gBAAM,EAAE;;qCACM;AAGf;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;6CACc;AA1Bd,OAAO;IADnB,gBAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;GAChB,OAAO,CA2BnB;AA3BY,0BAAO","sourcesContent":["import { Column, Entity } from 'typeorm';\nimport { AbstractBase } from './abstract-base';\n\nexport enum CONDITION_ENUM {\n STARTS_WITH = 'startsWith',\n ENDS_WITH = 'endsWith',\n INCLUDES = 'includes',\n EQUALS = 'equals'\n}\n\nexport enum CONDITION_FIELD_ENUM {\n CATEGORY_PATH = 'categoryPath',\n CATEGORY = 'category',\n PRODUCT_NAME = 'name'\n}\n\nexport enum CATEGORY_ENUM {\n NOTEBOOKS = 'NOTEBOOKS',\n NOTEBOOKS_MACBOOK = 'NOTEBOOKS_MACBOOK',\n\n SMARTPHONES = 'SMARTPHONES',\n SMARTPHONES_IPHONE = 'SMARTPHONES_IPHONE',\n\n SMARTWATCHES = 'SMARTWATCHES',\n TABLETS = 'TABLETS',\n TV = 'TV',\n AUDIO = 'AUDIO',\n FRIDGES = 'FRIDGES',\n WASHERS = 'WASHERS',\n DRYERS = 'DRYERS',\n WASHERS_DRYERS = 'WASHERS_DRYERS',\n AIR_CONDITIONING = 'AIR_CONDITIONING',\n HEATING = 'HEATING',\n KITCHEN = 'KITCHEN',\n GAMES = 'GAMES',\n\n DRINKABLE = 'DRINKABLE',\n DRINKABLE_WHISKY = 'DRINKABLE_WHISKY',\n DRINKABLE_BEER = 'DRINKABLE_BEER',\n DRINKABLE_WINE = 'DRINKABLE_WINE',\n DRINKABLE_VODKA = 'DRINKABLE_VODKA',\n DRINKABLE_COGNAC = 'DRINKABLE_COGNAC',\n DRINKABLE_GIN = 'DRINKABLE_GIN',\n DRINKABLE_TEQUILA = 'DRINKABLE_TEQUILA',\n DRINKABLE_RUM = 'DRINKABLE_RUM',\n DRINKABLE_PISCO = 'DRINKABLE_PISCO',\n\n DORMITORY = 'DORMITORY',\n PHOTOGRAPHY = 'PHOTOGRAPHY',\n HEADPHONES = 'HEADPHONES',\n CATEGORY_NOT_FOUND = 'CATEGORY_NOT_FOUND'\n}\n\n@Entity({ name: 'keywords' })\nexport class Keyword extends AbstractBase {\n @Column()\n category: CATEGORY_ENUM;\n\n @Column()\n keyword?: string;\n\n @Column()\n condition?: CONDITION_ENUM;\n\n @Column()\n field?: CONDITION_FIELD_ENUM;\n\n @Column()\n splitBy?: string;\n\n @Column()\n evalLastItem?: boolean;\n\n @Column()\n trim?: boolean;\n\n @Column()\n parentRef?: string;\n\n @Column()\n excludeWords: string[];\n}\n"]}
|
|
@@ -9,6 +9,7 @@ export declare class PricesStats extends AbstractBase {
|
|
|
9
9
|
avgMaxPrice: number;
|
|
10
10
|
currentMinPrice: number;
|
|
11
11
|
currentMaxPrice: number;
|
|
12
|
+
conditionalPriceMinPriceDiffPct?: number;
|
|
12
13
|
currentPriceAvgMinPriceDiffPct: number;
|
|
13
14
|
currentPriceBestPriceDiffPct: number;
|
|
14
15
|
currentPricePrevPriceDiffPct: number;
|
|
@@ -60,6 +60,11 @@ __decorate([
|
|
|
60
60
|
class_validator_1.IsNumber(),
|
|
61
61
|
__metadata("design:type", Number)
|
|
62
62
|
], PricesStats.prototype, "currentMaxPrice", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
typeorm_1.Column(),
|
|
65
|
+
class_validator_1.IsNumber(),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], PricesStats.prototype, "conditionalPriceMinPriceDiffPct", void 0);
|
|
63
68
|
__decorate([
|
|
64
69
|
typeorm_1.Column(),
|
|
65
70
|
class_validator_1.IsNumber(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices-stats.js","sourceRoot":"/","sources":["entities/prices-stats.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA2C;AAC3C,mDAA+C;AAG/C,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,4BAAY;
|
|
1
|
+
{"version":3,"file":"prices-stats.js","sourceRoot":"/","sources":["entities/prices-stats.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA2C;AAC3C,mDAA+C;AAG/C,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,4BAAY;CAwD5C,CAAA;AArDG;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;gDACS;AAIpB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;oDACa;AAIxB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;oDACa;AAIxB;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;oEAC8B;AAIzC;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;mEAC4B;AAIvC;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;iEAC0B;AAIrC;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;iEAC0B;AAIrC;IAFC,gBAAM,EAAE;IACR,0BAAQ,EAAE;;mEAC4B;AAvD9B,WAAW;IADvB,gBAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;GACnB,WAAW,CAwDvB;AAxDY,kCAAW","sourcesContent":["import {\n Column, Entity,\n} from 'typeorm';\nimport { IsNumber } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\n\n@Entity({ name: 'pricesStats' })\nexport class PricesStats extends AbstractBase {\n @Column()\n @IsNumber()\n minPriceSum: number;\n\n @Column()\n @IsNumber()\n maxPriceSum: number;\n\n @Column()\n @IsNumber()\n avgPriceSum: number;\n\n @Column()\n @IsNumber()\n pricesCount: number;\n\n @Column()\n @IsNumber()\n avgMinPrice: number;\n\n @Column()\n @IsNumber()\n avgAvgPrice: number;\n\n @Column()\n @IsNumber()\n avgMaxPrice: number;\n\n @Column()\n @IsNumber()\n currentMinPrice: number;\n\n @Column()\n @IsNumber()\n currentMaxPrice: number;\n\n @Column()\n @IsNumber()\n conditionalPriceMinPriceDiffPct?: number;\n\n @Column()\n @IsNumber()\n currentPriceAvgMinPriceDiffPct: number;\n\n @Column()\n @IsNumber()\n currentPriceBestPriceDiffPct: number;\n\n @Column()\n @IsNumber()\n currentPricePrevPriceDiffPct: number;\n\n @Column()\n @IsNumber()\n currentMinPriceMaxPriceDiffPct: number;\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
2
|
import { Price } from './price';
|
|
3
|
-
import { ObjectLiteral } from '../classes';
|
|
4
3
|
import { PricesStats } from './prices-stats';
|
|
5
4
|
import { Keyword } from './keyword';
|
|
6
5
|
export declare enum CurrencyEnum {
|
|
@@ -8,6 +7,7 @@ export declare enum CurrencyEnum {
|
|
|
8
7
|
CMR_PTS = "cmr_pts",
|
|
9
8
|
PARIS_PTS = "paris_pts",
|
|
10
9
|
RIPLEY_PTS = "ripley_pts",
|
|
10
|
+
GENERAL_POINTS = "general_pts",
|
|
11
11
|
BRL = "brl",
|
|
12
12
|
PEN = "PEN",
|
|
13
13
|
ARS = "ars",
|
|
@@ -16,11 +16,24 @@ export declare enum CurrencyEnum {
|
|
|
16
16
|
export declare enum UpdateReasonEnum {
|
|
17
17
|
TIME = "time",
|
|
18
18
|
NEW_PRICE = "new_price",
|
|
19
|
+
NEW_CONDITIONAL_PRICE = "new_conditional_price",
|
|
19
20
|
NEW_NAME = "new_name",
|
|
20
21
|
NEW_LISTING = "new_listing",
|
|
21
22
|
MISSING_DATA = "missing_data",
|
|
22
23
|
FIX_DATA = "fix_data"
|
|
23
24
|
}
|
|
25
|
+
export interface ProductAttributes {
|
|
26
|
+
stock?: number;
|
|
27
|
+
color?: string;
|
|
28
|
+
size?: string;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export interface ConditionalPrice {
|
|
32
|
+
minAmount?: number;
|
|
33
|
+
price?: number;
|
|
34
|
+
cardRequired?: boolean;
|
|
35
|
+
createdAt?: Date;
|
|
36
|
+
}
|
|
24
37
|
export declare class Product extends AbstractBase {
|
|
25
38
|
name: string;
|
|
26
39
|
brandName?: string;
|
|
@@ -32,6 +45,7 @@ export declare class Product extends AbstractBase {
|
|
|
32
45
|
storeName?: string;
|
|
33
46
|
sellerName?: string;
|
|
34
47
|
price?: Price;
|
|
48
|
+
conditionalPrice?: ConditionalPrice;
|
|
35
49
|
previousPrice?: Price;
|
|
36
50
|
bestPrice?: Price;
|
|
37
51
|
priceStats?: PricesStats;
|
|
@@ -40,7 +54,7 @@ export declare class Product extends AbstractBase {
|
|
|
40
54
|
image?: string;
|
|
41
55
|
category?: string;
|
|
42
56
|
categoryPath?: string;
|
|
43
|
-
attributes?:
|
|
57
|
+
attributes?: ProductAttributes;
|
|
44
58
|
homeDeliveryShipping?: boolean;
|
|
45
59
|
pickUpFromStoreShipping?: boolean;
|
|
46
60
|
enabled?: boolean;
|
package/dist/entities/product.js
CHANGED
|
@@ -21,6 +21,7 @@ var CurrencyEnum;
|
|
|
21
21
|
CurrencyEnum["CMR_PTS"] = "cmr_pts";
|
|
22
22
|
CurrencyEnum["PARIS_PTS"] = "paris_pts";
|
|
23
23
|
CurrencyEnum["RIPLEY_PTS"] = "ripley_pts";
|
|
24
|
+
CurrencyEnum["GENERAL_POINTS"] = "general_pts";
|
|
24
25
|
CurrencyEnum["BRL"] = "brl";
|
|
25
26
|
CurrencyEnum["PEN"] = "PEN";
|
|
26
27
|
CurrencyEnum["ARS"] = "ars";
|
|
@@ -30,6 +31,7 @@ var UpdateReasonEnum;
|
|
|
30
31
|
(function (UpdateReasonEnum) {
|
|
31
32
|
UpdateReasonEnum["TIME"] = "time";
|
|
32
33
|
UpdateReasonEnum["NEW_PRICE"] = "new_price";
|
|
34
|
+
UpdateReasonEnum["NEW_CONDITIONAL_PRICE"] = "new_conditional_price";
|
|
33
35
|
UpdateReasonEnum["NEW_NAME"] = "new_name";
|
|
34
36
|
UpdateReasonEnum["NEW_LISTING"] = "new_listing";
|
|
35
37
|
UpdateReasonEnum["MISSING_DATA"] = "missing_data";
|
|
@@ -83,6 +85,10 @@ __decorate([
|
|
|
83
85
|
class_validator_1.IsNotEmpty(),
|
|
84
86
|
__metadata("design:type", price_1.Price)
|
|
85
87
|
], Product.prototype, "price", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
typeorm_1.Column(),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], Product.prototype, "conditionalPrice", void 0);
|
|
86
92
|
__decorate([
|
|
87
93
|
typeorm_1.Column(),
|
|
88
94
|
__metadata("design:type", price_1.Price)
|
|
@@ -117,7 +123,7 @@ __decorate([
|
|
|
117
123
|
], Product.prototype, "categoryPath", void 0);
|
|
118
124
|
__decorate([
|
|
119
125
|
typeorm_1.Column(),
|
|
120
|
-
__metadata("design:type",
|
|
126
|
+
__metadata("design:type", Object)
|
|
121
127
|
], Product.prototype, "attributes", void 0);
|
|
122
128
|
__decorate([
|
|
123
129
|
typeorm_1.Column(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"/","sources":["entities/product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAGiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAC/C,mCAAgC;
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"/","sources":["entities/product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAGiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAC/C,mCAAgC;AAChC,iDAA6C;AAG7C,IAAY,YAUX;AAVD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,yCAAyB,CAAA;IACzB,8CAA8B,CAAA;IAC9B,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,2BAAW,CAAA;AACf,CAAC,EAVW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAUvB;AAED,IAAY,gBAQX;AARD,WAAY,gBAAgB;IACxB,iCAAa,CAAA;IACb,2CAAuB,CAAA;IACvB,mEAA+C,CAAA;IAC/C,yCAAqB,CAAA;IACrB,+CAA2B,CAAA;IAC3B,iDAA6B,CAAA;IAC7B,yCAAqB,CAAA;AACzB,CAAC,EARW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAQ3B;AAuBD,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,4BAAY;CA+GxC,CAAA;AA7GG;IADC,gBAAM,EAAE;;qCACI;AAGb;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;0CACU;AAKnB;IAHC,gBAAM,EAAE;IACR,4BAAU,EAAE;IACZ,eAAK,EAAE;;oCACI;AAGZ;IADC,gBAAM,EAAE;;2CACW;AAIpB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;;oCACD;AAKZ;IAHC,gBAAM,EAAE;IACR,4BAAU,EAAE;IACZ,eAAK,EAAE;;yCACS;AAGjB;IADC,gBAAM,EAAE;;0CACU;AAGnB;IADC,gBAAM,EAAE;;2CACW;AAIpB;IAFC,gBAAM,EAAE;IACR,4BAAU,EAAE;8BACL,aAAK;sCAAC;AAGd;IADC,gBAAM,EAAE;;iDAC2B;AAGpC;IADC,gBAAM,EAAE;8BACO,aAAK;8CAAC;AAGtB;IADC,gBAAM,EAAE;8BACG,aAAK;0CAAC;AAGlB;IADC,gBAAM,EAAE;8BACI,0BAAW;2CAAC;AAGzB;IADC,gBAAM,EAAE;;6CACc;AAGvB;IADC,gBAAM,EAAE;;qCACK;AAGd;IADC,gBAAM,EAAE;;sCACM;AAGf;IADC,gBAAM,EAAE;;yCACS;AAGlB;IADC,gBAAM,EAAE;;6CACa;AAGtB;IADC,gBAAM,EAAE;;2CACsB;AAG/B;IADC,gBAAM,EAAE;;qDACsB;AAG/B;IADC,gBAAM,EAAE;;wDACyB;AAGlC;IADC,gBAAM,EAAE;;wCACS;AAGlB;IADC,gBAAM,EAAE;;0CACU;AAInB;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;8BACI,IAAI;0CAAC;AAIjB;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;;qDACwB;AAGhC;IADC,gBAAM,EAAE;;iDACoB;AAI7B;IAFC,gBAAM,EAAE;IACR,eAAK,EAAE;8BACY,IAAI;kDAAC;AAGzB;IADC,gBAAM,EAAE;;yCACe;AAGxB;IADC,gBAAM,EAAE;;6CACuB;AAGhC;IADC,gBAAM,EAAE;;4CAIL;AAGJ;IADC,gBAAM,EAAE;;mDACmB;AAG5B;IADC,gBAAM,EAAE;;oDACoB;AA9GpB,OAAO;IAFnB,gBAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,gBAAM,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;GAChC,OAAO,CA+GnB;AA/GY,0BAAO","sourcesContent":["import {\n Column,\n Entity, Index, Unique,\n} from 'typeorm';\nimport { IsNotEmpty } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\nimport { Price } from './price';\nimport { PricesStats } from './prices-stats';\nimport { Keyword } from './keyword';\n\nexport enum CurrencyEnum {\n CLP = 'clp',\n CMR_PTS = 'cmr_pts',\n PARIS_PTS = 'paris_pts',\n RIPLEY_PTS = 'ripley_pts',\n GENERAL_POINTS = 'general_pts',\n BRL = 'brl',\n PEN = 'PEN',\n ARS = 'ars',\n EUR = 'eur'\n}\n\nexport enum UpdateReasonEnum {\n TIME = 'time',\n NEW_PRICE = 'new_price',\n NEW_CONDITIONAL_PRICE = 'new_conditional_price',\n NEW_NAME = 'new_name',\n NEW_LISTING = 'new_listing',\n MISSING_DATA = 'missing_data',\n FIX_DATA = 'fix_data',\n}\n\nexport interface ProductAttributes {\n stock?: number;\n\n // TODO: Add enum\n color?: string;\n\n // TODO: Add enum\n size?: string;\n\n [key: string]: any;\n}\n\nexport interface ConditionalPrice {\n minAmount?: number;\n price?:number;\n cardRequired?: boolean;\n createdAt?: Date;\n}\n\n@Entity({ name: 'products' })\n@Unique('store_ref_sku', ['storeRef', 'sku'])\nexport class Product extends AbstractBase {\n @Column()\n name: string;\n\n @Column()\n brandName?: string;\n\n @Column()\n modelName?: string;\n\n @Column()\n @IsNotEmpty()\n @Index()\n sku: string;\n\n @Column()\n internalId?: string;\n\n @Column()\n @IsNotEmpty()\n url: string;\n\n @Column()\n @IsNotEmpty()\n @Index()\n storeRef: string;\n\n @Column()\n storeName?: string;\n\n @Column()\n sellerName?: string;\n\n @Column()\n @IsNotEmpty()\n price?: Price;\n\n @Column()\n conditionalPrice?: ConditionalPrice;\n\n @Column()\n previousPrice?: Price;\n\n @Column()\n bestPrice?: Price;\n\n @Column()\n priceStats?: PricesStats;\n\n @Column()\n priceHistory?: Price[];\n\n @Column()\n rank?: number;\n\n @Column()\n image?: string;\n\n @Column()\n category?: string;\n\n @Column()\n categoryPath?: string;\n\n @Column()\n attributes?: ProductAttributes;\n\n @Column()\n homeDeliveryShipping?: boolean;\n\n @Column()\n pickUpFromStoreShipping?: boolean;\n\n @Column()\n enabled?: boolean;\n\n @Column()\n sourceUrl?: string;\n\n @Column()\n @Index()\n updatedAt?: Date;\n\n @Column()\n @Index()\n categoryKeywordNames?: string[];\n\n @Column()\n categoryKeywords?: Keyword[];\n\n @Column()\n @Index()\n processedPricesAt?: Date;\n\n @Column()\n currency?: CurrencyEnum;\n\n @Column()\n updateReason?: UpdateReasonEnum;\n\n @Column()\n nameHistory?: {\n name: string,\n updatedAt: string,\n }[];\n\n @Column()\n parentProductIdRef?: string;\n\n @Column()\n parentProductSkuRef?: string;\n}\n"]}
|
package/dist/entities/store.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbstractBase } from './abstract-base';
|
|
2
2
|
import { CurrencyEnum } from './product';
|
|
3
3
|
import { ObjectLiteral } from '../classes';
|
|
4
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
4
5
|
export interface StoreQueueConfig {
|
|
5
6
|
name?: string;
|
|
6
7
|
concurrency?: number;
|
|
@@ -15,10 +16,17 @@ export declare enum CountryEnum {
|
|
|
15
16
|
PERU = "peru",
|
|
16
17
|
BRAZIL = "brazil"
|
|
17
18
|
}
|
|
19
|
+
export declare enum PriorityEnum {
|
|
20
|
+
HIGH = "high",
|
|
21
|
+
MEDIUM = "medium",
|
|
22
|
+
LOW = "low"
|
|
23
|
+
}
|
|
18
24
|
export declare class Store extends AbstractBase {
|
|
19
25
|
name: string;
|
|
20
26
|
displayName?: string;
|
|
21
27
|
url: string;
|
|
28
|
+
categories?: CATEGORY_ENUM[];
|
|
29
|
+
priority?: PriorityEnum;
|
|
22
30
|
type: string;
|
|
23
31
|
parentStoreRef?: string;
|
|
24
32
|
enabled: boolean;
|
package/dist/entities/store.js
CHANGED
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Store = exports.CountryEnum = void 0;
|
|
12
|
+
exports.Store = exports.PriorityEnum = exports.CountryEnum = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const abstract_base_1 = require("./abstract-base");
|
|
@@ -20,6 +20,12 @@ var CountryEnum;
|
|
|
20
20
|
CountryEnum["PERU"] = "peru";
|
|
21
21
|
CountryEnum["BRAZIL"] = "brazil";
|
|
22
22
|
})(CountryEnum = exports.CountryEnum || (exports.CountryEnum = {}));
|
|
23
|
+
var PriorityEnum;
|
|
24
|
+
(function (PriorityEnum) {
|
|
25
|
+
PriorityEnum["HIGH"] = "high";
|
|
26
|
+
PriorityEnum["MEDIUM"] = "medium";
|
|
27
|
+
PriorityEnum["LOW"] = "low";
|
|
28
|
+
})(PriorityEnum = exports.PriorityEnum || (exports.PriorityEnum = {}));
|
|
23
29
|
let Store = class Store extends abstract_base_1.AbstractBase {
|
|
24
30
|
constructor() {
|
|
25
31
|
super(...arguments);
|
|
@@ -41,6 +47,14 @@ __decorate([
|
|
|
41
47
|
class_validator_1.IsNotEmpty(),
|
|
42
48
|
__metadata("design:type", String)
|
|
43
49
|
], Store.prototype, "url", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
typeorm_1.Column(),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], Store.prototype, "categories", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
typeorm_1.Column(),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], Store.prototype, "priority", void 0);
|
|
44
58
|
__decorate([
|
|
45
59
|
typeorm_1.Column(),
|
|
46
60
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"/","sources":["entities/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAEiB;AACjB,qDAA6C;AAC7C,mDAA+C;AAgB/C,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,4BAAa,CAAA;IACb,gCAAiB,CAAA;AACrB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,2BAAW,CAAA;AACf,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAID,IAAa,KAAK,GAAlB,MAAa,KAAM,SAAQ,4BAAY;IAAvC;;QA0BI,YAAO,GAAG,IAAI,CAAC;IAuBnB,CAAC;CAAA,CAAA;AA7CG;IAHC,gBAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3B,eAAK,EAAE;IACP,4BAAU,EAAE;;mCACA;AAGb;IADC,gBAAM,EAAE;;0CACY;AAIrB;IAFC,gBAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3B,4BAAU,EAAE;;kCACD;AAGZ;IADC,gBAAM,EAAE;;yCACoB;AAG7B;IADC,gBAAM,EAAE;;uCACe;AAGxB;IADC,gBAAM,EAAE;;mCACI;AAGb;IADC,gBAAM,EAAE;;6CACe;AAGxB;IADC,gBAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCAC5B;AAGf;IADC,gBAAM,EAAE;;oCACK;AAGd;IADC,gBAAM,EAAE;;2CACY;AAGrB;IADC,gBAAM,EAAE;;+CAC6B;AAGtC;IADC,gBAAM,EAAE;;sCACsB;AAG/B;IADC,gBAAM,EAAE;;8CAC+B;AAGxC;IADC,gBAAM,EAAE;;4CAKR;AAhDQ,KAAK;IAFjB,gBAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC1B,gBAAM,CAAC,CAAC,KAAK,CAAC,CAAC;GACH,KAAK,CAiDjB;AAjDY,sBAAK","sourcesContent":["import {\n Column, Entity, Index, Unique,\n} from 'typeorm';\nimport { IsNotEmpty } from 'class-validator';\nimport { AbstractBase } from './abstract-base';\nimport { CurrencyEnum } from './product';\nimport { ObjectLiteral } from '../classes';\nimport { CATEGORY_ENUM } from './keyword';\n\nexport interface StoreQueueConfig {\n name?: string;\n concurrency?: number;\n rateLimiter?: {\n /** Max numbers of jobs processed */\n max: number,\n /** Per duration in milliseconds */\n duration: number\n }\n}\n\nexport enum CountryEnum {\n CHILE = 'chile',\n ARGENTINA = 'argentina',\n PERU = 'peru',\n BRAZIL = 'brazil'\n}\n\nexport enum PriorityEnum {\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n@Entity({ name: 'stores' })\n@Unique(['url'])\nexport class Store extends AbstractBase {\n @Column({ nullable: false })\n @Index()\n @IsNotEmpty()\n name: string;\n\n @Column()\n displayName?: string;\n\n @Column({ nullable: false })\n @IsNotEmpty()\n url: string;\n\n @Column()\n categories?: CATEGORY_ENUM[];\n\n @Column()\n priority?: PriorityEnum;\n\n @Column()\n type: string;\n\n @Column()\n parentStoreRef?: string;\n\n @Column({ default: true, type: 'boolean' })\n enabled = true;\n\n @Column()\n queue: string;\n\n @Column()\n persistQueue: string;\n\n @Column()\n storeQueueConfig?: StoreQueueConfig[];\n\n @Column()\n country?: CountryEnum | string;\n\n @Column()\n defaultCurrency?: CurrencyEnum | string;\n\n @Column()\n scraperConfig?: {\n filterCategories?: string[];\n skipCategories?: string[];\n headers?: ObjectLiteral;\n }\n}\n"]}
|
package/package.json
CHANGED
package/src/entities/index.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
StoreQueueConfig, Store, CountryEnum, PriorityEnum,
|
|
3
|
+
} from './store';
|
|
4
|
+
import {
|
|
5
|
+
Product, UpdateReasonEnum, CurrencyEnum, ProductAttributes, ConditionalPrice,
|
|
6
|
+
} from './product';
|
|
3
7
|
import { Price } from './price';
|
|
4
8
|
import { Category } from './category';
|
|
5
9
|
import { AbstractBase } from './abstract-base';
|
|
@@ -15,6 +19,6 @@ export const Entities = [
|
|
|
15
19
|
|
|
16
20
|
export {
|
|
17
21
|
Store, Product, Price, Category, AbstractBase, Keyword, CONDITION_FIELD_ENUM,
|
|
18
|
-
CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum,
|
|
19
|
-
CurrencyEnum, UpdateReasonEnum,
|
|
22
|
+
CONDITION_ENUM, CATEGORY_ENUM, User, AlertConditions, StoreQueueConfig, CountryEnum, PriorityEnum,
|
|
23
|
+
CurrencyEnum, UpdateReasonEnum, ConditionalPrice, ProductAttributes,
|
|
20
24
|
};
|
package/src/entities/keyword.ts
CHANGED
|
@@ -16,7 +16,11 @@ export enum CONDITION_FIELD_ENUM {
|
|
|
16
16
|
|
|
17
17
|
export enum CATEGORY_ENUM {
|
|
18
18
|
NOTEBOOKS = 'NOTEBOOKS',
|
|
19
|
+
NOTEBOOKS_MACBOOK = 'NOTEBOOKS_MACBOOK',
|
|
20
|
+
|
|
19
21
|
SMARTPHONES = 'SMARTPHONES',
|
|
22
|
+
SMARTPHONES_IPHONE = 'SMARTPHONES_IPHONE',
|
|
23
|
+
|
|
20
24
|
SMARTWATCHES = 'SMARTWATCHES',
|
|
21
25
|
TABLETS = 'TABLETS',
|
|
22
26
|
TV = 'TV',
|
|
@@ -29,7 +33,18 @@ export enum CATEGORY_ENUM {
|
|
|
29
33
|
HEATING = 'HEATING',
|
|
30
34
|
KITCHEN = 'KITCHEN',
|
|
31
35
|
GAMES = 'GAMES',
|
|
36
|
+
|
|
32
37
|
DRINKABLE = 'DRINKABLE',
|
|
38
|
+
DRINKABLE_WHISKY = 'DRINKABLE_WHISKY',
|
|
39
|
+
DRINKABLE_BEER = 'DRINKABLE_BEER',
|
|
40
|
+
DRINKABLE_WINE = 'DRINKABLE_WINE',
|
|
41
|
+
DRINKABLE_VODKA = 'DRINKABLE_VODKA',
|
|
42
|
+
DRINKABLE_COGNAC = 'DRINKABLE_COGNAC',
|
|
43
|
+
DRINKABLE_GIN = 'DRINKABLE_GIN',
|
|
44
|
+
DRINKABLE_TEQUILA = 'DRINKABLE_TEQUILA',
|
|
45
|
+
DRINKABLE_RUM = 'DRINKABLE_RUM',
|
|
46
|
+
DRINKABLE_PISCO = 'DRINKABLE_PISCO',
|
|
47
|
+
|
|
33
48
|
DORMITORY = 'DORMITORY',
|
|
34
49
|
PHOTOGRAPHY = 'PHOTOGRAPHY',
|
|
35
50
|
HEADPHONES = 'HEADPHONES',
|
package/src/entities/product.ts
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
import { IsNotEmpty } from 'class-validator';
|
|
6
6
|
import { AbstractBase } from './abstract-base';
|
|
7
7
|
import { Price } from './price';
|
|
8
|
-
import { ObjectLiteral } from '../classes';
|
|
9
8
|
import { PricesStats } from './prices-stats';
|
|
10
9
|
import { Keyword } from './keyword';
|
|
11
10
|
|
|
@@ -14,6 +13,7 @@ export enum CurrencyEnum {
|
|
|
14
13
|
CMR_PTS = 'cmr_pts',
|
|
15
14
|
PARIS_PTS = 'paris_pts',
|
|
16
15
|
RIPLEY_PTS = 'ripley_pts',
|
|
16
|
+
GENERAL_POINTS = 'general_pts',
|
|
17
17
|
BRL = 'brl',
|
|
18
18
|
PEN = 'PEN',
|
|
19
19
|
ARS = 'ars',
|
|
@@ -23,12 +23,32 @@ export enum CurrencyEnum {
|
|
|
23
23
|
export enum UpdateReasonEnum {
|
|
24
24
|
TIME = 'time',
|
|
25
25
|
NEW_PRICE = 'new_price',
|
|
26
|
+
NEW_CONDITIONAL_PRICE = 'new_conditional_price',
|
|
26
27
|
NEW_NAME = 'new_name',
|
|
27
28
|
NEW_LISTING = 'new_listing',
|
|
28
29
|
MISSING_DATA = 'missing_data',
|
|
29
30
|
FIX_DATA = 'fix_data',
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
export interface ProductAttributes {
|
|
34
|
+
stock?: number;
|
|
35
|
+
|
|
36
|
+
// TODO: Add enum
|
|
37
|
+
color?: string;
|
|
38
|
+
|
|
39
|
+
// TODO: Add enum
|
|
40
|
+
size?: string;
|
|
41
|
+
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ConditionalPrice {
|
|
46
|
+
minAmount?: number;
|
|
47
|
+
price?:number;
|
|
48
|
+
cardRequired?: boolean;
|
|
49
|
+
createdAt?: Date;
|
|
50
|
+
}
|
|
51
|
+
|
|
32
52
|
@Entity({ name: 'products' })
|
|
33
53
|
@Unique('store_ref_sku', ['storeRef', 'sku'])
|
|
34
54
|
export class Product extends AbstractBase {
|
|
@@ -68,6 +88,9 @@ export class Product extends AbstractBase {
|
|
|
68
88
|
@IsNotEmpty()
|
|
69
89
|
price?: Price;
|
|
70
90
|
|
|
91
|
+
@Column()
|
|
92
|
+
conditionalPrice?: ConditionalPrice;
|
|
93
|
+
|
|
71
94
|
@Column()
|
|
72
95
|
previousPrice?: Price;
|
|
73
96
|
|
|
@@ -93,7 +116,7 @@ export class Product extends AbstractBase {
|
|
|
93
116
|
categoryPath?: string;
|
|
94
117
|
|
|
95
118
|
@Column()
|
|
96
|
-
attributes?:
|
|
119
|
+
attributes?: ProductAttributes;
|
|
97
120
|
|
|
98
121
|
@Column()
|
|
99
122
|
homeDeliveryShipping?: boolean;
|
package/src/entities/store.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { IsNotEmpty } from 'class-validator';
|
|
|
5
5
|
import { AbstractBase } from './abstract-base';
|
|
6
6
|
import { CurrencyEnum } from './product';
|
|
7
7
|
import { ObjectLiteral } from '../classes';
|
|
8
|
+
import { CATEGORY_ENUM } from './keyword';
|
|
8
9
|
|
|
9
10
|
export interface StoreQueueConfig {
|
|
10
11
|
name?: string;
|
|
@@ -24,6 +25,12 @@ export enum CountryEnum {
|
|
|
24
25
|
BRAZIL = 'brazil'
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
export enum PriorityEnum {
|
|
29
|
+
HIGH = 'high',
|
|
30
|
+
MEDIUM = 'medium',
|
|
31
|
+
LOW = 'low'
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
@Entity({ name: 'stores' })
|
|
28
35
|
@Unique(['url'])
|
|
29
36
|
export class Store extends AbstractBase {
|
|
@@ -39,6 +46,12 @@ export class Store extends AbstractBase {
|
|
|
39
46
|
@IsNotEmpty()
|
|
40
47
|
url: string;
|
|
41
48
|
|
|
49
|
+
@Column()
|
|
50
|
+
categories?: CATEGORY_ENUM[];
|
|
51
|
+
|
|
52
|
+
@Column()
|
|
53
|
+
priority?: PriorityEnum;
|
|
54
|
+
|
|
42
55
|
@Column()
|
|
43
56
|
type: string;
|
|
44
57
|
|