Passed
Push — master ( df4d92...158c77 )
by Florian
02:56 queued 17s
created

Bill::getReservationsSubtotalDiscount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the vseth-musikzimmer-pay project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Model;
13
14
use App\Enum\UserCategoryType;
15
use App\Model\Bill\Recipient;
16
use App\Model\Bill\Reservation;
17
use App\Model\Bill\Subscription;
18
19
class Bill
20
{
21
    /**
22
     * @var string
23
     */
24
    private $id;
25
26
    /**
27
     * @var Recipient
28
     */
29
    private $recipient;
30
31
    /**
32
     * @var \DateTime
33
     */
34
    private $periodStart;
35
36
    /**
37
     * @var \DateTime
38
     */
39
    private $periodEnd;
40
41
    /**
42
     * @var int
43
     */
44
    private $category = UserCategoryType::STUDENT;
45
46
    /**
47
     * @var Reservation[]
48
     */
49
    private $reservations = [];
50
51
    /**
52
     * @var int
53
     */
54
    private $reservationsSubtotal = 0;
55
56
    /**
57
     * @var int
58
     */
59
    private $reservationsSubtotalDiscount = 0;
60
61
    /**
62
     * @var \DateTime|null
63
     */
64
    private $lastPayedSubscriptionEnd;
65
66
    /**
67
     * @var Subscription[]
68
     */
69
    private $subscriptions = [];
70
71
    /**
72
     * @var int
73
     */
74
    private $subscriptionsSubtotal = 0;
75
76
    /**
77
     * @var int
78
     */
79
    private $billFee = 0;
80
81
    /**
82
     * @var int
83
     */
84
    private $discount = 0;
85
86
    /**
87
     * @var string|null
88
     */
89
    private $discountDescription;
90
91
    /**
92
     * @var int
93
     */
94
    private $total = 0;
95
96
    public function getId(): string
97
    {
98
        return $this->id;
99
    }
100
101
    public function setId(string $id): void
102
    {
103
        $this->id = $id;
104
    }
105
106
    public function getRecipient(): Recipient
107
    {
108
        return $this->recipient;
109
    }
110
111
    public function setRecipient(Recipient $recipient): void
112
    {
113
        $this->recipient = $recipient;
114
    }
115
116
    public function getPeriodStart(): \DateTime
117
    {
118
        return $this->periodStart;
119
    }
120
121
    public function setPeriodStart(\DateTime $periodStart): void
122
    {
123
        $this->periodStart = $periodStart;
124
    }
125
126
    public function getPeriodEnd(): \DateTime
127
    {
128
        return $this->periodEnd;
129
    }
130
131
    public function setPeriodEnd(\DateTime $periodEnd): void
132
    {
133
        $this->periodEnd = $periodEnd;
134
    }
135
136
    public function getCategory(): int
137
    {
138
        return $this->category;
139
    }
140
141
    public function setCategory(int $category): void
142
    {
143
        $this->category = $category;
144
    }
145
146
    /**
147
     * @return Reservation[]
148
     */
149
    public function getReservations(): array
150
    {
151
        return $this->reservations;
152
    }
153
154
    /**
155
     * @param Reservation[] $reservations
156
     */
157
    public function setReservations(array $reservations): void
158
    {
159
        $this->reservations = $reservations;
160
    }
161
162
    public function getLastPayedSubscriptionEnd(): ?\DateTime
163
    {
164
        return $this->lastPayedSubscriptionEnd;
165
    }
166
167
    public function setLastPayedSubscriptionEnd(?\DateTime $lastPayedSubscriptionEnd): void
168
    {
169
        $this->lastPayedSubscriptionEnd = $lastPayedSubscriptionEnd;
170
    }
171
172
    /**
173
     * @return Subscription[]
174
     */
175
    public function getSubscriptions(): array
176
    {
177
        return $this->subscriptions;
178
    }
179
180
    /**
181
     * @param Subscription[] $subscriptions
182
     */
183
    public function setSubscriptions(array $subscriptions): void
184
    {
185
        $this->subscriptions = $subscriptions;
186
    }
187
188
    public function getBillFee(): int
189
    {
190
        return $this->billFee;
191
    }
192
193
    public function setBillFee(int $billFee): void
194
    {
195
        $this->billFee = $billFee;
196
    }
197
198
    public function getDiscount(): int
199
    {
200
        return $this->discount;
201
    }
202
203
    public function setDiscount(int $discount): void
204
    {
205
        $this->discount = $discount;
206
    }
207
208
    public function getDiscountDescription(): ?string
209
    {
210
        return $this->discountDescription;
211
    }
212
213
    public function setDiscountDescription(?string $discountDescription): void
214
    {
215
        $this->discountDescription = $discountDescription;
216
    }
217
218
    public function getTotal(): int
219
    {
220
        return $this->total;
221
    }
222
223
    public function setTotal(int $total): void
224
    {
225
        $this->total = $total;
226
    }
227
228
    public function getReservationsSubtotal(): int
229
    {
230
        return $this->reservationsSubtotal;
231
    }
232
233
    public function setReservationsSubtotal(int $reservationsSubtotal): void
234
    {
235
        $this->reservationsSubtotal = $reservationsSubtotal;
236
    }
237
238
    public function getSubscriptionsSubtotal(): int
239
    {
240
        return $this->subscriptionsSubtotal;
241
    }
242
243
    public function setSubscriptionsSubtotal(int $subscriptionsSubtotal): void
244
    {
245
        $this->subscriptionsSubtotal = $subscriptionsSubtotal;
246
    }
247
248
    public function getReservationsSubtotalDiscount(): int
249
    {
250
        return $this->reservationsSubtotalDiscount;
251
    }
252
253
    public function setReservationsSubtotalDiscount(int $reservationsSubtotalDiscount): void
254
    {
255
        $this->reservationsSubtotalDiscount = $reservationsSubtotalDiscount;
256
    }
257
}
258