@reachu/database 1.0.3 → 1.0.4
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/modules/shipping/ProductShipping.d.ts +2 -0
- package/dist/entity/modules/shipping/ProductShipping.js +5 -0
- package/dist/entity/modules/shipping/ProductShipping.js.map +1 -1
- package/dist/entity/modules/shopcart/CartItem.d.ts +2 -0
- package/dist/entity/modules/shopcart/CartItem.js +6 -0
- package/dist/entity/modules/shopcart/CartItem.js.map +1 -1
- package/dist/migrations/1678113864577-task-1098V1.d.ts +6 -0
- package/dist/migrations/1678113864577-task-1098V1.js +31 -0
- package/dist/migrations/1678113864577-task-1098V1.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +78 -62
- package/package.json +3 -3
- package/src/entity/modules/shipping/ProductShipping.ts +5 -0
- package/src/entity/modules/shopcart/CartItem.ts +9 -0
- package/src/migrations/1678113864577-task-1098V1.ts +16 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Product } from '../../Product.entity';
|
|
2
2
|
import AuditedModel from '../../AuditedModel';
|
|
3
3
|
import Shipping from './Shipping';
|
|
4
|
+
import CartItem from '../shopcart/CartItem';
|
|
4
5
|
export default class ProductShipping extends AuditedModel {
|
|
5
6
|
id: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
deletedAt: Date;
|
|
8
9
|
shipping: Shipping;
|
|
9
10
|
product: Product;
|
|
11
|
+
cartItem: CartItem[];
|
|
10
12
|
}
|
|
@@ -16,6 +16,7 @@ const Product_entity_1 = require("../../Product.entity");
|
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
17
|
const AuditedModel_1 = __importDefault(require("../../AuditedModel"));
|
|
18
18
|
const Shipping_1 = __importDefault(require("./Shipping"));
|
|
19
|
+
const CartItem_1 = __importDefault(require("../shopcart/CartItem"));
|
|
19
20
|
let ProductShipping = class ProductShipping extends AuditedModel_1.default {
|
|
20
21
|
};
|
|
21
22
|
__decorate([
|
|
@@ -46,6 +47,10 @@ __decorate([
|
|
|
46
47
|
typeorm_1.JoinColumn(),
|
|
47
48
|
__metadata("design:type", Product_entity_1.Product)
|
|
48
49
|
], ProductShipping.prototype, "product", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
typeorm_1.OneToMany(() => CartItem_1.default, (cartItem) => cartItem.productShipping, { cascade: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], ProductShipping.prototype, "cartItem", void 0);
|
|
49
54
|
ProductShipping = __decorate([
|
|
50
55
|
typeorm_1.Entity()
|
|
51
56
|
], ProductShipping);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductShipping.js","sourceRoot":"","sources":["../../../../src/entity/modules/shipping/ProductShipping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"ProductShipping.js","sourceRoot":"","sources":["../../../../src/entity/modules/shipping/ProductShipping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,qCAQiB;AACjB,sEAA8C;AAC9C,0DAAkC;AAClC,oEAA4C;AAG5C,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;CA0BxD,CAAA;AAxBC;IADC,gCAAsB,CAAC,MAAM,CAAC;;2CACpB;AAGX;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACjB;AAGrB;IADC,0BAAgB,EAAE;8BACR,IAAI;kDAAC;AAOhB;IALC,mBAAS,CAAC,GAAG,EAAE,CAAC,kBAAQ,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE;QAC3E,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,oBAAU,EAAE;8BACH,kBAAQ;iDAAC;AAOnB;IALC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE;QACvE,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,oBAAU,EAAE;8BACJ,wBAAO;gDAAC;AAGjB;IADC,mBAAS,CAAC,GAAG,EAAE,CAAC,kBAAQ,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAC1E;AAzBF,eAAe;IADnC,gBAAM,EAAE;GACY,eAAe,CA0BnC;kBA1BoB,eAAe"}
|
|
@@ -2,6 +2,7 @@ import AuditedModel from '../../AuditedModel';
|
|
|
2
2
|
import { PriceData } from './PriceData';
|
|
3
3
|
import Cart from './Cart';
|
|
4
4
|
import { Product } from '../../Product.entity';
|
|
5
|
+
import ProductShipping from '../shipping/ProductShipping';
|
|
5
6
|
export default class CartItem extends AuditedModel {
|
|
6
7
|
id: string;
|
|
7
8
|
deletedAt: Date;
|
|
@@ -10,4 +11,5 @@ export default class CartItem extends AuditedModel {
|
|
|
10
11
|
quantity?: number;
|
|
11
12
|
priceData: PriceData;
|
|
12
13
|
cart: Cart;
|
|
14
|
+
productShipping: ProductShipping;
|
|
13
15
|
}
|
|
@@ -17,6 +17,7 @@ const AuditedModel_1 = __importDefault(require("../../AuditedModel"));
|
|
|
17
17
|
const PriceData_1 = require("./PriceData");
|
|
18
18
|
const Cart_1 = __importDefault(require("./Cart"));
|
|
19
19
|
const Product_entity_1 = require("../../Product.entity");
|
|
20
|
+
const ProductShipping_1 = __importDefault(require("../shipping/ProductShipping"));
|
|
20
21
|
let CartItem = class CartItem extends AuditedModel_1.default {
|
|
21
22
|
};
|
|
22
23
|
__decorate([
|
|
@@ -50,6 +51,11 @@ __decorate([
|
|
|
50
51
|
typeorm_1.JoinColumn(),
|
|
51
52
|
__metadata("design:type", Cart_1.default)
|
|
52
53
|
], CartItem.prototype, "cart", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
typeorm_1.ManyToOne(() => ProductShipping_1.default, (productShipping) => productShipping.cartItem, { eager: true, onDelete: 'CASCADE' }),
|
|
56
|
+
typeorm_1.JoinColumn(),
|
|
57
|
+
__metadata("design:type", ProductShipping_1.default)
|
|
58
|
+
], CartItem.prototype, "productShipping", void 0);
|
|
53
59
|
CartItem = __decorate([
|
|
54
60
|
typeorm_1.Entity()
|
|
55
61
|
], CartItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/CartItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,2CAAwC;AACxC,kDAA0B;AAC1B,yDAA+C;
|
|
1
|
+
{"version":3,"file":"CartItem.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/CartItem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,2CAAwC;AACxC,kDAA0B;AAC1B,yDAA+C;AAC/C,kFAA0D;AAG1D,IAAqB,QAAQ,GAA7B,MAAqB,QAAS,SAAQ,sBAAY;CAgCjD,CAAA;AA9BC;IADC,gCAAsB,CAAC,MAAM,CAAC;;oCACpB;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;2CAAC;AAIhB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACvF,oBAAU,EAAE;8BACJ,wBAAO;yCAAC;AAGjB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACnB;AAGnB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CAChB;AAIlB;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,qBAAS,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC;IAC5D,oBAAU,EAAE;8BACF,qBAAS;2CAAC;AAIrB;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC5F,oBAAU,EAAE;8BACP,cAAI;sCAAC;AAQX;IANC,mBAAS,CACR,GAAG,EAAE,CAAC,yBAAe,EACrB,CAAC,eAAgC,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAC9D,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CACrC;IACA,oBAAU,EAAE;8BACI,yBAAe;iDAAC;AA/Bd,QAAQ;IAD5B,gBAAM,EAAE;GACY,QAAQ,CAgC5B;kBAhCoB,QAAQ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.task1098V11678113864577 = void 0;
|
|
13
|
+
class task1098V11678113864577 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'task1098V11678113864577';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`product_shipping_id\` varchar(36) NULL`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_2b97b975f9f05cdc297f89d1287\` FOREIGN KEY (\`product_shipping_id\`) REFERENCES \`product_shipping\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
down(queryRunner) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_2b97b975f9f05cdc297f89d1287\``);
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`product_shipping_id\``);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.task1098V11678113864577 = task1098V11678113864577;
|
|
31
|
+
//# sourceMappingURL=1678113864577-task-1098V1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1678113864577-task-1098V1.js","sourceRoot":"","sources":["../../src/migrations/1678113864577-task-1098V1.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,uBAAuB;IAApC;QACI,SAAI,GAAG,yBAAyB,CAAA;IAYpC,CAAC;IAVgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,iMAAiM,CAAC,CAAC;QAC/N,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,+EAA+E,CAAC,CAAC;YACzG,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;QAC7F,CAAC;KAAA;CAEJ;AAbD,0DAaC"}
|
|
@@ -2431,9 +2431,69 @@
|
|
|
2431
2431
|
"signature": "80b9c2757b0d4c3f1a54a57baf0aaf10ba21fe752642f58dca0511bf34e581ba",
|
|
2432
2432
|
"affectsGlobalScope": false
|
|
2433
2433
|
},
|
|
2434
|
+
"../src/entity/modules/shopcart/pricedata.ts": {
|
|
2435
|
+
"version": "8d198c8a4b9ec24a576f38c6ce228e98e23d517ec03c1c7d7d8a4d956665497c",
|
|
2436
|
+
"signature": "13f818e7a8b123df9357122492988375966183e1659533220999b24700bda43f",
|
|
2437
|
+
"affectsGlobalScope": false
|
|
2438
|
+
},
|
|
2439
|
+
"../src/entity/modules/shopcart/checkoutbillingaddress.ts": {
|
|
2440
|
+
"version": "ab0e4e47a0c12af3e6a75a5df1e591a2cb6d83c5c8610e94c894f8347683cd85",
|
|
2441
|
+
"signature": "9034d0b32a3de8ce2025828476521d6713e80c42a63a5d487c0a9add41faa0f6",
|
|
2442
|
+
"affectsGlobalScope": false
|
|
2443
|
+
},
|
|
2444
|
+
"../src/entity/modules/shopcart/checkoutshippingaddress.ts": {
|
|
2445
|
+
"version": "fba937294a8b426bb1d8d9687870a2eca86befdfcab8306fad5fe7cdb7793702",
|
|
2446
|
+
"signature": "90dfe9f4f7f401bf8993564a88653c00f713d646f7002d392ed93da3b72d7f6f",
|
|
2447
|
+
"affectsGlobalScope": false
|
|
2448
|
+
},
|
|
2449
|
+
"../src/entity/paymentshopify.ts": {
|
|
2450
|
+
"version": "f6067f2afa8adeb2895259edd514d16bf8cad492c4520ca628fbef731d2252b0",
|
|
2451
|
+
"signature": "be8e6ec14e0c8f8c1797cb6323226f70746582df3bfd14dc456c734ea19b2aac",
|
|
2452
|
+
"affectsGlobalScope": false
|
|
2453
|
+
},
|
|
2454
|
+
"../src/entity/ordertracking.ts": {
|
|
2455
|
+
"version": "55d465f4fb25912e0c8e9ba44ec0476c972420250f05ae6065c339daf9955e42",
|
|
2456
|
+
"signature": "106654cf79326d89c41b6cf6d98144e39fa5985245bcef3f742916d0f11ac4a0",
|
|
2457
|
+
"affectsGlobalScope": false
|
|
2458
|
+
},
|
|
2459
|
+
"../src/entity/orderitem.ts": {
|
|
2460
|
+
"version": "73b5eb6c0116c5b35b176a5fc6a693e17daf392d85ffa83df7bd217482d9d708",
|
|
2461
|
+
"signature": "8a99f70f1b07ea2c55e8a586b4cafa3ddf7d2c93c73456de5ef1b57fe3ff47bd",
|
|
2462
|
+
"affectsGlobalScope": false
|
|
2463
|
+
},
|
|
2464
|
+
"../src/entity/ordercustomer.ts": {
|
|
2465
|
+
"version": "9f6365bcc286a1b5a8fbb12338b790fbcd6831f3219a27df6a49d70bd0d1b304",
|
|
2466
|
+
"signature": "d2a4453607aa4ee7e7bd9fa3813de5d6e28d1da6fa4623dc6c7cdc5269b3d00b",
|
|
2467
|
+
"affectsGlobalScope": false
|
|
2468
|
+
},
|
|
2469
|
+
"../src/entity/ordershipping.ts": {
|
|
2470
|
+
"version": "403c0ccff160f684973b9bd50e0a6ec3b07089352412c452147ee6850647cc29",
|
|
2471
|
+
"signature": "4d8cf015d972a54879875907c4a6c28adcf3b92574c1bcb348ec00e3564076c5",
|
|
2472
|
+
"affectsGlobalScope": false
|
|
2473
|
+
},
|
|
2474
|
+
"../src/entity/order.ts": {
|
|
2475
|
+
"version": "ff54a094a185cc60062a278d93b053329849797728ada151079833fd938dc20d",
|
|
2476
|
+
"signature": "9eed0ebc86da6c572000543bbc4769d9702b152d0ca454f8e703fed918f4af26",
|
|
2477
|
+
"affectsGlobalScope": false
|
|
2478
|
+
},
|
|
2479
|
+
"../src/entity/modules/shopcart/checkout.ts": {
|
|
2480
|
+
"version": "6a746ec2cdf50db38f74fb8294ab0ecfb87eda85ad1f12aef2b547c078929000",
|
|
2481
|
+
"signature": "41a7de2d69c9ed52ff5df008e4aee8bee1da4165862e1e13cfac4abf984e361a",
|
|
2482
|
+
"affectsGlobalScope": false
|
|
2483
|
+
},
|
|
2484
|
+
"../src/entity/modules/shopcart/cart.ts": {
|
|
2485
|
+
"version": "138d377cbeba92b2fea480cb1b35d5de930d5d3f63da4c5266eb7955d9f53919",
|
|
2486
|
+
"signature": "203972c6ae6a8a4bc90a4d6a7a6ac91559c5d53aed7dc3b2b491222e47d66a6f",
|
|
2487
|
+
"affectsGlobalScope": false
|
|
2488
|
+
},
|
|
2489
|
+
"../src/entity/modules/shopcart/cartitem.ts": {
|
|
2490
|
+
"version": "2aa93857c7df25d33db4143a6505d3c91ef8e4383b9b7e73221fe0911e3d545b",
|
|
2491
|
+
"signature": "2adb5963ab6b2bf2042fa12d08e3608fa8e8ee40ae894c9bca93d5c43ba19c4b",
|
|
2492
|
+
"affectsGlobalScope": false
|
|
2493
|
+
},
|
|
2434
2494
|
"../src/entity/modules/shipping/productshipping.ts": {
|
|
2435
|
-
"version": "
|
|
2436
|
-
"signature": "
|
|
2495
|
+
"version": "2c2c4318913b495e292358d29681fa957b9b4fefafec72ce14569a151b250c3f",
|
|
2496
|
+
"signature": "7bfe342f3b3bc6d3c065c224c471026018b455acbfbb8416a87c718b87ea930a",
|
|
2437
2497
|
"affectsGlobalScope": false
|
|
2438
2498
|
},
|
|
2439
2499
|
"../src/entity/customproductimage.ts": {
|
|
@@ -2526,36 +2586,6 @@
|
|
|
2526
2586
|
"signature": "4404f7653a743163063814d7cc6008012101cefac0416bd141aa081821063f5f",
|
|
2527
2587
|
"affectsGlobalScope": false
|
|
2528
2588
|
},
|
|
2529
|
-
"../src/entity/paymentshopify.ts": {
|
|
2530
|
-
"version": "f6067f2afa8adeb2895259edd514d16bf8cad492c4520ca628fbef731d2252b0",
|
|
2531
|
-
"signature": "be8e6ec14e0c8f8c1797cb6323226f70746582df3bfd14dc456c734ea19b2aac",
|
|
2532
|
-
"affectsGlobalScope": false
|
|
2533
|
-
},
|
|
2534
|
-
"../src/entity/ordertracking.ts": {
|
|
2535
|
-
"version": "55d465f4fb25912e0c8e9ba44ec0476c972420250f05ae6065c339daf9955e42",
|
|
2536
|
-
"signature": "106654cf79326d89c41b6cf6d98144e39fa5985245bcef3f742916d0f11ac4a0",
|
|
2537
|
-
"affectsGlobalScope": false
|
|
2538
|
-
},
|
|
2539
|
-
"../src/entity/orderitem.ts": {
|
|
2540
|
-
"version": "73b5eb6c0116c5b35b176a5fc6a693e17daf392d85ffa83df7bd217482d9d708",
|
|
2541
|
-
"signature": "8a99f70f1b07ea2c55e8a586b4cafa3ddf7d2c93c73456de5ef1b57fe3ff47bd",
|
|
2542
|
-
"affectsGlobalScope": false
|
|
2543
|
-
},
|
|
2544
|
-
"../src/entity/ordercustomer.ts": {
|
|
2545
|
-
"version": "9f6365bcc286a1b5a8fbb12338b790fbcd6831f3219a27df6a49d70bd0d1b304",
|
|
2546
|
-
"signature": "d2a4453607aa4ee7e7bd9fa3813de5d6e28d1da6fa4623dc6c7cdc5269b3d00b",
|
|
2547
|
-
"affectsGlobalScope": false
|
|
2548
|
-
},
|
|
2549
|
-
"../src/entity/ordershipping.ts": {
|
|
2550
|
-
"version": "403c0ccff160f684973b9bd50e0a6ec3b07089352412c452147ee6850647cc29",
|
|
2551
|
-
"signature": "4d8cf015d972a54879875907c4a6c28adcf3b92574c1bcb348ec00e3564076c5",
|
|
2552
|
-
"affectsGlobalScope": false
|
|
2553
|
-
},
|
|
2554
|
-
"../src/entity/order.ts": {
|
|
2555
|
-
"version": "ff54a094a185cc60062a278d93b053329849797728ada151079833fd938dc20d",
|
|
2556
|
-
"signature": "9eed0ebc86da6c572000543bbc4769d9702b152d0ca454f8e703fed918f4af26",
|
|
2557
|
-
"affectsGlobalScope": false
|
|
2558
|
-
},
|
|
2559
2589
|
"../src/entity/request.ts": {
|
|
2560
2590
|
"version": "7a043d86aa89966f51860bc7d153171da83cdfebf31d9c7dd210f5d084659090",
|
|
2561
2591
|
"signature": "92b7103666a311746fe5b80699c10968e75111a1a8e79525269edbcb4f0051cb",
|
|
@@ -2591,36 +2621,6 @@
|
|
|
2591
2621
|
"signature": "edfc427eed5128dec1fecd84338bbbf23d9737b2b637ef70601411e733545186",
|
|
2592
2622
|
"affectsGlobalScope": false
|
|
2593
2623
|
},
|
|
2594
|
-
"../src/entity/modules/shopcart/pricedata.ts": {
|
|
2595
|
-
"version": "8d198c8a4b9ec24a576f38c6ce228e98e23d517ec03c1c7d7d8a4d956665497c",
|
|
2596
|
-
"signature": "13f818e7a8b123df9357122492988375966183e1659533220999b24700bda43f",
|
|
2597
|
-
"affectsGlobalScope": false
|
|
2598
|
-
},
|
|
2599
|
-
"../src/entity/modules/shopcart/cartitem.ts": {
|
|
2600
|
-
"version": "53915949af0f9f5006e3799bc8bca4dccb33083a786412ae5363b09f122d279a",
|
|
2601
|
-
"signature": "f974d743e42395cd23ad2233bdf70e5b8ddaf210dce5ee1afee4cdab28352cc2",
|
|
2602
|
-
"affectsGlobalScope": false
|
|
2603
|
-
},
|
|
2604
|
-
"../src/entity/modules/shopcart/checkoutbillingaddress.ts": {
|
|
2605
|
-
"version": "ab0e4e47a0c12af3e6a75a5df1e591a2cb6d83c5c8610e94c894f8347683cd85",
|
|
2606
|
-
"signature": "9034d0b32a3de8ce2025828476521d6713e80c42a63a5d487c0a9add41faa0f6",
|
|
2607
|
-
"affectsGlobalScope": false
|
|
2608
|
-
},
|
|
2609
|
-
"../src/entity/modules/shopcart/checkoutshippingaddress.ts": {
|
|
2610
|
-
"version": "fba937294a8b426bb1d8d9687870a2eca86befdfcab8306fad5fe7cdb7793702",
|
|
2611
|
-
"signature": "90dfe9f4f7f401bf8993564a88653c00f713d646f7002d392ed93da3b72d7f6f",
|
|
2612
|
-
"affectsGlobalScope": false
|
|
2613
|
-
},
|
|
2614
|
-
"../src/entity/modules/shopcart/checkout.ts": {
|
|
2615
|
-
"version": "6a746ec2cdf50db38f74fb8294ab0ecfb87eda85ad1f12aef2b547c078929000",
|
|
2616
|
-
"signature": "41a7de2d69c9ed52ff5df008e4aee8bee1da4165862e1e13cfac4abf984e361a",
|
|
2617
|
-
"affectsGlobalScope": false
|
|
2618
|
-
},
|
|
2619
|
-
"../src/entity/modules/shopcart/cart.ts": {
|
|
2620
|
-
"version": "138d377cbeba92b2fea480cb1b35d5de930d5d3f63da4c5266eb7955d9f53919",
|
|
2621
|
-
"signature": "203972c6ae6a8a4bc90a4d6a7a6ac91559c5d53aed7dc3b2b491222e47d66a6f",
|
|
2622
|
-
"affectsGlobalScope": false
|
|
2623
|
-
},
|
|
2624
2624
|
"../src/entity/index.ts": {
|
|
2625
2625
|
"version": "144582c2fc899b1b172056c49b698fa1d904a0c0c241bca68ded469236ead98f",
|
|
2626
2626
|
"signature": "c41c2724dee5f5006abbec545a39e37670f3a02b7c049271016b91e2c181f5cb",
|
|
@@ -3011,6 +3011,11 @@
|
|
|
3011
3011
|
"signature": "0b0c73764a789c14efda2c2211880a22ecb26f1f57921327745ebb29dd3e317b",
|
|
3012
3012
|
"affectsGlobalScope": false
|
|
3013
3013
|
},
|
|
3014
|
+
"../src/migrations/1678113864577-task-1098v1.ts": {
|
|
3015
|
+
"version": "271195d4c7022d76537b3c66118faae70cfe629edfbd0366aac3fac5ac24ef25",
|
|
3016
|
+
"signature": "fd2aa5d8badb2191af4a7a266cf303aac34b90f7f1a42442cc80600d72fc99cd",
|
|
3017
|
+
"affectsGlobalScope": false
|
|
3018
|
+
},
|
|
3014
3019
|
"../src/migrations/execute/index.ts": {
|
|
3015
3020
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3016
3021
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -5195,6 +5200,7 @@
|
|
|
5195
5200
|
"../node_modules/typeorm/index.d.ts",
|
|
5196
5201
|
"../src/entity/auditedmodel.ts",
|
|
5197
5202
|
"../src/entity/modules/shipping/shipping.ts",
|
|
5203
|
+
"../src/entity/modules/shopcart/cartitem.ts",
|
|
5198
5204
|
"../src/entity/product.entity.ts"
|
|
5199
5205
|
],
|
|
5200
5206
|
"../src/entity/modules/shipping/shipping.ts": [
|
|
@@ -5218,6 +5224,7 @@
|
|
|
5218
5224
|
"../src/entity/modules/shopcart/cartitem.ts": [
|
|
5219
5225
|
"../node_modules/typeorm/index.d.ts",
|
|
5220
5226
|
"../src/entity/auditedmodel.ts",
|
|
5227
|
+
"../src/entity/modules/shipping/productshipping.ts",
|
|
5221
5228
|
"../src/entity/modules/shopcart/cart.ts",
|
|
5222
5229
|
"../src/entity/modules/shopcart/pricedata.ts",
|
|
5223
5230
|
"../src/entity/product.entity.ts"
|
|
@@ -5600,6 +5607,9 @@
|
|
|
5600
5607
|
"../src/migrations/1677764464274-task-1032v2.ts": [
|
|
5601
5608
|
"../node_modules/typeorm/index.d.ts"
|
|
5602
5609
|
],
|
|
5610
|
+
"../src/migrations/1678113864577-task-1098v1.ts": [
|
|
5611
|
+
"../node_modules/typeorm/index.d.ts"
|
|
5612
|
+
],
|
|
5603
5613
|
"../src/migrations/execute/index.ts": [
|
|
5604
5614
|
"../src/config/connect.ts"
|
|
5605
5615
|
],
|
|
@@ -7700,6 +7710,7 @@
|
|
|
7700
7710
|
"../src/entity/modules/shipping/productshipping.ts": [
|
|
7701
7711
|
"../src/entity/auditedmodel.ts",
|
|
7702
7712
|
"../src/entity/modules/shipping/shipping.ts",
|
|
7713
|
+
"../src/entity/modules/shopcart/cartitem.ts",
|
|
7703
7714
|
"../src/entity/product.entity.ts"
|
|
7704
7715
|
],
|
|
7705
7716
|
"../src/entity/modules/shipping/shipping.ts": [
|
|
@@ -7719,6 +7730,7 @@
|
|
|
7719
7730
|
],
|
|
7720
7731
|
"../src/entity/modules/shopcart/cartitem.ts": [
|
|
7721
7732
|
"../src/entity/auditedmodel.ts",
|
|
7733
|
+
"../src/entity/modules/shipping/productshipping.ts",
|
|
7722
7734
|
"../src/entity/modules/shopcart/cart.ts",
|
|
7723
7735
|
"../src/entity/modules/shopcart/pricedata.ts",
|
|
7724
7736
|
"../src/entity/product.entity.ts"
|
|
@@ -8037,6 +8049,9 @@
|
|
|
8037
8049
|
"../src/migrations/1677764464274-task-1032v2.ts": [
|
|
8038
8050
|
"../node_modules/typeorm/index.d.ts"
|
|
8039
8051
|
],
|
|
8052
|
+
"../src/migrations/1678113864577-task-1098v1.ts": [
|
|
8053
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8054
|
+
],
|
|
8040
8055
|
"../src/migrations/index.ts": [
|
|
8041
8056
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8042
8057
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -8760,6 +8775,7 @@
|
|
|
8760
8775
|
"../src/migrations/1677706695399-promote_to_production_2023_01_03.ts",
|
|
8761
8776
|
"../src/migrations/1677763068338-task-1032v1.ts",
|
|
8762
8777
|
"../src/migrations/1677764464274-task-1032v2.ts",
|
|
8778
|
+
"../src/migrations/1678113864577-task-1098v1.ts",
|
|
8763
8779
|
"../src/migrations/execute/index.ts",
|
|
8764
8780
|
"../src/migrations/index.ts",
|
|
8765
8781
|
"../src/repositories/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.4",
|
|
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.4",
|
|
25
|
+
"@reachu/utils": "1.0.4",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -6,9 +6,11 @@ import {
|
|
|
6
6
|
Column,
|
|
7
7
|
ManyToOne,
|
|
8
8
|
JoinColumn,
|
|
9
|
+
OneToMany,
|
|
9
10
|
} from 'typeorm';
|
|
10
11
|
import AuditedModel from '../../AuditedModel';
|
|
11
12
|
import Shipping from './Shipping';
|
|
13
|
+
import CartItem from '../shopcart/CartItem';
|
|
12
14
|
|
|
13
15
|
@Entity()
|
|
14
16
|
export default class ProductShipping extends AuditedModel {
|
|
@@ -34,4 +36,7 @@ export default class ProductShipping extends AuditedModel {
|
|
|
34
36
|
})
|
|
35
37
|
@JoinColumn()
|
|
36
38
|
product: Product;
|
|
39
|
+
|
|
40
|
+
@OneToMany(() => CartItem, (cartItem: CartItem) => cartItem.productShipping, { cascade: true })
|
|
41
|
+
cartItem: CartItem[];
|
|
37
42
|
}
|
|
@@ -11,6 +11,7 @@ import AuditedModel from '../../AuditedModel';
|
|
|
11
11
|
import { PriceData } from './PriceData';
|
|
12
12
|
import Cart from './Cart';
|
|
13
13
|
import { Product } from '../../Product.entity';
|
|
14
|
+
import ProductShipping from '../shipping/ProductShipping';
|
|
14
15
|
|
|
15
16
|
@Entity()
|
|
16
17
|
export default class CartItem extends AuditedModel {
|
|
@@ -37,4 +38,12 @@ export default class CartItem extends AuditedModel {
|
|
|
37
38
|
@ManyToOne(() => Cart, (cart: Cart) => cart.line_items, { eager: true, onDelete: 'CASCADE' })
|
|
38
39
|
@JoinColumn()
|
|
39
40
|
cart: Cart;
|
|
41
|
+
|
|
42
|
+
@ManyToOne(
|
|
43
|
+
() => ProductShipping,
|
|
44
|
+
(productShipping: ProductShipping) => productShipping.cartItem,
|
|
45
|
+
{ eager: true, onDelete: 'CASCADE' },
|
|
46
|
+
)
|
|
47
|
+
@JoinColumn()
|
|
48
|
+
productShipping: ProductShipping;
|
|
40
49
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class task1098V11678113864577 implements MigrationInterface {
|
|
4
|
+
name = 'task1098V11678113864577'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` ADD \`product_shipping_id\` varchar(36) NULL`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` ADD CONSTRAINT \`FK_2b97b975f9f05cdc297f89d1287\` FOREIGN KEY (\`product_shipping_id\`) REFERENCES \`product_shipping\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` DROP FOREIGN KEY \`FK_2b97b975f9f05cdc297f89d1287\``);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`cart_item\` DROP COLUMN \`product_shipping_id\``);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|