@reachu/database 1.0.183 → 1.0.185
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/entity/WooConnection.d.ts +1 -0
- package/dist/entity/WooConnection.js +4 -0
- package/dist/entity/WooConnection.js.map +1 -1
- package/dist/migrations/1719530172075-wooPricesIncludeTax.d.ts +6 -0
- package/dist/migrations/1719530172075-wooPricesIncludeTax.js +29 -0
- package/dist/migrations/1719530172075-wooPricesIncludeTax.js.map +1 -0
- package/dist/subscribers/ProductSubscriber.js +6 -0
- package/dist/subscribers/ProductSubscriber.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +17 -5
- package/package.json +3 -3
- package/src/entity/WooConnection.ts +3 -0
- package/src/migrations/1719530172075-wooPricesIncludeTax.ts +14 -0
- package/src/subscribers/ProductSubscriber.ts +9 -0
|
@@ -40,6 +40,10 @@ __decorate([
|
|
|
40
40
|
typeorm_1.Column('boolean', { nullable: true, default: false }),
|
|
41
41
|
__metadata("design:type", Boolean)
|
|
42
42
|
], WooConnection.prototype, "issuplier", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
typeorm_1.Column('boolean', { nullable: true }),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], WooConnection.prototype, "pricesIncludeTax", void 0);
|
|
43
47
|
__decorate([
|
|
44
48
|
typeorm_1.ManyToOne(() => User_1.default, (user) => user.id, { onDelete: 'CASCADE' }),
|
|
45
49
|
typeorm_1.JoinColumn(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WooConnection.js","sourceRoot":"","sources":["../../src/entity/WooConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kDAA0B;AAG1B,IAAqB,aAAa,GAAlC,MAAqB,aAAa;
|
|
1
|
+
{"version":3,"file":"WooConnection.js","sourceRoot":"","sources":["../../src/entity/WooConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kDAA0B;AAG1B,IAAqB,aAAa,GAAlC,MAAqB,aAAa;CAyBjC,CAAA;AAvBC;IADC,gCAAsB,EAAE;;yCACd;AAGX;IADC,gBAAM,CAAC,SAAS,CAAC;;2CACL;AAGb;IADC,gBAAM,CAAC,SAAS,CAAC;;kDACE;AAGpB;IADC,gBAAM,CAAC,SAAS,CAAC;;qDACK;AAGvB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACpB;AAGlB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDAClC;AAGpB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;AAI3B;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjE,oBAAU,EAAE;8BACP,cAAI;2CAAC;AAxBQ,aAAa;IADjC,gBAAM,EAAE;GACY,aAAa,CAyBjC;kBAzBoB,aAAa"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.wooPricesIncludeTax1719530172075 = void 0;
|
|
13
|
+
class wooPricesIncludeTax1719530172075 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'wooPricesIncludeTax1719530172075';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`prices_include_tax\` tinyint NULL`);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
down(queryRunner) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
yield queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`prices_include_tax\``);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.wooPricesIncludeTax1719530172075 = wooPricesIncludeTax1719530172075;
|
|
29
|
+
//# sourceMappingURL=1719530172075-wooPricesIncludeTax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1719530172075-wooPricesIncludeTax.js","sourceRoot":"","sources":["../../src/migrations/1719530172075-wooPricesIncludeTax.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,gCAAgC;IAA7C;QACI,SAAI,GAAG,kCAAkC,CAAA;IAU7C,CAAC;IARgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;QACtG,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACjG,CAAC;KAAA;CAEJ;AAXD,4EAWC"}
|
|
@@ -24,11 +24,17 @@ let ProductSubscriber = ProductSubscriber_1 = class ProductSubscriber {
|
|
|
24
24
|
constructor() {
|
|
25
25
|
this.listenTo = () => Product_entity_1.Product;
|
|
26
26
|
this.afterUpdate = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
console.log('event afterUpdate1', event);
|
|
27
28
|
if (event === null || event === void 0 ? void 0 : event.entity) {
|
|
29
|
+
console.log('event afterUpdate2', event);
|
|
28
30
|
logger_1.logger.debug(`[ProductSubscriber.afterUpdate] after update entity (${event.entity.id})`);
|
|
31
|
+
console.log('event afterUpdate3', event);
|
|
29
32
|
const { id } = event.entity;
|
|
33
|
+
console.log('event afterUpdate4', event);
|
|
30
34
|
yield Product_entity_1.Product.invalidateCache(id, ProductSubscriber_1.invalidateCache);
|
|
35
|
+
console.log('event afterUpdate5', event);
|
|
31
36
|
}
|
|
37
|
+
console.log('event afterUpdate6', event);
|
|
32
38
|
});
|
|
33
39
|
this.afterRemove = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
34
40
|
if (event === null || event === void 0 ? void 0 : event.entity) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSubscriber.js","sourceRoot":"","sources":["../../src/subscribers/ProductSubscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,qCAA+F;AAC/F,6DAAmD;AACnD,2CAAwC;AAGxC,IAAa,iBAAiB,yBAA9B,MAAa,iBAAiB;IAA9B;QAEE,aAAQ,GAAG,GAAG,EAAE,CAAC,wBAAO,CAAC;QAEzB,gBAAW,GAAG,CAAO,KAA2B,EAAE,EAAE;YAClD,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,EAAE;gBACjB,eAAM,CAAC,KAAK,CAAC,wDAAwD,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;gBACzF,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC5B,MAAM,wBAAO,CAAC,eAAe,CAAC,EAAE,EAAE,mBAAiB,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSubscriber.js","sourceRoot":"","sources":["../../src/subscribers/Pro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,eAAe,CAAC,EAAE,EAAE,mBAAiB,CAAC,eAAe,CAAC,CAAC;aACtE;QACH,CAAC,CAAA,CAAC;IACJ,CAAC;CAAA,CAAA;AA5BY,iBAAiB;IAD7B,yBAAe,EAAE;GACL,iBAAiB,CA4B7B;AA5BY,8CAAiB"}
|
|
@@ -1962,8 +1962,8 @@
|
|
|
1962
1962
|
"affectsGlobalScope": false
|
|
1963
1963
|
},
|
|
1964
1964
|
"../src/entity/wooconnection.ts": {
|
|
1965
|
-
"version": "
|
|
1966
|
-
"signature": "
|
|
1965
|
+
"version": "2a6c76c1d38b190973fb6938ec85a4c751c4e08544b8e387db3b478c7beb1599",
|
|
1966
|
+
"signature": "53a187e81c2dad2afbd671ccdec854aad3620b4eb7a5affdd47e2ba5ef5a0956",
|
|
1967
1967
|
"affectsGlobalScope": false
|
|
1968
1968
|
},
|
|
1969
1969
|
"../src/entity/businessproducts.ts": {
|
|
@@ -2882,7 +2882,7 @@
|
|
|
2882
2882
|
"affectsGlobalScope": false
|
|
2883
2883
|
},
|
|
2884
2884
|
"../src/subscribers/productsubscriber.ts": {
|
|
2885
|
-
"version": "
|
|
2885
|
+
"version": "8ae172fa9c91981c414ac77cb066f82d55d757673e9a30105c134a7193f1f0ba",
|
|
2886
2886
|
"signature": "38d7cc7c4cc4f6bfc7a3962cf7d92612f5f8599e213c34c8c78f9a804e25293a",
|
|
2887
2887
|
"affectsGlobalScope": false
|
|
2888
2888
|
},
|
|
@@ -3801,14 +3801,19 @@
|
|
|
3801
3801
|
"signature": "2e9bb08a17d91094c67ae0a34ec47f350e37ed74c0675786b39628243356f57c",
|
|
3802
3802
|
"affectsGlobalScope": false
|
|
3803
3803
|
},
|
|
3804
|
+
"../src/migrations/1719530172075-woopricesincludetax.ts": {
|
|
3805
|
+
"version": "efa7d64bf0de938b4d3d829dcb69bb13b8641d4edb87f789251eec03ec8f574e",
|
|
3806
|
+
"signature": "f5fe6ee17fc6ea9d9995bc636270b81422723124144b38567707638caf5768e0",
|
|
3807
|
+
"affectsGlobalScope": false
|
|
3808
|
+
},
|
|
3804
3809
|
"../src/migrations/execute/index.ts": {
|
|
3805
3810
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3806
3811
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
3807
3812
|
"affectsGlobalScope": false
|
|
3808
3813
|
},
|
|
3809
3814
|
"../node_modules/@babel/types/lib/index.d.ts": {
|
|
3810
|
-
"version": "
|
|
3811
|
-
"signature": "
|
|
3815
|
+
"version": "9bc7900e5ecd93822053b8b42ac890c871eee76c7b6cbd2c2561dc1db95f7d0a",
|
|
3816
|
+
"signature": "9bc7900e5ecd93822053b8b42ac890c871eee76c7b6cbd2c2561dc1db95f7d0a",
|
|
3812
3817
|
"affectsGlobalScope": false
|
|
3813
3818
|
},
|
|
3814
3819
|
"../node_modules/@types/babel__generator/index.d.ts": {
|
|
@@ -7004,6 +7009,9 @@
|
|
|
7004
7009
|
"../src/migrations/1718892353107-add_channel_user_discount.ts": [
|
|
7005
7010
|
"../node_modules/typeorm/index.d.ts"
|
|
7006
7011
|
],
|
|
7012
|
+
"../src/migrations/1719530172075-woopricesincludetax.ts": [
|
|
7013
|
+
"../node_modules/typeorm/index.d.ts"
|
|
7014
|
+
],
|
|
7007
7015
|
"../src/migrations/execute/index.ts": [
|
|
7008
7016
|
"../src/config/connect.ts"
|
|
7009
7017
|
],
|
|
@@ -10059,6 +10067,9 @@
|
|
|
10059
10067
|
"../src/migrations/1718892353107-add_channel_user_discount.ts": [
|
|
10060
10068
|
"../node_modules/typeorm/index.d.ts"
|
|
10061
10069
|
],
|
|
10070
|
+
"../src/migrations/1719530172075-woopricesincludetax.ts": [
|
|
10071
|
+
"../node_modules/typeorm/index.d.ts"
|
|
10072
|
+
],
|
|
10062
10073
|
"../src/migrations/index.ts": [
|
|
10063
10074
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
10064
10075
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -10982,6 +10993,7 @@
|
|
|
10982
10993
|
"../src/migrations/1714754554111-product_scraping_v4.ts",
|
|
10983
10994
|
"../src/migrations/1717708447469-production_01.ts",
|
|
10984
10995
|
"../src/migrations/1718892353107-add_channel_user_discount.ts",
|
|
10996
|
+
"../src/migrations/1719530172075-woopricesincludetax.ts",
|
|
10985
10997
|
"../src/migrations/execute/index.ts",
|
|
10986
10998
|
"../src/migrations/index.ts",
|
|
10987
10999
|
"../src/repositories/discount/index.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reachu/database",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.185",
|
|
4
4
|
"description": "reachu-database",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"author": "reachu",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@reachu/logger": "1.0.
|
|
25
|
-
"@reachu/utils": "1.0.
|
|
24
|
+
"@reachu/logger": "1.0.185",
|
|
25
|
+
"@reachu/utils": "1.0.185",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -21,6 +21,9 @@ export default class WooConnection {
|
|
|
21
21
|
@Column('boolean', { nullable: true, default: false })
|
|
22
22
|
issuplier?: boolean;
|
|
23
23
|
|
|
24
|
+
@Column('boolean', { nullable: true })
|
|
25
|
+
pricesIncludeTax?: boolean;
|
|
26
|
+
|
|
24
27
|
@ManyToOne(() => User, (user) => user.id, { onDelete: 'CASCADE' })
|
|
25
28
|
@JoinColumn()
|
|
26
29
|
user: User;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class wooPricesIncludeTax1719530172075 implements MigrationInterface {
|
|
4
|
+
name = 'wooPricesIncludeTax1719530172075'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`woo_connection\` ADD \`prices_include_tax\` tinyint NULL`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE \`woo_connection\` DROP COLUMN \`prices_include_tax\``);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -8,11 +8,20 @@ export class ProductSubscriber implements EntitySubscriberInterface<Product> {
|
|
|
8
8
|
listenTo = () => Product;
|
|
9
9
|
|
|
10
10
|
afterUpdate = async (event: UpdateEvent<Product>) => {
|
|
11
|
+
console.log('event afterUpdate1', event);
|
|
11
12
|
if (event?.entity) {
|
|
13
|
+
console.log('event afterUpdate2', event);
|
|
14
|
+
|
|
12
15
|
logger.debug(`[ProductSubscriber.afterUpdate] after update entity (${event.entity.id})`);
|
|
16
|
+
console.log('event afterUpdate3', event);
|
|
17
|
+
|
|
13
18
|
const { id } = event.entity;
|
|
19
|
+
console.log('event afterUpdate4', event);
|
|
20
|
+
|
|
14
21
|
await Product.invalidateCache(id, ProductSubscriber.invalidateCache);
|
|
22
|
+
console.log('event afterUpdate5', event);
|
|
15
23
|
}
|
|
24
|
+
console.log('event afterUpdate6', event);
|
|
16
25
|
};
|
|
17
26
|
|
|
18
27
|
afterRemove = async (event: RemoveEvent<Product>) => {
|