@reachu/database 1.0.116 → 1.0.118

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.
@@ -1,11 +1,26 @@
1
1
  import AuditedModel from './AuditedModel';
2
2
  import { Product } from './Product.entity';
3
+ import { Price } from './Price.entity';
4
+ export declare enum _type {
5
+ downloadable = 1,
6
+ sample = 2,
7
+ link = 3
8
+ }
9
+ export declare enum _shareable {
10
+ yes = 1,
11
+ no = 2,
12
+ useConfig = 3
13
+ }
3
14
  export default class ProductDigital extends AuditedModel {
4
15
  id: number;
5
16
  deletedAt: Date;
6
17
  file_url: string;
7
18
  file_size: number;
19
+ shareable: _shareable | null;
20
+ type: _type | null;
21
+ price: Price;
8
22
  donwload_limit: number;
9
23
  expiration_date: Date;
10
24
  product: Product;
25
+ name: string;
11
26
  }
@@ -12,9 +12,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports._shareable = exports._type = void 0;
15
16
  const typeorm_1 = require("typeorm");
16
17
  const AuditedModel_1 = __importDefault(require("./AuditedModel"));
17
18
  const Product_entity_1 = require("./Product.entity");
19
+ const Price_entity_1 = require("./Price.entity");
20
+ var _type;
21
+ (function (_type) {
22
+ _type[_type["downloadable"] = 1] = "downloadable";
23
+ _type[_type["sample"] = 2] = "sample";
24
+ _type[_type["link"] = 3] = "link";
25
+ })(_type = exports._type || (exports._type = {}));
26
+ var _shareable;
27
+ (function (_shareable) {
28
+ _shareable[_shareable["yes"] = 1] = "yes";
29
+ _shareable[_shareable["no"] = 2] = "no";
30
+ _shareable[_shareable["useConfig"] = 3] = "useConfig";
31
+ })(_shareable = exports._shareable || (exports._shareable = {}));
18
32
  let ProductDigital = class ProductDigital extends AuditedModel_1.default {
19
33
  };
20
34
  __decorate([
@@ -33,6 +47,18 @@ __decorate([
33
47
  typeorm_1.Column('integer', { nullable: true }),
34
48
  __metadata("design:type", Number)
35
49
  ], ProductDigital.prototype, "file_size", void 0);
50
+ __decorate([
51
+ typeorm_1.Column('integer', { nullable: true }),
52
+ __metadata("design:type", Number)
53
+ ], ProductDigital.prototype, "shareable", void 0);
54
+ __decorate([
55
+ typeorm_1.Column('integer', { nullable: true }),
56
+ __metadata("design:type", Number)
57
+ ], ProductDigital.prototype, "type", void 0);
58
+ __decorate([
59
+ typeorm_1.Column(() => Price_entity_1.Price, { prefix: 'price_' }),
60
+ __metadata("design:type", Price_entity_1.Price)
61
+ ], ProductDigital.prototype, "price", void 0);
36
62
  __decorate([
37
63
  typeorm_1.Column('integer', { nullable: true }),
38
64
  __metadata("design:type", Number)
@@ -48,6 +74,10 @@ __decorate([
48
74
  typeorm_1.JoinColumn(),
49
75
  __metadata("design:type", Product_entity_1.Product)
50
76
  ], ProductDigital.prototype, "product", void 0);
77
+ __decorate([
78
+ typeorm_1.Column('text', { nullable: false }),
79
+ __metadata("design:type", String)
80
+ ], ProductDigital.prototype, "name", void 0);
51
81
  ProductDigital = __decorate([
52
82
  typeorm_1.Entity()
53
83
  ], ProductDigital);
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDigital.js","sourceRoot":"","sources":["../../src/entity/ProductDigital.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAOiB;AACjB,kEAA0C;AAC1C,qDAA2C;AAG3C,IAAqB,cAAc,GAAnC,MAAqB,cAAe,SAAQ,sBAAY;CAwBvD,CAAA;AAtBC;IADC,gCAAsB,EAAE;;0CACd;AAGX;IADC,0BAAgB,EAAE;8BACR,IAAI;iDAAC;AAGhB;IADC,gBAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACnB;AAGjB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGlB;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAA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B;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACnB;AAGnB;IADC,gBAAM,CAAC,GAAG,EAAE,CAAC,oBAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;8BACnC,oBAAK;6CAAC;AAGb;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACf;AAGvB;IADC,gBAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACtB,IAAI;uDAAC;AAMtB;IAJC,mBAAS,CAAC,GAAG,EAAE,CAAC,wBAAO,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;QAC1D,KAAK,EAAE,KAAK;KACb,CAAC;IACD,oBAAU,EAAE;8BACJ,wBAAO;+CAAC;AAGjB;IADC,gBAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4CACvB;AAnCM,cAAc;IADlC,gBAAM,EAAE;GACY,cAAc,CAoClC;kBApCoB,cAAc"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+ export declare class digitalProductV21695907880854 implements MigrationInterface {
3
+ name: string;
4
+ up(queryRunner: QueryRunner): Promise<void>;
5
+ down(queryRunner: QueryRunner): Promise<void>;
6
+ }
@@ -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.digitalProductV21695907880854 = void 0;
13
+ class digitalProductV21695907880854 {
14
+ constructor() {
15
+ this.name = 'digitalProductV21695907880854';
16
+ }
17
+ up(queryRunner) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`name\` text NOT NULL`);
20
+ });
21
+ }
22
+ down(queryRunner) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ yield queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`name\``);
25
+ });
26
+ }
27
+ }
28
+ exports.digitalProductV21695907880854 = digitalProductV21695907880854;
29
+ //# sourceMappingURL=1695907880854-digital-product-v-2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1695907880854-digital-product-v-2.js","sourceRoot":"","sources":["../../src/migrations/1695907880854-digital-product-v-2.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,6BAA6B;IAA1C;QACI,SAAI,GAAG,+BAA+B,CAAA;IAU1C,CAAC;IARgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAC1F,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACpF,CAAC;KAAA;CAEJ;AAXD,sEAWC"}
@@ -2652,8 +2652,8 @@
2652
2652
  "affectsGlobalScope": false
