finamaze_schema 1.29.0 → 1.31.0

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.
Files changed (45) hide show
  1. package/dist/entity/manager.entity.js +1 -1
  2. package/dist/entity/manager.entity.js.map +1 -1
  3. package/dist/entity/user.entity.d.ts +11 -16
  4. package/dist/entity/user.entity.js +20 -42
  5. package/dist/entity/user.entity.js.map +1 -1
  6. package/dist/index.d.ts +0 -3
  7. package/dist/index.js +0 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/migrations/{1727451705010-goalpla.d.ts → 1733323133759-v1.d.ts} +1 -1
  10. package/dist/migrations/1733323133759-v1.js +38 -0
  11. package/dist/migrations/1733323133759-v1.js.map +1 -0
  12. package/dist/migrations/{1727449258977-goalpla.d.ts → 1733996187627-removeUniqueValue.d.ts} +1 -1
  13. package/dist/migrations/1733996187627-removeUniqueValue.js +18 -0
  14. package/dist/migrations/1733996187627-removeUniqueValue.js.map +1 -0
  15. package/dist/migrations/{1727446645786-goalpla.d.ts → 1734104865215-v2.d.ts} +1 -1
  16. package/dist/migrations/1734104865215-v2.js +26 -0
  17. package/dist/migrations/1734104865215-v2.js.map +1 -0
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +3 -2
  20. package/src/entity/manager.entity.ts +53 -48
  21. package/src/entity/user.entity.ts +47 -56
  22. package/src/index.ts +0 -3
  23. package/src/migrations/1733323133759-v1.ts +37 -0
  24. package/src/migrations/1734104865215-v2.ts +24 -0
  25. package/dist/entity/email.entity.d.ts +0 -6
  26. package/dist/entity/email.entity.js +0 -33
  27. package/dist/entity/email.entity.js.map +0 -1
  28. package/dist/entity/goal-plan.d.ts +0 -13
  29. package/dist/entity/goal-plan.js +0 -64
  30. package/dist/entity/goal-plan.js.map +0 -1
  31. package/dist/entity/goalPlan.entity.d.ts +0 -13
  32. package/dist/entity/goalPlan.entity.js +0 -64
  33. package/dist/entity/goalPlan.entity.js.map +0 -1
  34. package/dist/migrations/1727446645786-goalpla.js +0 -18
  35. package/dist/migrations/1727446645786-goalpla.js.map +0 -1
  36. package/dist/migrations/1727449258977-goalpla.js +0 -18
  37. package/dist/migrations/1727449258977-goalpla.js.map +0 -1
  38. package/dist/migrations/1727451705010-goalpla.js +0 -18
  39. package/dist/migrations/1727451705010-goalpla.js.map +0 -1
  40. package/dist/migrations/1727456964489-goalpla.d.ts +0 -6
  41. package/dist/migrations/1727456964489-goalpla.js +0 -18
  42. package/dist/migrations/1727456964489-goalpla.js.map +0 -1
  43. package/src/entity/email.entity.ts +0 -14
  44. package/src/entity/goalPlan.entity.ts +0 -38
  45. package/src/entity/phone-number.entity.ts +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finamaze_schema",
3
- "version": "1.29.0",
3
+ "version": "1.31.0",
4
4
  "description": "A package to connect two APIs with a single SQL database using TypeORM",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,8 @@
8
8
  "build": "tsc",
9
9
  "migration:create": "ts-node node_modules/typeorm/cli.js migration:create ./src/migrations/$npm_config_name",
10
10
  "migrate": "ts-node node_modules/typeorm/cli.js migration:run -d ./src/data-source.ts",
11
- "migration:genearate": "ts-node node_modules/typeorm/cli.js migration:generate -d ./src/data-source.ts ./src/migrations/$npm_config_name"
11
+ "migration:genearate": "ts-node node_modules/typeorm/cli.js migration:generate -d ./src/data-source.ts ./src/migrations/$npm_config_name",
12
+ "migration:revert": "ts-node node_modules/typeorm/cli.js migration:revert -d ./src/data-source.ts"
12
13
  },
13
14
  "keywords": [],
14
15
  "author": "",
