summaryrefslogtreecommitdiffstats
path: root/bank-eiffel/retireeaccount.e
blob: 24ae004811a57fda0cd48ede4e60a9a216a1654a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class
	RETIREEACCOUNT

inherit
	ACCOUNT
		redefine
			add_authorized_signer,
			set_default_transfer_minamount
		end

create
	make

feature -- Basic operations

	add_authorized_signer (an_authorized_signer: PERSON)
		do
			check
				authorized_signers_only_one: get_authorized_signers.count = 0
			end
			Precursor (an_authorized_signer)
		end

feature {NONE} -- Implementation

	set_default_transfer_minamount
		do
			set_transfer_minamount (1.0)
		end

invariant
	authorized_signers_only_one: authorized_signers.count = 1
	authorized_signers_attached: authorized_signers.linear_representation /= Void
	authorized_signers_only_retirees:
		(attached authorized_signers.linear_representation as signers) implies signers.for_all(
			agent (person: PERSON): BOOLEAN
				do
					Result := attached {RETIREE} person
				end)
end