Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Step 5: Get preregistration data #8

Open
jatitoam opened this issue Feb 23, 2023 · 3 comments
Open

Step 5: Get preregistration data #8

jatitoam opened this issue Feb 23, 2023 · 3 comments
Assignees

Comments

@jatitoam
Copy link
Contributor

jatitoam commented Feb 23, 2023

Add a new /preregistration/account/:account?signature=<signature> (GET) endpoint to get the full preregistration document in an application/json format.

Validations should be returning using 4xx error and a json document:

{
   "error": "<specific error>"
}

Validations:

  • Account in invalid format (regex): 406
  • Account not found in the preregistration collection AND in the account collection (it needs to be in both): 404
  • Signature not sent: 406
  • Signature not base64: 406
  • Unencoded signature not json format: 406
  • Validation fails (using concordium-sdk): 403

Important:

After signature verification (using concordium-sdk) the nonce needs to be cleared in the account document to invalidate it (if validation passes or fails).

Return:

If everything works, return the whole preregistration document in json format and a 200 http code.

Transformations:

The following are two rules for transforming the presented data (it will not affect the database):

  • The referred count will be limited to 6. Anything more than 6 will be returned as 6 in this field.
  • Add a derived field referredAmount which will be referred x 25. Tops is 150 (as referred top is 6)
@jatitoam jatitoam converted this from a draft issue Feb 23, 2023
@jatitoam jatitoam added this to the Pre-registration campaign milestone Feb 25, 2023
@CongThuong CongThuong moved this from Todo to In Progress in Web3 pre-registration Feb 26, 2023
@CongThuong
Copy link
Contributor

May you please explain me more about "Add a derived field referredAmount which will be referred x 25. Tops is 150 (as referred top is 6)" @jatitoam

@jatitoam
Copy link
Contributor Author

we only allow 6 referred per id, so if referrer > 6, return 6

in consequence, referredAmount (referred x 25) can only be 150 tops

@CongThuong CongThuong moved this from In Progress to Awaiting review in Web3 pre-registration Feb 26, 2023
@CongThuong CongThuong moved this from Awaiting review to QA in Web3 pre-registration Feb 26, 2023
@thaoredweb
Copy link

thaoredweb commented Feb 27, 2023

This issue is penidng signature from FE, will check later on

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

No branches or pull requests

3 participants