@@ -1,51 +1,56 @@
1
- import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, Unique } from 'typeorm';
1
+ import {
2
+ Entity,
3
+ Column,
4
+ PrimaryGeneratedColumn,
5
+ CreateDateColumn,
6
+ Unique,
7
+ } from "typeorm";
2
8
 
3
9
  @Entity()
4
- @Unique(['email'])
10
+ @Unique(["email"])
5
11
  export class Manager {
6
- @PrimaryGeneratedColumn()
7
- id: number;
8
-
9
- @Column({ nullable: true })
10
- username: string;
11
-
12
- @Column()
13
- email: string;
14
-
15
- @Column()
16
- password: string;
17
-
18
- @Column({ nullable: true })
19
- first_name: string;
20
-
21
- @Column({ nullable: true })
22
- last_name: string;
23
-
24
- @Column({ nullable: true })
25
- phone_number: string;
26
-
27
- @Column({ nullable: true })
28
- mobile_number: string;
29
-
30
-
31
- @Column({ nullable: true })
32
- department: string;
33
-
34
- @Column({ nullable: true })
35
- sub_department: string;
36
-
37
- @Column({ nullable: true })
38
- title: string;
39
-
40
- @Column()
41
- role: string;
42
-
43
- @Column({ nullable: true })
44
- is_deleted: boolean;
45
-
46
- @CreateDateColumn()
47
- created_at: Date;
48
-
49
- @CreateDateColumn()
50
- updated_at: Date;
51
- }
12
+ @PrimaryGeneratedColumn()
13
+ id: number;
14
+
15
+ @Column({ nullable: true })
16
+ username: string;
17
+
18
+ @Column()
19
+ email: string;
20
+
21
+ @Column()
22
+ password: string;
23
+
24
+ @Column({ nullable: true })
25
+ first_name: string;
26
+
27
+ @Column({ nullable: true })
28
+ last_name: string;
29
+
30
+ @Column({ nullable: true })
31
+ phone_number: string;
32
+
33
+ @Column({ nullable: true })
34
+ mobile_number: string;
35
+
36
+ @Column({ nullable: true })
37
+ department: string;
38
+
39
+ @Column({ nullable: true })
40
+ sub_department: string;
41
+
42
+ @Column({ nullable: true })
43
+ title: string;
44
+
45
+ @Column()
46
+ role: string;
47
+
48
+ @Column({ nullable: true })
49
+ is_deleted: boolean;
50
+
51
+ @CreateDateColumn()
52
+ created_at: Date;
53
+
54
+ @CreateDateColumn()
55
+ updated_at: Date;
56
+ }
@@ -1,74 +1,65 @@
1
- import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, Unique, OneToMany, Index } from 'typeorm';
2
- import { PhoneNumber } from './phone-number.entity';
3
- import { Email } from './email.entity';
4
- import { GoalPlan } from './goalPlan.entity';
1
+ import {
2
+ Entity,
3
+ Column,
4
+ PrimaryGeneratedColumn,
5
+ CreateDateColumn,
6
+ UpdateDateColumn,
7
+ Unique,
8
+ OneToMany,
9
+ Index,
10
+ DeleteDateColumn,
11
+ } from "typeorm";
12
+
13
+ export enum RegistrationStep {
14
+ INITIATED = "INITIATED",
15
+ COMPLETED = "COMPLETED",
16
+ }
5
17
 
6
18
  @Entity()
