@rolatech/angular-onboarding 20.3.0-beta.2 → 20.3.0-beta.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.
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DD-5SdjA.mjs +708 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DD-5SdjA.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-DP7wffLd.mjs +313 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-DP7wffLd.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs +446 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-result-page-CEL4nWb_.mjs +141 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-result-page-CEL4nWb_.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DG_D03YW.mjs +453 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DG_D03YW.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-apply-shell-page-DibWYeD1.mjs → rolatech-angular-onboarding-agent-apply-shell-page-CaTvnFzk.mjs} +27 -40
- package/fesm2022/rolatech-angular-onboarding-agent-apply-shell-page-CaTvnFzk.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-apply-start-page-DC7gyOnS.mjs → rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs} +31 -29
- package/fesm2022/rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-onboarding-documents-page-DWBGTj5J.mjs → rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs} +79 -6
- package/fesm2022/rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding.mjs +2252 -234
- package/fesm2022/rolatech-angular-onboarding.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rolatech-angular-onboarding.d.ts +219 -12
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DKJQX3cs.mjs +0 -224
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DKJQX3cs.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-BO4pC_NU.mjs +0 -206
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-BO4pC_NU.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-review-page-BERcLBeQ.mjs +0 -419
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-review-page-BERcLBeQ.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-banking-page-VYNfR4fy.mjs +0 -133
- package/fesm2022/rolatech-angular-onboarding-agent-apply-banking-page-VYNfR4fy.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-financial-page-Ck3Rowke.mjs +0 -132
- package/fesm2022/rolatech-angular-onboarding-agent-apply-financial-page-Ck3Rowke.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-profile-page-DNepDxHu.mjs +0 -122
- package/fesm2022/rolatech-angular-onboarding-agent-apply-profile-page-DNepDxHu.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-qualification-page-CSwupuKt.mjs +0 -108
- package/fesm2022/rolatech-angular-onboarding-agent-apply-qualification-page-CSwupuKt.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DugCjfvK.mjs +0 -182
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DugCjfvK.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-shell-page-DibWYeD1.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-start-page-DC7gyOnS.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-submitted-page-BMkV2V8K.mjs +0 -55
- package/fesm2022/rolatech-angular-onboarding-agent-apply-submitted-page-BMkV2V8K.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-onboarding-documents-page-DWBGTj5J.mjs.map +0 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
6
|
+
import { onboardingApplicantTypeLabel } from '@rolatech/angular-services';
|
|
7
|
+
import { AgentApplyFacade, OnboardingQualificationUploadSection, OnboardingVatSection, OnboardingBankingSection, OnboardingReviewIssuesBanner } from './rolatech-angular-onboarding.mjs';
|
|
8
|
+
|
|
9
|
+
class AgentApplyFormPage {
|
|
10
|
+
facade = inject(AgentApplyFacade);
|
|
11
|
+
applicantTypeLabel = onboardingApplicantTypeLabel;
|
|
12
|
+
router = inject(Router);
|
|
13
|
+
route = inject(ActivatedRoute);
|
|
14
|
+
companyCountryLabel = computed(() => {
|
|
15
|
+
switch (this.facade.companyCountry()) {
|
|
16
|
+
case 'CN':
|
|
17
|
+
return 'China';
|
|
18
|
+
case 'UK':
|
|
19
|
+
return 'United Kingdom';
|
|
20
|
+
default:
|
|
21
|
+
return 'Other';
|
|
22
|
+
}
|
|
23
|
+
}, ...(ngDevMode ? [{ debugName: "companyCountryLabel" }] : []));
|
|
24
|
+
progressPills = computed(() => {
|
|
25
|
+
const completion = this.facade.completion();
|
|
26
|
+
return [
|
|
27
|
+
{ label: 'Profile', complete: completion.profile },
|
|
28
|
+
{ label: 'Documents', complete: completion.qualification },
|
|
29
|
+
{ label: 'VAT', complete: completion.financial },
|
|
30
|
+
{ label: 'Banking', complete: completion.banking },
|
|
31
|
+
];
|
|
32
|
+
}, ...(ngDevMode ? [{ debugName: "progressPills" }] : []));
|
|
33
|
+
lockedDocuments = computed(() => this.facade.requiredDocuments().filter((spec) => this.facade.isDocumentLocked(spec.type)).map((spec) => spec.type), ...(ngDevMode ? [{ debugName: "lockedDocuments" }] : []));
|
|
34
|
+
financialFieldLocks = computed(() => ({
|
|
35
|
+
vatMode: this.facade.isIndividual() || this.facade.isFieldLocked('vatMode'),
|
|
36
|
+
vatNumber: this.facade.isIndividual() || this.facade.isFieldLocked('vatNumber'),
|
|
37
|
+
}), ...(ngDevMode ? [{ debugName: "financialFieldLocks" }] : []));
|
|
38
|
+
bankingFieldLocks = computed(() => ({
|
|
39
|
+
bankName: this.facade.isFieldLocked('bankName'),
|
|
40
|
+
accountHolderName: this.facade.isFieldLocked('accountHolderName'),
|
|
41
|
+
sortCode: this.facade.isFieldLocked('sortCode'),
|
|
42
|
+
accountNumber: this.facade.isFieldLocked('accountNumber'),
|
|
43
|
+
}), ...(ngDevMode ? [{ debugName: "bankingFieldLocks" }] : []));
|
|
44
|
+
profileTitle = computed(() => (this.facade.isCompany() ? 'Company Contact Details' : 'Applicant Details'), ...(ngDevMode ? [{ debugName: "profileTitle" }] : []));
|
|
45
|
+
profileDescription = computed(() => this.facade.isCompany()
|
|
46
|
+
? 'Enter the legal company name and the contact person responsible for this onboarding submission.'
|
|
47
|
+
: 'Enter the personal details for the applicant who is joining as an agent.', ...(ngDevMode ? [{ debugName: "profileDescription" }] : []));
|
|
48
|
+
contactNameLabel = computed(() => (this.facade.isCompany() ? 'Company representative' : 'Full name'), ...(ngDevMode ? [{ debugName: "contactNameLabel" }] : []));
|
|
49
|
+
vatRateLabel = computed(() => (this.facade.isIndividual() ? '0%' : '20%'), ...(ngDevMode ? [{ debugName: "vatRateLabel" }] : []));
|
|
50
|
+
draftSavedAt = computed(() => {
|
|
51
|
+
const value = this.facade.lastLocalDraftSavedAt();
|
|
52
|
+
return value ? new Date(value).toLocaleString() : '';
|
|
53
|
+
}, ...(ngDevMode ? [{ debugName: "draftSavedAt" }] : []));
|
|
54
|
+
primaryActionLabel = computed(() => (this.facade.hasSubmittedState() ? 'Open review' : 'Continue to review'), ...(ngDevMode ? [{ debugName: "primaryActionLabel" }] : []));
|
|
55
|
+
hasProfileError(controlName, errorCode) {
|
|
56
|
+
const control = this.facade.profileForm.get(controlName);
|
|
57
|
+
return Boolean(control?.touched && control.hasError(errorCode));
|
|
58
|
+
}
|
|
59
|
+
async onUpload(documentType, file, replacedDocumentId) {
|
|
60
|
+
await this.facade.uploadDocument(documentType, file, replacedDocumentId);
|
|
61
|
+
}
|
|
62
|
+
async continueToReview() {
|
|
63
|
+
if (!this.facade.hasSubmittedState()) {
|
|
64
|
+
const saved = await this.facade.saveFormProgress();
|
|
65
|
+
if (!saved) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
await this.router.navigate(['../review'], {
|
|
70
|
+
relativeTo: this.route,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentApplyFormPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
74
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: AgentApplyFormPage, isStandalone: true, selector: "rolatech-agent-apply-form-page", host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
75
|
+
<div class="space-y-6">
|
|
76
|
+
@if (facade.status() === 'NEED_MORE_INFO' && facade.issues().length > 0) {
|
|
77
|
+
<rolatech-onboarding-review-issues-banner [issues]="facade.issues()" [status]="facade.status()" />
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
<section class="grid gap-4 md:grid-cols-3">
|
|
81
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
82
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Applicant Type</p>
|
|
83
|
+
<p class="mt-2 text-lg font-semibold text-(--rt-text-primary)">{{ applicantTypeLabel(facade.applicantType()) }}</p>
|
|
84
|
+
</article>
|
|
85
|
+
|
|
86
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
87
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Operating Region</p>
|
|
88
|
+
<p class="mt-2 text-lg font-semibold text-(--rt-text-primary)">{{ companyCountryLabel() }}</p>
|
|
89
|
+
</article>
|
|
90
|
+
|
|
91
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
92
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Section Progress</p>
|
|
93
|
+
<div class="mt-3 flex flex-wrap gap-2">
|
|
94
|
+
@for (item of progressPills(); track item.label) {
|
|
95
|
+
<span
|
|
96
|
+
class="rounded-full px-3 py-1 text-xs font-semibold"
|
|
97
|
+
[class]="
|
|
98
|
+
item.complete
|
|
99
|
+
? 'bg-(--rt-raised-background) text-emerald-700'
|
|
100
|
+
: 'bg-(--rt-raised-background) text-(--rt-text-secondary)'
|
|
101
|
+
"
|
|
102
|
+
>
|
|
103
|
+
{{ item.label }}
|
|
104
|
+
</span>
|
|
105
|
+
}
|
|
106
|
+
</div>
|
|
107
|
+
</article>
|
|
108
|
+
</section>
|
|
109
|
+
|
|
110
|
+
<form [formGroup]="facade.profileForm" class="space-y-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm">
|
|
111
|
+
<div class="space-y-2">
|
|
112
|
+
<h2 class="text-lg font-semibold text-(--rt-text-primary)">{{ profileTitle() }}</h2>
|
|
113
|
+
<p class="max-w-2xl text-sm text-(--rt-text-secondary)">
|
|
114
|
+
{{ profileDescription() }}
|
|
115
|
+
</p>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div class="grid gap-4 md:grid-cols-2">
|
|
119
|
+
@if (facade.isCompany()) {
|
|
120
|
+
<label class="grid gap-2 md:col-span-2">
|
|
121
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Company legal name</span>
|
|
122
|
+
<input
|
|
123
|
+
formControlName="organizationName"
|
|
124
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
125
|
+
[readonly]="facade.isFieldLocked('organizationName')"
|
|
126
|
+
/>
|
|
127
|
+
@if (facade.getFieldIssueComment('organizationName')) {
|
|
128
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('organizationName') }}</span>
|
|
129
|
+
}
|
|
130
|
+
@if (hasProfileError('organizationName', 'required')) {
|
|
131
|
+
<span class="text-xs text-rose-700">Company legal name is required.</span>
|
|
132
|
+
}
|
|
133
|
+
</label>
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
<label class="grid gap-2">
|
|
137
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">{{ contactNameLabel() }}</span>
|
|
138
|
+
<input
|
|
139
|
+
formControlName="contactName"
|
|
140
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
141
|
+
[readonly]="facade.isFieldLocked('contactName')"
|
|
142
|
+
/>
|
|
143
|
+
@if (facade.getFieldIssueComment('contactName')) {
|
|
144
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactName') }}</span>
|
|
145
|
+
}
|
|
146
|
+
@if (hasProfileError('contactName', 'required')) {
|
|
147
|
+
<span class="text-xs text-rose-700">{{ contactNameLabel() }} is required.</span>
|
|
148
|
+
}
|
|
149
|
+
</label>
|
|
150
|
+
|
|
151
|
+
<label class="grid gap-2">
|
|
152
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Primary email</span>
|
|
153
|
+
<input
|
|
154
|
+
formControlName="contactEmail"
|
|
155
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
156
|
+
[readonly]="facade.isFieldLocked('contactEmail')"
|
|
157
|
+
/>
|
|
158
|
+
@if (facade.getFieldIssueComment('contactEmail')) {
|
|
159
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactEmail') }}</span>
|
|
160
|
+
}
|
|
161
|
+
@if (hasProfileError('contactEmail', 'required')) {
|
|
162
|
+
<span class="text-xs text-rose-700">Primary email is required.</span>
|
|
163
|
+
}
|
|
164
|
+
@if (hasProfileError('contactEmail', 'email')) {
|
|
165
|
+
<span class="text-xs text-rose-700">Enter a valid email address.</span>
|
|
166
|
+
}
|
|
167
|
+
</label>
|
|
168
|
+
|
|
169
|
+
<label class="grid gap-2">
|
|
170
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Phone number</span>
|
|
171
|
+
<input
|
|
172
|
+
formControlName="contactPhone"
|
|
173
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
174
|
+
[readonly]="facade.isFieldLocked('contactPhone')"
|
|
175
|
+
/>
|
|
176
|
+
@if (facade.getFieldIssueComment('contactPhone')) {
|
|
177
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactPhone') }}</span>
|
|
178
|
+
}
|
|
179
|
+
@if (hasProfileError('contactPhone', 'required')) {
|
|
180
|
+
<span class="text-xs text-rose-700">Phone number is required.</span>
|
|
181
|
+
}
|
|
182
|
+
</label>
|
|
183
|
+
|
|
184
|
+
<label class="grid gap-2">
|
|
185
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Country code</span>
|
|
186
|
+
<input
|
|
187
|
+
formControlName="countryCode"
|
|
188
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3 uppercase"
|
|
189
|
+
[readonly]="facade.isFieldLocked('countryCode')"
|
|
190
|
+
/>
|
|
191
|
+
@if (facade.getFieldIssueComment('countryCode')) {
|
|
192
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('countryCode') }}</span>
|
|
193
|
+
}
|
|
194
|
+
@if (hasProfileError('countryCode', 'required')) {
|
|
195
|
+
<span class="text-xs text-rose-700">Country code is required.</span>
|
|
196
|
+
}
|
|
197
|
+
</label>
|
|
198
|
+
</div>
|
|
199
|
+
</form>
|
|
200
|
+
|
|
201
|
+
<rolatech-onboarding-qualification-upload-section
|
|
202
|
+
[documentSpecs]="facade.requiredDocuments()"
|
|
203
|
+
[documents]="facade.documents()"
|
|
204
|
+
[issueComments]="facade.documentIssueComments()"
|
|
205
|
+
[lockedDocuments]="lockedDocuments()"
|
|
206
|
+
[uploadStates]="facade.uploadStates()"
|
|
207
|
+
[busy]="facade.saving()"
|
|
208
|
+
(fileSelected)="onUpload($event.documentType, $event.file, $event.replacedDocumentId)"
|
|
209
|
+
/>
|
|
210
|
+
|
|
211
|
+
<rolatech-onboarding-vat-section
|
|
212
|
+
[form]="facade.financialForm"
|
|
213
|
+
[applicantType]="facade.applicantType()"
|
|
214
|
+
[companyCountry]="facade.companyCountry()"
|
|
215
|
+
[fieldLocks]="financialFieldLocks()"
|
|
216
|
+
[vatRateLabel]="vatRateLabel()"
|
|
217
|
+
[issueComments]="facade.fieldIssueComments()"
|
|
218
|
+
/>
|
|
219
|
+
|
|
220
|
+
<rolatech-onboarding-banking-section
|
|
221
|
+
[form]="facade.bankingForm"
|
|
222
|
+
[fieldLocks]="bankingFieldLocks()"
|
|
223
|
+
[expectedAccountHolderName]="facade.expectedAccountHolderName()"
|
|
224
|
+
[issueComments]="facade.fieldIssueComments()"
|
|
225
|
+
/>
|
|
226
|
+
|
|
227
|
+
<section class="flex flex-wrap items-center justify-between gap-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
228
|
+
<div class="space-y-1 text-sm text-(--rt-text-secondary)">
|
|
229
|
+
@if (facade.lastLocalDraftSavedAt()) {
|
|
230
|
+
<p>Local draft saved {{ draftSavedAt() }}.</p>
|
|
231
|
+
} @else {
|
|
232
|
+
<p>Changes are stored locally while you work.</p>
|
|
233
|
+
}
|
|
234
|
+
@if (facade.hasActiveUploads()) {
|
|
235
|
+
<p class="text-amber-800">A document upload is still running.</p>
|
|
236
|
+
}
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<button
|
|
240
|
+
type="button"
|
|
241
|
+
class="rounded-xl bg-(--rt-brand-color) px-5 py-2.5 text-sm font-semibold text-(--rt-text-primary-inverse) transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"
|
|
242
|
+
[disabled]="facade.saving() || facade.hasActiveUploads()"
|
|
243
|
+
(click)="continueToReview()"
|
|
244
|
+
>
|
|
245
|
+
{{ primaryActionLabel() }}
|
|
246
|
+
</button>
|
|
247
|
+
</section>
|
|
248
|
+
</div>
|
|
249
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: OnboardingQualificationUploadSection, selector: "rolatech-onboarding-qualification-upload-section", inputs: ["documentSpecs", "documents", "issueComments", "lockedDocuments", "uploadStates", "busy"], outputs: ["fileSelected"] }, { kind: "component", type: OnboardingVatSection, selector: "rolatech-onboarding-vat-section", inputs: ["form", "applicantType", "companyCountry", "fieldLocks", "vatRateLabel", "issueComments"] }, { kind: "component", type: OnboardingBankingSection, selector: "rolatech-onboarding-banking-section", inputs: ["form", "fieldLocks", "expectedAccountHolderName", "issueComments"] }, { kind: "component", type: OnboardingReviewIssuesBanner, selector: "rolatech-onboarding-review-issues-banner", inputs: ["issues", "status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
250
|
+
}
|
|
251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentApplyFormPage, decorators: [{
|
|
252
|
+
type: Component,
|
|
253
|
+
args: [{
|
|
254
|
+
selector: 'rolatech-agent-apply-form-page',
|
|
255
|
+
standalone: true,
|
|
256
|
+
imports: [
|
|
257
|
+
ReactiveFormsModule,
|
|
258
|
+
OnboardingQualificationUploadSection,
|
|
259
|
+
OnboardingVatSection,
|
|
260
|
+
OnboardingBankingSection,
|
|
261
|
+
OnboardingReviewIssuesBanner,
|
|
262
|
+
],
|
|
263
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
264
|
+
encapsulation: ViewEncapsulation.None,
|
|
265
|
+
host: { class: 'block' },
|
|
266
|
+
template: `
|
|
267
|
+
<div class="space-y-6">
|
|
268
|
+
@if (facade.status() === 'NEED_MORE_INFO' && facade.issues().length > 0) {
|
|
269
|
+
<rolatech-onboarding-review-issues-banner [issues]="facade.issues()" [status]="facade.status()" />
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
<section class="grid gap-4 md:grid-cols-3">
|
|
273
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
274
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Applicant Type</p>
|
|
275
|
+
<p class="mt-2 text-lg font-semibold text-(--rt-text-primary)">{{ applicantTypeLabel(facade.applicantType()) }}</p>
|
|
276
|
+
</article>
|
|
277
|
+
|
|
278
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
279
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Operating Region</p>
|
|
280
|
+
<p class="mt-2 text-lg font-semibold text-(--rt-text-primary)">{{ companyCountryLabel() }}</p>
|
|
281
|
+
</article>
|
|
282
|
+
|
|
283
|
+
<article class="rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
284
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)">Section Progress</p>
|
|
285
|
+
<div class="mt-3 flex flex-wrap gap-2">
|
|
286
|
+
@for (item of progressPills(); track item.label) {
|
|
287
|
+
<span
|
|
288
|
+
class="rounded-full px-3 py-1 text-xs font-semibold"
|
|
289
|
+
[class]="
|
|
290
|
+
item.complete
|
|
291
|
+
? 'bg-(--rt-raised-background) text-emerald-700'
|
|
292
|
+
: 'bg-(--rt-raised-background) text-(--rt-text-secondary)'
|
|
293
|
+
"
|
|
294
|
+
>
|
|
295
|
+
{{ item.label }}
|
|
296
|
+
</span>
|
|
297
|
+
}
|
|
298
|
+
</div>
|
|
299
|
+
</article>
|
|
300
|
+
</section>
|
|
301
|
+
|
|
302
|
+
<form [formGroup]="facade.profileForm" class="space-y-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm">
|
|
303
|
+
<div class="space-y-2">
|
|
304
|
+
<h2 class="text-lg font-semibold text-(--rt-text-primary)">{{ profileTitle() }}</h2>
|
|
305
|
+
<p class="max-w-2xl text-sm text-(--rt-text-secondary)">
|
|
306
|
+
{{ profileDescription() }}
|
|
307
|
+
</p>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div class="grid gap-4 md:grid-cols-2">
|
|
311
|
+
@if (facade.isCompany()) {
|
|
312
|
+
<label class="grid gap-2 md:col-span-2">
|
|
313
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Company legal name</span>
|
|
314
|
+
<input
|
|
315
|
+
formControlName="organizationName"
|
|
316
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
317
|
+
[readonly]="facade.isFieldLocked('organizationName')"
|
|
318
|
+
/>
|
|
319
|
+
@if (facade.getFieldIssueComment('organizationName')) {
|
|
320
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('organizationName') }}</span>
|
|
321
|
+
}
|
|
322
|
+
@if (hasProfileError('organizationName', 'required')) {
|
|
323
|
+
<span class="text-xs text-rose-700">Company legal name is required.</span>
|
|
324
|
+
}
|
|
325
|
+
</label>
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
<label class="grid gap-2">
|
|
329
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">{{ contactNameLabel() }}</span>
|
|
330
|
+
<input
|
|
331
|
+
formControlName="contactName"
|
|
332
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
333
|
+
[readonly]="facade.isFieldLocked('contactName')"
|
|
334
|
+
/>
|
|
335
|
+
@if (facade.getFieldIssueComment('contactName')) {
|
|
336
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactName') }}</span>
|
|
337
|
+
}
|
|
338
|
+
@if (hasProfileError('contactName', 'required')) {
|
|
339
|
+
<span class="text-xs text-rose-700">{{ contactNameLabel() }} is required.</span>
|
|
340
|
+
}
|
|
341
|
+
</label>
|
|
342
|
+
|
|
343
|
+
<label class="grid gap-2">
|
|
344
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Primary email</span>
|
|
345
|
+
<input
|
|
346
|
+
formControlName="contactEmail"
|
|
347
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
348
|
+
[readonly]="facade.isFieldLocked('contactEmail')"
|
|
349
|
+
/>
|
|
350
|
+
@if (facade.getFieldIssueComment('contactEmail')) {
|
|
351
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactEmail') }}</span>
|
|
352
|
+
}
|
|
353
|
+
@if (hasProfileError('contactEmail', 'required')) {
|
|
354
|
+
<span class="text-xs text-rose-700">Primary email is required.</span>
|
|
355
|
+
}
|
|
356
|
+
@if (hasProfileError('contactEmail', 'email')) {
|
|
357
|
+
<span class="text-xs text-rose-700">Enter a valid email address.</span>
|
|
358
|
+
}
|
|
359
|
+
</label>
|
|
360
|
+
|
|
361
|
+
<label class="grid gap-2">
|
|
362
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Phone number</span>
|
|
363
|
+
<input
|
|
364
|
+
formControlName="contactPhone"
|
|
365
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3"
|
|
366
|
+
[readonly]="facade.isFieldLocked('contactPhone')"
|
|
367
|
+
/>
|
|
368
|
+
@if (facade.getFieldIssueComment('contactPhone')) {
|
|
369
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('contactPhone') }}</span>
|
|
370
|
+
}
|
|
371
|
+
@if (hasProfileError('contactPhone', 'required')) {
|
|
372
|
+
<span class="text-xs text-rose-700">Phone number is required.</span>
|
|
373
|
+
}
|
|
374
|
+
</label>
|
|
375
|
+
|
|
376
|
+
<label class="grid gap-2">
|
|
377
|
+
<span class="text-sm font-medium text-(--rt-text-secondary)">Country code</span>
|
|
378
|
+
<input
|
|
379
|
+
formControlName="countryCode"
|
|
380
|
+
class="h-11 rounded-xl border border-(--rt-border-color) px-3 uppercase"
|
|
381
|
+
[readonly]="facade.isFieldLocked('countryCode')"
|
|
382
|
+
/>
|
|
383
|
+
@if (facade.getFieldIssueComment('countryCode')) {
|
|
384
|
+
<span class="text-xs text-amber-800">{{ facade.getFieldIssueComment('countryCode') }}</span>
|
|
385
|
+
}
|
|
386
|
+
@if (hasProfileError('countryCode', 'required')) {
|
|
387
|
+
<span class="text-xs text-rose-700">Country code is required.</span>
|
|
388
|
+
}
|
|
389
|
+
</label>
|
|
390
|
+
</div>
|
|
391
|
+
</form>
|
|
392
|
+
|
|
393
|
+
<rolatech-onboarding-qualification-upload-section
|
|
394
|
+
[documentSpecs]="facade.requiredDocuments()"
|
|
395
|
+
[documents]="facade.documents()"
|
|
396
|
+
[issueComments]="facade.documentIssueComments()"
|
|
397
|
+
[lockedDocuments]="lockedDocuments()"
|
|
398
|
+
[uploadStates]="facade.uploadStates()"
|
|
399
|
+
[busy]="facade.saving()"
|
|
400
|
+
(fileSelected)="onUpload($event.documentType, $event.file, $event.replacedDocumentId)"
|
|
401
|
+
/>
|
|
402
|
+
|
|
403
|
+
<rolatech-onboarding-vat-section
|
|
404
|
+
[form]="facade.financialForm"
|
|
405
|
+
[applicantType]="facade.applicantType()"
|
|
406
|
+
[companyCountry]="facade.companyCountry()"
|
|
407
|
+
[fieldLocks]="financialFieldLocks()"
|
|
408
|
+
[vatRateLabel]="vatRateLabel()"
|
|
409
|
+
[issueComments]="facade.fieldIssueComments()"
|
|
410
|
+
/>
|
|
411
|
+
|
|
412
|
+
<rolatech-onboarding-banking-section
|
|
413
|
+
[form]="facade.bankingForm"
|
|
414
|
+
[fieldLocks]="bankingFieldLocks()"
|
|
415
|
+
[expectedAccountHolderName]="facade.expectedAccountHolderName()"
|
|
416
|
+
[issueComments]="facade.fieldIssueComments()"
|
|
417
|
+
/>
|
|
418
|
+
|
|
419
|
+
<section class="flex flex-wrap items-center justify-between gap-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm">
|
|
420
|
+
<div class="space-y-1 text-sm text-(--rt-text-secondary)">
|
|
421
|
+
@if (facade.lastLocalDraftSavedAt()) {
|
|
422
|
+
<p>Local draft saved {{ draftSavedAt() }}.</p>
|
|
423
|
+
} @else {
|
|
424
|
+
<p>Changes are stored locally while you work.</p>
|
|
425
|
+
}
|
|
426
|
+
@if (facade.hasActiveUploads()) {
|
|
427
|
+
<p class="text-amber-800">A document upload is still running.</p>
|
|
428
|
+
}
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
<button
|
|
432
|
+
type="button"
|
|
433
|
+
class="rounded-xl bg-(--rt-brand-color) px-5 py-2.5 text-sm font-semibold text-(--rt-text-primary-inverse) transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"
|
|
434
|
+
[disabled]="facade.saving() || facade.hasActiveUploads()"
|
|
435
|
+
(click)="continueToReview()"
|
|
436
|
+
>
|
|
437
|
+
{{ primaryActionLabel() }}
|
|
438
|
+
</button>
|
|
439
|
+
</section>
|
|
440
|
+
</div>
|
|
441
|
+
`,
|
|
442
|
+
}]
|
|
443
|
+
}] });
|
|
444
|
+
|
|
445
|
+
export { AgentApplyFormPage };
|
|
446
|
+
//# sourceMappingURL=rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs","sources":["../../../../packages/angular-onboarding/src/lib/pages/agent-apply/agent-apply-form-page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject, ViewEncapsulation } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { OnboardingDocumentType, onboardingApplicantTypeLabel } from '@rolatech/angular-services';\nimport { OnboardingBankingSection } from '../../components/onboarding/onboarding-banking-section';\nimport { OnboardingQualificationUploadSection } from '../../components/onboarding/onboarding-qualification-upload-section';\nimport { OnboardingReviewIssuesBanner } from '../../components/onboarding/onboarding-review-issues-banner';\nimport { OnboardingVatSection } from '../../components/onboarding/onboarding-vat-section';\nimport { AgentApplyFacade } from '../../store/agent-apply.facade';\n\n@Component({\n selector: 'rolatech-agent-apply-form-page',\n standalone: true,\n imports: [\n ReactiveFormsModule,\n OnboardingQualificationUploadSection,\n OnboardingVatSection,\n OnboardingBankingSection,\n OnboardingReviewIssuesBanner,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'block' },\n template: `\n <div class=\"space-y-6\">\n @if (facade.status() === 'NEED_MORE_INFO' && facade.issues().length > 0) {\n <rolatech-onboarding-review-issues-banner [issues]=\"facade.issues()\" [status]=\"facade.status()\" />\n }\n\n <section class=\"grid gap-4 md:grid-cols-3\">\n <article class=\"rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm\">\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)\">Applicant Type</p>\n <p class=\"mt-2 text-lg font-semibold text-(--rt-text-primary)\">{{ applicantTypeLabel(facade.applicantType()) }}</p>\n </article>\n\n <article class=\"rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm\">\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)\">Operating Region</p>\n <p class=\"mt-2 text-lg font-semibold text-(--rt-text-primary)\">{{ companyCountryLabel() }}</p>\n </article>\n\n <article class=\"rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm\">\n <p class=\"text-xs font-semibold uppercase tracking-[0.2em] text-(--rt-text-secondary)\">Section Progress</p>\n <div class=\"mt-3 flex flex-wrap gap-2\">\n @for (item of progressPills(); track item.label) {\n <span\n class=\"rounded-full px-3 py-1 text-xs font-semibold\"\n [class]=\"\n item.complete\n ? 'bg-(--rt-raised-background) text-emerald-700'\n : 'bg-(--rt-raised-background) text-(--rt-text-secondary)'\n \"\n >\n {{ item.label }}\n </span>\n }\n </div>\n </article>\n </section>\n\n <form [formGroup]=\"facade.profileForm\" class=\"space-y-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm\">\n <div class=\"space-y-2\">\n <h2 class=\"text-lg font-semibold text-(--rt-text-primary)\">{{ profileTitle() }}</h2>\n <p class=\"max-w-2xl text-sm text-(--rt-text-secondary)\">\n {{ profileDescription() }}\n </p>\n </div>\n\n <div class=\"grid gap-4 md:grid-cols-2\">\n @if (facade.isCompany()) {\n <label class=\"grid gap-2 md:col-span-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Company legal name</span>\n <input\n formControlName=\"organizationName\"\n class=\"h-11 rounded-xl border border-(--rt-border-color) px-3\"\n [readonly]=\"facade.isFieldLocked('organizationName')\"\n />\n @if (facade.getFieldIssueComment('organizationName')) {\n <span class=\"text-xs text-amber-800\">{{ facade.getFieldIssueComment('organizationName') }}</span>\n }\n @if (hasProfileError('organizationName', 'required')) {\n <span class=\"text-xs text-rose-700\">Company legal name is required.</span>\n }\n </label>\n }\n\n <label class=\"grid gap-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">{{ contactNameLabel() }}</span>\n <input\n formControlName=\"contactName\"\n class=\"h-11 rounded-xl border border-(--rt-border-color) px-3\"\n [readonly]=\"facade.isFieldLocked('contactName')\"\n />\n @if (facade.getFieldIssueComment('contactName')) {\n <span class=\"text-xs text-amber-800\">{{ facade.getFieldIssueComment('contactName') }}</span>\n }\n @if (hasProfileError('contactName', 'required')) {\n <span class=\"text-xs text-rose-700\">{{ contactNameLabel() }} is required.</span>\n }\n </label>\n\n <label class=\"grid gap-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Primary email</span>\n <input\n formControlName=\"contactEmail\"\n class=\"h-11 rounded-xl border border-(--rt-border-color) px-3\"\n [readonly]=\"facade.isFieldLocked('contactEmail')\"\n />\n @if (facade.getFieldIssueComment('contactEmail')) {\n <span class=\"text-xs text-amber-800\">{{ facade.getFieldIssueComment('contactEmail') }}</span>\n }\n @if (hasProfileError('contactEmail', 'required')) {\n <span class=\"text-xs text-rose-700\">Primary email is required.</span>\n }\n @if (hasProfileError('contactEmail', 'email')) {\n <span class=\"text-xs text-rose-700\">Enter a valid email address.</span>\n }\n </label>\n\n <label class=\"grid gap-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Phone number</span>\n <input\n formControlName=\"contactPhone\"\n class=\"h-11 rounded-xl border border-(--rt-border-color) px-3\"\n [readonly]=\"facade.isFieldLocked('contactPhone')\"\n />\n @if (facade.getFieldIssueComment('contactPhone')) {\n <span class=\"text-xs text-amber-800\">{{ facade.getFieldIssueComment('contactPhone') }}</span>\n }\n @if (hasProfileError('contactPhone', 'required')) {\n <span class=\"text-xs text-rose-700\">Phone number is required.</span>\n }\n </label>\n\n <label class=\"grid gap-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Country code</span>\n <input\n formControlName=\"countryCode\"\n class=\"h-11 rounded-xl border border-(--rt-border-color) px-3 uppercase\"\n [readonly]=\"facade.isFieldLocked('countryCode')\"\n />\n @if (facade.getFieldIssueComment('countryCode')) {\n <span class=\"text-xs text-amber-800\">{{ facade.getFieldIssueComment('countryCode') }}</span>\n }\n @if (hasProfileError('countryCode', 'required')) {\n <span class=\"text-xs text-rose-700\">Country code is required.</span>\n }\n </label>\n </div>\n </form>\n\n <rolatech-onboarding-qualification-upload-section\n [documentSpecs]=\"facade.requiredDocuments()\"\n [documents]=\"facade.documents()\"\n [issueComments]=\"facade.documentIssueComments()\"\n [lockedDocuments]=\"lockedDocuments()\"\n [uploadStates]=\"facade.uploadStates()\"\n [busy]=\"facade.saving()\"\n (fileSelected)=\"onUpload($event.documentType, $event.file, $event.replacedDocumentId)\"\n />\n\n <rolatech-onboarding-vat-section\n [form]=\"facade.financialForm\"\n [applicantType]=\"facade.applicantType()\"\n [companyCountry]=\"facade.companyCountry()\"\n [fieldLocks]=\"financialFieldLocks()\"\n [vatRateLabel]=\"vatRateLabel()\"\n [issueComments]=\"facade.fieldIssueComments()\"\n />\n\n <rolatech-onboarding-banking-section\n [form]=\"facade.bankingForm\"\n [fieldLocks]=\"bankingFieldLocks()\"\n [expectedAccountHolderName]=\"facade.expectedAccountHolderName()\"\n [issueComments]=\"facade.fieldIssueComments()\"\n />\n\n <section class=\"flex flex-wrap items-center justify-between gap-4 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 shadow-sm\">\n <div class=\"space-y-1 text-sm text-(--rt-text-secondary)\">\n @if (facade.lastLocalDraftSavedAt()) {\n <p>Local draft saved {{ draftSavedAt() }}.</p>\n } @else {\n <p>Changes are stored locally while you work.</p>\n }\n @if (facade.hasActiveUploads()) {\n <p class=\"text-amber-800\">A document upload is still running.</p>\n }\n </div>\n\n <button\n type=\"button\"\n class=\"rounded-xl bg-(--rt-brand-color) px-5 py-2.5 text-sm font-semibold text-(--rt-text-primary-inverse) transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n [disabled]=\"facade.saving() || facade.hasActiveUploads()\"\n (click)=\"continueToReview()\"\n >\n {{ primaryActionLabel() }}\n </button>\n </section>\n </div>\n `,\n})\nexport class AgentApplyFormPage {\n readonly facade = inject(AgentApplyFacade);\n readonly applicantTypeLabel = onboardingApplicantTypeLabel;\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n\n readonly companyCountryLabel = computed(() => {\n switch (this.facade.companyCountry()) {\n case 'CN':\n return 'China';\n case 'UK':\n return 'United Kingdom';\n default:\n return 'Other';\n }\n });\n\n readonly progressPills = computed(() => {\n const completion = this.facade.completion();\n\n return [\n { label: 'Profile', complete: completion.profile },\n { label: 'Documents', complete: completion.qualification },\n { label: 'VAT', complete: completion.financial },\n { label: 'Banking', complete: completion.banking },\n ];\n });\n\n readonly lockedDocuments = computed(() =>\n this.facade.requiredDocuments().filter((spec) => this.facade.isDocumentLocked(spec.type)).map((spec) => spec.type),\n );\n\n readonly financialFieldLocks = computed(() => ({\n vatMode: this.facade.isIndividual() || this.facade.isFieldLocked('vatMode'),\n vatNumber: this.facade.isIndividual() || this.facade.isFieldLocked('vatNumber'),\n }));\n\n readonly bankingFieldLocks = computed(() => ({\n bankName: this.facade.isFieldLocked('bankName'),\n accountHolderName: this.facade.isFieldLocked('accountHolderName'),\n sortCode: this.facade.isFieldLocked('sortCode'),\n accountNumber: this.facade.isFieldLocked('accountNumber'),\n }));\n\n readonly profileTitle = computed(() => (this.facade.isCompany() ? 'Company Contact Details' : 'Applicant Details'));\n readonly profileDescription = computed(() =>\n this.facade.isCompany()\n ? 'Enter the legal company name and the contact person responsible for this onboarding submission.'\n : 'Enter the personal details for the applicant who is joining as an agent.',\n );\n readonly contactNameLabel = computed(() => (this.facade.isCompany() ? 'Company representative' : 'Full name'));\n readonly vatRateLabel = computed(() => (this.facade.isIndividual() ? '0%' : '20%'));\n readonly draftSavedAt = computed(() => {\n const value = this.facade.lastLocalDraftSavedAt();\n return value ? new Date(value).toLocaleString() : '';\n });\n readonly primaryActionLabel = computed(() => (this.facade.hasSubmittedState() ? 'Open review' : 'Continue to review'));\n\n hasProfileError(controlName: string, errorCode: string): boolean {\n const control = this.facade.profileForm.get(controlName);\n return Boolean(control?.touched && control.hasError(errorCode));\n }\n\n async onUpload(documentType: OnboardingDocumentType, file: File, replacedDocumentId?: string): Promise<void> {\n await this.facade.uploadDocument(documentType, file, replacedDocumentId);\n }\n\n async continueToReview(): Promise<void> {\n if (!this.facade.hasSubmittedState()) {\n const saved = await this.facade.saveFormProgress();\n\n if (!saved) {\n return;\n }\n }\n\n await this.router.navigate(['../review'], {\n relativeTo: this.route,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;MAwMa,kBAAkB,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACjC,kBAAkB,GAAG,4BAA4B;AACzC,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAEtC,IAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAK;AAC3C,QAAA,QAAQ,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;AAClC,YAAA,KAAK,IAAI;AACP,gBAAA,OAAO,OAAO;AAChB,YAAA,KAAK,IAAI;AACP,gBAAA,OAAO,gBAAgB;AACzB,YAAA;AACE,gBAAA,OAAO,OAAO;;AAEpB,IAAA,CAAC,+DAAC;AAEO,IAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;QACrC,M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C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;AACxB,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+KT,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
4
|
+
import { AgentApplyFacade, OnboardingStatusBadge } from './rolatech-angular-onboarding.mjs';
|
|
5
|
+
|
|
6
|
+
class AgentApplyResultPage {
|
|
7
|
+
facade = inject(AgentApplyFacade);
|
|
8
|
+
router = inject(Router);
|
|
9
|
+
route = inject(ActivatedRoute);
|
|
10
|
+
toneClass = computed(() => {
|
|
11
|
+
switch (this.facade.status()) {
|
|
12
|
+
case 'APPROVED':
|
|
13
|
+
return 'border-(--rt-border-color) bg-(--rt-base-background) text-emerald-900';
|
|
14
|
+
case 'FAILED':
|
|
15
|
+
return 'border-(--rt-border-color) bg-(--rt-base-background) text-rose-800';
|
|
16
|
+
case 'NEED_MORE_INFO':
|
|
17
|
+
return 'border-(--rt-border-color) bg-(--rt-base-background) text-amber-900';
|
|
18
|
+
default:
|
|
19
|
+
return 'border-(--rt-border-color) bg-(--rt-base-background) text-sky-900';
|
|
20
|
+
}
|
|
21
|
+
}, ...(ngDevMode ? [{ debugName: "toneClass" }] : []));
|
|
22
|
+
title = computed(() => {
|
|
23
|
+
switch (this.facade.status()) {
|
|
24
|
+
case 'APPROVED':
|
|
25
|
+
return 'Application approved';
|
|
26
|
+
case 'FAILED':
|
|
27
|
+
return 'Application not approved';
|
|
28
|
+
case 'NEED_MORE_INFO':
|
|
29
|
+
return 'More information is required';
|
|
30
|
+
case 'IN_REVIEW':
|
|
31
|
+
return 'Application in review';
|
|
32
|
+
default:
|
|
33
|
+
return 'Application submitted';
|
|
34
|
+
}
|
|
35
|
+
}, ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
36
|
+
description = computed(() => {
|
|
37
|
+
switch (this.facade.status()) {
|
|
38
|
+
case 'APPROVED':
|
|
39
|
+
return 'The application passed review. PrimeCasa can now continue with the downstream agent enablement steps.';
|
|
40
|
+
case 'FAILED':
|
|
41
|
+
return 'The application was rejected during review. You can still inspect the submitted package and any reviewer feedback from the review screen.';
|
|
42
|
+
case 'NEED_MORE_INFO':
|
|
43
|
+
return 'Reviewer feedback has been returned to this application. Only the flagged fields and documents should be updated before resubmission.';
|
|
44
|
+
case 'IN_REVIEW':
|
|
45
|
+
return 'The submission is currently being reviewed by the PrimeCasa operations team.';
|
|
46
|
+
default:
|
|
47
|
+
return 'The application has been sent for manual review. You can return to the review screen to inspect the submission package.';
|
|
48
|
+
}
|
|
49
|
+
}, ...(ngDevMode ? [{ debugName: "description" }] : []));
|
|
50
|
+
async openReview() {
|
|
51
|
+
await this.router.navigate(['../review'], {
|
|
52
|
+
relativeTo: this.route,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async openForm() {
|
|
56
|
+
await this.router.navigate(['../form'], {
|
|
57
|
+
relativeTo: this.route,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentApplyResultPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
61
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: AgentApplyResultPage, isStandalone: true, selector: "rolatech-agent-apply-result-page", host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
62
|
+
<section class="rounded-3xl border p-8 shadow-sm" [class]="toneClass()">
|
|
63
|
+
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
64
|
+
<div class="space-y-3">
|
|
65
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] opacity-80">Application Result</p>
|
|
66
|
+
<h2 class="text-2xl font-semibold tracking-tight">{{ title() }}</h2>
|
|
67
|
+
<p class="max-w-2xl text-sm opacity-85">{{ description() }}</p>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<rolatech-onboarding-status-badge [status]="facade.status()" />
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="mt-6 flex flex-wrap gap-3">
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
class="rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-2 text-sm font-medium transition hover:bg-(--rt-base-background)"
|
|
77
|
+
(click)="openReview()"
|
|
78
|
+
>
|
|
79
|
+
View submission
|
|
80
|
+
</button>
|
|
81
|
+
|
|
82
|
+
@if (facade.status() === 'NEED_MORE_INFO') {
|
|
83
|
+
<button
|
|
84
|
+
type="button"
|
|
85
|
+
class="rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-2 text-sm font-medium transition hover:bg-(--rt-base-background)"
|
|
86
|
+
(click)="openForm()"
|
|
87
|
+
>
|
|
88
|
+
Update requested items
|
|
89
|
+
</button>
|
|
90
|
+
}
|
|
91
|
+
</div>
|
|
92
|
+
</section>
|
|
93
|
+
`, isInline: true, dependencies: [{ kind: "component", type: OnboardingStatusBadge, selector: "rolatech-onboarding-status-badge", inputs: ["status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentApplyResultPage, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{
|
|
98
|
+
selector: 'rolatech-agent-apply-result-page',
|
|
99
|
+
standalone: true,
|
|
100
|
+
imports: [OnboardingStatusBadge],
|
|
101
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
102
|
+
encapsulation: ViewEncapsulation.None,
|
|
103
|
+
host: { class: 'block' },
|
|
104
|
+
template: `
|
|
105
|
+
<section class="rounded-3xl border p-8 shadow-sm" [class]="toneClass()">
|
|
106
|
+
<div class="flex flex-wrap items-start justify-between gap-4">
|
|
107
|
+
<div class="space-y-3">
|
|
108
|
+
<p class="text-xs font-semibold uppercase tracking-[0.2em] opacity-80">Application Result</p>
|
|
109
|
+
<h2 class="text-2xl font-semibold tracking-tight">{{ title() }}</h2>
|
|
110
|
+
<p class="max-w-2xl text-sm opacity-85">{{ description() }}</p>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<rolatech-onboarding-status-badge [status]="facade.status()" />
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div class="mt-6 flex flex-wrap gap-3">
|
|
117
|
+
<button
|
|
118
|
+
type="button"
|
|
119
|
+
class="rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-2 text-sm font-medium transition hover:bg-(--rt-base-background)"
|
|
120
|
+
(click)="openReview()"
|
|
121
|
+
>
|
|
122
|
+
View submission
|
|
123
|
+
</button>
|
|
124
|
+
|
|
125
|
+
@if (facade.status() === 'NEED_MORE_INFO') {
|
|
126
|
+
<button
|
|
127
|
+
type="button"
|
|
128
|
+
class="rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-2 text-sm font-medium transition hover:bg-(--rt-base-background)"
|
|
129
|
+
(click)="openForm()"
|
|
130
|
+
>
|
|
131
|
+
Update requested items
|
|
132
|
+
</button>
|
|
133
|
+
}
|
|
134
|
+
</div>
|
|
135
|
+
</section>
|
|
136
|
+
`,
|
|
137
|
+
}]
|
|
138
|
+
}] });
|
|
139
|
+
|
|
140
|
+
export { AgentApplyResultPage };
|
|
141
|
+
//# sourceMappingURL=rolatech-angular-onboarding-agent-apply-result-page-CEL4nWb_.mjs.map
|