@dynamatix/gb-schemas 1.2.0 → 1.2.3

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,57 +1,65 @@
1
1
  import mongoose from 'mongoose';
2
2
  declare const applicantDirectDebitSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
3
3
  timestamps: true;
4
+ toJSON: {
5
+ virtuals: true;
6
+ getters: true;
7
+ };
8
+ toObject: {
9
+ virtuals: true;
10
+ getters: true;
11
+ };
4
12
  }, {
5
13
  createdAt: NativeDate;
6
14
  updatedAt: NativeDate;
7
15
  } & {
8
- isConfirmDeclaration: string;
9
16
  applicationId?: mongoose.Types.ObjectId | null | undefined;
10
17
  addressLine1?: string | null | undefined;
11
18
  addressLine2?: string | null | undefined;
12
- accountNumber?: string | null | undefined;
19
+ accountNumber?: number | null | undefined;
20
+ applicants?: string | null | undefined;
13
21
  branch?: string | null | undefined;
14
22
  city?: string | null | undefined;
15
23
  contactPostcode?: string | null | undefined;
16
24
  institution?: string | null | undefined;
25
+ isConfirmDeclaration?: boolean | null | undefined;
17
26
  nameOfAccountHolder?: string | null | undefined;
18
- sortCode?: string | null | undefined;
19
- selectedPaymentDay?: string | null | undefined;
20
- Applicants?: string | null | undefined;
27
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
28
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
21
29
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
22
30
  createdAt: NativeDate;
23
31
  updatedAt: NativeDate;
24
32
  } & {
25
- isConfirmDeclaration: string;
26
33
  applicationId?: mongoose.Types.ObjectId | null | undefined;
27
34
  addressLine1?: string | null | undefined;
28
35
  addressLine2?: string | null | undefined;
29
- accountNumber?: string | null | undefined;
36
+ accountNumber?: number | null | undefined;
37
+ applicants?: string | null | undefined;
30
38
  branch?: string | null | undefined;
31
39
  city?: string | null | undefined;
32
40
  contactPostcode?: string | null | undefined;
33
41
  institution?: string | null | undefined;
42
+ isConfirmDeclaration?: boolean | null | undefined;
34
43
  nameOfAccountHolder?: string | null | undefined;
35
- sortCode?: string | null | undefined;
36
- selectedPaymentDay?: string | null | undefined;
37
- Applicants?: string | null | undefined;
44
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
45
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
38
46
  }>> & mongoose.FlatRecord<{
39
47
  createdAt: NativeDate;
40
48
  updatedAt: NativeDate;
41
49
  } & {
42
- isConfirmDeclaration: string;
43
50
  applicationId?: mongoose.Types.ObjectId | null | undefined;
44
51
  addressLine1?: string | null | undefined;
45
52
  addressLine2?: string | null | undefined;
46
- accountNumber?: string | null | undefined;
53
+ accountNumber?: number | null | undefined;
54
+ applicants?: string | null | undefined;
47
55
  branch?: string | null | undefined;
48
56
  city?: string | null | undefined;
49
57
  contactPostcode?: string | null | undefined;
50
58
  institution?: string | null | undefined;
59
+ isConfirmDeclaration?: boolean | null | undefined;
51
60
  nameOfAccountHolder?: string | null | undefined;
52
- sortCode?: string | null | undefined;
53
- selectedPaymentDay?: string | null | undefined;
54
- Applicants?: string | null | undefined;
61
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
62
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
55
63
  }> & {
56
64
  _id: mongoose.Types.ObjectId;
57
65
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-direct-debit.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-direct-debit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcR,CAAC;AAEzB,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"applicant-direct-debit.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-direct-debit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAmB,MAAM,UAAU,CAAC;AAK3C,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4D9B,CAAC;AAeH,eAAe,0BAA0B,CAAC"}
@@ -14,4 +14,6 @@ const applicantDirectDebitSchema = new mongoose.Schema({
14
14
  selectedPaymentDay: { type: String },
15
15
  sortCode: { type: String }
16
16
  }, { timestamps: true });
