Skip to content

Commit 406719c

Browse files
committed
Add mock rules for the whole set of APIs
1 parent 4137c50 commit 406719c

File tree

1 file changed

+74
-5
lines changed

1 file changed

+74
-5
lines changed

v0/gettingstarted/sandbox/mocks.md

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,79 @@ When using the Sandbox in mock mode, the following rules apply:
2626

2727
| Input | Response Status | Response Body |
2828
|--------------|--------------------|------------------|
29-
| **device** missing or invalid | 400 | message: <error details> |
30-
| **device** > **ipv4Address** > **publicPort** missing when device = ipv4Address | 400 | message: "Missing publicPort" |
3129
| device > **networkAccessIdentifier** / **phoneNumber** / **ipv4Address** / **ipv6Address** ends in **9** | 409 | code: "CONFLICT"<br>message: "Another session is created for the same UE" |
32-
| **applicationServer** missing or invalid | 400 | message: error on IPv4/IPv6 format |
33-
| **qosProfile** missing or invalid | 400 | message: error on QoS profile not listed in the GET profiles operation |
3430
| **duration** Not in range **1...86400** seconds | 400 | message: error on duration not in range |
35-
| Valid input | 201 | Provided input adding: sessionId, startedAt, expiresAt, qosStatus, messages |
31+
| Valid input | 201 | Provided input adding: sessionId, startedAt, expiresAt, qosStatus, messages |
32+
33+
### SIM Swap
34+
35+
Check operation
36+
37+
| Input | Response Status | Response Body |
38+
|--------------|--------------------|------------------|
39+
| **phoneNumber** ends in **1** | 200 | simSwapped: **true** |
40+
| **phoneNumber** ends in **2** | 200 | simSwapped: **false** |
41+
| **phoneNumber** ends in **3...0** | 200 | simSwapped: random (depends on request timestamp being even or odd) |
42+
43+
Retrieve date
44+
45+
| Input | Response Status | Response Body |
46+
|--------------|--------------------|------------------|
47+
| **phoneNumber** ends in **9** | 409 | code: "CONFLICT"<br>message: "Another request is created for the same phone number" |
48+
| **phoneNumber** ends in **0...8** | 200 | latestSimChange: "2024-01-14T13:16:33.167Z" |
49+
50+
### Device Location Verification (v0.2)
51+
52+
| Input | Response Status | Response Body |
53+
|--------------|--------------------|------------------|
54+
| **device** > **networkAccessIdentifier** / **phoneNumber** / **ipv4Address** / **ipv6Address** ends in **4** | 404 | message: Device not found |
55+
| **maxAge** included and > 14400 | 404 | message: Device not found in the given maxAge |
56+
| **maxAge** not included<br>**center** > **latitude** round to integer ends in **0** | 200 | verificationResult: **"UNKNOWN"** |
57+
| **maxAge** included<br>**center** > **latitude** round to integer ends in **0** | 200 | verificationResult: **"UNKNOWN"**<br>lastLocationTime: (30 minutes + maxAge) to now |
58+
| **center** > **latitude** round to integer ends in **1** | 200 | verificationResult: **"PARTIAL"**<br>lastLocationTime: (30 minutes + maxAge) to now<br>matchRate: something between 50 if radius=2 and 99 if radius=200 |
59+
| **center** > **latitude** round to integer is **even** | 200 | verificationResult: **"TRUE"** |
60+
| **center** > **latitude** round to integer is **odd** | 200 | verificationResult: **"FALSE"** |
61+
62+
### Device Status (v0.4)
63+
64+
| Input | Response Status | Response Body |
65+
|--------------|--------------------|------------------|
66+
| **ueId** > **externalId** / **msisdn** / **ipv4addr** / **ipv6addr** ends in **1** | 200 | roaming: **true** |
67+
| **ueId** > **externalId** / **msisdn** / **ipv4addr** / **ipv6addr** ends in **2** | 200 | roaming: **false** |
68+
| **ueId** identifier ends in **3...0** | 200 | roaming: random (depends on request timestamp being even or odd) |
69+
70+
### Know Your Customer (KYC) Match (v0.2)
71+
72+
| Input | Response Status | Response Body |
73+
|--------------|--------------------|------------------|
74+
| Any invalid input | 400 | message: Details on the invalid input value |
75+
| Valid input | 200 | For every input value, response includes...<br>match: boolean<br>matchScore: 0...100 (only for some keys)<br>Those will be the result of matching the request data with a [mock user persona](https://github.com/camaraproject/KnowYourCustomer/blob/a2575b08550640999614a43dd2146ceab6b6e469/code/API_definitions/kyc-match.yaml#L105) |
76+
77+
### KYC Age Verification (v0.1)
78+
79+
For this API, the rules's input is the **login_hint** parameter, which is used to retrieve the access token used to authenticate the request (not directly as a request parameter). The response will be based on the last digit of the **login_hint**.
80+
81+
It will determine which mock user persona is used to verify the age of the user, by comparing the **ageThreshold** in the request body with the user's age.
82+
83+
| Input | Response Status | Response Body |
84+
|--------------|--------------------|------------------|
85+
| login_hint is **even** | 200 | ageCheck: Result of verifying the **ageThreshold** for a mock user born in **June 10th, 2004** |
86+
| login_hint is **odd** | 200 | ageCheck: Result of verifying the **ageThreshold** for a mock user born in **January 31st, 1971** |
87+
88+
### KYC Tenure (v0.1)
89+
90+
For this API, the rules's input is the **login_hint** parameter, which is used to retrieve the access token used to authenticate the request (not directly as a request parameter). The response will be based on the last digit of the **login_hint**.
91+
92+
It will determine which mock user persona is used to verify the line holding tenure, by comparing the **tenureDate** in the request body with the user's tenure.
93+
94+
| Input | Response Status | Response Body |
95+
|--------------|--------------------|------------------|
96+
| login_hint is **even** | 200 | tenureDateCheck: Result of verifying the **tenureDate** for a mock user with a tenure start date of **April 30th, 2025** |
97+
| login_hint is **odd** | 200 | tenureDateCheck: Result of verifying the **tenureDate** for a mock user with a tenure start date of **December 30th, 2023** |
98+
99+
### Scam Signal (v0.2)
100+
101+
| Input | Response Status | Response Body |
102+
|--------------|--------------------|------------------|
103+
| **phoneNumber** is **even** | 200 | callInProgress: **false** |
104+
| **phoneNumber** is **odd** | 200 | callInProgress: **true**<br>callStartTime: "2023-07-03T12:27:08.312Z" |

0 commit comments

Comments
 (0)