@dynamatix/gb-schemas 2.0.4 → 2.0.6

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,13 +1,17 @@
1
+
1
2
  import { LookupEntity } from './lookup.entity';
2
3
  import { JobRunEntity } from './job-run.entity';
3
4
 
4
- export class ApprivoSyncJourneyEntity {
5
+ export class ApprivoSyncJourneyEntity {
5
6
  id!: string;
6
- journeyId!: string;
7
- status!: string;
7
+ applicationId!: string;
8
+ milestoneLid?: string;
9
+ mileStoneStatus!: 'Completed' | 'Errored' | 'Not Applicable';
8
10
  error?: string;
9
- startedAt!: Date;
10
- completedAt?: Date;
11
+ isFirstPull!: boolean;
12
+ jobRunId?: string;
13
+ startTime?: Date;
14
+ endTime?: Date;
11
15
  createdAt!: Date;
12
16
  updatedAt!: Date;
13
17
 
@@ -0,0 +1,13 @@
1
+ export interface ApprivoSyncJourneyModel {
2
+ id: string;
3
+ applicationId: string;
4
+ milestoneLid?: string;
5
+ mileStoneStatus: 'Completed' | 'Errored' | 'Not Applicable';
6
+ error?: string;
7
+ isFirstPull: string;
8
+ jobRunId?: string;
9
+ startTime?: Date;
10
+ endTime?: Date;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
@@ -1,12 +1,19 @@
1
- export class JobRunEntity {
1
+ import { JobRunModel } from './job-run.model';
2
+ import { ApprivoSyncJourneyEntity } from './apprivo-sync-journey.entity';
3
+
4
+ export class JobRunEntity implements JobRunModel {
2
5
  id!: string;
3
6
  jobName!: string;
4
- status!: string;
5
- startedAt!: Date;
6
- completedAt?: Date;
7
+ status!: 'Running' | 'Completed' | 'Errored';
8
+ error?: string;
9
+ startTime?: Date;
10
+ endTime?: Date;
7
11
  createdAt!: Date;
8
12
  updatedAt!: Date;
9
13
 
14
+ // Relations
15
+ apprivoSyncJourneys?: ApprivoSyncJourneyEntity[];
16
+
10
17
  constructor(partial: Partial<JobRunEntity>) {
11
18
  Object.assign(this, partial);
12
19
  }
@@ -0,0 +1,10 @@
1
+ export interface JobRunModel {
2
+ id: string;
3
+ jobName: string;
4
+ status: 'Running' | 'Completed' | 'Errored';
5
+ error?: string;
6
+ startTime?: Date;
7
+ endTime?: Date;
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,30 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `completed_at` on the `apprivo_sync_journeys` table. All the data in the column will be lost.
5
+ - You are about to drop the column `journey_id` on the `apprivo_sync_journeys` table. All the data in the column will be lost.
6
+ - You are about to drop the column `started_at` on the `apprivo_sync_journeys` table. All the data in the column will be lost.
7
+ - You are about to drop the column `status` on the `apprivo_sync_journeys` table. All the data in the column will be lost.
8
+ - Added the required column `application_id` to the `apprivo_sync_journeys` table without a default value. This is not possible if the table is not empty.
9
+ - Added the required column `is_first_pull` to the `apprivo_sync_journeys` table without a default value. This is not possible if the table is not empty.
10
+ - Added the required column `milestone_status` to the `apprivo_sync_journeys` table without a default value. This is not possible if the table is not empty.
11
+
12
+ */
13
+ -- AlterTable
14
+ ALTER TABLE "apprivo_sync_journeys" DROP COLUMN "completed_at",
15
+ DROP COLUMN "journey_id",
16
+ DROP COLUMN "started_at",
17
+ DROP COLUMN "status",
18
+ ADD COLUMN "application_id" TEXT NOT NULL,
19
+ ADD COLUMN "end_time" TIMESTAMP(3),
20
+ ADD COLUMN "is_first_pull" TEXT NOT NULL,
21
+ ADD COLUMN "job_run_id" TEXT,
22
+ ADD COLUMN "milestone_lid" TEXT,
23
+ ADD COLUMN "milestone_status" TEXT NOT NULL,
24
+ ADD COLUMN "start_time" TIMESTAMP(3);
25
+
26
+ -- AddForeignKey
27
+ ALTER TABLE "apprivo_sync_journeys" ADD CONSTRAINT "apprivo_sync_journeys_milestone_lid_fkey" FOREIGN KEY ("milestone_lid") REFERENCES "lookups"("id") ON DELETE SET NULL ON UPDATE CASCADE;
28
+
29
+ -- AddForeignKey
30
+ ALTER TABLE "apprivo_sync_journeys" ADD CONSTRAINT "apprivo_sync_journeys_job_run_id_fkey" FOREIGN KEY ("job_run_id") REFERENCES "job_runs"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,9 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - Changed the type of `is_first_pull` on the `apprivo_sync_journeys` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "apprivo_sync_journeys" DROP COLUMN "is_first_pull",
9
+ ADD COLUMN "is_first_pull" BOOLEAN NOT NULL;
@@ -0,0 +1,13 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `completed_at` on the `job_runs` table. All the data in the column will be lost.
5
+ - You are about to drop the column `started_at` on the `job_runs` table. All the data in the column will be lost.
6
+
7
+ */
8
+ -- AlterTable
9
+ ALTER TABLE "job_runs" DROP COLUMN "completed_at",
10
+ DROP COLUMN "started_at",
11
+ ADD COLUMN "end_time" TIMESTAMP(3),
12
+ ADD COLUMN "error" TEXT,
13
+ ADD COLUMN "start_time" TIMESTAMP(3);
@@ -32,14 +32,21 @@ model Alert {
32
32
 
33
33
  // From prisma/shared/apprivo-sync-journey.prisma
34
34
  model ApprivoSyncJourney {
35
- id String @id @default(uuid())
36
- journeyId String @map("journey_id")
37
- status String
38
- error String?
39
- startedAt DateTime @map("started_at")
40
- completedAt DateTime? @map("completed_at")
41
- createdAt DateTime @default(now()) @map("created_at")
42
- updatedAt DateTime @updatedAt @map("updated_at")
35
+ id String @id @default(uuid())
36
+ applicationId String @map("application_id")
37
+ milestoneLid String? @map("milestone_lid")
38
+ mileStoneStatus String @map("milestone_status")
39
+ error String?
40
+ isFirstPull Boolean @map("is_first_pull")
41
+ jobRunId String? @map("job_run_id")
42
+ startTime DateTime? @map("start_time")
43
+ endTime DateTime? @map("end_time")
44
+ createdAt DateTime @default(now()) @map("created_at")
45
+ updatedAt DateTime @updatedAt @map("updated_at")
46
+
47
+ // Relations
48
+ milestone Lookup? @relation("ApprivoSyncJourney", fields: [milestoneLid], references: [id])
49
+ jobRun JobRun? @relation("Milestones", fields: [jobRunId], references: [id])
43
50
 
44
51
  @@map("apprivo_sync_journeys")
45
52
  }
@@ -69,13 +76,17 @@ model DocumentType {
69
76
 
70
77
  // From prisma/shared/job-run.prisma
71
78
  model JobRun {
72
- id String @id @default(uuid())
73
- jobName String @map("job_name")
74
- status String
75
- startedAt DateTime @map("started_at")
76
- completedAt DateTime? @map("completed_at")
77
- createdAt DateTime @default(now()) @map("created_at")
78
- updatedAt DateTime @updatedAt @map("updated_at")
79
+ id String @id @default(uuid())
80
+ jobName String @map("job_name")
81
+ status String @map("status")
82
+ error String?
83
+ startTime DateTime? @map("start_time")
84
+ endTime DateTime? @map("end_time")
85
+ createdAt DateTime @default(now()) @map("created_at")
86
+ updatedAt DateTime @updatedAt @map("updated_at")
87
+
88
+ // Relations
89
+ apprivoSyncJourneys ApprivoSyncJourney[] @relation("Milestones")
79
90
 
80
91
  @@map("job_runs")
81
92
  }
@@ -243,6 +254,7 @@ model Lookup {
243
254
  applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
244
255
  applicantExpenditure ApplicantExpenditure[] @relation("ExpenditureType")
245
256
 
257
+ apprivoSyncJourneys ApprivoSyncJourney[] @relation("ApprivoSyncJourney")
246
258
 
247
259
  @@map("lookups")
248
260
  @@unique([groupId, value])
@@ -1,12 +1,19 @@
1
1
  model ApprivoSyncJourney {
2
- id String @id @default(uuid())
3
- journeyId String @map("journey_id")
4
- status String
5
- error String?
6
- startedAt DateTime @map("started_at")
7
- completedAt DateTime? @map("completed_at")
8
- createdAt DateTime @default(now()) @map("created_at")
9
- updatedAt DateTime @updatedAt @map("updated_at")
2
+ id String @id @default(uuid())
3
+ applicationId String @map("application_id")
4
+ milestoneLid String? @map("milestone_lid")
5
+ mileStoneStatus String @map("milestone_status")
6
+ error String?
7
+ isFirstPull Boolean @map("is_first_pull")
8
+ jobRunId String? @map("job_run_id")
9
+ startTime DateTime? @map("start_time")
10
+ endTime DateTime? @map("end_time")
11
+ createdAt DateTime @default(now()) @map("created_at")
12
+ updatedAt DateTime @updatedAt @map("updated_at")
13
+
14
+ // Relations
15
+ milestone Lookup? @relation("ApprivoSyncJourney", fields: [milestoneLid], references: [id])
16
+ jobRun JobRun? @relation("Milestones", fields: [jobRunId], references: [id])
10
17
 
11
18
  @@map("apprivo_sync_journeys")
12
19
  }
@@ -1,11 +1,15 @@
1
1
  model JobRun {
2
- id String @id @default(uuid())
3
- jobName String @map("job_name")
4
- status String
5
- startedAt DateTime @map("started_at")
6
- completedAt DateTime? @map("completed_at")
7
- createdAt DateTime @default(now()) @map("created_at")
8
- updatedAt DateTime @updatedAt @map("updated_at")
2
+ id String @id @default(uuid())
3
+ jobName String @map("job_name")
4
+ status String @map("status")
5
+ error String?
6
+ startTime DateTime? @map("start_time")
7
+ endTime DateTime? @map("end_time")
8
+ createdAt DateTime @default(now()) @map("created_at")
9
+ updatedAt DateTime @updatedAt @map("updated_at")
10
+
11
+ // Relations
12
+ apprivoSyncJourneys ApprivoSyncJourney[] @relation("Milestones")
9
13
 
10
14
  @@map("job_runs")
11
15
  }
@@ -133,6 +133,7 @@ model Lookup {
133
133
  applicantEmploymentIncome ApplicantEmploymentIncome[] @relation("ApplicantEmploymentIncomeType")
134
134
  applicantExpenditure ApplicantExpenditure[] @relation("ExpenditureType")
135
135
 
136
+ apprivoSyncJourneys ApprivoSyncJourney[] @relation("ApprivoSyncJourney")
136
137
 
137
138
  @@map("lookups")
138
139
  @@unique([groupId, value])