+
+
\ No newline at end of file
diff --git a/client/src/SendMoney.svelte b/client/src/SendMoney.svelte
index 3882661..c912bad 100644
--- a/client/src/SendMoney.svelte
+++ b/client/src/SendMoney.svelte
@@ -4,77 +4,89 @@
import CardBG from "./CardBG.svelte";
import InputField from "./InputField.svelte";
import {createEventDispatcher} from 'svelte';
-import Icon from "@iconify/svelte";
+ import Icon from "@iconify/svelte";
+ import Overlay from "./Overlay.svelte";
+ import TextareaField from "./TextareaField.svelte";
+ import { fade, fly, slide } from 'svelte/transition';
+ import { flip } from 'svelte/animate';
const dispatch = createEventDispatcher();
- let type = "";
- let currencies = ["RON", "EUR"];
- let currency = currencies[0];
- let termsAccepted = false;
+ export let account={type: "", currency:"", balance:0};
+ let receivername="";
+ let receiveriban="";
+ let amount=0.00;
+ let description="";
+
+ let send_details={receivername:"", receiveriban:"", amount:0, description:""};
function create(){
- if(type == "" || type == null) {
- alert("Account Name field can not be empty!");
- console.debug(`account name: ${type}`)
- }else if(!currencies.includes(currency)){
- alert("Currency is not supported!");
- }else if (!termsAccepted){
- alert("Terms of Service not accepted!");
+ if(receivername == "" || receivername == null) {
+ alert("Receiver's name field can not be empty!");
+ }else if(receiveriban == "" || receiveriban == null){
+ alert("Receiver's iBan field can not be empty!");
+ }else if (amount > parseFloat(account.balance) ){
+ alert("Not enough money in your account!");
+ }else if (amount <= 0.00 ){
+ alert("Insert a valid amount!");
}else{
//TODO Create account with provided details on the server
- dispatch("createPopup",{type:"create_acc_success"});
+ send_details={receivername:receivername, receiveriban:receiveriban, amount:amount, description:description}
+ dispatch("createPopup",{type:"send_money_success", send_details:{send_details}});
}
}
- function cancelCreate(){
- dispatch("createPopup",{type:"create_acc_cancelled"});
+ function cancelSend(){
+ dispatch("createPopup",{type:"send_money_cancelled"});
}
- function failCreate(){
- dispatch("createPopup",{type:"create_acc_failed", reason:"Invalid arguments. [type: "+type+", currency: "+currency});
- }
-
- function termsOfService() {
- termsAccepted = !termsAccepted;
- }
-
-
-
-
-
Open a new account
-
+
+
+
+
+
+
Send money
+ from
+ {account.type}
+
-
-
-
Account name:
-
-
-
-
-
Currency:
-
-
-
-
-
Terms of Service:
-
-
I have read and accepted the terms and conditions for creating a new account at FOXBANK.