7
- @Unique(['username'])
19
+ @Unique(["username"])
8
20
  export class User {
9
- @PrimaryGeneratedColumn()
10
- id: number;
11
-
12
- @Column({ nullable: false })
13
- username: string;
14
-
15
- @Column({ nullable: true })
16
- email: string;
17
-
18
- @OneToMany(() => Email, (email) => email.user, { cascade: true })
19
- emails: Email[];
20
-
21
- @Column({ nullable: true })
22
- password: string;
23
-
24
- @Column({ nullable: true })
25
- phone_number: string;
26
-
27
- @OneToMany(() => PhoneNumber, (phoneNumber) => phoneNumber.user, { cascade: true })
28
- phone_numbers: PhoneNumber[];
29
-
30
- @Column({ nullable: true })
31
- iqama_number: string;
21
+ @PrimaryGeneratedColumn()
22
+ id: number;
32
23
 
33
- @Column({ nullable: true })
34
- is_profile_complete: boolean;
24
+ @Column({ nullable: true })
25
+ username: string;
35
26
 
36
- @Column({ nullable: true })
37
- registration_step: string;
27
+ @Column({ nullable: true })
28
+ email: string;
38
29
 
39
- @Column({ nullable: true })
40
- smartcore_reference_id: number;
30
+ @Column({ nullable: true, select: false })
31
+ password: string;
41
32
 
42
- @Column({ nullable: true })
43
- tcs_reference_id: string;
33
+ @Column({ nullable: true })
34
+ phone_number: string;
44
35
 
45
- @Column({ nullable: true })
46
- name: string;
36
+ @Column({ nullable: true })
37
+ national_id: string;
47
38
 
48
- @Column({ nullable: true })
49
- type: string;
39
+ @Column({ default: false })
40
+ smartcore_sync_status: boolean;
50
41
 
51
- @Column({ nullable: true })
52
- status: string;
42
+ @Column({ type: "varchar2", default: RegistrationStep.INITIATED })
43
+ registration_step: RegistrationStep;
53
44
 
54
- @Column({nullable: true })
55
- risk_profile: string;
45
+ @Column({ nullable: true })
46
+ smartcore_reference_id: number;
56
47
 
57
- @Column({default: false})
58
- is_username_set: boolean;
48
+ @Column({ nullable: true })
49
+ cif: string;
59
50
 
51
+ @Column({ nullable: true })
52
+ full_name: string;
60
53
 
61
- @Column({nullable: true })
62
- external_status: string;
54
+ @Column({ type: "clob", nullable: true })
55
+ metadata: string;
63
56
 
64
- // Automatically set on entity creation
65
- @CreateDateColumn()
66
- created_at: Date;
57
+ @CreateDateColumn()
58
+ created_at: Date;
67
59
 
68
- // Automatically updated when entity is updated
69
- @UpdateDateColumn()
70
- updated_at: Date;
60
+ @UpdateDateColumn()
61
+ updated_at: Date;
71
62
 
72
- @OneToMany(() => GoalPlan, (goalPlan) => goalPlan.user, { cascade: true })
73
- goal_plans: GoalPlan[];
63
+ @DeleteDateColumn()
64
+ deleted_at: Date | null;
74
65
  }
package/src/index.ts CHANGED
@@ -8,6 +8,3 @@
8
8
 
9
9
  export * from './entity/user.entity';
10
10
  export * from './entity/manager.entity';
