-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.ts
1142 lines (995 loc) · 46.7 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Router } from "express";
import * as config from "../config";
import {
beneficialOwnerGov,
beneficialOwnerIndividual,
beneficialOwnerOther,
beneficialOwnerStatements,
beneficialOwnerDeleteWarning,
beneficialOwnerType,
updateBeneficialOwnerBoMoReview,
cannotUse,
checkYourAnswers,
confirmation,
entity,
healthcheck,
interruptCard,
updateInterruptCard,
landing,
updateLanding,
overseasEntityQuery,
managingOfficerIndividual,
managingOfficerCorporate,
presenter,
payment,
removeCannotUse,
soldLandFilter,
secureRegisterFilter,
secureUpdateFilter,
trustInformation,
usePaper,
updateUsePaper,
whoIsMakingFiling,
dueDiligence,
overseasEntityDueDiligence,
accessibilityStatement,
confirmOverseasEntityDetails,
signOut,
trustDetails,
trustInvolved,
trustHistoricalbeneficialOwner,
trustIndividualbeneficialOwner,
trustLegalEntitybeneficialOwner,
trustInterrupt,
addTrust,
removeSoldAllLandFilter,
removeIsEntityRegisteredOwner,
removeConfirmStatement,
resumeSubmission,
overseasName,
startingNew,
overseasEntityPayment,
overseasEntityUpdateDetails,
overseasEntityPresenter,
whoIsMakingUpdate,
updateDueDiligence,
updateDueDiligenceOverseasEntity,
updateConfirmation,
paymentFailed,
updateBeneficialOwnerIndividual,
updateBeneficialOwnerGov,
updateBeneficialOwnerStatements,
updateBeneficialOwnerType,
updateTrustsSubmissionInterrupt,
updateTrustsTellUsAboutIt,
updateTrustsIndividualsOrEntitiesInvolved,
updateTrustsAssociatedWithEntity,
updateTrustHistoricalBeneficialOwner,
updateCheckYourAnswers,
updateSignOut,
updateBeneficialOwnerOther,
confirmToRemove,
updateManagingOfficerIndividual,
updateManagingOfficerCorporate,
updateFilingDate,
updateRegistrableBeneficialOwner,
updateContinueSavedFiling,
updateReviewOverseasEntityInformation,
updateReviewBeneficialOwnerIndividual,
updateReviewBeneficialOwnerOther,
updateReviewBeneficialOwnerGov,
resumeUpdateSubmission,
updateReviewIndividualManagingOfficer,
updateReviewManagingOfficerCorporate,
updateTrustsSubmitByPaper,
updateAnyTrustsInvolved,
doYouWantToMakeOeChange,
noChangeBeneficialOwnerStatement,
noChangeRegistrableBeneficialOwner,
updateReviewStatement,
updateTrustsIndividualBeneficialOwner,
updateTrustsLegalEntityBeneficialOwner,
updateStatementValidationErrors,
updateManageTrustsOrchestrator,
updateManageTrustsInterrupt,
updateManageTrustsReviewTheTrust,
updateManageTrustsReviewFormerBo,
updateManageTrustsTellUsAboutTheFormerBo,
updateManageTrustsReviewIndividuals,
updateManageTrustsTellUsAboutTheIndividual,
updateManageTrustsReviewLegalEntities,
updateManageTrustsIndividualsOrEntitiesInvolved,
updatePaymentFailed,
updateManageTrustsTellUsAboutTheLegalEntity,
relevantPeriodOwnedLandFilter,
relevantPeriodInterrupt,
relevantPeriodCombinedStatements,
relevantPeriodReviewStatements,
} from "../controllers";
import { serviceAvailabilityMiddleware } from "../middleware/service.availability.middleware";
import { journeyDetectionMiddleware } from "../middleware/navigation/journey.detection.middleware";
import { authentication } from "../middleware/authentication.middleware";
import { navigation } from "../middleware/navigation";
import { checkTrustValidations, checkValidations } from "../middleware/validation.middleware";
import { isFeatureEnabled } from '../middleware/is.feature.enabled.middleware';
import { validator } from "../validation";
import { companyAuthentication } from "../middleware/company.authentication.middleware";
import { validateStatements, statementValidationErrorsGuard, summaryPagesGuard } from "../middleware/statement.validation.middleware";
import { generateSignOutBaseUrl } from "../middleware/navigation/sign.out.base.url";
const router = Router();
router.use(serviceAvailabilityMiddleware);
router.use(journeyDetectionMiddleware);
router.use(generateSignOutBaseUrl);
router.get(config.HEALTHCHECK_URL, healthcheck.get);
router.get(config.ACCESSIBILITY_STATEMENT_URL, accessibilityStatement.get);
router.get(config.LANDING_URL, landing.get);
router.get(config.SIGN_OUT_URL, signOut.get);
router.get(config.SIGN_OUT_WITH_PARAMS_URL, signOut.get);
router.post(config.SIGN_OUT_URL, ...validator.signOut, checkValidations, signOut.post);
router.post(config.SIGN_OUT_WITH_PARAMS_URL, ...validator.signOut, checkValidations, signOut.post);
router.get(config.RESUME_SUBMISSION_URL, authentication, resumeSubmission.get);
router.get(config.STARTING_NEW_URL, authentication, startingNew.get);
router.post(config.STARTING_NEW_URL, authentication, ...validator.startingNew, checkValidations, startingNew.post);
router.get(config.SOLD_LAND_FILTER_URL, authentication, soldLandFilter.get);
router.post(config.SOLD_LAND_FILTER_URL, authentication, ...validator.soldLandFilter, checkValidations, soldLandFilter.post);
router.get(config.SOLD_LAND_FILTER_WITH_PARAMS_URL, authentication, soldLandFilter.get);
router.post(config.SOLD_LAND_FILTER_WITH_PARAMS_URL, authentication, ...validator.soldLandFilter, checkValidations, soldLandFilter.post);
router.get(config.CANNOT_USE_URL, authentication, cannotUse.get);
router.get(config.CANNOT_USE_WITH_PARAMS_URL, authentication, cannotUse.get);
router.get(config.SECURE_REGISTER_FILTER_URL, authentication, navigation.hasSoldLand, secureRegisterFilter.get);
router.post(config.SECURE_REGISTER_FILTER_URL, authentication, navigation.hasSoldLand, ...validator.secureRegisterFilter, checkValidations, secureRegisterFilter.post);
router.get(config.SECURE_REGISTER_FILTER_WITH_PARAMS_URL, authentication, navigation.hasSoldLand, secureRegisterFilter.get);
router.post(config.SECURE_REGISTER_FILTER_WITH_PARAMS_URL, authentication, navigation.hasSoldLand, ...validator.secureRegisterFilter, checkValidations, secureRegisterFilter.post);
router.get(config.USE_PAPER_URL, authentication, navigation.hasSoldLand, usePaper.get);
router.get(config.USE_PAPER_WITH_PARAMS_URL, authentication, navigation.hasSoldLand, usePaper.get);
router.get(config.INTERRUPT_CARD_URL, authentication, navigation.isSecureRegister, interruptCard.get);
router.get(config.INTERRUPT_CARD_WITH_PARAMS_URL, authentication, navigation.isSecureRegister, interruptCard.get);
router.get(config.OVERSEAS_NAME_URL, authentication, navigation.isSecureRegister, overseasName.get);
router.get(config.OVERSEAS_NAME_WITH_PARAMS_URL, authentication, navigation.isSecureRegister, overseasName.get);
router.post(config.OVERSEAS_NAME_URL, authentication, navigation.isSecureRegister, ...validator.overseasName, checkValidations, overseasName.post);
router.post(config.OVERSEAS_NAME_WITH_PARAMS_URL, authentication, navigation.isSecureRegister, ...validator.overseasName, checkValidations, overseasName.post);
router.get(config.PRESENTER_URL, authentication, navigation.hasOverseasName, presenter.get);
router.get(config.PRESENTER_WITH_PARAMS_URL, authentication, navigation.hasOverseasName, presenter.get);
router.post(config.PRESENTER_URL, authentication, navigation.hasOverseasName, ...validator.presenter, checkValidations, presenter.post);
router.post(config.PRESENTER_WITH_PARAMS_URL, authentication, navigation.hasOverseasName, ...validator.presenter, checkValidations, presenter.post);
router.get(config.WHO_IS_MAKING_FILING_URL, authentication, navigation.hasPresenter, whoIsMakingFiling.get);
router.get(config.WHO_IS_MAKING_FILING_WITH_PARAMS_URL, authentication, navigation.hasPresenter, whoIsMakingFiling.get);
router.post(config.WHO_IS_MAKING_FILING_URL, authentication, navigation.hasPresenter, ...validator.whoIsMakingFiling, checkValidations, whoIsMakingFiling.post);
router.post(config.WHO_IS_MAKING_FILING_WITH_PARAMS_URL, authentication, navigation.hasPresenter, ...validator.whoIsMakingFiling, checkValidations, whoIsMakingFiling.post);
router.get(config.DUE_DILIGENCE_URL, authentication, navigation.hasPresenter, dueDiligence.get);
router.get(config.DUE_DILIGENCE_WITH_PARAMS_URL, authentication, navigation.hasPresenter, dueDiligence.get);
router.post(config.DUE_DILIGENCE_URL, authentication, navigation.hasPresenter, ...validator.dueDiligence, checkValidations, dueDiligence.post);
router.post(config.DUE_DILIGENCE_WITH_PARAMS_URL, authentication, navigation.hasPresenter, ...validator.dueDiligence, checkValidations, dueDiligence.post);
router.get(config.OVERSEAS_ENTITY_DUE_DILIGENCE_URL, authentication, navigation.hasPresenter, overseasEntityDueDiligence.get);
router.get(config.OVERSEAS_ENTITY_DUE_DILIGENCE_WITH_PARAMS_URL, authentication, navigation.hasPresenter, overseasEntityDueDiligence.get);
router.post(config.OVERSEAS_ENTITY_DUE_DILIGENCE_URL, authentication, navigation.hasPresenter, ...validator.overseasEntityDueDiligence, checkValidations, overseasEntityDueDiligence.post);
router.post(config.OVERSEAS_ENTITY_DUE_DILIGENCE_WITH_PARAMS_URL, authentication, navigation.hasPresenter, ...validator.overseasEntityDueDiligence, checkValidations, overseasEntityDueDiligence.post);
router.get(config.ENTITY_URL, authentication, navigation.hasDueDiligence, entity.get);
router.get(config.ENTITY_WITH_PARAMS_URL, authentication, navigation.hasDueDiligence, entity.get);
router.post(config.ENTITY_URL, authentication, navigation.hasDueDiligence, ...validator.entity, checkValidations, entity.post);
router.post(config.ENTITY_WITH_PARAMS_URL, authentication, navigation.hasDueDiligence, ...validator.entity, checkValidations, entity.post);
router.get(config.BENEFICIAL_OWNER_STATEMENTS_URL, authentication, navigation.hasEntity, beneficialOwnerStatements.get);
router.get(config.BENEFICIAL_OWNER_STATEMENTS_WITH_PARAMS_URL, authentication, navigation.hasEntity, beneficialOwnerStatements.get);
router.post(config.BENEFICIAL_OWNER_STATEMENTS_URL, authentication, navigation.hasEntity, ...validator.beneficialOwnersStatement, checkValidations, beneficialOwnerStatements.post);
router.post(config.BENEFICIAL_OWNER_STATEMENTS_WITH_PARAMS_URL, authentication, navigation.hasEntity, ...validator.beneficialOwnersStatement, checkValidations, beneficialOwnerStatements.post);
router.get(config.BENEFICIAL_OWNER_DELETE_WARNING_URL, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerDeleteWarning.get);
router.get(config.BENEFICIAL_OWNER_DELETE_WARNING_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerDeleteWarning.get);
router.post(config.BENEFICIAL_OWNER_DELETE_WARNING_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.beneficialOwnerDeleteWarning, checkValidations, beneficialOwnerDeleteWarning.post);
router.post(config.BENEFICIAL_OWNER_DELETE_WARNING_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.beneficialOwnerDeleteWarning, checkValidations, beneficialOwnerDeleteWarning.post);
router.get(config.BENEFICIAL_OWNER_TYPE_URL, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerType.get);
router.get(config.BENEFICIAL_OWNER_TYPE_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerType.get);
router.post(config.BENEFICIAL_OWNER_TYPE_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.beneficialOwnersType, checkValidations, beneficialOwnerType.post);
router.post(config.BENEFICIAL_OWNER_TYPE_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.beneficialOwnersType, checkValidations, beneficialOwnerType.post);
router.post(config.BENEFICIAL_OWNER_TYPE_SUBMIT_URL, authentication, navigation.hasBeneficialOwnersStatement, checkValidations, beneficialOwnerType.postSubmit);
router.post(config.BENEFICIAL_OWNER_TYPE_SUBMIT_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, checkValidations, beneficialOwnerType.postSubmit);
router.route(config.BENEFICIAL_OWNER_INDIVIDUAL_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerIndividual.get)
.post(...validator.beneficialOwnerIndividual, checkValidations, beneficialOwnerIndividual.post);
router.route(config.BENEFICIAL_OWNER_INDIVIDUAL_WITH_PARAMS_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerIndividual.get)
.post(...validator.beneficialOwnerIndividual, checkValidations, beneficialOwnerIndividual.post);
router.route(config.BENEFICIAL_OWNER_INDIVIDUAL_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerIndividual.getById)
.post(...validator.beneficialOwnerIndividual, checkValidations, beneficialOwnerIndividual.update);
router.route(config.BENEFICIAL_OWNER_INDIVIDUAL_WITH_PARAMS_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerIndividual.getById)
.post(...validator.beneficialOwnerIndividual, checkValidations, beneficialOwnerIndividual.update);
router.get(config.BENEFICIAL_OWNER_INDIVIDUAL_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerIndividual.remove);
router.get(config.BENEFICIAL_OWNER_INDIVIDUAL_WITH_PARAMS_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerIndividual.remove);
router.route(config.BENEFICIAL_OWNER_OTHER_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerOther.get)
.post(...validator.beneficialOwnerOther, checkValidations, beneficialOwnerOther.post);
router.route(config.BENEFICIAL_OWNER_OTHER_WITH_PARAMS_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerOther.get)
.post(...validator.beneficialOwnerOther, checkValidations, beneficialOwnerOther.post);
router.route(config.BENEFICIAL_OWNER_OTHER_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerOther.getById)
.post(...validator.beneficialOwnerOther, checkValidations, beneficialOwnerOther.update);
router.route(config.BENEFICIAL_OWNER_OTHER_WITH_PARAMS_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerOther.getById)
.post(...validator.beneficialOwnerOther, checkValidations, beneficialOwnerOther.update);
router.get(config.BENEFICIAL_OWNER_OTHER_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerOther.remove);
router.get(config.BENEFICIAL_OWNER_OTHER_WITH_PARAMS_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerOther.remove);
router.route(config.BENEFICIAL_OWNER_GOV_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerGov.get)
.post(...validator.beneficialOwnerGov, checkValidations, beneficialOwnerGov.post);
router.route(config.BENEFICIAL_OWNER_GOV_WITH_PARAMS_URL)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerGov.get)
.post(...validator.beneficialOwnerGov, checkValidations, beneficialOwnerGov.post);
router.route(config.BENEFICIAL_OWNER_GOV_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerGov.getById)
.post(...validator.beneficialOwnerGov, checkValidations, beneficialOwnerGov.update);
router.route(config.BENEFICIAL_OWNER_GOV_WITH_PARAMS_URL + config.ID)
.all(
authentication,
navigation.hasBeneficialOwnersStatement
)
.get(beneficialOwnerGov.getById)
.post(...validator.beneficialOwnerGov, checkValidations, beneficialOwnerGov.update);
router.get(config.BENEFICIAL_OWNER_GOV_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerGov.remove);
router.get(config.BENEFICIAL_OWNER_GOV_WITH_PARAMS_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, beneficialOwnerGov.remove);
router.get(config.MANAGING_OFFICER_URL, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.get);
router.get(config.MANAGING_OFFICER_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.getById);
router.post(config.MANAGING_OFFICER_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerIndividual, checkValidations, managingOfficerIndividual.post);
router.post(config.MANAGING_OFFICER_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerIndividual, checkValidations, managingOfficerIndividual.update);
router.get(config.MANAGING_OFFICER_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.remove);
router.get(config.MANAGING_OFFICER_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.get);
router.get(config.MANAGING_OFFICER_WITH_PARAMS_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.getById);
router.post(config.MANAGING_OFFICER_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerIndividual, checkValidations, managingOfficerIndividual.post);
router.post(config.MANAGING_OFFICER_WITH_PARAMS_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerIndividual, checkValidations, managingOfficerIndividual.update);
router.get(config.MANAGING_OFFICER_WITH_PARAMS_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerIndividual.remove);
router.get(config.MANAGING_OFFICER_CORPORATE_URL, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.get);
router.get(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.get);
router.get(config.MANAGING_OFFICER_CORPORATE_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.getById);
router.get(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.getById);
router.post(config.MANAGING_OFFICER_CORPORATE_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerCorporate, checkValidations, managingOfficerCorporate.post);
router.post(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerCorporate, checkValidations, managingOfficerCorporate.post);
router.post(config.MANAGING_OFFICER_CORPORATE_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerCorporate, checkValidations, managingOfficerCorporate.update);
router.post(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL + config.ID, authentication, navigation.hasBeneficialOwnersStatement, ...validator.managingOfficerCorporate, checkValidations, managingOfficerCorporate.update);
router.get(config.MANAGING_OFFICER_CORPORATE_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.remove);
router.get(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL + config.REMOVE + config.ID, authentication, navigation.hasBeneficialOwnersStatement, managingOfficerCorporate.remove);
// TO DO: add a navigation middleware that has got only BOs with the right NOC selected
router.get(
config.TRUST_INFO_URL, authentication, navigation.hasBOsOrMOs,
trustInformation.get
);
router.post(config.TRUST_INFO_URL, authentication, navigation.hasBOsOrMOs, ...validator.trustInformation, checkTrustValidations, trustInformation.post);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_INTERRUPT_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
)
.get(trustInterrupt.get)
.post(trustInterrupt.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_INTERRUPT_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
)
.get(trustInterrupt.get)
.post(trustInterrupt.post);
router
.route(config.TRUST_ENTRY_URL + config.ADD_TRUST_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustDataRegister,
)
.get(addTrust.get)
.post(addTrust.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.ADD_TRUST_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustDataRegister,
)
.get(addTrust.get)
.post(addTrust.post);
router
.route(config.TRUST_DETAILS_URL + config.TRUST_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasBOsOrMOs,
)
.get(trustDetails.get)
.post(...validator.trustDetails, trustDetails.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasBOsOrMOs,
)
.get(trustDetails.get)
.post(...validator.trustDetails, trustDetails.post);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_ID + config.TRUST_INVOLVED_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustInvolved.get)
.post(
...validator.trustInvolved,
trustInvolved.post,
);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_ID + config.TRUST_INVOLVED_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustInvolved.get)
.post(
...validator.trustInvolved,
trustInvolved.post,
);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_ID + config.TRUST_HISTORICAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustHistoricalbeneficialOwner.get)
.post(...validator.trustHistoricalBeneficialOwner, trustHistoricalbeneficialOwner.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_ID + config.TRUST_HISTORICAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustHistoricalbeneficialOwner.get)
.post(...validator.trustHistoricalBeneficialOwner, trustHistoricalbeneficialOwner.post);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_ID + config.TRUST_INDIVIDUAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustIndividualbeneficialOwner.get)
.post(...validator.trustIndividualBeneficialOwner, trustIndividualbeneficialOwner.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_ID + config.TRUST_INDIVIDUAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustIndividualbeneficialOwner.get)
.post(...validator.trustIndividualBeneficialOwner, trustIndividualbeneficialOwner.post);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_ID + config.TRUST_LEGAL_ENTITY_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustLegalEntitybeneficialOwner.get)
.post(...validator.trustLegalEntityBeneficialOwnerValidator, trustLegalEntitybeneficialOwner.post);
router
.route(config.TRUST_ENTRY_WITH_PARAMS_URL + config.TRUST_ID + config.TRUST_LEGAL_ENTITY_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_TRUSTS_WEB),
authentication,
navigation.hasTrustWithIdRegister,
)
.get(trustLegalEntitybeneficialOwner.get)
.post(...validator.trustLegalEntityBeneficialOwnerValidator, trustLegalEntitybeneficialOwner.post);
router
.route(config.TRUST_ENTRY_URL + config.TRUST_ID + config.TRUST_BENEFICIAL_OWNER_DETACH_URL + config.BO_ID)
.get((_req, res) => {
return res.render('#TODO BENEFICIAL OWNER DETACH FROM TRUST PAGE');
});
router.get(config.CHECK_YOUR_ANSWERS_URL, authentication, navigation.hasBOsOrMOs, checkYourAnswers.get);
router.get(config.CHECK_YOUR_ANSWERS_WITH_PARAMS_URL, authentication, navigation.hasBOsOrMOs, checkYourAnswers.get);
router.post(config.CHECK_YOUR_ANSWERS_URL, authentication, navigation.hasBOsOrMOs, checkYourAnswers.post);
router.post(config.CHECK_YOUR_ANSWERS_WITH_PARAMS_URL, authentication, navigation.hasBOsOrMOs, checkYourAnswers.post);
router.get(config.PAYMENT_WITH_TRANSACTION_URL, authentication, payment.get);
router.get(config.PAYMENT_WITH_TRANSACTION_WITH_PARAMS_URL, authentication, payment.get);
router.get(config.PAYMENT_FAILED_URL, authentication, paymentFailed.get);
router.get(config.PAYMENT_FAILED_WITH_PARAMS_URL, authentication, paymentFailed.get);
router.get(config.CONFIRMATION_URL, authentication, navigation.hasBOsOrMOs, confirmation.get);
router.get(config.CONFIRMATION_WITH_PARAMS_URL, authentication, navigation.hasBOsOrMOs, confirmation.get);
// Routes for UPDATE journey
router.get(config.UPDATE_LANDING_URL, updateLanding.get);
router.get(config.RESUME_UPDATE_SUBMISSION_URL, authentication, companyAuthentication, resumeUpdateSubmission.get);
router.route(config.SECURE_UPDATE_FILTER_URL)
.all(authentication)
.get(secureUpdateFilter.get)
.post(...validator.secureRegisterFilter, checkValidations, secureUpdateFilter.post);
router.route(config.UPDATE_DO_YOU_WANT_TO_MAKE_OE_CHANGE_URL)
.all(
authentication,
companyAuthentication,
navigation.hasOverseasEntity
)
.get(doYouWantToMakeOeChange.get)
.post(checkValidations, doYouWantToMakeOeChange.post);
router.route(config.UPDATE_NO_CHANGE_BENEFICIAL_OWNER_STATEMENTS_URL)
.all(
authentication,
companyAuthentication,
navigation.hasOverseasEntity
)
.get(noChangeBeneficialOwnerStatement.get)
.post(...validator.updateBeneficialOwnerStatements, checkValidations, noChangeBeneficialOwnerStatement.post);
router.route(config.UPDATE_USE_PAPER_URL)
.all(authentication)
.get(updateUsePaper.get);
router.route(config.UPDATE_INTERRUPT_CARD_URL)
.all(authentication)
.get(updateInterruptCard.get)
.post(updateInterruptCard.post);
router.get(config.UPDATE_CONFIRMATION_URL, authentication, companyAuthentication, navigation.hasBOsOrMOsUpdate, updateConfirmation.get);
router.get(config.OVERSEAS_ENTITY_QUERY_URL, authentication, overseasEntityQuery.get);
router.post(config.OVERSEAS_ENTITY_QUERY_URL, authentication, ...validator.overseasEntityQuery, checkValidations, overseasEntityQuery.post);
router.route(config.UPDATE_SIGN_OUT_URL)
.get(updateSignOut.get)
.post(...validator.signOut, checkValidations, updateSignOut.post);
router.route(config.UPDATE_SUB_PATH_SIGN_OUT_URL)
.get(updateSignOut.get)
.post(...validator.signOut, checkValidations, updateSignOut.post);
router.route(config.UPDATE_OVERSEAS_ENTITY_CONFIRM_URL)
.all(
authentication,
navigation.hasOverseasEntity
)
.get(confirmOverseasEntityDetails.get)
.post(confirmOverseasEntityDetails.post);
router.route(config.RELEVANT_PERIOD_OWNED_LAND_FILTER_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_RELEVANT_PERIOD),
authentication,
companyAuthentication,
navigation.hasOverseasEntity)
.get(relevantPeriodOwnedLandFilter.get)
.post(...validator.relevantPeriodOwnedLandFilter, checkValidations, relevantPeriodOwnedLandFilter.post);
router.route(config.RELEVANT_PERIOD_INTERRUPT_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_RELEVANT_PERIOD),
authentication,
companyAuthentication,
navigation.hasOverseasEntity)
.get(relevantPeriodInterrupt.get)
.post(relevantPeriodInterrupt.post);
router.route(config.RELEVANT_PERIOD_COMBINED_STATEMENTS_PAGE_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_RELEVANT_PERIOD),
authentication,
companyAuthentication,
navigation.hasOverseasEntity)
.get(relevantPeriodCombinedStatements.get)
.post(...validator.relevantPeriodCombinedStatements, checkValidations, relevantPeriodCombinedStatements.post);
router.route(config.RELEVANT_PERIOD_REVIEW_STATEMENTS_URL)
.all(
isFeatureEnabled(config.FEATURE_FLAG_ENABLE_RELEVANT_PERIOD),
authentication,
companyAuthentication,
navigation.hasOverseasEntity)
.get(relevantPeriodReviewStatements.get)
.post(relevantPeriodReviewStatements.post);
router.route(config.OVERSEAS_ENTITY_PRESENTER_URL)
.all(
authentication,
companyAuthentication,
navigation.hasOverseasEntityNumber
)
.get(overseasEntityPresenter.get)
.post(...validator.presenter, checkValidations, overseasEntityPresenter.post);
router.route(config.UPDATE_BENEFICIAL_OWNER_STATEMENTS_URL)
.all(
authentication,
companyAuthentication,
navigation.hasOverseasEntity
)
.get(updateBeneficialOwnerStatements.get)
.post(...validator.updateBeneficialOwnerStatements, checkValidations, updateBeneficialOwnerStatements.post);
router.get(config.OVERSEAS_ENTITY_PAYMENT_WITH_TRANSACTION_URL, authentication, companyAuthentication, overseasEntityPayment.get);
router.get(config.UPDATE_PAYMENT_FAILED_URL, authentication, updatePaymentFailed.get);
router.route(config.OVERSEAS_ENTITY_UPDATE_DETAILS_URL)
.all(
authentication,
companyAuthentication,
navigation.hasOverseasEntityNumber
)
.get(overseasEntityUpdateDetails.get)
.post(...validator.entity, ...validator.overseasName, checkValidations, overseasEntityUpdateDetails.post);
router.route(config.WHO_IS_MAKING_UPDATE_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(whoIsMakingUpdate.get)
.post(...validator.whoIsMakingUpdate, checkValidations, whoIsMakingUpdate.post);
router.route(config.UPDATE_DUE_DILIGENCE_URL)
.all(
authentication,
companyAuthentication,
navigation.hasWhoIsMakingUpdate
)
.get(updateDueDiligence.get)
.post(...validator.dueDiligence, checkValidations, updateDueDiligence.post);
router.route(config.UPDATE_DUE_DILIGENCE_OVERSEAS_ENTITY_URL)
.all(
authentication,
companyAuthentication,
navigation.hasWhoIsMakingUpdate
)
.get(updateDueDiligenceOverseasEntity.get)
.post(...validator.overseasEntityDueDiligence, checkValidations, updateDueDiligenceOverseasEntity.post);
router.route(config.UPDATE_REVIEW_OVERSEAS_ENTITY_INFORMATION_URL)
.all(
authentication,
companyAuthentication,
navigation.hasDueDiligenceDetails
)
.get(updateReviewOverseasEntityInformation.get)
.post(updateReviewOverseasEntityInformation.post);
router.route(config.UPDATE_BENEFICIAL_OWNER_BO_MO_REVIEW_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerBoMoReview.get)
.post(updateBeneficialOwnerBoMoReview.post);
router.route(config.UPDATE_CHECK_YOUR_ANSWERS_URL)
.all(
authentication,
companyAuthentication,
navigation.hasBOsOrMOsUpdate
)
.get(validateStatements, summaryPagesGuard, updateCheckYourAnswers.get)
.post(updateCheckYourAnswers.post);
router.route(config.UPDATE_BENEFICIAL_OWNER_TYPE_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerType.get)
.post(...validator.updateBeneficialOwnerAndManagingOfficerType, updateBeneficialOwnerType.post);
router.post(config.UPDATE_BENEFICIAL_OWNER_TYPE_SUBMIT_URL, authentication, navigation.hasUpdatePresenter, updateBeneficialOwnerType.postSubmit);
router.route(config.UPDATE_MANAGE_TRUSTS_ORCHESTRATOR_URL)
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
)
.all(updateManageTrustsOrchestrator.handler);
router.route(config.UPDATE_MANAGE_TRUSTS_ORCHESTRATOR_CHANGE_HANDLER_URL + config.TRUST_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasTrustWithIdUpdate
)
.all(updateManageTrustsOrchestrator.trustChangeHandler);
router.route(config.UPDATE_MANAGE_TRUSTS_ORCHESTRATOR_CHANGE_HANDLER_URL + config.TRUST_ID + '?' + config.TRUSTEE_TYPE + '?' + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasTrusteeWithIdUpdate
)
.all(updateManageTrustsOrchestrator.trustChangeHandler);
router.route(config.UPDATE_MANAGE_TRUSTS_INTERRUPT_URL)
.all(
authentication,
companyAuthentication,
navigation.hasBOsOrMOsUpdate,
)
.get(updateManageTrustsInterrupt.get)
.post(updateManageTrustsInterrupt.post);
router.route(config.UPDATE_MANAGE_TRUSTS_REVIEW_THE_TRUST_URL)
.all(
authentication,
companyAuthentication,
navigation.reviewTheTrustGuard,
)
.get(updateManageTrustsReviewTheTrust.get)
.post(...validator.reviewTrustDetails, updateManageTrustsReviewTheTrust.post);
router.route(config.UPDATE_MANAGE_TRUSTS_REVIEW_FORMER_BO_URL)
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
navigation.manageTrustsReviewFormerBOsGuard,
)
.get(updateManageTrustsReviewFormerBo.get)
.post(updateManageTrustsReviewFormerBo.post);
router.route(config.UPDATE_MANAGE_TRUSTS_TELL_US_ABOUT_THE_FORMER_BO_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.manageTrustsTellUsAboutFormerBOsGuard,
)
.get(updateManageTrustsTellUsAboutTheFormerBo.get)
.post(...validator.trustHistoricalBeneficialOwner, updateManageTrustsTellUsAboutTheFormerBo.post);
router.route(config.UPDATE_MANAGE_TRUSTS_REVIEW_INDIVIDUALS_URL)
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
navigation.manageTrustsReviewIndividualsGuard,
)
.get(updateManageTrustsReviewIndividuals.get)
.post(updateManageTrustsReviewIndividuals.post);
router.route(config.UPDATE_MANAGE_TRUSTS_TELL_US_ABOUT_THE_INDIVIDUAL_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
navigation.manageTrustsTellUsAboutIndividualsGuard,
)
.get(updateManageTrustsTellUsAboutTheIndividual.get)
.post(...validator.trustIndividualBeneficialOwner, updateManageTrustsTellUsAboutTheIndividual.post);
router.route(config.UPDATE_MANAGE_TRUSTS_REVIEW_LEGAL_ENTITIES_URL)
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
navigation.manageTrustsReviewLegalEntitiesGuard,
)
.get(updateManageTrustsReviewLegalEntities.get)
.post(updateManageTrustsReviewLegalEntities.post);
router.route(config.UPDATE_MANAGE_TRUSTS_INDIVIDUALS_OR_ENTITIES_INVOLVED_URL)
.all(
authentication,
companyAuthentication,
navigation.hasBOsOrMOsUpdate,
)
.get(updateManageTrustsIndividualsOrEntitiesInvolved.get)
.post(...validator.trustInvolved, updateManageTrustsIndividualsOrEntitiesInvolved.post);
router.route(config.UPDATE_TRUSTS_SUBMISSION_INTERRUPT_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
)
.get(navigation.hasAnyBosWithTrusteeNocs, updateTrustsSubmissionInterrupt.get)
.post(updateTrustsSubmissionInterrupt.post);
router.route(config.UPDATE_TRUSTS_TELL_US_ABOUT_IT_URL + config.TRUST_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateTrustsTellUsAboutIt.get)
.post(...validator.trustDetails, updateTrustsTellUsAboutIt.post);
router.route(config.UPDATE_TRUSTS_INDIVIDUALS_OR_ENTITIES_INVOLVED_URL + config.TRUST_ID + config.TRUST_INVOLVED_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
)
.get(updateTrustsIndividualsOrEntitiesInvolved.get)
.post(...validator.trustInvolved, updateTrustsIndividualsOrEntitiesInvolved.post);
router.route(config.UPDATE_MANAGE_TRUSTS_TELL_US_ABOUT_THE_LEGAL_ENTITY_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.isInChangeJourney,
navigation.hasBOsOrMOsUpdate,
navigation.manageTrustsTellUsAboutLegalEntitiesGuard,
)
.get(updateManageTrustsTellUsAboutTheLegalEntity.get)
.post(...validator.trustLegalEntityBeneficialOwnerValidator, updateManageTrustsTellUsAboutTheLegalEntity.post);
router
.route(config.UPDATE_TRUSTS_INDIVIDUALS_OR_ENTITIES_INVOLVED_URL + config.TRUST_ID + config.TRUST_HISTORICAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
navigation.hasTrustWithIdUpdate,
)
.get(updateTrustHistoricalBeneficialOwner.get)
.post(...validator.trustHistoricalBeneficialOwner, updateTrustHistoricalBeneficialOwner.post);
router
.route(config.UPDATE_TRUSTS_INDIVIDUALS_OR_ENTITIES_INVOLVED_URL + config.TRUST_ID + config.TRUST_LEGAL_ENTITY_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
navigation.hasTrustWithIdUpdate,
)
.get(updateTrustsLegalEntityBeneficialOwner.get)
.post(...validator.trustLegalEntityBeneficialOwnerValidator, updateTrustsLegalEntityBeneficialOwner.post);
router.route(config.UPDATE_TRUSTS_ASSOCIATED_WITH_THE_OVERSEAS_ENTITY_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
navigation.hasTrustDataUpdate,
)
.get(updateTrustsAssociatedWithEntity.get)
.post(updateTrustsAssociatedWithEntity.post);
router.route(config.UPDATE_TRUSTS_INDIVIDUALS_OR_ENTITIES_INVOLVED_URL + config.TRUST_ID + config.TRUST_INDIVIDUAL_BENEFICIAL_OWNER_URL + config.TRUSTEE_ID + '?')
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter,
navigation.hasTrustWithIdUpdate
)
.get(updateTrustsIndividualBeneficialOwner.get)
.post(...validator.trustIndividualBeneficialOwner, updateTrustsIndividualBeneficialOwner.post);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_OTHER_URL)
.all(
authentication,
companyAuthentication,
)
.get(updateReviewBeneficialOwnerOther.get)
.post(...validator.updateReviewBeneficialOwnerOther, checkValidations, updateReviewBeneficialOwnerOther.post);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_OTHER_URL + config.UPDATE_REVIEW_OWNERS_PARAMS)
.all(
authentication,
navigation.hasUpdatePresenter
)
.get(updateReviewBeneficialOwnerOther.get);
router.route(config.UPDATE_BENEFICIAL_OWNER_GOV_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerGov.get)
.post(...validator.updateBeneficialOwnerGov, checkValidations, updateBeneficialOwnerGov.post);
router.route(config.UPDATE_BENEFICIAL_OWNER_GOV_URL + config.ID)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerGov.getById)
.post(...validator.updateBeneficialOwnerGov, checkValidations, updateBeneficialOwnerGov.update);
router.route(config.UPDATE_REVIEW_INDIVIDUAL_MANAGING_OFFICER_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateReviewIndividualManagingOfficer.get)
.post(...validator.reviewManagingOfficers, checkValidations, updateReviewIndividualManagingOfficer.post);
router.route(config.UPDATE_REVIEW_INDIVIDUAL_MANAGING_OFFICER_URL + config.UPDATE_REVIEW_OWNERS_PARAMS)
.all(
authentication,
navigation.hasUpdatePresenter
)
.get(updateReviewIndividualManagingOfficer.get);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_GOV_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateReviewBeneficialOwnerGov.get)
.post(...validator.updateReviewBeneficialOwnerGovValidator, checkValidations, updateReviewBeneficialOwnerGov.post);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_GOV_URL + config.UPDATE_REVIEW_OWNERS_PARAMS)
.all(
authentication,
navigation.hasUpdatePresenter
)
.get(updateReviewBeneficialOwnerGov.get);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_INDIVIDUAL_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateReviewBeneficialOwnerIndividual.get)
.post(...validator.updateBeneficialOwnerAndReviewValidator, checkValidations, updateReviewBeneficialOwnerIndividual.post);
router.route(config.UPDATE_REVIEW_BENEFICIAL_OWNER_INDIVIDUAL_URL + config.UPDATE_REVIEW_OWNERS_PARAMS)
.all(
authentication,
navigation.hasUpdatePresenter
)
.get(updateReviewBeneficialOwnerIndividual.get);
router.route(config.UPDATE_BENEFICIAL_OWNER_INDIVIDUAL_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerIndividual.get)
.post(...validator.updateBeneficialOwnerIndividual, checkValidations, updateBeneficialOwnerIndividual.post);
router.route(config.UPDATE_BENEFICIAL_OWNER_INDIVIDUAL_URL + config.ID)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateBeneficialOwnerIndividual.getById)
.post(...validator.updateBeneficialOwnerIndividual, checkValidations, updateBeneficialOwnerIndividual.update);
router.route(config.UPDATE_MANAGING_OFFICER_URL)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)
.get(updateManagingOfficerIndividual.get)
.post(...validator.updateManagingOfficerIndividual, checkValidations, updateManagingOfficerIndividual.post);
router.route(config.UPDATE_MANAGING_OFFICER_URL + config.ID)
.all(
authentication,
companyAuthentication,
navigation.hasUpdatePresenter
)