@reachu/database 1.0.201 → 1.0.203

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.
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class promoteToProd1010231728584044370 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -0,0 +1,35 @@
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.promoteToProd1010231728584044370 = void 0;
13
+ class promoteToProd1010231728584044370 {
14
+ constructor() {
15
+ this.name = 'promoteToProd1010231728584044370';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`CREATE TABLE \`channel_user_products\` (\`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, \`title\` varchar(255) NULL, \`description\` text NULL, \`public_price\` decimal(10,2) NULL, \`referral_fee\` int NOT NULL DEFAULT '10', \`tags\` varchar(255) NULL DEFAULT '', \`sku\` varchar(255) NULL, \`barcode\` varchar(255) NULL, \`quantity\` int NULL, \`options_enabled\` tinyint NOT NULL DEFAULT 0, \`digital\` tinyint NOT NULL DEFAULT 0, \`origin\` varchar(255) NULL, \`brand\` varchar(255) NULL, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`collection_id\` varchar(10) NULL, \`price_amount\` decimal(10,2) NULL, \`price_currency_code\` varchar(255) NULL, \`price_base_amount\` decimal(10,2) NULL, \`price_compare_at\` decimal(10,2) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
20
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_635d9f7bf7582fca6e2b961bdbe\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
21
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_ef37d3e38597aa6352c51ca2d57\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
22
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_6a15e1ba4f071b0fa85f8188756\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
23
+ });
24
+ }
25
+ down(queryRunner) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_6a15e1ba4f071b0fa85f8188756\``);
28
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_ef37d3e38597aa6352c51ca2d57\``);
29
+ yield queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_635d9f7bf7582fca6e2b961bdbe\``);
30
+ yield queryRunner.query(`DROP TABLE \`channel_user_products\``);
31
+ });
32
+ }
33
+ }
34
+ exports.promoteToProd1010231728584044370 = promoteToProd1010231728584044370;
35
+ //# sourceMappingURL=1728584044370-promote_to_prod_10_10_23.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1728584044370-promote_to_prod_10_10_23.js","sourceRoot":"","sources":["../../src/migrations/1728584044370-promote_to_prod_10_10_23.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,gCAAgC;IAA7C;QACI,SAAI,GAAG,kCAAkC,CAAA;IAgB7C,CAAC;IAdgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,u8BAAu8B,CAAC,CAAC;YACj+B,MAAM,WAAW,CAAC,KAAK,CAAC,qMAAqM,CAAC,CAAC;YAC/N,MAAM,WAAW,CAAC,KAAK,CAAC,2LAA2L,CAAC,CAAC;YACrN,MAAM,WAAW,CAAC,KAAK,CAAC,iMAAiM,CAAC,CAAC;QAC/N,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAC;YACrH,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAC;YACrH,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAC;YACrH,MAAM,WAAW,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACpE,CAAC;KAAA;CAEJ;AAjBD,4EAiBC"}
@@ -3,7 +3,8 @@ declare enum Currency {
3
3
  NOK = "NOK",
4
4
  USD = "USD",
5
5
  GBP = "GBP",
6
- ARS = "ARS"
6
+ ARS = "ARS",
7
+ CAD = "CAD"
7
8
  }
8
9
  export declare const currencies: Currency[];
9
10
  export default Currency;
@@ -8,7 +8,8 @@ var Currency;
8
8
  Currency["USD"] = "USD";
9
9
  Currency["GBP"] = "GBP";
10
10
  Currency["ARS"] = "ARS";
11
+ Currency["CAD"] = "CAD";
11
12
  })(Currency || (Currency = {}));
12
- exports.currencies = [Currency.EUR, Currency.NOK, Currency.USD, Currency.GBP];
13
+ exports.currencies = [Currency.EUR, Currency.NOK, Currency.USD, Currency.GBP, Currency.CAD];
13
14
  exports.default = Currency;
14
15
  //# sourceMappingURL=Currency.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/staticData/Currency.ts"],"names":[],"mappings":";;;AAAA,IAAK,QAMJ;AAND,WAAK,QAAQ;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACb,CAAC,EANI,QAAQ,KAAR,QAAQ,QAMZ;AAEY,QAAA,UAAU,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAEnF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/staticData/Currency.ts"],"names":[],"mappings":";;;AAAA,IAAK,QAOJ;AAPD,WAAK,QAAQ;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACb,CAAC,EAPI,QAAQ,KAAR,QAAQ,QAOZ;AAEY,QAAA,UAAU,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAEjG,kBAAe,QAAQ,CAAC"}
@@ -2437,8 +2437,8 @@
2437
2437
  "affectsGlobalScope": false
2438
2438
  },
2439
2439
  "../src/staticdata/currency.ts": {
2440
- "version": "5faa7445e0d0401dd506f690d0ebe1f4be774fa070cfa8de1097e596184d5114",
2441
- "signature": "c340562159e3e2b5fbe2f073867a3dfde1d8c2cbe81327d4746b323aa2eb2b83",
2440
+ "version": "7ff2f7b908b2c5f3c9dd0e50b6e70c5a385cf5a6bda8d6bb0a446a20129525c9",
2441
+ "signature": "15160cb3a2539b94c529b65fc37e1927f4064b3d711a7f06291a11b1a26c5972",
2442
2442
  "affectsGlobalScope": false
2443
2443
  },
2444
2444
  "../src/entity/price.entity.ts": {
@@ -3861,6 +3861,11 @@
3861
3861
  "signature": "87a807cb93e5ed46e133005eb6e4d0b78aafb6c555283a7864240460c7a9301f",
3862
3862
  "affectsGlobalScope": false
3863
3863
  },
