# Partial Flow 2.8 Setup PIN
## Overview
| Aspect | Description |
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Summary** | The user enters the PIN and confirms it. If entries do not match or if the PIN is too simple the user has to try again. |
| **Goal** | Setup a PIN that matches the PIN policy. |
| **Preconditions** | *None* |
| **Postconditions** | Depends on the use case. |
| **Used by** |
- [UC2.1 Setup remote PIN](../use-cases/UC2.1_SetupRemotePinAndBiometricsUnlock.md)
- [PF2.3.2 Recover PIN](../use-cases/UC2.3.2_RecoverPIN.md)
- [PF2.6 Change PIN](../use-cases/UC2.6_ChangeRemotePIN.md)
|
| **Parameters** | *None* |
| **Possible Results** | |
| **Additional Documentation** | - [PIN Validation](../../architecture/use-cases/pin-validation.md)
|
| **Possible errors** | - [No Internet](../errors.md#no-internet)
- [Server Unreachable](../errors.md#server-unreachable)
- [Device Insecure](../errors.md#device-insecure)
|
| **Logical test cases** | - [LTC51 Setup PIN](../logical-test-cases.md#ltc51)
|
---
## Flow
| # | Description | Next |
|---------|---------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| **1.1** | **System displays screen 'Choose PIN'**- Input: 6 digits (0-9) PIN field, in-app keyboard
- Actions: Back, Info
| |
| 1.1a | User enters PIN | 1.2 |
| 1.1b | User selects Back | Result: Back |
| 1.1c | User selects Info | Go to: [UC9.2 Get app information](../use-cases/UC9.2_GetAppInformation.md) |
| **1.2** | **System validates entered PIN satisfies PIN policy**- Duration: 0.0 - 0.1 seconds
| |
| 1.2a | Case: PIN matches PIN policy | 1.3 |
| 1.2b | Case: PIN does not match PIN policy | 2 |
| **1.3** | **System displays screen 'Repeat PIN'**- Input: 6 digits (0-9) PIN field, in-app keyboard
- Actions: Back, Info
| |
| 1.3a | User enters PIN | 1.4 |
| 1.3b | User selects Back | Back |
| 1.3c | User selects Info | Go to: [UC9.2 Get app information](../use-cases/UC9.2_GetAppInformation.md) |
| **1.4** | **System validates PINs match, displays loading message**- Duration: 0.0 - 0.1 seconds
| |
| 1.4a | Case: PINs match | 1.5 |
| 1.4b | Case: PINs do not match (first time) | 3 |
| 1.4c | Case: PINs do not match (second time) | 4 |
| **1.5** | **System executes PIN setup, displays loading message**- Duration: 0.0 - 1.0 seconds
| |
| 1.5a | Case: PIN setup succeeds | Result: PIN setup succeeds |
| 1.5b | Error: Device insecure | Error flow: [Device Insecure](../errors.md#device-insecure) |
| 1.5c | Error: No internet | Error flow: [No Internet](../errors.md#no-internet) |
| 1.5d | Error: Server unreachable | Error flow: [Server Unreachable](../errors.md#server-unreachable) |
| **2** | **WHEN PIN DOES NOT SATISFY POLICY (TOO SIMPLE)** | |
| **2.1** | **System displays prompt 'PIN too simple'** | |
| 2.1a | User selects OK | 1.3 |
| **3** | **WHEN PINs ARE NOT EQUAL (FIRST TIME)** | |
| **3.1** | **System displays prompt 'PIN is different, retry'** | |
| 3.1a | User selects Try again | 1.3 |
| **4** | **WHEN PINs ARE NOT EQUAL (SECOND TIME)** | |
| **4.1** | **System displays prompt 'PIN is different, start over'** | |
| 4.1a | User selects Start over | 1.1 |
| **5** | **WHEN USER ABORTS FROM CHOOSING NEW PIN** | |
| **5.1** | **System displays bottom drawer 'Are you sure you want to stop?'** | |
| 5.1a | User selects No | Back |
| 5.1b | User selects Yes stop | 5.2 |
| **5.2** | **System displays screen 'Stopped'** | |
| 5.2a | User selects Close | Result: Stop |
| 5.2b | User selects Help | Show placeholder 'under construction' |