17
- export default applicantDirectDebitSchema;
17
+ const DirectDebitModel = mongoose.model("DirectDebit", applicantDirectDebitSchema);
18
+ export default DirectDebitModel;
19
+ export { applicantDirectDebitSchema };
@@ -218,19 +218,19 @@ declare const ApplicantModel: mongoose.Model<{
218
218
  createdAt: NativeDate;
219
219
  updatedAt: NativeDate;
220
220
  } & {
221
- isConfirmDeclaration: string;
222
221
  applicationId?: mongoose.Types.ObjectId | null | undefined;
223
222
  addressLine1?: string | null | undefined;
224
223
  addressLine2?: string | null | undefined;
225
- accountNumber?: string | null | undefined;
224
+ accountNumber?: number | null | undefined;
225
+ applicants?: string | null | undefined;
226
226
  branch?: string | null | undefined;
227
227
  city?: string | null | undefined;
228
228
  contactPostcode?: string | null | undefined;
229
229
  institution?: string | null | undefined;
230
+ isConfirmDeclaration?: boolean | null | undefined;
230
231
  nameOfAccountHolder?: string | null | undefined;
231
- sortCode?: string | null | undefined;
232
- selectedPaymentDay?: string | null | undefined;
233
- Applicants?: string | null | undefined;
232
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
233
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
234
234
  }) | null | undefined;
235
235
  income?: {
236
236
  businessType: string;
@@ -501,19 +501,19 @@ declare const ApplicantModel: mongoose.Model<{
501
501
  createdAt: NativeDate;
502
502
  updatedAt: NativeDate;
503
503
  } & {
504
- isConfirmDeclaration: string;
505
504
  applicationId?: mongoose.Types.ObjectId | null | undefined;
506
505
  addressLine1?: string | null | undefined;
507
506
  addressLine2?: string | null | undefined;
508
- accountNumber?: string | null | undefined;
507
+ accountNumber?: number | null | undefined;
508
+ applicants?: string | null | undefined;
509
509
  branch?: string | null | undefined;
510
510
  city?: string | null | undefined;
511
511
  contactPostcode?: string | null | undefined;
512
512
  institution?: string | null | undefined;
513
+ isConfirmDeclaration?: boolean | null | undefined;
513
514
  nameOfAccountHolder?: string | null | undefined;
514
- sortCode?: string | null | undefined;
515
- selectedPaymentDay?: string | null | undefined;
516
- Applicants?: string | null | undefined;
515
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
516
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
517
517
  }) | null | undefined;
518
518
  income?: {
519
519
  businessType: string;
@@ -784,19 +784,19 @@ declare const ApplicantModel: mongoose.Model<{
784
784
  createdAt: NativeDate;
785
785
  updatedAt: NativeDate;
786
786
  } & {
787
- isConfirmDeclaration: string;
788
787
  applicationId?: mongoose.Types.ObjectId | null | undefined;
789
788
  addressLine1?: string | null | undefined;
790
789
  addressLine2?: string | null | undefined;
791
- accountNumber?: string | null | undefined;
790
+ accountNumber?: number | null | undefined;
791
+ applicants?: string | null | undefined;
792
792
  branch?: string | null | undefined;
793
793
  city?: string | null | undefined;
794
794
  contactPostcode?: string | null | undefined;
795
795
  institution?: string | null | undefined;
796
+ isConfirmDeclaration?: boolean | null | undefined;
796
797
  nameOfAccountHolder?: string | null | undefined;
797
- sortCode?: string | null | undefined;
798
- selectedPaymentDay?: string | null | undefined;
799
- Applicants?: string | null | undefined;
798
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
799
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
800
800
  }) | null | undefined;
