@reachu/database 1.0.162 → 1.0.164
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/ChannelUser.d.ts +2 -0
- package/dist/entity/ChannelUser.js +6 -0
- package/dist/entity/ChannelUser.js.map +1 -1
- package/dist/entity/ChannelUserSettings.d.ts +9 -0
- package/dist/entity/ChannelUserSettings.js +47 -0
- package/dist/entity/ChannelUserSettings.js.map +1 -0
- package/dist/entity/modules/shopcart/Checkout.d.ts +1 -0
- package/dist/entity/modules/shopcart/Checkout.js +4 -0
- package/dist/entity/modules/shopcart/Checkout.js.map +1 -1
- package/dist/migrations/1711562145337-user-channel-settings.d.ts +6 -0
- package/dist/migrations/1711562145337-user-channel-settings.js +37 -0
- package/dist/migrations/1711562145337-user-channel-settings.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +31 -4
- package/package.json +3 -3
- package/src/entity/ChannelUser.ts +6 -0
- package/src/entity/ChannelUserSettings.ts +24 -0
- package/src/entity/modules/shopcart/Checkout.ts +3 -1
- package/src/migrations/1711562145337-user-channel-settings.ts +22 -0
|
@@ -7,6 +7,7 @@ import ShopifyConnection from './ShopifyConnection';
|
|
|
7
7
|
import WooConnection from './WooConnection';
|
|
8
8
|
import UserChannelApiKey from './UserChannelApiKey';
|
|
9
9
|
import { MagentoConnection } from './MagentoConnection.entity';
|
|
10
|
+
import ChannelUserSettings from './ChannelUserSettings';
|
|
10
11
|
export default class ChannelUser extends AuditedModel {
|
|
11
12
|
deletedAt: Date;
|
|
12
13
|
id: number;
|
|
@@ -23,4 +24,5 @@ export default class ChannelUser extends AuditedModel {
|
|
|
23
24
|
magentoConnection: MagentoConnection;
|
|
24
25
|
userChannelApiKey: UserChannelApiKey;
|
|
25
26
|
testOrigen: boolean;
|
|
27
|
+
channelUserSettings: ChannelUserSettings;
|
|
26
28
|
}
|
|
@@ -22,6 +22,7 @@ const ShopifyConnection_1 = __importDefault(require("./ShopifyConnection"));
|
|
|
22
22
|
const WooConnection_1 = __importDefault(require("./WooConnection"));
|
|
23
23
|
const UserChannelApiKey_1 = __importDefault(require("./UserChannelApiKey"));
|
|
24
24
|
const MagentoConnection_entity_1 = require("./MagentoConnection.entity");
|
|
25
|
+
const ChannelUserSettings_1 = __importDefault(require("./ChannelUserSettings"));
|
|
25
26
|
let ChannelUser = class ChannelUser extends AuditedModel_1.default {
|
|
26
27
|
};
|
|
27
28
|
__decorate([
|
|
@@ -104,6 +105,11 @@ __decorate([
|
|
|
104
105
|
typeorm_1.Column('boolean', { default: false }),
|
|
105
106
|
__metadata("design:type", Boolean)
|
|
106
107
|
], ChannelUser.prototype, "testOrigen", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
typeorm_1.OneToOne(() => ChannelUserSettings_1.default, { eager: false, nullable: true }),
|
|
110
|
+
typeorm_1.JoinColumn(),
|
|
111
|
+
__metadata("design:type", ChannelUserSettings_1.default)
|
|
112
|
+
], ChannelUser.prototype, "channelUserSettings", void 0);
|
|
107
113
|
ChannelUser = __decorate([
|
|
108
114
|
typeorm_1.Entity()
|
|
109
115
|
], ChannelUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelUser.js","sourceRoot":"","sources":["../../src/entity/ChannelUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"ChannelUser.js","sourceRoot":"","sources":["../../src/entity/ChannelUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCASiB;AACjB,kEAA0C;AAC1C,wDAAgC;AAChC,kEAA0C;AAC1C,sFAA8D;AAC9D,kDAA0B;AAC1B,4EAAoD;AACpD,oEAA4C;AAE5C,4EAAoD;AACpD,yEAA+D;AAC/D,gFAAwD;AAGxD,IAAqB,WAAW,GAAhC,MAAqB,WAAY,SAAQ,sBAAY;CAyEpD,CAAA;AAvEC;IADC,0BAAgB,EAAE;8BACR,IAAI;8CAAC;AAGhB;IADC,gCAA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AC,iBAAiB,CAAC,EAAE,EAAE;QAC/E,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAMrC;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,uBAAa,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;QACnE,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACE,uBAAa;kDAAC;AAM7B;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,4CAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE;QAC/E,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACM,4CAAiB;sDAAC;AAMrC;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,2BAAiB,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,EAAE;QAC/E,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,oBAAU,EAAE;8BACM,2BAAiB;sDAAC;AAGrC;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CAClB;AAIpB;IAFC,kBAAQ,CAAC,GAAG,EAAE,CAAC,6BAAmB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrE,oBAAU,EAAE;8BACQ,6BAAmB;wDAAC;AAxEtB,WAAW;IAD/B,gBAAM,EAAE;GACY,WAAW,CAyE/B;kBAzEoB,WAAW"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
17
|
+
let ChannelUserSettings = class ChannelUserSettings extends AuditedModel_1.default {
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
typeorm_1.DeleteDateColumn(),
|
|
21
|
+
__metadata("design:type", Date)
|
|
22
|
+
], ChannelUserSettings.prototype, "deletedAt", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
typeorm_1.PrimaryGeneratedColumn(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], ChannelUserSettings.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
typeorm_1.Column('boolean', { default: false }),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], ChannelUserSettings.prototype, "stripePaymentLink", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
typeorm_1.Column('boolean', { default: false }),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], ChannelUserSettings.prototype, "stripePaymentIntent", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
typeorm_1.Column('boolean', { default: false }),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], ChannelUserSettings.prototype, "klarna", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
typeorm_1.Column('varchar', { length: '21844' }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ChannelUserSettings.prototype, "markets", void 0);
|
|
43
|
+
ChannelUserSettings = __decorate([
|
|
44
|
+
typeorm_1.Entity()
|
|
45
|
+
], ChannelUserSettings);
|
|
46
|
+
exports.default = ChannelUserSettings;
|
|
47
|
+
//# sourceMappingURL=ChannelUserSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelUserSettings.js","sourceRoot":"","sources":["../../src/entity/ChannelUserSettings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAmF;AACnF,kEAA0C;AAG1C,IAAqB,mBAAmB,GAAxC,MAAqB,mBAAoB,SAAQ,sBAAY;CAmB5D,CAAA;AAjBC;IADC,0BAAgB,EAAE;8BACR,IAAI;sDAAC;AAGhB;IADC,gCAAsB,EAAE;;+CACd;AAGX;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACX;AAG3B;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gEACT;AAG7B;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDACtB;AAIhB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;oDACvB;AAlBG,mBAAmB;IADvC,gBAAM,EAAE;GACY,mBAAmB,CAmBvC;kBAnBoB,mBAAmB"}
|
|
@@ -75,6 +75,10 @@ __decorate([
|
|
|
75
75
|
typeorm_1.Column('varchar', { nullable: true }),
|
|
76
76
|
__metadata("design:type", String)
|
|
77
77
|
], Checkout.prototype, "origin_payment_id", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
typeorm_1.Column('varchar', { nullable: true, length: '21844' }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], Checkout.prototype, "origin_payment_body", void 0);
|
|
78
82
|
__decorate([
|
|
79
83
|
typeorm_1.ManyToOne(() => Cart_1.default, (cart) => cart.checkout_items, { eager: true, onDelete: 'CASCADE' }),
|
|
80
84
|
typeorm_1.JoinColumn(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/Checkout.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,kDAA0B;AAC1B,qEAAkE;AAClE,uEAAoE;AACpE,wDAAgC;AAGhC,IAAqB,QAAQ,GAA7B,MAAqB,QAAS,SAAQ,sBAAY;
|
|
1
|
+
{"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../../src/entity/modules/shopcart/Checkout.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAQiB;AACjB,sEAA8C;AAC9C,kDAA0B;AAC1B,qEAAkE;AAClE,uEAAoE;AACpE,wDAAgC;AAGhC,IAAqB,QAAQ,GAA7B,MAAqB,QAAS,SAAQ,sBAAY;CA2DjD,CAAA;AAzDC;IADC,gCAAsB,CAAC,MAAM,CAAC;;oCACpB;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;2CAAC;AAGhB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACjB;AAGrB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAClB;AAGpB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACd;AAGxB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACvB;AAGf;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CA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E,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2CACxC;AAGnB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACF;AA1Db,QAAQ;IAD5B,gBAAM,EAAE;GACY,QAAQ,CA2D5B;kBA3DoB,QAAQ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.userChannelSettings1711562145337 = void 0;
|
|
13
|
+
class userChannelSettings1711562145337 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'userChannelSettings1711562145337';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`CREATE TABLE \`channel_user_settings\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`stripe_payment_link\` tinyint NOT NULL DEFAULT 0, \`stripe_payment_intent\` tinyint NOT NULL DEFAULT 0, \`klarna\` tinyint NOT NULL DEFAULT 0, \`markets\` varchar(21844) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`channel_user_settings_id\` int NULL`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD UNIQUE INDEX \`IDX_7e330764fdf1dc12dd5ba35dec\` (\`channel_user_settings_id\`)`);
|
|
22
|
+
yield queryRunner.query(`CREATE UNIQUE INDEX \`REL_7e330764fdf1dc12dd5ba35dec\` ON \`channel_user\` (\`channel_user_settings_id\`)`);
|
|
23
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_7e330764fdf1dc12dd5ba35dece\` FOREIGN KEY (\`channel_user_settings_id\`) REFERENCES \`channel_user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
down(queryRunner) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_7e330764fdf1dc12dd5ba35dece\``);
|
|
29
|
+
yield queryRunner.query(`DROP INDEX \`REL_7e330764fdf1dc12dd5ba35dec\` ON \`channel_user\``);
|
|
30
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP INDEX \`IDX_7e330764fdf1dc12dd5ba35dec\``);
|
|
31
|
+
yield queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`channel_user_settings_id\``);
|
|
32
|
+
yield queryRunner.query(`DROP TABLE \`channel_user_settings\``);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.userChannelSettings1711562145337 = userChannelSettings1711562145337;
|
|
37
|
+
//# sourceMappingURL=1711562145337-user-channel-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1711562145337-user-channel-settings.js","sourceRoot":"","sources":["../../src/migrations/1711562145337-user-channel-settings.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,gCAAgC;IAA7C;QACI,SAAI,GAAG,kCAAkC,CAAA;IAkB7C,CAAC;IAhBgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,2eAA2e,CAAC,CAAC;YACrgB,MAAM,WAAW,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;YAClG,MAAM,WAAW,CAAC,KAAK,CAAC,iHAAiH,CAAC,CAAC;YAC3I,MAAM,WAAW,CAAC,KAAK,CAAC,2GAA2G,CAAC,CAAC;YACrI,MAAM,WAAW,CAAC,KAAK,CAAC,gNAAgN,CAAC,CAAC;QAC9O,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,kFAAkF,CAAC,CAAC;YAC5G,MAAM,WAAW,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7F,MAAM,WAAW,CAAC,KAAK,CAAC,4EAA4E,CAAC,CAAC;YACtG,MAAM,WAAW,CAAC,KAAK,CAAC,uEAAuE,CAAC,CAAC;YACjG,MAAM,WAAW,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACpE,CAAC;KAAA;CAEJ;AAnBD,4EAmBC"}
|
|
@@ -2481,9 +2481,14 @@
|
|
|
2481
2481
|
"signature": "7efd2406080e07894d8d335fbe75ba26c7dc03e64ce95245ba86c08a271ee76d",
|
|
2482
2482
|
"affectsGlobalScope": false
|
|
2483
2483
|
},
|
|
2484
|
+
"../src/entity/channelusersettings.ts": {
|
|
2485
|
+
"version": "a47982b54c3f5c458bd71013b53e382c46e90ee3c16436429882be02ecfbbb48",
|
|
2486
|
+
"signature": "33b238a18b58d058b0d9f68b163b4c8f7b54e6f812db2a70838c993d34706d20",
|
|
2487
|
+
"affectsGlobalScope": false
|
|
2488
|
+
},
|
|
2484
2489
|
"../src/entity/channeluser.ts": {
|
|
2485
|
-
"version": "
|
|
2486
|
-
"signature": "
|
|
2490
|
+
"version": "e238c137ace5e721933d353c5118dc7a0a88790fad7ee1f020653c684b2ffeb2",
|
|
2491
|
+
"signature": "65f97d9fa475392c2ef13b994380a6f64cc02295ef5594c4ba6379599d4f94e0",
|
|
2487
2492
|
"affectsGlobalScope": false
|
|
2488
2493
|
},
|
|
2489
2494
|
"../src/entity/channel.ts": {
|
|
@@ -2542,8 +2547,8 @@
|
|
|
2542
2547
|
"affectsGlobalScope": false
|
|
2543
2548
|
},
|
|
2544
2549
|
"../src/entity/modules/shopcart/checkout.ts": {
|
|
2545
|
-
"version": "
|
|
2546
|
-
"signature": "
|
|
2550
|
+
"version": "cc4d16bd72cdfd1949973d2b38065009ca2e989ac8e8a4f87e6dfac05213f3d8",
|
|
2551
|
+
"signature": "a9961ffc9ff83ef589fa12959732e6ce745076fc496e11980b69ed7595cdd267",
|
|
2547
2552
|
"affectsGlobalScope": false
|
|
2548
2553
|
},
|
|
2549
2554
|
"../src/entity/modules/shopcart/cart.ts": {
|
|
@@ -3706,6 +3711,11 @@
|
|
|
3706
3711
|
"signature": "7cc7d57e7b8d8064a350346af4fac982fbd8dab6c2f076576e215566ac50780c",
|
|
3707
3712
|
"affectsGlobalScope": false
|
|
3708
3713
|
},
|
|
3714
|
+
"../src/migrations/1711562145337-user-channel-settings.ts": {
|
|
3715
|
+
"version": "5cfdc4d825c13c4aabb2f0bac03e03ca7ce90054df8a6226de247ad79cfc1351",
|
|
3716
|
+
"signature": "9f5612345e6e3183640df5d3fe9f236c85556134a3b67da39f6adf03c22fd69a",
|
|
3717
|
+
"affectsGlobalScope": false
|
|
3718
|
+
},
|
|
3709
3719
|
"../src/migrations/execute/index.ts": {
|
|
3710
3720
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3711
3721
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -5703,6 +5713,7 @@
|
|
|
5703
5713
|
"../src/entity/channel.ts",
|
|
5704
5714
|
"../src/entity/channelgroup.ts",
|
|
5705
5715
|
"../src/entity/channeluserproductsync.ts",
|
|
5716
|
+
"../src/entity/channelusersettings.ts",
|
|
5706
5717
|
"../src/entity/magentoconnection.entity.ts",
|
|
5707
5718
|
"../src/entity/shopifyconnection.ts",
|
|
5708
5719
|
"../src/entity/user.ts",
|
|
@@ -5716,6 +5727,10 @@
|
|
|
5716
5727
|
"../src/entity/product.entity.ts",
|
|
5717
5728
|
"../src/entity/variant.ts"
|
|
5718
5729
|
],
|
|
5730
|
+
"../src/entity/channelusersettings.ts": [
|
|
5731
|
+
"../node_modules/typeorm/index.d.ts",
|
|
5732
|
+
"../src/entity/auditedmodel.ts"
|
|
5733
|
+
],
|
|
5719
5734
|
"../src/entity/check.ts": [
|
|
5720
5735
|
"../node_modules/typeorm/index.d.ts"
|
|
5721
5736
|
],
|
|
@@ -6844,6 +6859,9 @@
|
|
|
6844
6859
|
"../src/migrations/1708039535580-order-channel-user.ts": [
|
|
6845
6860
|
"../node_modules/typeorm/index.d.ts"
|
|
6846
6861
|
],
|
|
6862
|
+
"../src/migrations/1711562145337-user-channel-settings.ts": [
|
|
6863
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6864
|
+
],
|
|
6847
6865
|
"../src/migrations/execute/index.ts": [
|
|
6848
6866
|
"../src/config/connect.ts"
|
|
6849
6867
|
],
|
|
@@ -8843,6 +8861,7 @@
|
|
|
8843
8861
|
"../src/entity/channel.ts",
|
|
8844
8862
|
"../src/entity/channelgroup.ts",
|
|
8845
8863
|
"../src/entity/channeluserproductsync.ts",
|
|
8864
|
+
"../src/entity/channelusersettings.ts",
|
|
8846
8865
|
"../src/entity/magentoconnection.entity.ts",
|
|
8847
8866
|
"../src/entity/shopifyconnection.ts",
|
|
8848
8867
|
"../src/entity/user.ts",
|
|
@@ -8855,6 +8874,9 @@
|
|
|
8855
8874
|
"../src/entity/product.entity.ts",
|
|
8856
8875
|
"../src/entity/variant.ts"
|
|
8857
8876
|
],
|
|
8877
|
+
"../src/entity/channelusersettings.ts": [
|
|
8878
|
+
"../src/entity/auditedmodel.ts"
|
|
8879
|
+
],
|
|
8858
8880
|
"../src/entity/collection.ts": [
|
|
8859
8881
|
"../src/entity/auditedmodel.ts",
|
|
8860
8882
|
"../src/entity/channelgroup.ts",
|
|
@@ -9836,6 +9858,9 @@
|
|
|
9836
9858
|
"../src/migrations/1708039535580-order-channel-user.ts": [
|
|
9837
9859
|
"../node_modules/typeorm/index.d.ts"
|
|
9838
9860
|
],
|
|
9861
|
+
"../src/migrations/1711562145337-user-channel-settings.ts": [
|
|
9862
|
+
"../node_modules/typeorm/index.d.ts"
|
|
9863
|
+
],
|
|
9839
9864
|
"../src/migrations/index.ts": [
|
|
9840
9865
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
9841
9866
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -10489,6 +10514,7 @@
|
|
|
10489
10514
|
"../src/entity/channelgroup.ts",
|
|
10490
10515
|
"../src/entity/channeluser.ts",
|
|
10491
10516
|
"../src/entity/channeluserproductsync.ts",
|
|
10517
|
+
"../src/entity/channelusersettings.ts",
|
|
10492
10518
|
"../src/entity/check.ts",
|
|
10493
10519
|
"../src/entity/checkoutmetadata.ts",
|
|
10494
10520
|
"../src/entity/collection.ts",
|
|
@@ -10737,6 +10763,7 @@
|
|
|
10737
10763
|
"../src/migrations/1707768053927-shopify-supplier-delete.ts",
|
|
10738
10764
|
"../src/migrations/1708027064933-woo-user-delete.ts",
|
|
10739
10765
|
"../src/migrations/1708039535580-order-channel-user.ts",
|
|
10766
|
+
"../src/migrations/1711562145337-user-channel-settings.ts",
|
|
10740
10767
|
"../src/migrations/execute/index.ts",
|
|
10741
10768
|
"../src/migrations/index.ts",
|
|
10742
10769
|
"../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.164",
|
|
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.164",
|
|
25
|
+
"@reachu/utils": "1.0.164",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
JoinColumn,
|
|
7
7
|
OneToMany,
|
|
8
8
|
Column,
|
|
9
|
+
OneToOne,
|
|
9
10
|
} from 'typeorm';
|
|
10
11
|
import AuditedModel from './AuditedModel';
|
|
11
12
|
import Channel from './Channel';
|
|
@@ -17,6 +18,7 @@ import WooConnection from './WooConnection';
|
|
|
17
18
|
|
|
18
19
|
import UserChannelApiKey from './UserChannelApiKey';
|
|
19
20
|
import { MagentoConnection } from './MagentoConnection.entity';
|
|
21
|
+
import ChannelUserSettings from './ChannelUserSettings';
|
|
20
22
|
|
|
21
23
|
@Entity()
|
|
22
24
|
export default class ChannelUser extends AuditedModel {
|
|
@@ -88,4 +90,8 @@ export default class ChannelUser extends AuditedModel {
|
|
|
88
90
|
|
|
89
91
|
@Column('boolean', { default: false })
|
|
90
92
|
testOrigen: boolean;
|
|
93
|
+
|
|
94
|
+
@OneToOne(() => ChannelUserSettings, { eager: false, nullable: true })
|
|
95
|
+
@JoinColumn()
|
|
96
|
+
channelUserSettings: ChannelUserSettings;
|
|
91
97
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, DeleteDateColumn, Column } from 'typeorm';
|
|
2
|
+
import AuditedModel from './AuditedModel';
|
|
3
|
+
|
|
4
|
+
@Entity()
|
|
5
|
+
export default class ChannelUserSettings extends AuditedModel {
|
|
6
|
+
@DeleteDateColumn()
|
|
7
|
+
deletedAt: Date;
|
|
8
|
+
|
|
9
|
+
@PrimaryGeneratedColumn()
|
|
10
|
+
id: number;
|
|
11
|
+
|
|
12
|
+
@Column('boolean', { default: false })
|
|
13
|
+
stripePaymentLink: boolean;
|
|
14
|
+
|
|
15
|
+
@Column('boolean', { default: false })
|
|
16
|
+
stripePaymentIntent: boolean;
|
|
17
|
+
|
|
18
|
+
@Column('boolean', { default: false })
|
|
19
|
+
klarna: boolean;
|
|
20
|
+
|
|
21
|
+
//array of strings (countries code)
|
|
22
|
+
@Column('varchar', { length: '21844' })
|
|
23
|
+
markets: string;
|
|
24
|
+
}
|
|
@@ -55,10 +55,12 @@ export default class Checkout extends AuditedModel {
|
|
|
55
55
|
@Column('varchar', { nullable: true })
|
|
56
56
|
checkout_url?: string;
|
|
57
57
|
|
|
58
|
-
|
|
59
58
|
@Column('varchar', { nullable: true })
|
|
60
59
|
origin_payment_id?: string;
|
|
61
60
|
|
|
61
|
+
@Column('varchar', { nullable: true, length: '21844' })
|
|
62
|
+
origin_payment_body?: string;
|
|
63
|
+
|
|
62
64
|
@ManyToOne(() => Cart, (cart: Cart) => cart.checkout_items, { eager: true, onDelete: 'CASCADE' })
|
|
63
65
|
@JoinColumn()
|
|
64
66
|
cart: Cart;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class userChannelSettings1711562145337 implements MigrationInterface {
|
|
4
|
+
name = 'userChannelSettings1711562145337'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE \`channel_user_settings\` (\`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`deleted_at\` datetime(6) NULL, \`id\` int NOT NULL AUTO_INCREMENT, \`stripe_payment_link\` tinyint NOT NULL DEFAULT 0, \`stripe_payment_intent\` tinyint NOT NULL DEFAULT 0, \`klarna\` tinyint NOT NULL DEFAULT 0, \`markets\` varchar(21844) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`channel_user_settings_id\` int NULL`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` ADD UNIQUE INDEX \`IDX_7e330764fdf1dc12dd5ba35dec\` (\`channel_user_settings_id\`)`);
|
|
10
|
+
await queryRunner.query(`CREATE UNIQUE INDEX \`REL_7e330764fdf1dc12dd5ba35dec\` ON \`channel_user\` (\`channel_user_settings_id\`)`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` ADD CONSTRAINT \`FK_7e330764fdf1dc12dd5ba35dece\` FOREIGN KEY (\`channel_user_settings_id\`) REFERENCES \`channel_user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` DROP FOREIGN KEY \`FK_7e330764fdf1dc12dd5ba35dece\``);
|
|
16
|
+
await queryRunner.query(`DROP INDEX \`REL_7e330764fdf1dc12dd5ba35dec\` ON \`channel_user\``);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` DROP INDEX \`IDX_7e330764fdf1dc12dd5ba35dec\``);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`channel_user_settings_id\``);
|
|
19
|
+
await queryRunner.query(`DROP TABLE \`channel_user_settings\``);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|