|
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 $paymentType; |
|
37
|
|
|
private $paymentIntervalInMonths; |
|
38
|
|
|
private $paymentAmount; |
|
39
|
|
|
private $bankData; |
|
40
|
|
|
|
|
41
|
|
|
private $trackingInfo; |
|
42
|
|
|
private $piwikTrackingString; |
|
43
|
|
|
|
|
44
|
|
|
private $optsIntoDonationReceipt = true; |
|
45
|
|
|
|
|
46
|
|
|
public function getMembershipType(): string { |
|
47
|
|
|
return $this->membershipType; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function setMembershipType( string $membershipType ): void { |
|
51
|
|
|
$this->assertIsWritable(); |
|
52
|
|
|
$this->membershipType = $membershipType; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @return bool True when the applicant is a company, false when the applicant is a private person |
|
57
|
|
|
*/ |
|
58
|
|
|
public function isCompanyApplication(): bool { |
|
59
|
|
|
return $this->applicantIsCompany; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function markApplicantAsCompany(): void { |
|
63
|
|
|
$this->assertIsWritable(); |
|
64
|
|
|
$this->applicantIsCompany = true; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getApplicantCompanyName(): string { |
|
68
|
|
|
return $this->applicantCompanyName; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function setApplicantCompanyName( string $applicantCompanyName ): void { |
|
72
|
|
|
$this->applicantCompanyName = $applicantCompanyName; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getApplicantSalutation(): string { |
|
76
|
|
|
return $this->applicantSalutation; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function setApplicantSalutation( string $applicantSalutation ): void { |
|
80
|
|
|
$this->assertIsWritable(); |
|
81
|
|
|
$this->applicantSalutation = $applicantSalutation; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function getApplicantTitle(): string { |
|
85
|
|
|
return $this->applicantTitle; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function setApplicantTitle( string $applicantTitle ): void { |
|
89
|
|
|
$this->assertIsWritable(); |
|
90
|
|
|
$this->applicantTitle = $applicantTitle; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getApplicantFirstName(): string { |
|
94
|
|
|
return $this->applicantFirstName; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function setApplicantFirstName( string $applicantFirstName ): void { |
|
98
|
|
|
$this->assertIsWritable(); |
|
99
|
|
|
$this->applicantFirstName = $applicantFirstName; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
public function getApplicantLastName(): string { |
|
103
|
|
|
return $this->applicantLastName; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function setApplicantLastName( string $applicantLastName ): void { |
|
107
|
|
|
$this->assertIsWritable(); |
|
108
|
|
|
$this->applicantLastName = $applicantLastName; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
public function getApplicantStreetAddress(): string { |
|
112
|
|
|
return $this->applicantStreetAddress; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
public function setApplicantStreetAddress( string $applicantStreetAddress ): void { |
|
116
|
|
|
$this->assertIsWritable(); |
|
117
|
|
|
$this->applicantStreetAddress = $applicantStreetAddress; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
public function getApplicantPostalCode(): string { |
|
121
|
|
|
return $this->applicantPostalCode; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
public function setApplicantPostalCode( string $applicantPostalCode ): void { |
|
125
|
|
|
$this->assertIsWritable(); |
|
126
|
|
|
$this->applicantPostalCode = $applicantPostalCode; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
public function getApplicantCity(): string { |
|
130
|
|
|
return $this->applicantCity; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function setApplicantCity( string $applicantCity ): void { |
|
134
|
|
|
$this->assertIsWritable(); |
|
135
|
|
|
$this->applicantCity = $applicantCity; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
public function getApplicantCountryCode(): string { |
|
139
|
|
|
return $this->applicantCountryCode; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
public function setApplicantCountryCode( string $applicantCountryCode ): void { |
|
143
|
|
|
$this->assertIsWritable(); |
|
144
|
|
|
$this->applicantCountryCode = $applicantCountryCode; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function getApplicantEmailAddress(): string { |
|
148
|
|
|
return $this->applicantEmailAddress; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
public function setApplicantEmailAddress( string $applicantEmailAddress ): void { |
|
152
|
|
|
$this->assertIsWritable(); |
|
153
|
|
|
$this->applicantEmailAddress = $applicantEmailAddress; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
public function getApplicantPhoneNumber(): string { |
|
157
|
|
|
return $this->applicantPhoneNumber; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
public function setApplicantPhoneNumber( string $applicantPhoneNumber ): void { |
|
161
|
|
|
$this->assertIsWritable(); |
|
162
|
|
|
$this->applicantPhoneNumber = $applicantPhoneNumber; |
|
163
|
|
|
} |
|
164
|
|
|
|
|
165
|
|
|
public function getApplicantDateOfBirth(): string { |
|
166
|
|
|
return $this->applicantDateOfBirth; |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
public function setApplicantDateOfBirth( string $applicantDateOfBirth ): void { |
|
170
|
|
|
$this->assertIsWritable(); |
|
171
|
|
|
$this->applicantDateOfBirth = $applicantDateOfBirth; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
public function getPaymentIntervalInMonths(): int { |
|
175
|
|
|
return $this->paymentIntervalInMonths; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function setPaymentIntervalInMonths( int $paymentIntervalInMonths ): void { |
|
179
|
|
|
$this->assertIsWritable(); |
|
180
|
|
|
$this->paymentIntervalInMonths = $paymentIntervalInMonths; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
public function getPaymentAmountInEuros(): string { |
|
184
|
|
|
return $this->paymentAmount; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
public function setPaymentAmountInEuros( string $paymentAmount ): void { |
|
188
|
|
|
$this->assertIsWritable(); |
|
189
|
|
|
$this->paymentAmount = $paymentAmount; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
public function getBankData(): ?BankData { |
|
193
|
|
|
return $this->bankData; |
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
public function setBankData( BankData $bankData ): void { |
|
197
|
|
|
$this->assertIsWritable(); |
|
198
|
|
|
$this->bankData = $bankData; |
|
199
|
|
|
} |
|
200
|
|
|
|
|
201
|
|
|
public function getTrackingInfo(): MembershipApplicationTrackingInfo { |
|
202
|
|
|
return $this->trackingInfo; |
|
203
|
|
|
} |
|
204
|
|
|
|
|
205
|
|
|
public function setTrackingInfo( MembershipApplicationTrackingInfo $trackingInfo ): void { |
|
206
|
|
|
$this->assertIsWritable(); |
|
207
|
|
|
$this->trackingInfo = $trackingInfo; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
public function getPiwikTrackingString(): string { |
|
211
|
|
|
return $this->piwikTrackingString; |
|
212
|
|
|
} |
|
213
|
|
|
|
|
214
|
|
|
public function setPiwikTrackingString( string $piwikTrackingString ): void { |
|
215
|
|
|
$this->assertIsWritable(); |
|
216
|
|
|
$this->piwikTrackingString = $piwikTrackingString; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
public function getPaymentType(): string { |
|
220
|
|
|
return $this->paymentType; |
|
221
|
|
|
} |
|
222
|
|
|
|
|
223
|
|
|
public function setPaymentType( string $paymentType ): void { |
|
224
|
|
|
$this->assertIsWritable(); |
|
225
|
|
|
$this->paymentType = $paymentType; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
public function getOptsIntoDonationReceipt(): bool { |
|
229
|
|
|
return $this->optsIntoDonationReceipt; |
|
230
|
|
|
} |
|
231
|
|
|
|
|
232
|
|
|
public function setOptsIntoDonationReceipt( bool $optIn ): void { |
|
233
|
|
|
$this->assertIsWritable(); |
|
234
|
|
|
$this->optsIntoDonationReceipt = $optIn; |
|
235
|
|
|
} |
|
236
|
|
|
|
|
237
|
|
|
} |
|
238
|
|
|
|