-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Finally Done with this issue
- Loading branch information
Showing
14 changed files
with
467 additions
and
109 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 |
---|---|---|
@@ -1 +1,29 @@ | ||
// Adding / Spending Balance History | ||
|
||
const mongoose = require("mongoose"); | ||
var Float = require("mongoose-float").loadType(mongoose); | ||
|
||
const TransactionSchema = new mongoose.Schema({ | ||
details: { | ||
type: String, | ||
required: true, | ||
}, | ||
amount: { | ||
type: Float, | ||
required: true, | ||
}, | ||
opration: { | ||
type: String, | ||
required: true | ||
}, | ||
user: { | ||
type: mongoose.Schema.Types.ObjectId, | ||
ref: 'User', | ||
}, | ||
createdAt: { | ||
type: Date, | ||
default: Date.now, | ||
}, | ||
}); | ||
|
||
module.exports = mongoose.model("Transaction", TransactionSchema); |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,26 +1,25 @@ | ||
<main class="md:col-span-4 bg-gray-300 md:ml-56 lg:ml-64 md:pr-14 w-full rounded"> | ||
<div class="container px-5 py-10 mx-auto md:px-auto"> | ||
<header> | ||
<h2 class="text-blue-700 text-4xl font-semibold leading-none tracking-wider"> <a href="/portfolio"><i class="fas fa-arrow-left"></i></a> AddBalance | ||
</h2> | ||
</header> | ||
<div> | ||
<div class="relative text--600 mt-12 shadow-md rounded-b-lg py-4 pl-2 font-bold"> | ||
<h3 class="underline sm:no-underline md:line-through lg:underline xl:no-underline text-blue-700"> Your Current Balance: | ||
<%= user.balance%> | ||
</h3> | ||
</div> | ||
<div class="container py-16 mx-auto"> | ||
<form action="/addBalance" method="POST" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"> | ||
<div class="mb-5"> | ||
<label class="block text-gray-700 text-xl font-bold mb-2"> | ||
Enter amount | ||
</label> | ||
<input type="number" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" name="addAmount" placeholder="amount" /> | ||
<input type="submit" value="Add" class=" mt-2 bg-blue-500 hover:bg-blue-400 text-white font-bold py-2 px-6 rounded-full focus:outline-none focus:shadow-outline " /> | ||
</div> | ||
</form> | ||
</div> | ||
<section class="text-gray-700 body-font md:ml-56 lg:ml-64 md:mx-auto md:pr-14 w-screen inline"> | ||
<div class="container px-5 py-10 mx-auto md:px-auto"> | ||
<div class="my-4 absolute-center"> | ||
<h2 class="text-gray-700 lg:text-6xl text-5xl font-semibold leading-none tracking-wider px-5">Add Balance</h2> | ||
</div> | ||
<hr class="line"> | ||
|
||
<div class="container py-16 mx-auto"> | ||
<h3>Your Current Balance: <%= user.balance%></h3> | ||
<form action="/addBalance" method="POST" class="bg-white shadow-md rounded-lg px-8 pt-6 pb-8 my-6"> | ||
<div class="text-center mb-4"> | ||
<label class="block text-gray-700 text-sm font-bold mb-2"> | ||
Enter amount | ||
</label> | ||
<input type="number" | ||
class="shadow appearance-none border rounded w-4/5 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" | ||
name="addAmount" placeholder="amount" /> | ||
<input type="submit" value="Add" | ||
class="button text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" /> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
</div> | ||
</main> | ||
</div> | ||
</section> |
Oops, something went wrong.