@@ -8,6 +8,7 @@ import { NoticeOfIntentModificationService } from '../../notice-of-intent-decisi
8
8
import { NoticeOfIntentService } from '../../notice-of-intent/notice-of-intent.service' ;
9
9
import { NotificationService } from '../../notification/notification.service' ;
10
10
import { PlanningReferralService } from '../../planning-review/planning-referral/planning-referral.service' ;
11
+ import { ApplicationDecisionConditionCardService } from '../../application-decision/application-decision-condition/application-decision-condition-card/application-decision-condition-card.service' ;
11
12
12
13
@Injectable ( )
13
14
export class UnarchiveCardService {
@@ -20,6 +21,7 @@ export class UnarchiveCardService {
20
21
private notificationService : NotificationService ,
21
22
private planningReferralService : PlanningReferralService ,
22
23
private inquiryService : InquiryService ,
24
+ private applicationDecisionConditionCardService : ApplicationDecisionConditionCardService ,
23
25
) { }
24
26
25
27
async fetchByFileId ( fileId : string ) {
@@ -37,6 +39,7 @@ export class UnarchiveCardService {
37
39
await this . fetchAndMapNOIs ( fileId , result ) ;
38
40
await this . fetchAndMapNotifications ( fileId , result ) ;
39
41
await this . fetchAndMapInquiries ( fileId , result ) ;
42
+ await this . fetchAndMapApplicationDecisionConditionCards ( fileId , result ) ;
40
43
41
44
return result ;
42
45
}
@@ -70,8 +73,7 @@ export class UnarchiveCardService {
70
73
createdAt : number ;
71
74
} [ ] ,
72
75
) {
73
- const modifications =
74
- await this . modificationService . getDeletedCards ( fileId ) ;
76
+ const modifications = await this . modificationService . getDeletedCards ( fileId ) ;
75
77
for ( const modification of modifications ) {
76
78
result . push ( {
77
79
cardUuid : modification . cardUuid ?? '' ,
@@ -91,8 +93,7 @@ export class UnarchiveCardService {
91
93
createdAt : number ;
92
94
} [ ] ,
93
95
) {
94
- const reconsiderations =
95
- await this . reconsiderationService . getDeletedCards ( fileId ) ;
96
+ const reconsiderations = await this . reconsiderationService . getDeletedCards ( fileId ) ;
96
97
for ( const reconsideration of reconsiderations ) {
97
98
result . push ( {
98
99
cardUuid : reconsideration . cardUuid ?? '' ,
@@ -112,8 +113,7 @@ export class UnarchiveCardService {
112
113
createdAt : number ;
113
114
} [ ] ,
114
115
) {
115
- const noticeOfIntents =
116
- await this . noticeOfIntentService . getDeletedCards ( fileId ) ;
116
+ const noticeOfIntents = await this . noticeOfIntentService . getDeletedCards ( fileId ) ;
117
117
for ( const noi of noticeOfIntents ) {
118
118
result . push ( {
119
119
cardUuid : noi . cardUuid ,
@@ -123,8 +123,7 @@ export class UnarchiveCardService {
123
123
} ) ;
124
124
}
125
125
126
- const modificationNOIs =
127
- await this . noticeOfIntentModificationService . getDeletedCards ( fileId ) ;
126
+ const modificationNOIs = await this . noticeOfIntentModificationService . getDeletedCards ( fileId ) ;
128
127
129
128
for ( const noi of modificationNOIs ) {
130
129
result . push ( {
@@ -145,8 +144,7 @@ export class UnarchiveCardService {
145
144
createdAt : number ;
146
145
} [ ] ,
147
146
) {
148
- const notifications =
149
- await this . notificationService . getDeletedCards ( fileId ) ;
147
+ const notifications = await this . notificationService . getDeletedCards ( fileId ) ;
150
148
for ( const notification of notifications ) {
151
149
result . push ( {
152
150
cardUuid : notification . cardUuid ,
@@ -166,8 +164,7 @@ export class UnarchiveCardService {
166
164
createdAt : number ;
167
165
} [ ] ,
168
166
) {
169
- const planningReferrals =
170
- await this . planningReferralService . getDeletedCards ( fileId ) ;
167
+ const planningReferrals = await this . planningReferralService . getDeletedCards ( fileId ) ;
171
168
for ( const referral of planningReferrals ) {
172
169
result . push ( {
173
170
cardUuid : referral . cardUuid ,
@@ -197,4 +194,25 @@ export class UnarchiveCardService {
197
194
} ) ;
198
195
}
199
196
}
197
+
198
+ private async fetchAndMapApplicationDecisionConditionCards (
199
+ fileId : string ,
200
+ result : {
201
+ cardUuid : string ;
202
+ type : string ;
203
+ status : string ;
204
+ createdAt : number ;
205
+ } [ ] ,
206
+ ) {
207
+ const conditionCards = await this . applicationDecisionConditionCardService . getDeletedCards ( fileId ) ;
208
+
209
+ for ( const conditionCard of conditionCards ) {
210
+ result . push ( {
211
+ cardUuid : conditionCard . cardUuid ,
212
+ createdAt : conditionCard . auditCreatedAt . getTime ( ) ,
213
+ type : CARD_TYPE . APP_CON ,
214
+ status : conditionCard . card ! . status . label ,
215
+ } ) ;
216
+ }
217
+ }
200
218
}
0 commit comments