Skip to content

Commit 9c964ed

Browse files
djudjuudev
andauthored
v0lender onboarding (#208)
* store account details on user table * query bank account details on signup * specify upload information * added kyc doc * new pending page * redirect to pending if not kyc'ed * add pendingReview to demo (lenderJourneySequence) * ask for complete info necessary to onboard lender to RC * onboarding journey with tabs * disable borrower Signup * specify kyc folder * comment out pledges & loans from dashboard * comment out invest & withdraw options * hasura db migration to add account_details field * submit button as spinner * comment out ability to write scenario to DB & to toggle company name * comment out reset-db link & protect route * protect toggle kyc route * missing db migrations to introduce user accounts * protect root admin route * updated comments * remove sandbox from tab * add account details to db seeds * add new demographic info to db seeds * remove some comments * add admin to seeds * use magic link for login * add admin to db seed * add admin-email description to production readme * fixed db-link and better pw * also update hasura console pw * make links external * skip non relevant tests * add new demographic info to test fixtures * add dummy account details to basic fixtures * ask for address during onboarding * re-add dob to demographic data with dummy * query pan card number Co-authored-by: dev <dev@ip-172-31-18-40.us-west-1.compute.internal>
1 parent 0e7e558 commit 9c964ed

File tree

34 files changed

+741
-158
lines changed

34 files changed

+741
-158
lines changed

docs/kyc.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 1 Document Upload
2+
3+
Lenders will upload the relevant documents to an s3 bucket. The uploads can be found when logging in to aws-console
4+
under s3/uploads-all-arboreum/<process.ENVIRONMENT>/user_uploads/lenderKYC/<lender-email-address>
5+
and a download-link to the documents is posted to the slack-integrations-channel.
6+
7+
the user then sees a screen that tells them that their application is being reviewed.
8+
9+
# Manual Review
10+
11+
Using the latest insomnia collection please do:
12+
13+
### 1) Penny Drop to bank account
14+
15+
1. select request: `decentro/pennyDrop`
16+
2. fill request with ifsc, account number & unique reference id
17+
3. compare names from result
18+
4. if OK. save screenshot of result (entire screen) to our googledocs folder (google drive /KYC)
19+
20+
### 2) Validate Pan-card
21+
22+
1. select request: `decentro/kyc/public/registry/validate`
23+
2. copy pan number from image into request
24+
3. result should be success
25+
4. if OK. save screenshot of result (entire screen) to our googledocs folder
26+
27+
### 3) Validate Aadhaar card
28+
29+
1. go to uidai site,
30+
2. enter aadhaar card number
31+
3. compare basic dates
32+
4. if OK. save screenshot of result (entire screen) to our googledocs folder
33+
34+
### 4) Register with RC
35+
36+
1. select request: `RC/registration/investor/v1/register`
37+
2. copy data from DB to request
38+
39+
- if success:
40+
2.1 copy investor_id & escrow_id into the user.table.accout_info.rcAccount to the keys "investorID" & "accountNumber"
41+
- if failure:
42+
2.2 talk to Julius
43+
44+
# Final approval
45+
46+
If everything is done, go to admin/1290 and click toggle kyc for the user
47+
then send an email to them
48+
49+
```
50+
Congratulations!
51+
52+
Your account has been approved. Go to LINK to log in, deposit funds and start investing.
53+
We look forward to collaborating with you.
54+
55+
Arboreum
56+
```

hasura/config.production.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2
22
endpoint: http://app.arbo.link:8075/
3-
admin_secret: arbo_secret_hasura_gs
3+
# admin_secret: arbo_secret_hasura_gs
4+
admin_secret: 41dgE7roC0ePLA3Cv8iuP2JY0QhPIhQfOw6tc1yiMmrTjmm2ig
45
metadata_directory: metadata
56
actions:
67
kind: synchronous

hasura/migrations/1610369534136_alter_table_public_user_add_column_roi/down.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
ALTER TABLE "public"."user" DROP COLUMN "account_details";
3+
4+
ALTER TABLE "public"."user" DROP COLUMN "roi";

hasura/migrations/1610369534136_alter_table_public_user_add_column_roi/up.sql renamed to hasura/migrations/1616000904309_squashed/up.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
12
ALTER TABLE "public"."user" ADD COLUMN "roi" jsonb NULL DEFAULT jsonb_build_object();
3+
4+
ALTER TABLE "public"."user" ADD COLUMN "account_details" jsonb NULL;
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
INSERT INTO public."user" (id, created_at, updated_at, name, email, min_interest_rate, max_exposure, user_type, balance, demographic_info, phone, user_number, corpus_share, kyc_approved, roi) VALUES
2-
('8653118e-7a00-4c4f-be53-0b2e04485db0', '2020-09-01 16:24:32.225944+00', '2020-09-01 16:24:32.225944+00', 'Gaurav Paruthi', 'gparuthi@gmail.com', NULL, NULL, 'borrower', 0, '{"income":300,"credit_score":600,"education_years":3}', '7342723929', 1, 0, false, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }'),
3-
('230cff88-a594-4922-90cd-05938de5bdd0', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'gp', 'gp@arboreum.dev', NULL, NULL, 'lender', 23000, '{}', '12312', 4, 0, true, '{ "total_apr": { "apr": 0, "interest": { "paid": 0, "remain": 0 }, "principal": { "paid": 0, "remain": 0 } }, "apr_on_pledges": {}, "apr_on_loans": {} }'),
4-
('130cff88-a594-4922-90cd-05938de5bdd0', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Julius Faber', 'julius@arboreum.dev', NULL, NULL, 'lender', 0, '{}', '1231211', 5, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }'),
5-
('8653118e-7a00-4c4f-be53-0b2e04485db1', '2020-09-01 16:24:32.225944+00', '2020-09-01 16:24:32.225944+00', 'Amitabh Bachann', 'amitabh@mail.com', NULL, NULL, 'borrower', 0, '{"income":300,"credit_score":600,"education_years":3}', '7342723929', 6, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }'),
6-
('230cff88-a594-4922-90cd-05938de5bdd2', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Deepika Padukone', 'deepika@mail.com', NULL, NULL, 'lender', 30000, '{}', '12312', 7, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }'),
7-
('230cff88-a594-4922-90cd-05938de5bdd5', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Salman Khan', 'salman@mail.com', NULL, NULL, 'lender', 70000, '{}', '12312', 8, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }');
1+
INSERT INTO public."user" (id, created_at, updated_at, name, email, min_interest_rate, max_exposure, user_type, balance, demographic_info, phone, user_number, corpus_share, kyc_approved, roi, account_details) VALUES
2+
('8653118e-7a00-4c4f-be53-0b2e04485db0', '2020-09-01 16:24:32.225944+00', '2020-09-01 16:24:32.225944+00', 'Vishal', 'vishal@arboreum.dev', NULL, NULL, 'lender', 0, '{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '7342723929', 1, 0, false, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }', '{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}'),
3+
('230cff88-a594-4922-90cd-05938de5bdd0', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'admin', 'dev@arboreum.dev', NULL, NULL, 'lender', 23000,'{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '12312', 4, 0, true, '{ "total_apr": { "apr": 0, "interest": { "paid": 0, "remain": 0 }, "principal": { "paid": 0, "remain": 0 } }, "apr_on_pledges": {}, "apr_on_loans": {} }','{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}'),
4+
('130cff88-a594-4922-90cd-05938de5bdd0', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Julius Faber', 'julius@arboreum.dev', NULL, NULL, 'lender', 0,'{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '1231211', 5, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }','{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}'),
5+
('8653118e-7a00-4c4f-be53-0b2e04485db1', '2020-09-01 16:24:32.225944+00', '2020-09-01 16:24:32.225944+00', 'Amitabh Bachann', 'amitabh@mail.com', NULL, NULL, 'borrower', 0,'{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '7342723929', 6, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }', '{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}'),
6+
('230cff88-a594-4922-90cd-05938de5bdd2', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Deepika Padukone', 'deepika@mail.com', NULL, NULL, 'lender', 30000,'{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '12312', 7, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }', '{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}'),
7+
('230cff88-a594-4922-90cd-05938de5bdd5', '2020-09-01 18:05:33.10771+00', '2020-09-02 20:38:30.446776+00', 'Salman Khan', 'salman@mail.com', NULL, NULL, 'lender', 70000,'{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}' , '12312', 8, 0, true, '{ "total_apr": { "apr": "0", "interest": { "paid": "0", "remain": "0" }, "principal": { "paid": "0", "remain": "0" } }, "apr_on_pledges": {}, "apr_on_loans": {} }', '{"rcAccount":{"branchCode":"FIXED","investor_id":"","accountNumber":""},"bankDetails":{"bankName":"example","branchCode":"123","accountType":"CURRENT","accountNumber":"1xxx"}}');
88
SELECT pg_catalog.setval('public.user_user_number_seq', 11, true);
99

1010
-- Add Loan Request for gparuthi@gmail.com
@@ -16,3 +16,6 @@ INSERT INTO public.loan_requests (borrower_id, created_at, amount, status, reque
1616
INSERT INTO public.supporters (request_id, supporter_id, pledge_amount, status, invest_in_corpus, participation_request_time, guarantee_division, info) VALUES
1717
('44c6d2cb-062c-4dac-a88f-0df0f32bba96', '230cff88-a594-4922-90cd-05938de5bdd0', 20000, 'unknown', true, '2020-10-13 01:04:37.41869+00', '{}', '{"name": "gp", "email": "gp@arboreum.dev", "amount": "2000", "known_since": "Aug 2011", "supporter_relation": "Manager"}'),
1818
('44c6d2cb-062c-4dac-a88f-0df0f32bba91', '230cff88-a594-4922-90cd-05938de5bdd2', 20000, 'unknown', true, '2020-10-13 01:04:37.41869+00', '{}', '{"name": "deepika", "email": "deepika@mail.com", "amount": "2000", "known_since": "Aug 2011", "supporter_relation": "Manager"}');
19+
20+
-- demographic fixture
21+
-- '{"father":{"lastName":"fatherLast","firstName":"fatherFirst"},"gender":"MALE","income":"2000000-1000000000","address":"somePlace 3000","zipCode":"40453","aadharPassword":"123"}'

production/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Make json file like
2020
"AWS_ACCESS_KEY_ID_APP": "AWS_ACCESS_KEY_ID_APP",
2121
"AWS_SECRET_ACCESS_KEY_APP": "AWS_SECRET_ACCESS_KEY_APP",
2222
"ENVIRONMENT": "ENVIRONMENT",
23-
"SWARMAI_URL": "SWARMAI_URL"
23+
"SWARMAI_URL": "SWARMAI_URL",
24+
"ADMIN_EMAIL": "ADMIN_EMAIL"
2425
}
2526
```
2627

production/docker-compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ services:
66
- "8075:8080"
77
restart: always
88
environment:
9-
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:arbor3umpg@arboreum-sf.cvdulo7qnwp6.us-west-1.rds.amazonaws.com:5432/pilot_db_9_16_2020
9+
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:arbor3umpg2@arboreum-sf2.cvdulo7qnwp6.us-west-1.rds.amazonaws.com:5432/prod_db
1010
## enable the console served by server
1111
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
1212
## enable debugging mode. It is recommended to disable this in production
1313
HASURA_GRAPHQL_DEV_MODE: "true"
1414
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
1515
## uncomment next line to set an admin secret
16-
HASURA_GRAPHQL_ADMIN_SECRET: arbo_secret_hasura_gs
16+
# HASURA_GRAPHQL_ADMIN_SECRET: arbo_secret_hasura_gs
17+
HASURA_GRAPHQL_ADMIN_SECRET: 41dgE7roC0ePLA3Cv8iuP2JY0QhPIhQfOw6tc1yiMmrTjmm2ig

src/components/common/onboarding/investBorrowButtons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const InvestBorrowButtons = (props: { needSignin?: boolean }) => {
2222
Invest
2323
</Button>
2424
<Button
25+
disabled
2526
onClick={() => {
2627
onclick(UserType.Borrower)
2728
}}

0 commit comments

Comments
 (0)