|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare( strict_types = 1 ); |
|
4
|
|
|
|
|
5
|
|
|
namespace WMDE\Fundraising\Frontend\MembershipContext\UseCases\ApplyForMembership; |
|
6
|
|
|
|
|
7
|
|
|
use WMDE\Fundraising\Frontend\FreezableValueObject; |
|
8
|
|
|
use WMDE\Fundraising\Frontend\MembershipContext\Tracking\MembershipApplicationTrackingInfo; |
|
9
|
|
|
use WMDE\Fundraising\Frontend\PaymentContext\Domain\Model\BankData; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* @license GNU GPL v2+ |
|
13
|
|
|
* @author Jeroen De Dauw < [email protected] > |
|
14
|
|
|
*/ |
|
15
|
|
|
class ApplyForMembershipRequest { |
|
16
|
|
|
use FreezableValueObject; |
|
17
|
|
|
|
|
18
|
|
|
private $membershipType; |
|
19
|
|
|
|
|
20
|
|
|
private $applicantIsCompany = false; |
|
21
|
|
|
private $applicantCompanyName; |
|
22
|
|
|
private $applicantSalutation; |
|
23
|
|
|
private $applicantTitle; |
|
24
|
|
|
private $applicantFirstName; |
|
25
|
|
|
private $applicantLastName; |
|
26
|
|
|
|
|
27
|
|
|
private $applicantStreetAddress; |
|
28
|
|
|
private $applicantPostalCode; |
|
29
|
|
|
private $applicantCity; |
|
30
|
|
|
private $applicantCountryCode; |
|
31
|
|
|
|
|
32
|
|
|
private $applicantEmailAddress; |
|
33
|
|
|
private $applicantPhoneNumber; |
|
34
|
|
|
private $applicantDateOfBirth; |
|
35
|
|
|
|
|
36
|
|
|
private $paymentIntervalInMonths; |
|
37
|
|
|
private $paymentAmount; |
|
38
|
|
|
private $paymentBankData; |
|
39
|
|
|
|
|
40
|
|
|
private $trackingInfo; |
|
41
|
|
|
private $piwikTrackingString; |
|
42
|
|
|
|
|
43
|
|
|
public function getMembershipType(): string { |
|
44
|
|
|
return $this->membershipType; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function setMembershipType( string $membershipType ) { |
|
48
|
|
|
$this->assertIsWritable(); |
|
49
|
|
|
$this->membershipType = $membershipType; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return bool True when the applicant is a company, false when the applicant is a private person |
|
54
|
|
|
*/ |
|
55
|
|
|
public function isCompanyApplication(): bool { |
|
56
|
|
|
return $this->applicantIsCompany; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function markApplicantAsCompany() { |
|
60
|
|
|
$this->assertIsWritable(); |
|
61
|
|
|
$this->applicantIsCompany = true; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function getApplicantCompanyName(): string { |
|
65
|
|
|
return $this->applicantCompanyName; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function setApplicantCompanyName( string $applicantCompanyName ) { |
|
69
|
|
|
$this->applicantCompanyName = $applicantCompanyName; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function getApplicantSalutation(): string { |
|
73
|
|
|
return $this->applicantSalutation; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function setApplicantSalutation( string $applicantSalutation ) { |
|
77
|
|
|
$this->assertIsWritable(); |
|
78
|
|
|
$this->applicantSalutation = $applicantSalutation; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function getApplicantTitle(): string { |
|
82
|
|
|
return $this->applicantTitle; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
public function setApplicantTitle( string $applicantTitle ) { |
|
86
|
|
|
$this->assertIsWritable(); |
|
87
|
|
|
$this->applicantTitle = $applicantTitle; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function getApplicantFirstName(): string { |
|
91
|
|
|
return $this->applicantFirstName; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function setApplicantFirstName( string $applicantFirstName ) { |
|
95
|
|
|
$this->assertIsWritable(); |
|
96
|
|
|
$this->applicantFirstName = $applicantFirstName; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function getApplicantLastName(): string { |
|
100
|
|
|
return $this->applicantLastName; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function setApplicantLastName( string $applicantLastName ) { |
|
104
|
|
|
$this->assertIsWritable(); |
|
105
|
|
|
$this->applicantLastName = $applicantLastName; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function getApplicantStreetAddress(): string { |
|
109
|
|
|
return $this->applicantStreetAddress; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function setApplicantStreetAddress( string $applicantStreetAddress ) { |
|
113
|
|
|
$this->assertIsWritable(); |
|
114
|
|
|
$this->applicantStreetAddress = $applicantStreetAddress; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
public function getApplicantPostalCode(): string { |
|
118
|
|
|
return $this->applicantPostalCode; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
public function setApplicantPostalCode( string $applicantPostalCode ) { |
|
122
|
|
|
$this->assertIsWritable(); |
|
123
|
|
|
$this->applicantPostalCode = $applicantPostalCode; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
public function getApplicantCity(): string { |
|
127
|
|
|
return $this->applicantCity; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
public function setApplicantCity( string $applicantCity ) { |
|
131
|
|
|
$this->assertIsWritable(); |
|
132
|
|
|
$this->applicantCity = $applicantCity; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
public function getApplicantCountryCode(): string { |
|
136
|
|
|
return $this->applicantCountryCode; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
public function setApplicantCountryCode( string $applicantCountryCode ) { |
|
140
|
|
|
$this->assertIsWritable(); |
|
141
|
|
|
$this->applicantCountryCode = $applicantCountryCode; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
public function getApplicantEmailAddress(): string { |
|
145
|
|
|
return $this->applicantEmailAddress; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
public function setApplicantEmailAddress( string $applicantEmailAddress ) { |
|
149
|
|
|
$this->assertIsWritable(); |
|
150
|
|
|
$this->applicantEmailAddress = $applicantEmailAddress; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
public function getApplicantPhoneNumber(): string { |
|
154
|
|
|
return $this->applicantPhoneNumber; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
public function setApplicantPhoneNumber( string $applicantPhoneNumber ) { |
|
158
|
|
|
$this->assertIsWritable(); |
|
159
|
|
|
$this->applicantPhoneNumber = $applicantPhoneNumber; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
public function getApplicantDateOfBirth(): string { |
|
163
|
|
|
return $this->applicantDateOfBirth; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
public function setApplicantDateOfBirth( string $applicantDateOfBirth ) { |
|
167
|
|
|
$this->assertIsWritable(); |
|
168
|
|
|
$this->applicantDateOfBirth = $applicantDateOfBirth; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
public function getPaymentIntervalInMonths(): int { |
|
172
|
|
|
return $this->paymentIntervalInMonths; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
public function setPaymentIntervalInMonths( int $paymentIntervalInMonths ) { |
|
176
|
|
|
$this->assertIsWritable(); |
|
177
|
|
|
$this->paymentIntervalInMonths = $paymentIntervalInMonths; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
public function getPaymentAmountInEuros(): string { |
|
181
|
|
|
return $this->paymentAmount; |
|
182
|
|
|
} |
|
183
|
|
|
|
|
184
|
|
|
public function setPaymentAmountInEuros( string $paymentAmount ) { |
|
185
|
|
|
$this->assertIsWritable(); |
|
186
|
|
|
$this->paymentAmount = $paymentAmount; |
|
187
|
|
|
} |
|
188
|
|
|
|
|
189
|
|
|
public function getPaymentBankData(): BankData { |
|
190
|
|
|
return $this->paymentBankData; |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
public function setPaymentBankData( BankData $paymentBankData ) { |
|
194
|
|
|
$this->assertIsWritable(); |
|
195
|
|
|
$this->paymentBankData = $paymentBankData; |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
public function getTrackingInfo(): MembershipApplicationTrackingInfo { |
|
199
|
|
|
return $this->trackingInfo; |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
public function setTrackingInfo( MembershipApplicationTrackingInfo $trackingInfo ) { |
|
203
|
|
|
$this->assertIsWritable(); |
|
204
|
|
|
$this->trackingInfo = $trackingInfo; |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
public function getPiwikTrackingString(): string { |
|
208
|
|
|
return $this->piwikTrackingString; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
public function setPiwikTrackingString( string $piwikTrackingString ) { |
|
212
|
|
|
$this->assertIsWritable(); |
|
213
|
|
|
$this->piwikTrackingString = $piwikTrackingString; |
|
214
|
|
|
} |
|
215
|
|
|
|
|
216
|
|
|
} |
|
217
|
|
|
|