Git Product home page Git Product logo

kyc.api.proxy's People

Contributors

ardenhide avatar lomet avatar

kyc.api.proxy's Issues

test

please add test

add `proxy`

the proxy will have the wallet it came from.
in case when its not the original wallet

using System.Linq - part 2

foreach (var wallet in wallets)
{
response = httpCall.GetBlockPassResponse(wallet);
if (response.Status != RequestStatus.error)
{
return BuildOutputData(response);
}
}

var validResponse = wallets
    .Select(wallet => httpCall.GetBlockPassResponse(wallet))
    .FirstOrDefault(response => response.Status != RequestStatus.error);

if (validResponse != null)
{
    return BuildOutputData(validResponse);
}

using System.Linq

public virtual string[] GetWallets(string wallet)
{
var user = GetItem(wallet);
if (user == null || !user.ContainsKey("EvmWallets"))
return Array.Empty<string>();
var associatedWallets = user["EvmWallets"].L.Select(x => x.S).ToArray();
var wallets = new List<string>();
foreach (var associatedWallet in associatedWallets)
{
var associatedUser = GetItem(associatedWallet);
if (associatedUser == null || !associatedUser.ContainsKey("EvmWallets"))
continue;
if (associatedUser["EvmWallets"].L.Exists(x => x.S == wallet))
{
wallets.Add(associatedUser["EvmWallet"].S);
}
}
return wallets.ToArray();
}

public virtual string[] GetWallets(string wallet)
{
    var user = GetItem(wallet);
    if (user == null || !user.ContainsKey("EvmWallets"))
        return Array.Empty<string>();

    var associatedWallets = user["EvmWallets"].L.Select(x => x.S).ToArray();

    return associatedWallets
        .Select(associatedWallet => GetItem(associatedWallet))
        .Where(associatedUser => associatedUser != null && associatedUser.ContainsKey("EvmWallets"))
        .Where(associatedUser => associatedUser["EvmWallets"].L.Exists(x => x.S == wallet))
        .Select(associatedUser => associatedUser["EvmWallet"].S)
        .ToArray();
}

check for other wallets

If the KYC result is false,
We want to check other EVM wallets, if none, return the result
Then we check if any of the wallets are linked back (wallet A got wallet B and wallet B got wallet A)
We check the KYC status for all the wallets who follow this rule. if any is true, return the valid object.

`RefId` is null possible

I receive some users with null address (RefId)

{
    "Status": "approved",
    "RecordId": "123",
    "RefId": null,
    "SubmitCount": 1,
    "BlockPassID": "321",
    "IsArchived": false,
    "InreviewDate": "0000-00-00",
    "WaitingDate": "0000-00-00",
    "ApprovedDate": "0000-00-00"
}

IDK it's bug or not, what we need to do if RefId is null?

Update `sonarcloud.yml`

Add two envs to possible download private package:

GITHUB_PACKAGE_USER_NAME: ${{ github.actor }}
GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.