-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(connect transactions endpoint to database):
connect transaction endpoint to database [Starts #165434274]
- Loading branch information
Showing
11 changed files
with
362 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
id | email | firstname | lastname | accountnumber | createdon | owner | type | status | balance | ||
----+---------------------+-----------+----------+---------------+-----------+-------+---------+---------+--------- | ||
1 | banka872@banka4.com | | | 3702581476 | 17/4/2019 | 50 | savings | active | 0 | ||
2 | banka872@banka4.com | | | 3872146107 | 17/4/2019 | 50 | savings | active | 0 | ||
5 | banka872@banka4.com | cavdy | isaiah | 3548652217 | 17/4/2019 | 50 | savings | active | 0 | ||
6 | banka872@banka4.com | cavdy | isaiah | 3491564558 | 17/4/2019 | 50 | savings | active | 0 | ||
7 | banka872@banka4.com | cavdy | isaiah | 3146859791 | 17/4/2019 | 54 | savings | active | 0 | ||
8 | banka872@banka4.com | cavdy | isaiah | 3779533562 | 17/4/2019 | 55 | savings | active | 0 | ||
3 | banka872@banka4.com | cavdy | isaiah | 3699742813 | 17/4/2019 | 50 | savings | dormant | 0 | ||
10 | banka872@banka4.com | cavdy | isaiah | 3484311663 | 17/4/2019 | 57 | savings | active | 0 | ||
11 | banka872@banka4.com | cavdy | isaiah | 3204762909 | 17/4/2019 | 57 | savings | active | 0 | ||
12 | banka872@banka4.com | cavdy | isaiah | 3877851924 | 17/4/2019 | 59 | savings | active | 0 | ||
13 | banka872@banka4.com | cavdy | isaiah | 3072181085 | 17/4/2019 | 60 | savings | active | 0 | ||
14 | banka872@banka4.com | cavdy | isaiah | 3432650514 | 17/4/2019 | 60 | savings | active | 0 | ||
15 | banka872@banka4.com | cavdy | isaiah | 3983443368 | 17/4/2019 | 61 | savings | active | 0 | ||
16 | banka872@banka4.com | cavdy | isaiah | 3438930243 | 17/4/2019 | 61 | savings | active | 0 | ||
17 | banka872@banka4.com | cavdy | isaiah | 3655609161 | 17/4/2019 | 62 | savings | active | 0 | ||
18 | banka872@banka4.com | cavdy | isaiah | 3297739483 | 17/4/2019 | 62 | savings | active | 0 | ||
19 | banka872@banka4.com | cavdy | isaiah | 3633960829 | 17/4/2019 | 62 | savings | active | 0 | ||
20 | banka872@banka4.com | cavdy | isaiah | 3003801983 | 17/4/2019 | 63 | savings | active | 0 | ||
21 | banka872@banka4.com | cavdy | isaiah | 3453420061 | 17/4/2019 | 63 | savings | active | 0 | ||
22 | banka872@banka4.com | cavdy | isaiah | 3797532048 | 17/4/2019 | 63 | savings | active | 0 | ||
23 | admin@banka.com | cavdy | ikenna | 3515833161 | 17/4/2019 | 64 | savings | active | 0 | ||
24 | banka872@banka4.com | cavdy | isaiah | 3931715014 | 17/4/2019 | 65 | savings | active | 0 | ||
25 | banka872@banka4.com | cavdy | isaiah | 3502561578 | 17/4/2019 | 65 | savings | active | 0 | ||
26 | banka872@banka4.com | cavdy | isaiah | 3261422912 | 17/4/2019 | 65 | savings | active | 0 | ||
27 | banka872@banka4.com | cavdy | isaiah | 3298245957 | 17/4/2019 | 67 | savings | active | 0 | ||
28 | banka872@banka4.com | cavdy | isaiah | 3461967601 | 17/4/2019 | 67 | savings | active | 0 | ||
29 | banka872@banka4.com | cavdy | isaiah | 3243384247 | 17/4/2019 | 67 | savings | active | 0 | ||
30 | admin@banka.com | cavdy | ikenna | 3563254210 | 17/4/2019 | 68 | savings | active | 0 | ||
31 | banka872@banka4.com | cavdy | isaiah | 3534066798 | 17/4/2019 | 69 | savings | active | 0 | ||
32 | banka872@banka4.com | cavdy | isaiah | 3482397810 | 17/4/2019 | 69 | savings | active | 0 | ||
33 | banka872@banka4.com | cavdy | isaiah | 3110547517 | 17/4/2019 | 69 | savings | active | 0 | ||
34 | banka872@banka4.com | cavdy | isaiah | 3437719577 | 17/4/2019 | 69 | savings | active | 0 | ||
35 | banka872@banka4.com | cavdy | isaiah | 3548538073 | 17/4/2019 | 71 | savings | active | 0 | ||
36 | banka872@banka4.com | cavdy | isaiah | 3703724774 | 17/4/2019 | 73 | savings | active | 0 | ||
37 | banka872@banka4.com | cavdy | isaiah | 3124616562 | 17/4/2019 | 75 | savings | active | 0 | ||
38 | banka872@banka4.com | cavdy | isaiah | 3057087124 | 17/4/2019 | 77 | savings | active | 0 | ||
39 | banka872@banka4.com | cavdy | isaiah | 3753591929 | 17/4/2019 | 79 | savings | active | 0 | ||
40 | banka872@banka4.com | cavdy | isaiah | 3008302349 | 17/4/2019 | 81 | savings | active | 0 | ||
41 | banka872@banka4.com | cavdy | isaiah | 3164295216 | 17/4/2019 | 83 | savings | active | 0 | ||
42 | banka872@banka4.com | cavdy | isaiah | 3355341006 | 17/4/2019 | 85 | savings | active | 0 | ||
43 | banka872@banka4.com | cavdy | isaiah | 3043952815 | 17/4/2019 | 87 | savings | active | 0 | ||
44 | banka872@banka4.com | cavdy | isaiah | 3331809305 | 17/4/2019 | 89 | savings | active | 0 | ||
45 | banka872@banka4.com | cavdy | isaiah | 3983804072 | 17/4/2019 | 91 | savings | active | 0 | ||
46 | banka872@banka4.com | cavdy | isaiah | 3446930353 | 17/4/2019 | 93 | savings | active | 0 | ||
47 | banka872@banka4.com | cavdy | isaiah | 3571949659 | 17/4/2019 | 95 | savings | active | 0 | ||
48 | banka872@banka4.com | cavdy | isaiah | 3242133029 | 17/4/2019 | 97 | savings | active | 0 | ||
49 | banka872@banka4.com | cavdy | isaiah | 3384304769 | 17/4/2019 | 107 | savings | active | 0 | ||
50 | banka872@banka4.com | cavdy | isaiah | 3429391534 | 17/4/2019 | 107 | savings | active | 0 | ||
51 | banka872@banka4.com | cavdy | isaiah | 3344395362 | 17/4/2019 | 107 | savings | active | 0 | ||
(49 rows) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- Transactions SQL query | ||
|
||
-- create transactions table | ||
CREATE TABLE transactions ( | ||
id SERIAL PRIMARY KEY UNIQUE, | ||
createdOn VARCHAR(40), | ||
type VARCHAR(10), | ||
accountNumber BIGINT, | ||
cashier INTEGER, | ||
amount FLOAT, | ||
oldBalance FLOAT, | ||
newBalance FLOAT | ||
); | ||
|
||
-- select all from transactions table | ||
SELECT * FROM transactions LIMIT 10 | ||
|
||
-- select account number fro transactions | ||
SELECT accountNumber FROM transactions WHERE accountNumber=$1, ['accountNumber'] | ||
|
||
-- insert into transactions table | ||
INSERT into transactions values($1), ['value'] | ||
|
||
-- update | ||
UPDATE transactions SET balance=$1 WHERE accountnumber=$2, [newBalance, accountNumber] | ||
|
||
-- delete from transactions table | ||
DELETE FROM transactions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
export default class Transaction { | ||
constructor() { | ||
this.id = null; | ||
this.createdOn = null; | ||
this.type = null; // credit or debit | ||
this.transactionId = null; | ||
this.accountNumber = null; | ||
this.cashier = null; // cashier id | ||
this.amount = null; | ||
this.oldBalance = null; | ||
this.newBalance = null; | ||
this.cashier = null; // cashier id | ||
this.transactionType = null; // credit or debit | ||
this.accountBalance = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.