2653
2653
  },
2654
2654
  "../src/entity/productdigital.ts": {
2655
- "version": "1a8d6b2e87063af60aa677c93941c9dd4ccf8269e6e2305a1a5649fa832629f3",
2656
- "signature": "e78c087f1f5dd26086ad14cdea5baa5c91fdbb99215315d1e3b2443b214b1027",
2655
+ "version": "816cfe054dcc5d48de7fab883ccdeb14e80c1c3f146842ad377d615a9fb6bd1b",
2656
+ "signature": "5cae1b468d208a1dcb2f9372f04b11b7036ec008497e8bfba1aa24bbe0555a0b",
2657
2657
  "affectsGlobalScope": false
2658
2658
  },
2659
2659
  "../src/entity/modules/templates/endpointtemplateecommerce.ts": {
@@ -3531,6 +3531,11 @@
3531
3531
  "signature": "e659d5a979a00a9e06f84e8a49e3e1ee0209081584e3fc61e661be0010c55514",
3532
3532
  "affectsGlobalScope": false
3533
3533
  },
3534
+ "../src/migrations/1695907880854-digital-product-v-2.ts": {
3535
+ "version": "a6d812720d8d08a2fa6806d7c7f70eeaf118983bd6962844ef8b3c1999518a54",
3536
+ "signature": "a44b995de12ecde750895d72b61706ba5c063712ea3d2f505597b008f04b92dc",
3537
+ "affectsGlobalScope": false
3538
+ },
3534
3539
  "../src/migrations/execute/index.ts": {
3535
3540
  "version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
3536
3541
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -6054,6 +6059,7 @@
6054
6059
  "../src/entity/productdigital.ts": [
6055
6060
  "../node_modules/typeorm/index.d.ts",
6056
6061
  "../src/entity/auditedmodel.ts",
6062
+ "../src/entity/price.entity.ts",
6057
6063
  "../src/entity/product.entity.ts"
6058
6064
  ],
6059
6065
  "../src/entity/request.ts": [
@@ -6550,6 +6556,9 @@
6550
6556
  "../src/migrations/1695658039275-digital-product-v-1.ts": [
6551
6557
  "../node_modules/typeorm/index.d.ts"
6552
6558
  ],
6559
+ "../src/migrations/1695907880854-digital-product-v-2.ts": [
6560
+ "../node_modules/typeorm/index.d.ts"
6561
+ ],
6553
6562
  "../src/migrations/execute/index.ts": [
6554
6563
  "../src/config/connect.ts"
6555
6564
  ],
@@ -8971,6 +8980,7 @@
8971
8980
  ],
8972
8981
  "../src/entity/productdigital.ts": [
8973
8982
  "../src/entity/auditedmodel.ts",
8983
+ "../src/entity/price.entity.ts",
8974
8984
  "../src/entity/product.entity.ts"
8975
8985
  ],
8976
8986
  "../src/entity/request.ts": [
@@ -9424,6 +9434,9 @@
9424
9434
  "../src/migrations/1695658039275-digital-product-v-1.ts": [
9425
9435
  "../node_modules/typeorm/index.d.ts"
9426
9436
  ],
9437
+ "../src/migrations/1695907880854-digital-product-v-2.ts": [
9438
+ "../node_modules/typeorm/index.d.ts"
9439
+ ],
9427
9440
  "../src/migrations/index.ts": [
9428
9441
  "../src/migrations/1628474597284-initialschema.ts",
9429
9442
  "../src/migrations/1630077596132-removemangopay.ts",
@@ -10288,6 +10301,7 @@
10288
10301
  "../src/migrations/1695122269023-imported_magento.ts",
10289
10302
  "../src/migrations/1695123846329-imported_magento_1.ts",
10290
10303
  "../src/migrations/1695658039275-digital-product-v-1.ts",
10304
+ "../src/migrations/1695907880854-digital-product-v-2.ts",
10291
10305
  "../src/migrations/execute/index.ts",
10292
10306
  "../src/migrations/index.ts",
10293
10307
  "../src/repositories/discount/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reachu/database",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
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.116",
25
- "@reachu/utils": "1.0.116",
24
+ "@reachu/logger": "1.0.118",
25
+ "@reachu/utils": "1.0.118",
26
26
  "dotenv": "8.0.0",
27
27
  "express": "4.17.1",
28
28
  "mysql2": "1.5.2",
@@ -8,6 +8,19 @@ import {
8
8
  } from 'typeorm';
9
9
  import AuditedModel from './AuditedModel';
10
10
  import { Product } from './Product.entity';
11
+ import { Price } from './Price.entity';
12
+
13
+ export enum _type {
14
+ downloadable = 1,
15
+ sample = 2,
16
+ link = 3,
17
+ }
18
+
19
+ export enum _shareable {
20
+ yes = 1,
21
+ no = 2,
22
+ useConfig = 3,
23
+ }
11
24
 
12
25
  @Entity()
13
26
  export default class ProductDigital extends AuditedModel {
@@ -23,6 +36,15 @@ export default class ProductDigital extends AuditedModel {
23
36
  @Column('integer', { nullable: true })
24
37
  file_size: number;
25
38
 
39
+ @Column('integer', { nullable: true })
40
+ shareable: _shareable | null;
41
+
42
+ @Column('integer', { nullable: true })
43
+ type: _type | null;
44
+
45
+ @Column(() => Price, { prefix: 'price_' })
46
+ price: Price;
47
+
26
48
  @Column('integer', { nullable: true })
27
49
  donwload_limit: number;
28
50
 
@@ -34,4 +56,7 @@ export default class ProductDigital extends AuditedModel {
34
56
  })
35
57
  @JoinColumn()
36
58
  product: Product;
59
+
60
+ @Column('text', { nullable: false })
61
+ name: string;
37
62
  }
@@ -0,0 +1,14 @@
1
+ import {MigrationInterface, QueryRunner} from "typeorm";
2
+
3
+ export class digitalProductV21695907880854 implements MigrationInterface {
4
+ name = 'digitalProductV21695907880854'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE \`product_digital\` ADD \`name\` text NOT NULL`);
8
+ }
9
+
10
+ public async down(queryRunner: QueryRunner): Promise<void> {
11
+ await queryRunner.query(`ALTER TABLE \`product_digital\` DROP COLUMN \`name\``);
12
+ }
13
+
14
+ }