Skip to content

Commit

Permalink
fix set kyc passed if social was skipped (3/4 not assigned) (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-cronus authored Jun 26, 2024
1 parent 8e347d2 commit 4c9bc93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kyc/face/internal/threedivi/threedivi.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,20 @@ func (t *threeDivi) Reset(ctx context.Context, user *users.User, fetchState bool
}
}

//nolint:funlen //.
//nolint:funlen,gocognit,gocyclo,revive,cyclop //.
func (*threeDivi) parseApplicant(user *users.User, bafApplicant *applicant) *users.User {
updUser := new(users.User)
updUser.ID = user.ID
//nolint:nestif // .
if bafApplicant != nil && bafApplicant.LastValidationResponse != nil && bafApplicant.Status == statusPassed {
passedTime := time.New(bafApplicant.LastValidationResponse.CreatedAt)
if user.KYCStepsCreatedAt != nil && len(*user.KYCStepsCreatedAt) >= int(users.LivenessDetectionKYCStep) {
updUser.KYCStepsCreatedAt = user.KYCStepsCreatedAt
updUser.KYCStepsLastUpdatedAt = user.KYCStepsLastUpdatedAt
if user.KYCStepPassed == nil || *user.KYCStepPassed == 0 {
stepPassed := users.LivenessDetectionKYCStep
updUser.KYCStepPassed = &stepPassed
}
(*updUser.KYCStepsCreatedAt)[stepIdx(users.FacialRecognitionKYCStep)] = passedTime
(*updUser.KYCStepsCreatedAt)[stepIdx(users.LivenessDetectionKYCStep)] = passedTime
(*updUser.KYCStepsLastUpdatedAt)[stepIdx(users.FacialRecognitionKYCStep)] = passedTime
Expand Down

0 comments on commit 4c9bc93

Please sign in to comment.