@reachu/database 1.0.139 → 1.0.141
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 +1 -0
- package/dist/entity/ChannelUser.js +4 -0
- package/dist/entity/ChannelUser.js.map +1 -1
- package/dist/entity/Collection.d.ts +1 -0
- package/dist/entity/Collection.js +4 -0
- package/dist/entity/Collection.js.map +1 -1
- package/dist/entity/Connection.d.ts +1 -0
- package/dist/entity/Connection.js +4 -0
- package/dist/entity/Connection.js.map +1 -1
- package/dist/entity/EnvType.d.ts +6 -0
- package/dist/entity/EnvType.js +35 -0
- package/dist/entity/EnvType.js.map +1 -0
- package/dist/entity/Order.d.ts +1 -0
- package/dist/entity/Order.js +4 -0
- package/dist/entity/Order.js.map +1 -1
- package/dist/entity/Product.entity.d.ts +2 -0
- package/dist/entity/Product.entity.js +8 -0
- package/dist/entity/Product.entity.js.map +1 -1
- package/dist/entity/UserSettings.d.ts +7 -0
- package/dist/entity/UserSettings.js +40 -0
- package/dist/entity/UserSettings.js.map +1 -1
- package/dist/entity/index.d.ts +2 -1
- package/dist/entity/index.js +3 -0
- package/dist/entity/index.js.map +1 -1
- package/dist/helpers/products/storage/search.d.ts +2 -0
- package/dist/migrations/1701807577519-test-step-1.d.ts +6 -0
- package/dist/migrations/1701807577519-test-step-1.js +43 -0
- package/dist/migrations/1701807577519-test-step-1.js.map +1 -0
- package/dist/migrations/1701868990386-test-v2.d.ts +6 -0
- package/dist/migrations/1701868990386-test-v2.js +81 -0
- package/dist/migrations/1701868990386-test-v2.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/index.js +8 -1
- package/dist/repositories/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +107 -98
- package/package.json +3 -3
- package/src/entity/ChannelUser.ts +3 -0
- package/src/entity/Collection.ts +3 -0
- package/src/entity/Connection.ts +3 -0
- package/src/entity/EnvType.ts +14 -0
- package/src/entity/Order.ts +3 -0
- package/src/entity/Product.entity.ts +6 -0
- package/src/entity/UserSettings.ts +34 -0
- package/src/entity/index.ts +2 -0
- package/src/migrations/1701807577519-test-step-1.ts +28 -0
- package/src/migrations/1701868990386-test-v2.ts +66 -0
- package/src/repositories/index.ts +4 -0
package/src/entity/Order.ts
CHANGED
|
@@ -181,6 +181,12 @@ export class Product extends AuditedModel {
|
|
|
181
181
|
@JoinColumn()
|
|
182
182
|
productAttribute: ProductAttribute[];
|
|
183
183
|
|
|
184
|
+
@Column('boolean', { default: false })
|
|
185
|
+
testOrigen: boolean;
|
|
186
|
+
|
|
187
|
+
@Column('boolean', { default: false })
|
|
188
|
+
demo: boolean;
|
|
189
|
+
|
|
184
190
|
@AfterLoad()
|
|
185
191
|
convertNumerics() {
|
|
186
192
|
const diff = (this.referralFee * this.publicPrice) / 100;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import AuditedModel from './AuditedModel';
|
|
11
11
|
import Currency from './Currency';
|
|
12
12
|
import User from './User';
|
|
13
|
+
import EnvType from './EnvType';
|
|
13
14
|
|
|
14
15
|
@Entity()
|
|
15
16
|
export default class UserSettings extends AuditedModel {
|
|
@@ -34,4 +35,37 @@ export default class UserSettings extends AuditedModel {
|
|
|
34
35
|
@ManyToOne(() => Currency, (currency) => currency.id, { nullable: true, eager: true })
|
|
35
36
|
@JoinColumn()
|
|
36
37
|
currency: Currency;
|
|
38
|
+
|
|
39
|
+
@Column('boolean', { default: false })
|
|
40
|
+
testEnv: boolean;
|
|
41
|
+
|
|
42
|
+
@ManyToOne(() => EnvType, (envType: EnvType) => envType.id, {
|
|
43
|
+
onDelete: 'CASCADE',
|
|
44
|
+
})
|
|
45
|
+
@JoinColumn()
|
|
46
|
+
testConnections: EnvType;
|
|
47
|
+
|
|
48
|
+
@ManyToOne(() => EnvType, (envType: EnvType) => envType.id, {
|
|
49
|
+
onDelete: 'CASCADE',
|
|
50
|
+
})
|
|
51
|
+
@JoinColumn()
|
|
52
|
+
testCollections: EnvType;
|
|
53
|
+
|
|
54
|
+
@ManyToOne(() => EnvType, (envType: EnvType) => envType.id, {
|
|
55
|
+
onDelete: 'CASCADE',
|
|
56
|
+
})
|
|
57
|
+
@JoinColumn()
|
|
58
|
+
testEcomSystemConnection: EnvType;
|
|
59
|
+
|
|
60
|
+
@ManyToOne(() => EnvType, (envType: EnvType) => envType.id, {
|
|
61
|
+
onDelete: 'CASCADE',
|
|
62
|
+
})
|
|
63
|
+
@JoinColumn()
|
|
64
|
+
testProducts: EnvType;
|
|
65
|
+
|
|
66
|
+
@ManyToOne(() => EnvType, (envType: EnvType) => envType.id, {
|
|
67
|
+
onDelete: 'CASCADE',
|
|
68
|
+
})
|
|
69
|
+
@JoinColumn()
|
|
70
|
+
testChannels: EnvType;
|
|
37
71
|
}
|
package/src/entity/index.ts
CHANGED
|
@@ -59,6 +59,7 @@ import ExchangeRate from './ExchangeRate';
|
|
|
59
59
|
import EnvironmentConfiguration from './EnvironmentConfiguration';
|
|
60
60
|
import ProductCategory from './ProductCategory';
|
|
61
61
|
import ProductDigital from './ProductDigital';
|
|
62
|
+
import EnvType from './EnvType';
|
|
62
63
|
|
|
63
64
|
//shopCart
|
|
64
65
|
import Cart from './modules/shopcart/Cart';
|
|
@@ -216,4 +217,5 @@ export {
|
|
|
216
217
|
DiscountType,
|
|
217
218
|
ProductCategory,
|
|
218
219
|
ProductDigital,
|
|
220
|
+
EnvType,
|
|
219
221
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class testStep11701807577519 implements MigrationInterface {
|
|
4
|
+
name = 'testStep11701807577519'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE \`env_type\` (\`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), \`id\` int NOT NULL AUTO_INCREMENT, \`deleted_at\` datetime(6) NULL, \`type\` varchar(255) NOT NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_mode\` tinyint NOT NULL DEFAULT 0`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`collection\` ADD \`env_type_id\` int NULL`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD \`env_type_id\` int NULL`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE \`connection\` ADD \`env_type_id\` int NULL`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE \`collection\` ADD CONSTRAINT \`FK_8ff9c88995340f133428155c704\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD CONSTRAINT \`FK_966cc3c7ba601e3c61d21511693\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`connection\` ADD CONSTRAINT \`FK_296e46adf5d1c3ed8b06e2ca034\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
18
|
+
await queryRunner.query(`ALTER TABLE \`connection\` DROP FOREIGN KEY \`FK_296e46adf5d1c3ed8b06e2ca034\``);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP FOREIGN KEY \`FK_966cc3c7ba601e3c61d21511693\``);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE \`collection\` DROP FOREIGN KEY \`FK_8ff9c88995340f133428155c704\``);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE \`connection\` DROP COLUMN \`env_type_id\``);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`env_type_id\``);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE \`collection\` DROP COLUMN \`env_type_id\``);
|
|
24
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_mode\``);
|
|
25
|
+
await queryRunner.query(`DROP TABLE \`env_type\``);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class testV21701868990386 implements MigrationInterface {
|
|
4
|
+
name = 'testV21701868990386'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`collection\` DROP FOREIGN KEY \`FK_8ff9c88995340f133428155c704\``);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP FOREIGN KEY \`FK_966cc3c7ba601e3c61d21511693\``);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`connection\` DROP FOREIGN KEY \`FK_296e46adf5d1c3ed8b06e2ca034\``);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`env_type_id\` \`test_origen\` int NULL`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE \`connection\` CHANGE \`env_type_id\` \`test_origen\` int NULL`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_mode\``);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`env_type_id\``);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_env\` tinyint NOT NULL DEFAULT 0`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_connections_id\` int NULL`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_collections_id\` int NULL`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_ecom_system_connection_id\` int NULL`);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_products_id\` int NULL`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_channels_id\` int NULL`);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` ADD \`test_origen\` tinyint NOT NULL DEFAULT 0`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD \`test_origen\` tinyint NOT NULL DEFAULT 0`);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD \`demo\` tinyint NOT NULL DEFAULT 0`);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE \`order\` ADD \`test_origen\` tinyint NOT NULL DEFAULT 0`);
|
|
24
|
+
await queryRunner.query(`ALTER TABLE \`collection\` DROP COLUMN \`test_origen\``);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE \`collection\` ADD \`test_origen\` tinyint NOT NULL DEFAULT 0`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE \`order_item\` CHANGE \`variant_title\` \`variant_title\` varchar(255) NOT NULL`);
|
|
27
|
+
await queryRunner.query(`ALTER TABLE \`connection\` DROP COLUMN \`test_origen\``);
|
|
28
|
+
await queryRunner.query(`ALTER TABLE \`connection\` ADD \`test_origen\` tinyint NOT NULL DEFAULT 0`);
|
|
29
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_6eee65c312f8ad4632163d4a607\` FOREIGN KEY (\`test_connections_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
30
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_f7f0dd7cf1918fc0bc1efb85c85\` FOREIGN KEY (\`test_collections_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
31
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_6226c6c18feb3e27344b6f1de8a\` FOREIGN KEY (\`test_ecom_system_connection_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
32
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_92746ff9f5b968598cb3540d6e2\` FOREIGN KEY (\`test_products_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
33
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD CONSTRAINT \`FK_d89787b04ae0835cc623cf55421\` FOREIGN KEY (\`test_channels_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
37
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_d89787b04ae0835cc623cf55421\``);
|
|
38
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_92746ff9f5b968598cb3540d6e2\``);
|
|
39
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_6226c6c18feb3e27344b6f1de8a\``);
|
|
40
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_f7f0dd7cf1918fc0bc1efb85c85\``);
|
|
41
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP FOREIGN KEY \`FK_6eee65c312f8ad4632163d4a607\``);
|
|
42
|
+
await queryRunner.query(`ALTER TABLE \`connection\` DROP COLUMN \`test_origen\``);
|
|
43
|
+
await queryRunner.query(`ALTER TABLE \`connection\` ADD \`test_origen\` int NULL`);
|
|
44
|
+
await queryRunner.query(`ALTER TABLE \`order_item\` CHANGE \`variant_title\` \`variant_title\` varchar(255) NOT NULL DEFAULT ''`);
|
|
45
|
+
await queryRunner.query(`ALTER TABLE \`collection\` DROP COLUMN \`test_origen\``);
|
|
46
|
+
await queryRunner.query(`ALTER TABLE \`collection\` ADD \`test_origen\` int NULL`);
|
|
47
|
+
await queryRunner.query(`ALTER TABLE \`order\` DROP COLUMN \`test_origen\``);
|
|
48
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`demo\``);
|
|
49
|
+
await queryRunner.query(`ALTER TABLE \`product\` DROP COLUMN \`test_origen\``);
|
|
50
|
+
await queryRunner.query(`ALTER TABLE \`channel_user\` DROP COLUMN \`test_origen\``);
|
|
51
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_channels_id\``);
|
|
52
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_products_id\``);
|
|
53
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_ecom_system_connection_id\``);
|
|
54
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_collections_id\``);
|
|
55
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_connections_id\``);
|
|
56
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` DROP COLUMN \`test_env\``);
|
|
57
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD \`env_type_id\` int NULL`);
|
|
58
|
+
await queryRunner.query(`ALTER TABLE \`user_settings\` ADD \`test_mode\` tinyint NOT NULL DEFAULT '0'`);
|
|
59
|
+
await queryRunner.query(`ALTER TABLE \`connection\` CHANGE \`test_origen\` \`env_type_id\` int NULL`);
|
|
60
|
+
await queryRunner.query(`ALTER TABLE \`collection\` CHANGE \`test_origen\` \`env_type_id\` int NULL`);
|
|
61
|
+
await queryRunner.query(`ALTER TABLE \`connection\` ADD CONSTRAINT \`FK_296e46adf5d1c3ed8b06e2ca034\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
62
|
+
await queryRunner.query(`ALTER TABLE \`product\` ADD CONSTRAINT \`FK_966cc3c7ba601e3c61d21511693\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
63
|
+
await queryRunner.query(`ALTER TABLE \`collection\` ADD CONSTRAINT \`FK_8ff9c88995340f133428155c704\` FOREIGN KEY (\`env_type_id\`) REFERENCES \`env_type\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
@@ -61,6 +61,7 @@ import Translate from '../entity/Translate';
|
|
|
61
61
|
import Connection from '../entity/Connection';
|
|
62
62
|
import ProductCategory from '../entity/ProductCategory';
|
|
63
63
|
import ProductDigital from '../entity/ProductDigital';
|
|
64
|
+
import EnvType from '../entity/EnvType';
|
|
64
65
|
|
|
65
66
|
import {
|
|
66
67
|
CartItemRepository,
|
|
@@ -283,6 +284,9 @@ export class ProductCategoryRepository extends Repository<ProductCategory> {}
|
|
|
283
284
|
@EntityRepository(ProductDigital)
|
|
284
285
|
export class ProductDigitalRepository extends Repository<ProductDigital> {}
|
|
285
286
|
|
|
287
|
+
@EntityRepository(EnvType)
|
|
288
|
+
export class EnvTypeRepository extends Repository<EnvType> {}
|
|
289
|
+
|
|
286
290
|
export {
|
|
287
291
|
CartItemRepository,
|
|
288
292
|
CartRepository,
|