801
801
  income?: {
802
802
  businessType: string;
@@ -1079,19 +1079,19 @@ declare const ApplicantModel: mongoose.Model<{
1079
1079
  createdAt: NativeDate;
1080
1080
  updatedAt: NativeDate;
1081
1081
  } & {
1082
- isConfirmDeclaration: string;
1083
1082
  applicationId?: mongoose.Types.ObjectId | null | undefined;
1084
1083
  addressLine1?: string | null | undefined;
1085
1084
  addressLine2?: string | null | undefined;
1086
- accountNumber?: string | null | undefined;
1085
+ accountNumber?: number | null | undefined;
1086
+ applicants?: string | null | undefined;
1087
1087
  branch?: string | null | undefined;
1088
1088
  city?: string | null | undefined;
1089
1089
  contactPostcode?: string | null | undefined;
1090
1090
  institution?: string | null | undefined;
1091
+ isConfirmDeclaration?: boolean | null | undefined;
1091
1092
  nameOfAccountHolder?: string | null | undefined;
1092
- sortCode?: string | null | undefined;
1093
- selectedPaymentDay?: string | null | undefined;
1094
- Applicants?: string | null | undefined;
1093
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
1094
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
1095
1095
  }) | null | undefined;
1096
1096
  income?: {
1097
1097
  businessType: string;
@@ -1362,19 +1362,19 @@ declare const ApplicantModel: mongoose.Model<{
1362
1362
  createdAt: NativeDate;
1363
1363
  updatedAt: NativeDate;
1364
1364
  } & {
1365
- isConfirmDeclaration: string;
1366
1365
  applicationId?: mongoose.Types.ObjectId | null | undefined;
1367
1366
  addressLine1?: string | null | undefined;
1368
1367
  addressLine2?: string | null | undefined;
1369
- accountNumber?: string | null | undefined;
1368
+ accountNumber?: number | null | undefined;
1369
+ applicants?: string | null | undefined;
1370
1370
  branch?: string | null | undefined;
1371
1371
  city?: string | null | undefined;
1372
1372
  contactPostcode?: string | null | undefined;
1373
1373
  institution?: string | null | undefined;
1374
+ isConfirmDeclaration?: boolean | null | undefined;
1374
1375
  nameOfAccountHolder?: string | null | undefined;
1375
- sortCode?: string | null | undefined;
1376
- selectedPaymentDay?: string | null | undefined;
1377
- Applicants?: string | null | undefined;
1376
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
1377
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
1378
1378
  }) | null | undefined;
1379
1379
  income?: {
1380
1380
  businessType: string;
@@ -1645,19 +1645,19 @@ declare const ApplicantModel: mongoose.Model<{
1645
1645
  createdAt: NativeDate;
1646
1646
  updatedAt: NativeDate;
1647
1647
  } & {
1648
- isConfirmDeclaration: string;
1649
1648
  applicationId?: mongoose.Types.ObjectId | null | undefined;
1650
1649
  addressLine1?: string | null | undefined;
1651
1650
  addressLine2?: string | null | undefined;
1652
- accountNumber?: string | null | undefined;
1651
+ accountNumber?: number | null | undefined;
1652
+ applicants?: string | null | undefined;
1653
1653
  branch?: string | null | undefined;
1654
1654
  city?: string | null | undefined;
1655
1655
  contactPostcode?: string | null | undefined;
1656
1656
  institution?: string | null | undefined;
1657
+ isConfirmDeclaration?: boolean | null | undefined;
1657
1658
  nameOfAccountHolder?: string | null | undefined;
1658
- sortCode?: string | null | undefined;
1659
- selectedPaymentDay?: string | null | undefined;
1660
- Applicants?: string | null | undefined;
1659
+ sortCode?: mongoose.Schema.Types.SortCode | null | undefined;
1660
+ selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
1661
1661
  }) | null | undefined;
