Skip to content

Commit 62e65ec

Browse files
Merge branch 'release/1.1.3'
2 parents 219ec6d + 719cdcb commit 62e65ec

File tree

6 files changed

+50
-10
lines changed

6 files changed

+50
-10
lines changed

src/Spd.Manager.Screening/ApplicationContract.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ public ApplicationCreateRequestValidator()
635635
RuleFor(r => r.BirthPlace)
636636
.NotEmpty();
637637

638+
RuleFor(r => r.GenderCode)
639+
.NotEmpty();
640+
638641
RuleFor(r => r.JobTitle)
639642
.NotEmpty()
640643
.MaximumLength(100);

src/Spd.Presentation.Screening/ClientApp/src/app/shared/components/manual-submission-common.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,13 @@ export interface ManualSubmissionBody {
184184
</div>
185185
<div class="col-xl-3 col-lg-6 col-md-12">
186186
<mat-form-field>
187-
<mat-label>Sex <span class="optional-label">(optional)</span></mat-label>
187+
<mat-label>Sex</mat-label>
188188
<mat-select formControlName="genderCode">
189189
<mat-option *ngFor="let gdr of genderTypes" [value]="gdr.code">
190190
{{ gdr.desc }}
191191
</mat-option>
192192
</mat-select>
193+
<mat-error *ngIf="form.get('genderCode')?.hasError('required')">This is required</mat-error>
193194
</mat-form-field>
194195
</div>
195196
<div class="col-xl-3 col-lg-6 col-md-12">
@@ -541,7 +542,7 @@ export class ManualSubmissionCommonComponent implements OnInit {
541542
emailAddress: new FormControl('', [FormControlValidators.email]),
542543
phoneNumber: new FormControl('', [Validators.required]),
543544
driversLicense: new FormControl(''),
544-
genderCode: new FormControl(''),
545+
genderCode: new FormControl('', [Validators.required]),
545546
dateOfBirth: new FormControl(null, [Validators.required]),
546547
birthPlace: new FormControl('', [FormControlValidators.required]),
547548
jobTitle: new FormControl('', [FormControlValidators.required]),

src/Spd.Presentation.Screening/ClientApp/src/app/shared/components/screening-application-steps/step-components/sa-personal-information.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ import { AppInviteOrgData, CrcFormStepComponent } from '../screening-application
5959
</div>
6060
<div class="col-lg-4 col-md-12 col-sm-12">
6161
<mat-form-field>
62-
<mat-label>Sex <span class="optional-label">(optional)</span></mat-label>
62+
<mat-label>Sex</mat-label>
6363
<mat-select formControlName="genderCode">
6464
<mat-option *ngFor="let gdr of genderTypes" [value]="gdr.code">
6565
{{ gdr.desc }}
6666
</mat-option>
6767
</mat-select>
68+
<mat-error *ngIf="form.get('genderCode')?.hasError('required')">This is required</mat-error>
6869
</mat-form-field>
6970
</div>
7071
</div>
@@ -97,7 +98,7 @@ export class SaPersonalInformationComponent implements CrcFormStepComponent {
9798
Validators.required,
9899
]),
99100
employeeId: new FormControl(data.employeeId),
100-
genderCode: new FormControl(data.genderCode),
101+
genderCode: new FormControl(data.genderCode, [FormControlValidators.required]),
101102
});
102103
}
103104
get orgData(): AppInviteOrgData | null {

src/Spd.Presentation.Screening/ClientApp/src/app/shared/components/screening-application-steps/step-components/sa-security-information.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ import { AppInviteOrgData, CrcFormStepComponent } from '../screening-application
6868
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
6969
<mat-form-field>
7070
<mat-label>{{ companyFacilityLabel }}</mat-label>
71-
<input matInput formControlName="contractedCompanyName" />
71+
<input
72+
matInput
73+
formControlName="contractedCompanyName"
74+
[errorStateMatcher]="matcher"
75+
maxlength="100"
76+
/>
7277
<mat-hint>{{ companyFacilityHint }}</mat-hint>
7378
<mat-error *ngIf="form.get('contractedCompanyName')?.hasError('required')"
7479
>This is required</mat-error

src/Spd.Resource.Repository/Application/ApplicationRepository.Application.cs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,39 @@ public async Task ProcessAppWithSharableClearanceAsync(ApplicationCreateCmd crea
138138
if (!createApplicationCmd.SharedClearanceId.HasValue)
139139
throw new ArgumentException("SharedClearanceId cannot be null");
140140
account? org = await _context.GetOrgById(createApplicationCmd.OrgId, ct);
141-
spd_clearance? clearance = await _context.GetClearanceById((Guid)createApplicationCmd.SharedClearanceId, ct);
142141
contact? contact = await _context.contacts.Where(c => c.contactid == createApplicationCmd.ContactId).FirstOrDefaultAsync(ct);
143142
_mapper.Map<ApplicationCreateCmd, contact>(createApplicationCmd, contact);
144143
_context.UpdateObject(contact);
145144

146-
Guid teamGuid = Guid.Parse(DynamicsConstants.Screening_Risk_Assessment_Coordinator_Team_Guid);
147-
team? team = await _context.teams.Where(t => t.teamid == teamGuid).FirstOrDefaultAsync(ct);
145+
//spdbt-3220
146+
spd_clearance? clearance = await _context.spd_clearances
147+
.Expand(c => c.spd_CaseID)
148+
.Where(c => c.spd_clearanceid == (Guid)createApplicationCmd.SharedClearanceId)
149+
.FirstOrDefaultAsync(ct);
150+
if (clearance == null)
151+
throw new ApiException(HttpStatusCode.BadRequest, "Cannot find specified clearance.");
152+
team? team = null;
153+
int state;
154+
int status;
155+
if (clearance.spd_CaseID.spd_risklevel == (int)CaseRiskLevelOptionSet.L2 || clearance.spd_CaseID.spd_risklevel == (int)CaseRiskLevelOptionSet.L3)
156+
{
157+
Guid teamGuid = Guid.Parse(DynamicsConstants.Screening_Risk_Assessment_Coordinator_Team_Guid);
158+
team = await _context.teams.Where(t => t.teamid == teamGuid).FirstOrDefaultAsync(ct);
159+
status = (int)ClearanceAccessStatusOptionSet.Draft;
160+
state = DynamicsConstants.StateCode_Active;
161+
}
162+
else
163+
{
164+
Guid teamGuid = Guid.Parse(DynamicsConstants.Client_Service_Team_Guid);
165+
team = await _context.teams.Where(t => t.teamid == teamGuid).FirstOrDefaultAsync(ct);
166+
status = (int)ClearanceAccessStatusOptionSet.Approved;
167+
state = DynamicsConstants.StateCode_Active;
168+
}
169+
148170
spd_clearanceaccess clearanceaccess = new() { spd_clearanceaccessid = Guid.NewGuid() };
149-
clearanceaccess.statecode = DynamicsConstants.StateCode_Active;
150-
clearanceaccess.statuscode = (int)ClearanceAccessStatusOptionSet.Draft;
171+
clearanceaccess.statecode = state;
172+
clearanceaccess.statuscode = status;
173+
clearanceaccess.spd_issystemgenerated = true;
151174
_context.AddTospd_clearanceaccesses(clearanceaccess);
152175
_context.SetLink(clearanceaccess, nameof(clearanceaccess.spd_OrganizationId), org);
153176
_context.SetLink(clearanceaccess, nameof(clearanceaccess.spd_ClearanceId), clearance);

src/Spd.Utilities.Dynamics/OptionSets.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,11 @@ public enum EventStatusReasonOptionSet
402402
Success = 100000002, //Inactive State status reason
403403
Fail = 100000003 //Inactive State status reason
404404
}
405+
406+
public enum CaseRiskLevelOptionSet
407+
{
408+
L1 = 100000000,
409+
L2 = 100000001,
410+
L3 = 100000002
411+
}
405412
}

0 commit comments

Comments
 (0)