# SEPA instant 需求
### API


* createAccount(2h):
* setting
* clearingSystem: SepaND
* currency: EUR
* store in user_transfer_info, need column for whitelist
* createDeposit(2h)
* as current balanceAudit, additional column for shorter remark(notes)
---

* get balanceAudit_status(new)
---

* createWithdraw(4h) - balanceAudit: almost the same as current, only check new status(wait to check with PM)
* callWithdraw(payout) - for admin(non-whitelist) and payment(whitelist)
* callback response(8h): update balanceAudit/ create new balanceAudit(if pairing fail)
* deposit
* for not whitelist account: wait-callBack -> open(?)-> pending approval
* for whitelist account: wait-callback -> complete
* for not pairing issue:
* create another balance audit
* withdraw
* update status
* ask txn detail(2h): after get callback, track detail to check.
---

* get user_transfer_info_list(2h)
* account query by userId and pmid(self_sepa)
---

* add bank API (write to db.user_transfer_info)(3h)
### schema change
1. balanceAudit adding new status
* wait callback
* not pairing response
* non-whitelist: get callback-wait manually approval
* get callback- data compare fail - wait manually handle
* whitelist - amount greater than upperlimit - wait manually handle
* complete(whitelist: get callback- data sync successfully)
3. balanceAudit use notes as remark
4. user_transfer_info add column(boolean nullable/ 0,1,2) for whitelist or not, nullable for systembankInfo or other no need whitelist third party account, or use status column?
---
1. function test estimation: 8h
### wait to discusss with PM(1-2 hr)
1. the balanceaudit status change enough to apply for admin- special page for SEPA?
2. the not pairing event handling?
3. whitelist only for account with success withdrawl?
4. account upper limit?
---
#### remark field
stored in balanceAudit-notes?
* Description field
* Sender Reference field
1. The standard for remittance information is intended to be that the string arrives as an unchanged string with a length up to 35 chars.
For Deposits, it is possible the reference id shows up in either the Description field, or the Sender Reference field.
For Deposits, we have seen the following different behaviors, though infrequently, depending on the sender/intermediate financial institutions:
* White spaces may be removed
* Lower case letters may be converted to caps
* Lower case letters may be converted to whitespace
* Length may be truncated to, we've seen as low as 13 chars
* If not provided at all Sender Reference will show up as: NOTPROVIDED and Description will be blank.
There may be more but these are the common ones
### payorder
payment_ref:
payment_ref is for recording thirdparty transaction unique
transaction_ref:
transaction_ref is for sequencial number in our side, ex: 20200817000880
bank_id:
It is for mapping balanceAudit bank_id, it will be stored the <font color='red'> userTransferInfoId???? </font>
* need other column record "remarks"
* add column store "acoount number"
* for query issue, build index
* composite index: pmid, ref
userTransfer_info
build ref_account,pmid-> unique
### deposit flow
1. create account to display
2. get callback
3. send email inform user amount transfering in account
### withdraw flow
request creating sending email
get ammount send 2nd email