3864
+ "../src/migrations/1728584044370-promote_to_prod_10_10_23.ts": {
3865
+ "version": "370d8c3d13a7d917c4ef01f8efd642f7b14bbec542b4e37e5eb79f7cf5b08a3b",
3866
+ "signature": "230d3d8e2123e37adc33dd54772f795775b58577b54be6ab63e0093c63f8286a",
3867
+ "affectsGlobalScope": false
3868
+ },
3864
3869
  "../src/migrations/execute/index.ts": {
3865
3870
  "version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
3866
3871
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -7101,6 +7106,9 @@
7101
7106
  "../src/migrations/1727969574564-promote_to_qa_03_10_24_v2.ts": [
7102
7107
  "../node_modules/typeorm/index.d.ts"
7103
7108
  ],
7109
+ "../src/migrations/1728584044370-promote_to_prod_10_10_23.ts": [
7110
+ "../node_modules/typeorm/index.d.ts"
7111
+ ],
7104
7112
  "../src/migrations/execute/index.ts": [
7105
7113
  "../src/config/connect.ts"
7106
7114
  ],
@@ -10198,6 +10206,9 @@
10198
10206
  "../src/migrations/1727969574564-promote_to_qa_03_10_24_v2.ts": [
10199
10207
  "../node_modules/typeorm/index.d.ts"
10200
10208
  ],
10209
+ "../src/migrations/1728584044370-promote_to_prod_10_10_23.ts": [
10210
+ "../node_modules/typeorm/index.d.ts"
10211
+ ],
10201
10212
  "../src/migrations/index.ts": [
10202
10213
  "../src/migrations/1628474597284-initialschema.ts",
10203
10214
  "../src/migrations/1630077596132-removemangopay.ts",
@@ -11137,6 +11148,7 @@
11137
11148
  "../src/migrations/1727969140402-promote_to_qa_03_10_24.ts",
11138
11149
  "../src/migrations/1727969488134-channeluserproducts-index-rollback.ts",
11139
11150
  "../src/migrations/1727969574564-promote_to_qa_03_10_24_v2.ts",
11151
+ "../src/migrations/1728584044370-promote_to_prod_10_10_23.ts",
11140
11152
  "../src/migrations/execute/index.ts",
11141
11153
  "../src/migrations/index.ts",
11142
11154
  "../src/repositories/discount/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reachu/database",
3
- "version": "1.0.201",
3
+ "version": "1.0.203",
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.201",
25
- "@reachu/utils": "1.0.201",
24
+ "@reachu/logger": "1.0.203",
25
+ "@reachu/utils": "1.0.203",
26
26
  "dotenv": "8.0.0",
27
27
  "eventemitter2": "^6.4.9",
28
28
  "express": "4.17.1",
@@ -0,0 +1,20 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class promoteToProd1010231728584044370 implements MigrationInterface {
4
+ name = 'promoteToProd1010231728584044370'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`CREATE TABLE \`channel_user_products\` (\`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, \`title\` varchar(255) NULL, \`description\` text NULL, \`public_price\` decimal(10,2) NULL, \`referral_fee\` int NOT NULL DEFAULT '10', \`tags\` varchar(255) NULL DEFAULT '', \`sku\` varchar(255) NULL, \`barcode\` varchar(255) NULL, \`quantity\` int NULL, \`options_enabled\` tinyint NOT NULL DEFAULT 0, \`digital\` tinyint NOT NULL DEFAULT 0, \`origin\` varchar(255) NULL, \`brand\` varchar(255) NULL, \`channel_user_id\` int NULL, \`product_id\` int NULL, \`collection_id\` varchar(10) NULL, \`price_amount\` decimal(10,2) NULL, \`price_currency_code\` varchar(255) NULL, \`price_base_amount\` decimal(10,2) NULL, \`price_compare_at\` decimal(10,2) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
8
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_635d9f7bf7582fca6e2b961bdbe\` FOREIGN KEY (\`channel_user_id\`) REFERENCES \`channel_user\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
9
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_ef37d3e38597aa6352c51ca2d57\` FOREIGN KEY (\`product_id\`) REFERENCES \`product\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
10
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` ADD CONSTRAINT \`FK_6a15e1ba4f071b0fa85f8188756\` FOREIGN KEY (\`collection_id\`) REFERENCES \`collection\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
11
+ }
12
+
13
+ public async down(queryRunner: QueryRunner): Promise<void> {
14
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_6a15e1ba4f071b0fa85f8188756\``);
15
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_ef37d3e38597aa6352c51ca2d57\``);
16
+ await queryRunner.query(`ALTER TABLE \`channel_user_products\` DROP FOREIGN KEY \`FK_635d9f7bf7582fca6e2b961bdbe\``);
17
+ await queryRunner.query(`DROP TABLE \`channel_user_products\``);
18
+ }
19
+
20
+ }
@@ -4,8 +4,9 @@ enum Currency {
4
4
  USD = 'USD',
5
5
  GBP = 'GBP',
6
6
  ARS = 'ARS',
7
+ CAD = 'CAD',
7
8
  }
8
9
 
9
- export const currencies = [Currency.EUR, Currency.NOK, Currency.USD, Currency.GBP];
10
+ export const currencies = [Currency.EUR, Currency.NOK, Currency.USD, Currency.GBP, Currency.CAD];
10
11
 
11
12
  export default Currency;