1662
1662
  income?: {
1663
1663
  businessType: string;
@@ -6,7 +6,7 @@ import applicantIncomeSourceSchema from "./applicant-income-source.model";
6
6
  import applicantExpenditureSchema from "./applicant-expenditure.model";
7
7
  import applicantEmploymentSchema from "./applicant-employment.model";
8
8
  import applicantCommitmentSchema from "./applicant-commitment.model";
9
- import applicantDirectDebitSchema from "./applicant-direct-debit.model";
9
+ import { applicantDirectDebitSchema } from "./applicant-direct-debit.model";
10
10
  import creditProfileSchema from "./applicant-credit-profile.model";
11
11
  import incomeSchema from "./applicant-income.model";
12
12
  const applicantSchema = new mongoose.Schema({
@@ -1,121 +1,86 @@
1
- import mongoose from 'mongoose';
2
- import { SortCode } from '../value-objects/sort-code';
1
+ import mongoose from "mongoose";
3
2
  declare const ApplicationDirectDebitModel: mongoose.Model<{
4
- createdAt: NativeDate;
5
- updatedAt: NativeDate;
6
- } & {
7
- applicationId?: mongoose.Types.ObjectId | null | undefined;
8
- addressLine1?: string | null | undefined;
9
- addressLine2?: string | null | undefined;
10
- accountNumber?: number | null | undefined;
11
- applicants?: string | null | undefined;
12
- branch?: string | null | undefined;
13
- city?: string | null | undefined;
14
- contactPostcode?: string | null | undefined;
15
- institution?: string | null | undefined;
16
- isConfirmDeclaration?: boolean | null | undefined;
17
- nameOfAccountHolder?: string | null | undefined;
18
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
19
- sortCode?: SortCode | null | undefined;
3
+ addressLine1: string;
4
+ addressLine2: string;
5
+ accountNumber: string;
6
+ applicants: string;
7
+ branch: string;
8
+ city: string;
9
+ contactPostcode: string;
10
+ institution: string;
11
+ isConfirmDeclaration: string;
12
+ nameOfAccountHolder: string;
13
+ selectedPaymentDay: string;
14
+ sortCode: string;
20
15
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
21
- createdAt: NativeDate;
22
- updatedAt: NativeDate;
23
- } & {
24
- applicationId?: mongoose.Types.ObjectId | null | undefined;
25
- addressLine1?: string | null | undefined;
26
- addressLine2?: string | null | undefined;
27
- accountNumber?: number | null | undefined;
28
- applicants?: string | null | undefined;
29
- branch?: string | null | undefined;
30
- city?: string | null | undefined;
31
- contactPostcode?: string | null | undefined;
32
- institution?: string | null | undefined;
33
- isConfirmDeclaration?: boolean | null | undefined;
34
- nameOfAccountHolder?: string | null | undefined;
35
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
36
- sortCode?: SortCode | null | undefined;
16
+ addressLine1: string;
17
+ addressLine2: string;
18
+ accountNumber: string;
19
+ applicants: string;
20
+ branch: string;
21
+ city: string;
22
+ contactPostcode: string;
23
+ institution: string;
24
+ isConfirmDeclaration: string;
25
+ nameOfAccountHolder: string;
26
+ selectedPaymentDay: string;
27
+ sortCode: string;
37
28
  }> & {
38
- createdAt: NativeDate;
39
- updatedAt: NativeDate;
40
- } & {
41
- applicationId?: mongoose.Types.ObjectId | null | undefined;
42
- addressLine1?: string | null | undefined;
43
- addressLine2?: string | null | undefined;
44
- accountNumber?: number | null | undefined;
45
- applicants?: string | null | undefined;
46
- branch?: string | null | undefined;
47
- city?: string | null | undefined;
48
- contactPostcode?: string | null | undefined;
49
- institution?: string | null | undefined;
50
- isConfirmDeclaration?: boolean | null | undefined;
51
- nameOfAccountHolder?: string | null | undefined;
52
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
53
- sortCode?: SortCode | null | undefined;
29
+ addressLine1: string;
30
+ addressLine2: string;
31
+ accountNumber: string;
32
+ applicants: string;
33
+ branch: string;
34
+ city: string;
35
+ contactPostcode: string;
36
+ institution: string;
37
+ isConfirmDeclaration: string;
38
+ nameOfAccountHolder: string;
39
+ selectedPaymentDay: string;
40
+ sortCode: string;
54
41
  } & {
55
42
  _id: mongoose.Types.ObjectId;
56
43
  } & {
57
44
  __v: number;
58
- }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
59
- timestamps: true;
60
- toJSON: {
61
- virtuals: true;
62
- getters: true;
63
- };
64
- toObject: {
65
- virtuals: true;
66
- getters: true;
67
- };
68
- }, {
69
- createdAt: NativeDate;
70
- updatedAt: NativeDate;
71
- } & {
72
- applicationId?: mongoose.Types.ObjectId | null | undefined;
73
- addressLine1?: string | null | undefined;
74
- addressLine2?: string | null | undefined;
75
- accountNumber?: number | null | undefined;
76
- applicants?: string | null | undefined;
77
- branch?: string | null | undefined;
78
- city?: string | null | undefined;
79
- contactPostcode?: string | null | undefined;
80
- institution?: string | null | undefined;
81
- isConfirmDeclaration?: boolean | null | undefined;
82
- nameOfAccountHolder?: string | null | undefined;
83
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
84
- sortCode?: SortCode | null | undefined;
45
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
46
+ addressLine1: string;
47
+ addressLine2: string;
48
+ accountNumber: string;
49
+ applicants: string;
50
+ branch: string;
51
+ city: string;
52
+ contactPostcode: string;
53
+ institution: string;
54
+ isConfirmDeclaration: string;
55
+ nameOfAccountHolder: string;
56
+ selectedPaymentDay: string;
57
+ sortCode: string;
85
58
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
86
- createdAt: NativeDate;
87
- updatedAt: NativeDate;
88
- } & {
89
- applicationId?: mongoose.Types.ObjectId | null | undefined;
90
- addressLine1?: string | null | undefined;
91
- addressLine2?: string | null | undefined;
92
- accountNumber?: number | null | undefined;
93
- applicants?: string | null | undefined;
94
- branch?: string | null | undefined;
95
- city?: string | null | undefined;
96
- contactPostcode?: string | null | undefined;
97
- institution?: string | null | undefined;
98
- isConfirmDeclaration?: boolean | null | undefined;
99
- nameOfAccountHolder?: string | null | undefined;
100
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
101
- sortCode?: SortCode | null | undefined;
59
+ addressLine1: string;
60
+ addressLine2: string;
61
+ accountNumber: string;
62
+ applicants: string;
63
+ branch: string;
64
+ city: string;
65
+ contactPostcode: string;
66
+ institution: string;
67
+ isConfirmDeclaration: string;
68
+ nameOfAccountHolder: string;
69
+ selectedPaymentDay: string;
70
+ sortCode: string;
102
71
  }>> & mongoose.FlatRecord<{
103
- createdAt: NativeDate;
104
- updatedAt: NativeDate;
105
- } & {
106
- applicationId?: mongoose.Types.ObjectId | null | undefined;
107
- addressLine1?: string | null | undefined;
108
- addressLine2?: string | null | undefined;
109
- accountNumber?: number | null | undefined;
110
- applicants?: string | null | undefined;
111
- branch?: string | null | undefined;
112
- city?: string | null | undefined;
113
- contactPostcode?: string | null | undefined;
114
- institution?: string | null | undefined;
115
- isConfirmDeclaration?: boolean | null | undefined;
116
- nameOfAccountHolder?: string | null | undefined;
117
- selectedPaymentDayLid?: mongoose.Types.ObjectId | null | undefined;
118
- sortCode?: SortCode | null | undefined;
72
+ addressLine1: string;
73
+ addressLine2: string;
74
+ accountNumber: string;
75
+ applicants: string;
76
+ branch: string;
77
+ city: string;
78
+ contactPostcode: string;
79
+ institution: string;
80
+ isConfirmDeclaration: string;
81
+ nameOfAccountHolder: string;
82
+ selectedPaymentDay: string;
83
+ sortCode: string;
119
84
  }> & {
120
85
  _id: mongoose.Types.ObjectId;
121
86
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"application-direct-debit.model.d.ts","sourceRoot":"","sources":["../../applications/application-direct-debit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAmB,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AA+EtD,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyE,CAAC;AAC3G,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"application-direct-debit.model.d.ts","sourceRoot":"","sources":["../../applications/application-direct-debit.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAkBhC,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AACrF,eAAe,2BAA2B,CAAC"}
@@ -1,72 +1,17 @@
1
- import mongoose from 'mongoose';
2
- import { SortCode } from '../value-objects/sort-code';
3
- const applicationDirectDebitSchema = new mongoose.Schema({
4
- applicationId: {
5
- type: mongoose.Schema.Types.ObjectId,
6
- ref: 'Application',
7
- description: 'Reference to the application this direct debit belongs to',
8
- },
9
- accountNumber: {
10
- type: Number,
11
- description: 'Bank account number of the applicant',
12
- },
13
- addressLine1: {
14
- type: String,
15
- description: 'First line of the applicant’s address',
16
- },
17
- addressLine2: {
18
- type: String,
19
- description: 'Second line of the applicant’s address',
20
- },
21
- applicants: {
22
- type: String,
23
- description: 'Name(s) of the applicant(s)',
24
- },
25
- branch: {
26
- type: String,
27
- description: 'Branch name or code of the bank',
28
- },
29
- city: {
30
- type: String,
31
- description: 'City of the applicant’s address',
32
- },
33
- contactPostcode: {
34
- type: String,
35
- description: 'Postcode for correspondence',
36
- },
37
- institution: {
38
- type: String,
39
- description: 'Name of the financial institution',
40
- },
41
- isConfirmDeclaration: {
42
- type: Boolean,
43
- description: 'Whether the applicant has confirmed the declaration',
44
- get: (value) => value ? 'Yes' : 'No',
45
- },
46
- nameOfAccountHolder: {
47
- type: String,
48
- description: 'Full name of the bank account holder',
49
- },
50
- selectedPaymentDayLid: {
51
- type: mongoose.Schema.Types.ObjectId,
52
- ref: 'Lookup',
53
- description: 'Lookup reference for selected payment day',
54
- },
55
- sortCode: {
56
- type: SortCode,
57
- description: 'UK bank sort code in XX-XX-XX format',
58
- },
59
- }, {
60
- timestamps: true,
61
- toJSON: { virtuals: true, getters: true },
62
- toObject: { virtuals: true, getters: true }
1
+ import mongoose from "mongoose";
2
+ const directDebitSchema = new mongoose.Schema({
3
+ accountNumber: { type: String, default: "" },
4
+ addressLine1: { type: String, default: "" },
5
+ addressLine2: { type: String, default: "" },
6
+ applicants: { type: String, default: "" },
7
+ branch: { type: String, default: "" },
8
+ city: { type: String, default: "" },
9
+ contactPostcode: { type: String, default: "" },
10
+ institution: { type: String, default: "" },
11
+ isConfirmDeclaration: { type: String, default: false },
12
+ nameOfAccountHolder: { type: String, default: "" },
13
+ selectedPaymentDay: { type: String, default: null },
14
+ sortCode: { type: String, default: "" },
63
15
  });
64
- const virtual = applicationDirectDebitSchema.virtual('selectedPaymentDay', {
65
- ref: 'Lookup',
66
- localField: 'selectedPaymentDayLid',
67
- foreignField: '_id',
68
- justOne: true
69
- });
70
- virtual.description = 'Populated lookup value for the selected payment day';
71
- const ApplicationDirectDebitModel = mongoose.model("ApplicationDirectDebit", applicationDirectDebitSchema);
72
- export default ApplicationDirectDebitModel;
16
+ const DirectDebitModel = mongoose.model("DirectDebit", directDebitSchema);
17
+ export default DirectDebitModel;
@@ -16,4 +16,5 @@ export { default as ApplicationDocumentModel } from './application-document.mode
16
16
  export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model';
17
17
  export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model';
18
18
  export { default as DocumentModel } from './document.model';
19
+ export { default as DirectDebitModel } from './application-direct-debit.model';
19
20
  export { default as MortgageModel } from './application-mortgage.model';
@@ -8,5 +8,4 @@ export { default as TaskModel } from './task.model';
8
8
  export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
9
9
  export { default as JobRunModel } from './job-run.model';
10
10
  export { default as TaskDocumentTypeModel } from './task-document.model';
11
- export { default as DocumentTypeModel } from './document-type-model';
12
- export { default as SchemaDocModel } from './schema-doc.model';
11
+ export { default as DocumentTypeModel } from './document-type-model.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.0",
3
+ "version": "1.2.3",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/mongoose": "^5.11.96",
66
- "@types/node": "^22.13.14",
66
+ "@types/node": "^22.14.0",
67
67
  "ts-node": "^10.9.2",
68
68
  "typescript": "^5.8.2"
69
69
  }