11
- export * from './entity/phone-number.entity';
12
- export * from './entity/email.entity';
13
- export * from './entity/goalPlan.entity';
@@ -0,0 +1,37 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class V11733323133759 implements MigrationInterface {
4
+ name = 'V11733323133759'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "iqama_number" TO "national_id"`);
8
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "is_profile_complete" TO "smartcore_sync_status"`);
9
+ await queryRunner.query(`UPDATE "user" SET "smartcore_sync_status" = 0 WHERE "smartcore_sync_status" IS NULL`);
10
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "smartcore_sync_status" DEFAULT 0`);
11
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "smartcore_sync_status" NOT NULL`);
12
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "status"`);
13
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "risk_profile"`);
14
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "is_username_set"`);
15
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "external_status"`);
16
+ await queryRunner.query(`ALTER TABLE "user" ADD "meta_data" clob`);
17
+ await queryRunner.query(`ALTER TABLE "user" ADD "deleted_at" timestamp`);
18
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "username" varchar2(255) NULL`);
19
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "registration_step" varchar2(255) DEFAULT 'INITIATED' NOT NULL`);
20
+ }
21
+
22
+ public async down(queryRunner: QueryRunner): Promise<void> {
23
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "registration_step" varchar2(255) NULL`);
24
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "username" varchar2(255) NOT NULL`);
25
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "deleted_at"`);
26
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "meta_data"`);
27
+ await queryRunner.query(`ALTER TABLE "user" ADD "external_status" varchar2(255) NULL`);
28
+ await queryRunner.query(`ALTER TABLE "user" ADD "is_username_set" number DEFAULT 0 NOT NULL`);
29
+ await queryRunner.query(`ALTER TABLE "user" ADD "risk_profile" varchar2(255) NULL`);
30
+ await queryRunner.query(`ALTER TABLE "user" ADD "status" varchar2(255) NULL`);
31
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "smartcore_sync_status" To "is_profile_complete"`);
32
+ await queryRunner.query(`ALTER TABLE "user" MODIFY "is_profile_complete" NULL`);
33
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "national_id" TO "iqama_number"`);
34
+
35
+ }
36
+
37
+ }
@@ -0,0 +1,24 @@
1
+ import { MigrationInterface, QueryRunner } from "typeorm";
2
+
3
+ export class V21734104865215 implements MigrationInterface {
4
+ name = 'V21734104865215'
5
+
6
+ public async up(queryRunner: QueryRunner): Promise<void> {
7
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "name" TO "full_name"`);
8
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "type"`);
9
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "meta_data" TO "metadata"`);
10
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "tcs_reference_id" TO "cif"`);
11
+ await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "UQ_78a916df40e02a9deb1c4b75edb" UNIQUE ("username")`);
12
+ await queryRunner.query(`DROP TABLE "goal_plan"`);
13
+ await queryRunner.query(`DROP TABLE "phone_number"`);
14
+ await queryRunner.query(`Drop TABLE "email"`);
15
+ }
16
+
17
+ public async down(queryRunner: QueryRunner): Promise<void> {
18
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "cif" TO "tcs_reference_id"`);
19
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "metadata" TO "meta_data"`);
20
+ await queryRunner.query(`ALTER TABLE "user" ADD "type" varchar2(255)`);
21
+ await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "full_name" TO "name"`);
22
+ }
23
+
24
+ }
@@ -1,6 +0,0 @@
1
- import { User } from './user.entity';
2
- export declare class Email {
3
- id: number;
4
- address: string;
5
- user: User;
6
- }
@@ -1,33 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Email = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const user_entity_1 = require("./user.entity");
15
- let Email = class Email {
16
- };
17
- exports.Email = Email;
18
- __decorate([
19
- (0, typeorm_1.PrimaryGeneratedColumn)(),
20
- __metadata("design:type", Number)
21
- ], Email.prototype, "id", void 0);
22
- __decorate([
23
- (0, typeorm_1.Column)({ nullable: false }),
24
- __metadata("design:type", String)
25
- ], Email.prototype, "address", void 0);
26
- __decorate([
27
- (0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.emails, { nullable: false }),
28
- __metadata("design:type", user_entity_1.User)
29
- ], Email.prototype, "user", void 0);
30
- exports.Email = Email = __decorate([
31
- (0, typeorm_1.Entity)()
32
- ], Email);
33
- //# sourceMappingURL=email.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"email.entity.js","sourceRoot":"","sources":["../../src/entity/email.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4E;AAC5E,+CAAqC;AAG9B,IAAM,KAAK,GAAX,MAAM,KAAK;CASjB,CAAA;AATY,sBAAK;AAEhB;IADC,IAAA,gCAAsB,GAAE;;iCACd;AAGX;IADC,IAAA,gBAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;sCACb;AAGhB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAC5D,kBAAI;mCAAC;gBARA,KAAK;IADjB,IAAA,gBAAM,GAAE;GACI,KAAK,CASjB"}
@@ -1,13 +0,0 @@
1
- import { User } from './user.entity';
2
- export declare class GoalPlan {
3
- id: number;
4
- objective: string;
5
- currency: string;
6
- initial_amount: number;
7
- target_amount: number;
8
- contribution_amount: number;
9
- contribution_frequency: string;
10
- start_date: Date;
11
- investment_duration: number;
12
- user: User;
13
- }
@@ -1,64 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GoalPlan = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const user_entity_1 = require("./user.entity");
15
- let GoalPlan = class GoalPlan {
16
- };
17
- exports.GoalPlan = GoalPlan;
18
- __decorate([
19
- (0, typeorm_1.PrimaryGeneratedColumn)(),
20
- __metadata("design:type", Number)
21
- ], GoalPlan.prototype, "id", void 0);
22
- __decorate([
23
- (0, typeorm_1.Column)(),
24
- __metadata("design:type", String)
25
- ], GoalPlan.prototype, "objective", void 0);
26
- __decorate([
27
- (0, typeorm_1.Column)({
28
- type: 'enum',
29
- enum: ['USD', 'SAR']
30
- }),
31
- __metadata("design:type", String)
32
- ], GoalPlan.prototype, "currency", void 0);
33
- __decorate([
34
- (0, typeorm_1.Column)({ nullable: true }),
35
- __metadata("design:type", Number)
36
- ], GoalPlan.prototype, "initial_amount", void 0);
37
- __decorate([
38
- (0, typeorm_1.Column)({ nullable: true }),
39
- __metadata("design:type", Number)
40
- ], GoalPlan.prototype, "target_amount", void 0);
41
- __decorate([
42
- (0, typeorm_1.Column)({ nullable: true }),
43
- __metadata("design:type", Number)
44
- ], GoalPlan.prototype, "contribution_amount", void 0);
45
- __decorate([
46
- (0, typeorm_1.Column)(),
47
- __metadata("design:type", String)
48
- ], GoalPlan.prototype, "contribution_frequency", void 0);
49
- __decorate([
50
- (0, typeorm_1.Column)(),
51
- __metadata("design:type", Date)
52
- ], GoalPlan.prototype, "start_date", void 0);
53
- __decorate([
54
- (0, typeorm_1.Column)({ nullable: true }),
55
- __metadata("design:type", Number)
56
- ], GoalPlan.prototype, "investment_duration", void 0);
57
- __decorate([
58
- (0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.goal_plans, { nullable: false }),
59
- __metadata("design:type", user_entity_1.User)
60
- ], GoalPlan.prototype, "user", void 0);
61
- exports.GoalPlan = GoalPlan = __decorate([
62
- (0, typeorm_1.Entity)('goalPlan')
63
- ], GoalPlan);
64
- //# sourceMappingURL=goal-plan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goal-plan.js","sourceRoot":"","sources":["../../src/entity/goal-plan.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2E;AAC3E,+CAAqC;AAG9B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAiCpB,CAAA;AAjCY,4BAAQ;AAEnB;IADC,IAAA,gCAAsB,GAAE;;oCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;2CACS;AAMlB;IAJC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;KACrB,CAAC;;0CACe;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;gDACF;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;+CACH;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;qDACG;AAG5B;IADC,IAAA,gBAAM,GAAE;;wDACsB;AAG/B;IADC,IAAA,gBAAM,GAAE;8BACG,IAAI;4CAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;qDACG;AAG5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAChE,kBAAI;sCAAC;mBAhCA,QAAQ;IADpB,IAAA,gBAAM,EAAC,UAAU,CAAC;GACN,QAAQ,CAiCpB"}
@@ -1,13 +0,0 @@
1
- import { User } from './user.entity';
2
- export declare class GoalPlan {
3
- id: number;
4
- objective: string;
5
- currency: 'USD' | 'SAR';
6
- initial_amount: number;
7
- target_amount: number;
8
- contribution_amount: number;
9
- contribution_frequency: string;
10
- start_date: string;
11
- investment_duration: number;
12
- user: User;
13
- }
@@ -1,64 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GoalPlan = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const user_entity_1 = require("./user.entity");
15
- let GoalPlan = class GoalPlan {
16
- };
17
- exports.GoalPlan = GoalPlan;
18
- __decorate([
19
- (0, typeorm_1.PrimaryGeneratedColumn)(),
20
- __metadata("design:type", Number)
21
- ], GoalPlan.prototype, "id", void 0);
22
- __decorate([
23
- (0, typeorm_1.Column)(),
24
- __metadata("design:type", String)
25
- ], GoalPlan.prototype, "objective", void 0);
26
- __decorate([
27
- (0, typeorm_1.Column)({
28
- type: 'varchar',
29
- length: 3,
30
- }),
31
- __metadata("design:type", String)
32
- ], GoalPlan.prototype, "currency", void 0);
33
- __decorate([
34
- (0, typeorm_1.Column)({ nullable: true }),
35
- __metadata("design:type", Number)
36
- ], GoalPlan.prototype, "initial_amount", void 0);
37
- __decorate([
38
- (0, typeorm_1.Column)({ nullable: true }),
39
- __metadata("design:type", Number)
40
- ], GoalPlan.prototype, "target_amount", void 0);
41
- __decorate([
42
- (0, typeorm_1.Column)({ nullable: true }),
43
- __metadata("design:type", Number)
44
- ], GoalPlan.prototype, "contribution_amount", void 0);
45
- __decorate([
46
- (0, typeorm_1.Column)(),
47
- __metadata("design:type", String)
48
- ], GoalPlan.prototype, "contribution_frequency", void 0);
49
- __decorate([
50
- (0, typeorm_1.Column)(),
51
- __metadata("design:type", String)
52
- ], GoalPlan.prototype, "start_date", void 0);
53
- __decorate([
54
- (0, typeorm_1.Column)({ nullable: true }),
55
- __metadata("design:type", Number)
56
- ], GoalPlan.prototype, "investment_duration", void 0);
57
- __decorate([
58
- (0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.goal_plans, { nullable: false }),
59
- __metadata("design:type", user_entity_1.User)
60
- ], GoalPlan.prototype, "user", void 0);
61
- exports.GoalPlan = GoalPlan = __decorate([
62
- (0, typeorm_1.Entity)()
63
- ], GoalPlan);
64
- //# sourceMappingURL=goalPlan.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goalPlan.entity.js","sourceRoot":"","sources":["../../src/entity/goalPlan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA2E;AAC3E,+CAAqC;AAG9B,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAiCpB,CAAA;AAjCY,4BAAQ;AAEnB;IADC,IAAA,gCAAsB,GAAE;;oCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;2CACS;AAMlB;IAJC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC;KACV,CAAC;;0CACsB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;gDACF;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;+CACH;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;qDACG;AAG5B;IADC,IAAA,gBAAM,GAAE;;wDACsB;AAG/B;IADC,IAAA,gBAAM,GAAE;;4CACU;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;qDACG;AAG5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;8BAChE,kBAAI;sCAAC;mBAhCA,QAAQ;IADpB,IAAA,gBAAM,GAAE;GACI,QAAQ,CAiCpB"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Goalpla1727446645786 = void 0;
4
- class Goalpla1727446645786 {
5
- constructor() {
6
- this.name = 'Goalpla1727446645786';
7
- }
8
- async up(queryRunner) {
9
- await queryRunner.query(`CREATE TABLE "goal_plan" ("id" number GENERATED BY DEFAULT AS IDENTITY, "objective" varchar2(255) NOT NULL, "currency" varchar2(3) NOT NULL, "initial_amount" number, "target_amount" number, "contribution_amount" number, "contribution_frequency" varchar2(255) NOT NULL, "start_date" timestamp NOT NULL, "investment_duration" number, "userId" number NOT NULL, CONSTRAINT "PK_02a5c53bc719b6694de4bbbe530" PRIMARY KEY ("id"))`);
10
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
11
- }
12
- async down(queryRunner) {
13
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37"`);
14
- await queryRunner.query(`DROP TABLE "goal_plan"`);
15
- }
16
- }
17
- exports.Goalpla1727446645786 = Goalpla1727446645786;
18
- //# sourceMappingURL=1727446645786-goalpla.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1727446645786-goalpla.js","sourceRoot":"","sources":["../../src/migrations/1727446645786-goalpla.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACI,SAAI,GAAG,sBAAsB,CAAA;IAYjC,CAAC;IAVU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,uaAAua,CAAC,CAAC;QACjc,MAAM,WAAW,CAAC,KAAK,CAAC,yHAAyH,CAAC,CAAC;IACvJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QACpG,MAAM,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACtD,CAAC;CAEJ;AAbD,oDAaC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Goalpla1727449258977 = void 0;
4
- class Goalpla1727449258977 {
5
- constructor() {
6
- this.name = 'Goalpla1727449258977';
7
- }
8
- async up(queryRunner) {
9
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP COLUMN "contribution_frequency"`);
10
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD "contribution_frequency" number NOT NULL`);
11
- }
12
- async down(queryRunner) {
13
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP COLUMN "contribution_frequency"`);
14
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD "contribution_frequency" varchar2(255) NOT NULL`);
15
- }
16
- }
17
- exports.Goalpla1727449258977 = Goalpla1727449258977;
18
- //# sourceMappingURL=1727449258977-goalpla.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1727449258977-goalpla.js","sourceRoot":"","sources":["../../src/migrations/1727449258977-goalpla.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACI,SAAI,GAAG,sBAAsB,CAAA;IAYjC,CAAC;IAVU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;QACxF,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;IACpG,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;QACxF,MAAM,WAAW,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;IAC3G,CAAC;CAEJ;AAbD,oDAaC"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Goalpla1727451705010 = void 0;
4
- class Goalpla1727451705010 {
5
- constructor() {
6
- this.name = 'Goalpla1727451705010';
7
- }
8
- async up(queryRunner) {
9
- await queryRunner.query(`CREATE TABLE "goal_plan" ("id" number GENERATED BY DEFAULT AS IDENTITY, "objective" varchar2(255) NOT NULL, "currency" varchar2(3) NOT NULL, "initial_amount" number, "target_amount" number, "contribution_amount" number, "contribution_frequency" varchar2(255) NOT NULL, "start_date" timestamp NOT NULL, "investment_duration" number, "userId" number NOT NULL, CONSTRAINT "PK_02a5c53bc719b6694de4bbbe530" PRIMARY KEY ("id"))`);
10
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37" FOREIGN KEY ("userId") REFERENCES "user" ("id")`);
11
- }
12
- async down(queryRunner) {
13
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP CONSTRAINT "FK_5d42c50d3e7132a7839cdfdff37"`);
14
- await queryRunner.query(`DROP TABLE "goal_plan"`);
15
- }
16
- }
17
- exports.Goalpla1727451705010 = Goalpla1727451705010;
18
- //# sourceMappingURL=1727451705010-goalpla.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1727451705010-goalpla.js","sourceRoot":"","sources":["../../src/migrations/1727451705010-goalpla.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACI,SAAI,GAAG,sBAAsB,CAAA;IAYjC,CAAC;IAVU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,uaAAua,CAAC,CAAC;QACjc,MAAM,WAAW,CAAC,KAAK,CAAC,yHAAyH,CAAC,CAAC;IACvJ,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QACpG,MAAM,WAAW,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACtD,CAAC;CAEJ;AAbD,oDAaC"}
@@ -1,6 +0,0 @@
1
- import { MigrationInterface, QueryRunner } from "typeorm";
2
- export declare class Goalpla1727456964489 implements MigrationInterface {
3
- name: string;
4
- up(queryRunner: QueryRunner): Promise<void>;
5
- down(queryRunner: QueryRunner): Promise<void>;
6
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Goalpla1727456964489 = void 0;
4
- class Goalpla1727456964489 {
5
- constructor() {
6
- this.name = 'Goalpla1727456964489';
7
- }
8
- async up(queryRunner) {
9
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP COLUMN "start_date"`);
10
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD "start_date" varchar2(255) NOT NULL`);
11
- }
12
- async down(queryRunner) {
13
- await queryRunner.query(`ALTER TABLE "goal_plan" DROP COLUMN "start_date"`);
14
- await queryRunner.query(`ALTER TABLE "goal_plan" ADD "start_date" timestamp NOT NULL`);
15
- }
16
- }
17
- exports.Goalpla1727456964489 = Goalpla1727456964489;
18
- //# sourceMappingURL=1727456964489-goalpla.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1727456964489-goalpla.js","sourceRoot":"","sources":["../../src/migrations/1727456964489-goalpla.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACI,SAAI,GAAG,sBAAsB,CAAA;IAYjC,CAAC;IAVU,KAAK,CAAC,EAAE,CAAC,WAAwB;QACpC,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAC5E,MAAM,WAAW,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;IAC/F,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAC5E,MAAM,WAAW,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;IAC3F,CAAC;CAEJ;AAbD,oDAaC"}
@@ -1,14 +0,0 @@
1
- import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
2
- import { User } from './user.entity';
3
-
4
- @Entity()
5
- export class Email {
6
- @PrimaryGeneratedColumn()
7
- id: number;
8
-
9
- @Column( { nullable: false })
10
- address: string;
11
-
12
- @ManyToOne(() => User, (user) => user.emails, { nullable: false })
13
- user: User;
14
- }