aesirxio / web3-id-preregistration-backend

Backend for the pre-registration and share2earn of web3 id
GNU General Public License v3.0
0 stars 3 forks source link

Step 5: Get preregistration data #8

Open jatitoam opened 1 year ago

jatitoam commented 1 year ago

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:

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):

CongThuong commented 1 year ago

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 commented 1 year ago

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

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

thaoredweb commented 1 year ago

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