@reachu/database 1.0.70 → 1.0.71
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/ExternalRequest.d.ts +3 -0
- package/dist/entity/ExternalRequest.js +10 -0
- package/dist/entity/ExternalRequest.js.map +1 -1
- package/dist/migrations/1684452127341-externalRequest_v1.d.ts +6 -0
- package/dist/migrations/1684452127341-externalRequest_v1.js +33 -0
- package/dist/migrations/1684452127341-externalRequest_v1.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +16 -2
- package/package.json +3 -3
- package/src/entity/ExternalRequest.ts +11 -0
- package/src/migrations/1684452127341-externalRequest_v1.ts +18 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import AuditedModel from './AuditedModel';
|
|
2
|
+
import Plan from './modules/subscriptions/Plan';
|
|
2
3
|
import User from './User';
|
|
3
4
|
export default class ExternalRequest extends AuditedModel {
|
|
4
5
|
id: number;
|
|
5
6
|
sender: User;
|
|
7
|
+
plan: Plan;
|
|
6
8
|
receiverEmail: string;
|
|
9
|
+
collection: number;
|
|
7
10
|
url: string;
|
|
8
11
|
state: number;
|
|
9
12
|
}
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const AuditedModel_1 = __importDefault(require("./AuditedModel"));
|
|
17
|
+
const Plan_1 = __importDefault(require("./modules/subscriptions/Plan"));
|
|
17
18
|
const User_1 = __importDefault(require("./User"));
|
|
18
19
|
let ExternalRequest = class ExternalRequest extends AuditedModel_1.default {
|
|
19
20
|
};
|
|
@@ -26,10 +27,19 @@ __decorate([
|
|
|
26
27
|
typeorm_1.JoinColumn(),
|
|
27
28
|
__metadata("design:type", User_1.default)
|
|
28
29
|
], ExternalRequest.prototype, "sender", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
typeorm_1.ManyToOne(() => Plan_1.default, { eager: true, onDelete: 'CASCADE' }),
|
|
32
|
+
typeorm_1.JoinColumn(),
|
|
33
|
+
__metadata("design:type", Plan_1.default)
|
|
34
|
+
], ExternalRequest.prototype, "plan", void 0);
|
|
29
35
|
__decorate([
|
|
30
36
|
typeorm_1.Column('varchar'),
|
|
31
37
|
__metadata("design:type", String)
|
|
32
38
|
], ExternalRequest.prototype, "receiverEmail", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
typeorm_1.Column('integer', { nullable: true, default: 0 }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], ExternalRequest.prototype, "collection", void 0);
|
|
33
43
|
__decorate([
|
|
34
44
|
typeorm_1.Column('varchar'),
|
|
35
45
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalRequest.js","sourceRoot":"","sources":["../../src/entity/ExternalRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kEAA0C;AAC1C,kDAA0B;AAG1B,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;
|
|
1
|
+
{"version":3,"file":"ExternalRequest.js","sourceRoot":"","sources":["../../src/entity/ExternalRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAwF;AACxF,kEAA0C;AAC1C,wEAA+C;AAC/C,kDAA0B;AAG1B,IAAqB,eAAe,GAApC,MAAqB,eAAgB,SAAQ,sBAAY;CA0BxD,CAAA;AAxBC;IADC,gCAAsB,EAAE;;2CACd;AAIX;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,oBAAU,EAAE;8BACL,cAAI;+CAAC;AAIb;IAFC,mBAAS,CAAC,GAAG,EAAE,CAAC,cAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,oBAAU,EAAE;8BACP,cAAI;6CAAC;AAGX;IADC,gBAAM,CAAC,SAAS,CAAC;;sDACI;AAGtB;IADC,gBAAM,CAAC,SAAS,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAC,CAAC;;mDAC5B;AAGnB;IADC,gBAAM,CAAC,SAAS,CAAC;;4CACN;AAMZ;IADC,gBAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACpC;AAzBK,eAAe;IADnC,gBAAM,EAAE;GACY,eAAe,CA0BnC;kBA1BoB,eAAe"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.externalRequestV11684452127341 = void 0;
|
|
13
|
+
class externalRequestV11684452127341 {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.name = 'externalRequestV11684452127341';
|
|
16
|
+
}
|
|
17
|
+
up(queryRunner) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` ADD \`collection\` int NULL DEFAULT '0'`);
|
|
20
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` ADD \`plan_id\` int NULL`);
|
|
21
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_6bba3dfa40a288826cda4ddacc5\` FOREIGN KEY (\`plan_id\`) REFERENCES \`plan\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
down(queryRunner) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_6bba3dfa40a288826cda4ddacc5\``);
|
|
27
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` DROP COLUMN \`plan_id\``);
|
|
28
|
+
yield queryRunner.query(`ALTER TABLE \`external_request\` DROP COLUMN \`collection\``);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.externalRequestV11684452127341 = externalRequestV11684452127341;
|
|
33
|
+
//# sourceMappingURL=1684452127341-externalRequest_v1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1684452127341-externalRequest_v1.js","sourceRoot":"","sources":["../../src/migrations/1684452127341-externalRequest_v1.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,8BAA8B;IAA3C;QACI,SAAI,GAAG,gCAAgC,CAAA;IAc3C,CAAC;IAZgB,EAAE,CAAC,WAAwB;;YACpC,MAAM,WAAW,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;YACpG,MAAM,WAAW,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;YACrF,MAAM,WAAW,CAAC,KAAK,CAAC,gLAAgL,CAAC,CAAC;QAC9M,CAAC;KAAA;IAEY,IAAI,CAAC,WAAwB;;YACtC,MAAM,WAAW,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;YAChH,MAAM,WAAW,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;YACpF,MAAM,WAAW,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAC3F,CAAC;KAAA;CAEJ;AAfD,wEAeC"}
|
|
@@ -2617,8 +2617,8 @@
|
|
|
2617
2617
|
"affectsGlobalScope": false
|
|
2618
2618
|
},
|
|
2619
2619
|
"../src/entity/externalrequest.ts": {
|
|
2620
|
-
"version": "
|
|
2621
|
-
"signature": "
|
|
2620
|
+
"version": "0b9493f093b9f9c0f3461e20fb18855d6b2e19bfc174fd35738b3b3a9b97a821",
|
|
2621
|
+
"signature": "4ff799881b47b74a2d88b12c67727dedd7e5f1a33c1cdf57237b64c588972da8",
|
|
2622
2622
|
"affectsGlobalScope": false
|
|
2623
2623
|
},
|
|
2624
2624
|
"../src/entity/wallet.ts": {
|
|
@@ -3246,6 +3246,11 @@
|
|
|
3246
3246
|
"signature": "efa1b2a3bc304f80a628444319086645d910534bed8b925bb317ebfeb4d0c479",
|
|
3247
3247
|
"affectsGlobalScope": false
|
|
3248
3248
|
},
|
|
3249
|
+
"../src/migrations/1684452127341-externalrequest_v1.ts": {
|
|
3250
|
+
"version": "e39b4bc92c2b6e579224b6df69ae9b5165e3c470fe4298ca569419889aef2a72",
|
|
3251
|
+
"signature": "55d83a9fd40ea572a7e5b735749b66a53d6743e310b062f95a0f428d9992e9fd",
|
|
3252
|
+
"affectsGlobalScope": false
|
|
3253
|
+
},
|
|
3249
3254
|
"../src/migrations/execute/index.ts": {
|
|
3250
3255
|
"version": "8b5bf13d095aeb57afd593adf3d799681176a13c327e2f77e0028e178c4ee3b9",
|
|
3251
3256
|
"signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
|
|
@@ -5338,6 +5343,7 @@
|
|
|
5338
5343
|
"../src/entity/externalrequest.ts": [
|
|
5339
5344
|
"../node_modules/typeorm/index.d.ts",
|
|
5340
5345
|
"../src/entity/auditedmodel.ts",
|
|
5346
|
+
"../src/entity/modules/subscriptions/plan.ts",
|
|
5341
5347
|
"../src/entity/user.ts"
|
|
5342
5348
|
],
|
|
5343
5349
|
"../src/entity/flatrate.ts": [
|
|
@@ -6056,6 +6062,9 @@
|
|
|
6056
6062
|
"../src/migrations/1684451330738-externalrequest.ts": [
|
|
6057
6063
|
"../node_modules/typeorm/index.d.ts"
|
|
6058
6064
|
],
|
|
6065
|
+
"../src/migrations/1684452127341-externalrequest_v1.ts": [
|
|
6066
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6067
|
+
],
|
|
6059
6068
|
"../src/migrations/execute/index.ts": [
|
|
6060
6069
|
"../src/config/connect.ts"
|
|
6061
6070
|
],
|
|
@@ -8102,6 +8111,7 @@
|
|
|
8102
8111
|
],
|
|
8103
8112
|
"../src/entity/externalrequest.ts": [
|
|
8104
8113
|
"../src/entity/auditedmodel.ts",
|
|
8114
|
+
"../src/entity/modules/subscriptions/plan.ts",
|
|
8105
8115
|
"../src/entity/user.ts"
|
|
8106
8116
|
],
|
|
8107
8117
|
"../src/entity/flatrate.ts": [
|
|
@@ -8721,6 +8731,9 @@
|
|
|
8721
8731
|
"../src/migrations/1684451330738-externalrequest.ts": [
|
|
8722
8732
|
"../node_modules/typeorm/index.d.ts"
|
|
8723
8733
|
],
|
|
8734
|
+
"../src/migrations/1684452127341-externalrequest_v1.ts": [
|
|
8735
|
+
"../node_modules/typeorm/index.d.ts"
|
|
8736
|
+
],
|
|
8724
8737
|
"../src/migrations/index.ts": [
|
|
8725
8738
|
"../src/migrations/1628474597284-initialschema.ts",
|
|
8726
8739
|
"../src/migrations/1630077596132-removemangopay.ts",
|
|
@@ -9518,6 +9531,7 @@
|
|
|
9518
9531
|
"../src/migrations/1683908691683-connections-update.ts",
|
|
9519
9532
|
"../src/migrations/1684176902363-connections-update-2.ts",
|
|
9520
9533
|
"../src/migrations/1684451330738-externalrequest.ts",
|
|
9534
|
+
"../src/migrations/1684452127341-externalrequest_v1.ts",
|
|
9521
9535
|
"../src/migrations/execute/index.ts",
|
|
9522
9536
|
"../src/migrations/index.ts",
|
|
9523
9537
|
"../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.71",
|
|
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.71",
|
|
25
|
+
"@reachu/utils": "1.0.71",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Entity, PrimaryGeneratedColumn, Column, JoinColumn, ManyToOne } from 'typeorm';
|
|
2
2
|
import AuditedModel from './AuditedModel';
|
|
3
|
+
import Plan from './modules/subscriptions/Plan'
|
|
3
4
|
import User from './User';
|
|
4
5
|
|
|
5
6
|
@Entity()
|
|
@@ -11,12 +12,22 @@ export default class ExternalRequest extends AuditedModel {
|
|
|
11
12
|
@JoinColumn()
|
|
12
13
|
sender: User;
|
|
13
14
|
|
|
15
|
+
@ManyToOne(() => Plan, { eager: true, onDelete: 'CASCADE' })
|
|
16
|
+
@JoinColumn()
|
|
17
|
+
plan: Plan;
|
|
18
|
+
|
|
14
19
|
@Column('varchar')
|
|
15
20
|
receiverEmail: string;
|
|
16
21
|
|
|
22
|
+
@Column('integer',{nullable: true, default: 0})
|
|
23
|
+
collection: number;
|
|
24
|
+
|
|
17
25
|
@Column('varchar')
|
|
18
26
|
url: string;
|
|
19
27
|
|
|
28
|
+
// 0 pending
|
|
29
|
+
// 1 accepted
|
|
30
|
+
// 2 denied
|
|
20
31
|
@Column('integer', { nullable: true, default: 0 })
|
|
21
32
|
state: number;
|
|
22
33
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {MigrationInterface, QueryRunner} from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class externalRequestV11684452127341 implements MigrationInterface {
|
|
4
|
+
name = 'externalRequestV11684452127341'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` ADD \`collection\` int NULL DEFAULT '0'`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` ADD \`plan_id\` int NULL`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` ADD CONSTRAINT \`FK_6bba3dfa40a288826cda4ddacc5\` FOREIGN KEY (\`plan_id\`) REFERENCES \`plan\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` DROP FOREIGN KEY \`FK_6bba3dfa40a288826cda4ddacc5\``);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` DROP COLUMN \`plan_id\``);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE \`external_request\` DROP COLUMN \`collection\``);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|