summaryrefslogtreecommitdiffstats
path: root/bank-eiffel/account.e
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-22 17:29:58 +0200
committermanuel <manuel@mausz.at>2011-05-22 17:29:58 +0200
commit4453374f4e9ae51ea4d9dec4c4407e420e61b72f (patch)
treec11b7d7e66aff8727d491cbf3b1b605ed2f64d4c /bank-eiffel/account.e
parentc34798ced5fa423e3fc448f5b43f55e716d4b925 (diff)
downloadfoop-4453374f4e9ae51ea4d9dec4c4407e420e61b72f.tar.gz
foop-4453374f4e9ae51ea4d9dec4c4407e420e61b72f.tar.bz2
foop-4453374f4e9ae51ea4d9dec4c4407e420e61b72f.zip
some stuff..
Diffstat (limited to 'bank-eiffel/account.e')
-rw-r--r--bank-eiffel/account.e14
1 files changed, 7 insertions, 7 deletions
diff --git a/bank-eiffel/account.e b/bank-eiffel/account.e
index 154a1fa..3ef7a8b 100644
--- a/bank-eiffel/account.e
+++ b/bank-eiffel/account.e
@@ -51,8 +51,9 @@ feature {NONE} -- Initialization
51 51
52feature -- Basic operations 52feature -- Basic operations
53 53
54 deposit (an_amount: like transfer_minamount) 54 deposit (an_amount: like transfer_minamount; an_authorized_signer: PERSON)
55 require 55 require
56 an_authorized_signer_authorized: authorized_signers.has (an_authorized_signer)
56 an_amount_positive: an_amount > 0.0 57 an_amount_positive: an_amount > 0.0
57 transfer_minamount_ok: an_amount >= transfer_minamount 58 transfer_minamount_ok: an_amount >= transfer_minamount
58 do 59 do
@@ -62,8 +63,9 @@ feature -- Basic operations
62 deposited: balance = old balance + an_amount 63 deposited: balance = old balance + an_amount
63 end 64 end
64 65
65 withdraw (an_amount: like transfer_minamount) 66 withdraw (an_amount: like transfer_minamount; an_authorized_signer: PERSON)
66 require 67 require
68 an_authorized_signer_authorized: authorized_signers.has (an_authorized_signer)
67 an_amount_positive: an_amount > 0.0 69 an_amount_positive: an_amount > 0.0
68 transfer_minamount_ok: an_amount >= transfer_minamount 70 transfer_minamount_ok: an_amount >= transfer_minamount
69 do 71 do
@@ -74,14 +76,12 @@ feature -- Basic operations
74 creditline_ok: balance >= creditline 76 creditline_ok: balance >= creditline
75 end 77 end
76 78
77 transfer(an_amount: like transfer_minamount; an_account: like Current) 79 transfer(an_amount: like transfer_minamount; an_authorized_signer: PERSON; an_account: like Current; another_authorized_signer: PERSON;)
78 require 80 require
79 an_amount_positive: an_amount > 0.0
80 transfer_minamount_ok: an_amount >= transfer_minamount
81 an_account_attached: an_account /= Void 81 an_account_attached: an_account /= Void
82 do 82 do
83 withdraw (an_amount) 83 withdraw (an_amount, an_authorized_signer)
84 an_account.deposit (an_amount) 84 an_account.deposit (an_amount, another_authorized_signer)
85 end 85 end
86 86
87 add_authorized_signer (an_authorized_signer: PERSON) 87 add_authorized_signer (an_authorized_signer: PERSON)