1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Integracao\ControlPay\Contracts\Venda; |
4
|
|
|
use Integracao\ControlPay\Helpers\SerializerHelper; |
5
|
|
|
use Integracao\ControlPay\Model\Produto; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class VenderRequest |
9
|
|
|
* @package Integracao\ControlPay\Contracts\Venda |
10
|
|
|
*/ |
11
|
|
|
class VenderRequest implements \JsonSerializable |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var integer |
15
|
|
|
*/ |
16
|
|
|
private $operadorId; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var integer |
20
|
|
|
*/ |
21
|
|
|
private $pessoaClienteId; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var integer |
25
|
|
|
*/ |
26
|
|
|
private $formaPagamentoId; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var integer |
30
|
|
|
*/ |
31
|
|
|
private $terminalId; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var integer |
35
|
|
|
*/ |
36
|
|
|
private $pedidoId; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
private $referencia; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var double |
45
|
|
|
*/ |
46
|
|
|
private $valorTotalVendido; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var double |
50
|
|
|
*/ |
51
|
|
|
private $valorAcrescimo; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var double |
55
|
|
|
*/ |
56
|
|
|
private $valorDesconto; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string |
60
|
|
|
*/ |
61
|
|
|
private $observacao; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @var boolean |
65
|
|
|
*/ |
66
|
|
|
private $parcelamentoAdmin; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @var integer |
70
|
|
|
*/ |
71
|
|
|
private $quantidadeParcelas; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var boolean |
75
|
|
|
*/ |
76
|
|
|
private $aguardarTefIniciarTransacao; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var array |
80
|
|
|
*/ |
81
|
|
|
private $produtosVendidos; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Venda constructor. |
85
|
|
|
*/ |
86
|
|
|
public function __construct() |
87
|
|
|
{ |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return int |
92
|
|
|
*/ |
93
|
|
|
public function getOperadorId() |
94
|
|
|
{ |
95
|
|
|
return $this->operadorId; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @param int $operadorId |
100
|
|
|
* @return Venda |
101
|
|
|
*/ |
102
|
|
|
public function setOperadorId($operadorId) |
103
|
|
|
{ |
104
|
|
|
$this->operadorId = $operadorId; |
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return int |
110
|
|
|
*/ |
111
|
|
|
public function getPessoaClienteId() |
112
|
|
|
{ |
113
|
|
|
return $this->pessoaClienteId; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param int $pessoaClienteId |
118
|
|
|
* @return Venda |
119
|
|
|
*/ |
120
|
|
|
public function setPessoaClienteId($pessoaClienteId) |
121
|
|
|
{ |
122
|
|
|
$this->pessoaClienteId = $pessoaClienteId; |
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return int |
128
|
|
|
*/ |
129
|
|
|
public function getFormaPagamentoId() |
130
|
|
|
{ |
131
|
|
|
return $this->formaPagamentoId; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @param int $formaPagamentoId |
136
|
|
|
* @return Venda |
137
|
|
|
*/ |
138
|
|
|
public function setFormaPagamentoId($formaPagamentoId) |
139
|
|
|
{ |
140
|
|
|
$this->formaPagamentoId = $formaPagamentoId; |
141
|
|
|
return $this; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @return int |
146
|
|
|
*/ |
147
|
|
|
public function getTerminalId() |
148
|
|
|
{ |
149
|
|
|
return $this->terminalId; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @param int $terminalId |
154
|
|
|
* @return Venda |
155
|
|
|
*/ |
156
|
|
|
public function setTerminalId($terminalId) |
157
|
|
|
{ |
158
|
|
|
$this->terminalId = $terminalId; |
159
|
|
|
return $this; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @return int |
164
|
|
|
*/ |
165
|
|
|
public function getPedidoId() |
166
|
|
|
{ |
167
|
|
|
return $this->pedidoId; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* @param int $pedidoId |
172
|
|
|
* @return Venda |
173
|
|
|
*/ |
174
|
|
|
public function setPedidoId($pedidoId) |
175
|
|
|
{ |
176
|
|
|
$this->pedidoId = $pedidoId; |
177
|
|
|
return $this; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @return string |
182
|
|
|
*/ |
183
|
|
|
public function getReferencia() |
184
|
|
|
{ |
185
|
|
|
return $this->referencia; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @param string $referencia |
190
|
|
|
* @return VenderRequest |
191
|
|
|
*/ |
192
|
|
|
public function setReferencia($referencia) |
193
|
|
|
{ |
194
|
|
|
$this->referencia = $referencia; |
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @return float |
200
|
|
|
*/ |
201
|
|
|
public function getValorTotalVendido() |
202
|
|
|
{ |
203
|
|
|
return $this->valorTotalVendido; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @param float $valorTotalVendido |
208
|
|
|
* @return Venda |
209
|
|
|
*/ |
210
|
|
|
public function setValorTotalVendido($valorTotalVendido) |
211
|
|
|
{ |
212
|
|
|
$this->valorTotalVendido = $valorTotalVendido; |
213
|
|
|
return $this; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @return float |
218
|
|
|
*/ |
219
|
|
|
public function getValorAcrescimo() |
220
|
|
|
{ |
221
|
|
|
return $this->valorAcrescimo; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @param float $valorAcrescimo |
226
|
|
|
* @return Venda |
227
|
|
|
*/ |
228
|
|
|
public function setValorAcrescimo($valorAcrescimo) |
229
|
|
|
{ |
230
|
|
|
$this->valorAcrescimo = $valorAcrescimo; |
231
|
|
|
return $this; |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* @return float |
236
|
|
|
*/ |
237
|
|
|
public function getValorDesconto() |
238
|
|
|
{ |
239
|
|
|
return $this->valorDesconto; |
240
|
|
|
} |
241
|
|
|
|
242
|
|
|
/** |
243
|
|
|
* @param float $valorDesconto |
244
|
|
|
* @return Venda |
245
|
|
|
*/ |
246
|
|
|
public function setValorDesconto($valorDesconto) |
247
|
|
|
{ |
248
|
|
|
$this->valorDesconto = $valorDesconto; |
249
|
|
|
return $this; |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @return string |
254
|
|
|
*/ |
255
|
|
|
public function getObservacao() |
256
|
|
|
{ |
257
|
|
|
return $this->observacao; |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* @param string $observacao |
262
|
|
|
* @return Venda |
263
|
|
|
*/ |
264
|
|
|
public function setObservacao($observacao) |
265
|
|
|
{ |
266
|
|
|
$this->observacao = $observacao; |
267
|
|
|
return $this; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @return boolean |
272
|
|
|
*/ |
273
|
|
|
public function isParcelamentoAdmin() |
274
|
|
|
{ |
275
|
|
|
return $this->parcelamentoAdmin; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @param boolean $parcelamentoAdmin |
280
|
|
|
* @return Venda |
281
|
|
|
*/ |
282
|
|
|
public function setParcelamentoAdmin($parcelamentoAdmin) |
283
|
|
|
{ |
284
|
|
|
$this->parcelamentoAdmin = $parcelamentoAdmin; |
285
|
|
|
return $this; |
286
|
|
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* @return int |
290
|
|
|
*/ |
291
|
|
|
public function getQuantidadeParcelas() |
292
|
|
|
{ |
293
|
|
|
return $this->quantidadeParcelas; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @param int $quantidadeParcelas |
298
|
|
|
* @return Venda |
299
|
|
|
*/ |
300
|
|
|
public function setQuantidadeParcelas($quantidadeParcelas) |
301
|
|
|
{ |
302
|
|
|
$this->quantidadeParcelas = $quantidadeParcelas; |
303
|
|
|
return $this; |
304
|
|
|
} |
305
|
|
|
|
306
|
|
|
/** |
307
|
|
|
* @return boolean |
308
|
|
|
*/ |
309
|
|
|
public function isAguardarTefIniciarTransacao() |
310
|
|
|
{ |
311
|
|
|
return $this->aguardarTefIniciarTransacao; |
312
|
|
|
} |
313
|
|
|
|
314
|
|
|
/** |
315
|
|
|
* @param boolean $aguardarTefIniciarTransacao |
316
|
|
|
* @return Venda |
317
|
|
|
*/ |
318
|
|
|
public function setAguardarTefIniciarTransacao($aguardarTefIniciarTransacao) |
319
|
|
|
{ |
320
|
|
|
$this->aguardarTefIniciarTransacao = $aguardarTefIniciarTransacao; |
321
|
|
|
return $this; |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
/** |
325
|
|
|
* @return array |
326
|
|
|
*/ |
327
|
|
|
public function getProdutosVendidos() |
328
|
|
|
{ |
329
|
|
|
return $this->produtosVendidos; |
330
|
|
|
} |
331
|
|
|
|
332
|
|
|
/** |
333
|
|
|
* @param array $produtosVendidos |
334
|
|
|
* @return Venda |
335
|
|
|
*/ |
336
|
|
|
public function setProdutosVendidos($produtosVendidos) |
337
|
|
|
{ |
338
|
|
|
|
339
|
|
|
foreach ($produtosVendidos as $produto) |
340
|
|
|
$this->produtosVendidos[] = is_array($produto) ? SerializerHelper::denormalize($produto, Produto::class) : $produto; |
341
|
|
|
|
342
|
|
|
return $this; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
function jsonSerialize() |
346
|
|
|
{ |
347
|
|
|
return [ |
348
|
|
|
"operadorId" => $this->operadorId, |
349
|
|
|
"pessoaClienteId" => $this->pessoaClienteId, |
350
|
|
|
"formaPagamentoId" => $this->formaPagamentoId, |
351
|
|
|
"pedidoId" => $this->pedidoId, |
352
|
|
|
"terminalId" => $this->terminalId, |
353
|
|
|
"referencia" => $this->referencia, |
354
|
|
|
"valorTotalVendido" => $this->valorTotalVendido, |
355
|
|
|
"valorAcrescimo" => $this->valorAcrescimo, |
356
|
|
|
"valorDesconto" => $this->valorDesconto, |
357
|
|
|
"observacao" => $this->observacao, |
358
|
|
|
"aguardarTefIniciarTransacao" => $this->aguardarTefIniciarTransacao, |
359
|
|
|
"parcelamentoAdmin" => $this->parcelamentoAdmin, |
360
|
|
|
"quantidadeParcelas" => $this->quantidadeParcelas, |
361
|
|
|
"produtosVendidos" => $this->produtosVendidos |
362
|
|
|
]; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
|
366
|
|
|
} |