-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.go
626 lines (531 loc) · 22.8 KB
/
models.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
package cloudloyalty_client
import (
"time"
"github.com/shopspring/decimal"
)
const (
LoyaltyActionNone = "none"
LoyaltyActionApply = "apply"
LoyaltyActionCollect = "collect"
LoyaltyActionApplyCollect = "apply-collect"
)
const (
GenderUnknown = 0
GenderMale = 1
GenderFemale = 2
)
const (
ExtraFieldTypeText = "text"
ExtraFieldTypeNumeric = "numeric"
ExtraFieldTypeStaticSet = "static-set"
ExtraFieldTypeSet = "set"
)
const (
ReceiptInfoLineTypeText = "text"
ReceiptInfoLineTypeTable = "table"
ReceiptInfoLineTypeBarcode = "barcode"
ReceiptInfoLineTypeDivider = "divider"
ReceiptInfoLineTextAlignLeft = "left"
ReceiptInfoLineTextAlignCenter = "center"
ReceiptInfoLineTextAlignRight = "right"
ReceiptInfoLineBarcodeTypeQR = "QR"
ReceiptInfoLineBarcodeTypeEAN13 = "EAN13"
)
type ErrorReply struct {
ErrorCode int `json:"errorCode"`
Description string `json:"description"`
Hint string `json:"hint,omitempty"`
}
// get-balance
type GetBalanceQuery struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
}
type GetBalanceReply struct {
Client GetBalanceReplyClient `json:"client"`
Bonuses []GetBalanceReplyBonus `json:"bonuses"`
Level *GetBalanceReplyLevel `json:"level,omitempty"`
WalletsLink string `json:"walletsLink,omitempty"`
}
type GetBalanceReplyClient struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card int64 `json:"card,omitempty"`
CardString string `json:"cardString,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Surname string `json:"surname,omitempty"`
Name string `json:"name,omitempty"`
PatronymicName string `json:"patronymicName,omitempty"`
FullName string `json:"fullName,omitempty"`
Gender int `json:"gender"`
Birthdate string `json:"birthdate,omitempty"`
Email string `json:"email,omitempty"`
Level int `json:"level"`
IsEmailSubscribed bool `json:"isEmailSubscribed"`
IsPhoneSubscribed bool `json:"isPhoneSubscribed"`
ExtraFields ExtraFields `json:"extraFields,omitempty"`
Bonuses int `json:"bonuses"`
PendingBonuses int `json:"pendingBonuses"`
Children []Child `json:"children,omitempty"`
}
type GetBalanceReplyBonus struct {
ExpireAt *time.Time `json:"expireAt,omitempty"`
Amount int `json:"amount"`
}
type GetBalanceReplyLevel struct {
Level int `json:"level"`
Name string `json:"name"`
LevelSpent decimal.Decimal `json:"levelSpent"`
Remaining *decimal.Decimal `json:"remaining,omitempty"`
ProgressPercent *int `json:"progressPercent,omitempty"`
}
type Child struct {
Name string `json:"name,omitempty"`
Birthdate string `json:"birthdate,omitempty"`
Gender Int `json:"gender"`
}
// new-client
type NewClientQuery struct {
Client NewClientClient `json:"client"`
Shop *ShopQuery `json:"shop,omitempty"`
Cashier *CashierQuery `json:"cashier,omitempty"`
Promocode string `json:"promocode,omitempty"`
}
type ShopQuery struct {
Code string `json:"code"`
Name string `json:"name"`
}
type CashierQuery struct {
Code string `json:"code"`
Name string `json:"name"`
}
type NewClientClient struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Surname string `json:"surname,omitempty"`
Name string `json:"name,omitempty"`
PatronymicName string `json:"patronymicName,omitempty"`
FullName string `json:"fullName,omitempty"`
Gender Int `json:"gender,omitempty"`
Birthdate string `json:"birthdate,omitempty"`
Email string `json:"email,omitempty"`
Level Int `json:"level,omitempty"`
IsEmailSubscribed *bool `json:"isEmailSubscribed,omitempty"`
IsPhoneSubscribed *bool `json:"isPhoneSubscribed,omitempty"`
ExtraFields ExtraFields `json:"extraFields,omitempty"`
Children []Child `json:"children,omitempty"`
City string `json:"city,omitempty"` // deprecated
Street string `json:"street,omitempty"` // deprecated
}
type NewClientReply struct {
Client GetBalanceReplyClient `json:"client"`
Bonuses []GetBalanceReplyBonus `json:"bonuses"`
WalletsLink string `json:"walletsLink,omitempty"`
}
// update-client
type UpdateClientQuery struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Client NewClientClient `json:"client"`
}
type UpdateClientReply struct {
Client GetBalanceReplyClient `json:"client"`
Bonuses []GetBalanceReplyBonus `json:"bonuses"`
WalletsLink string `json:"walletsLink,omitempty"`
}
// delete-client
type DeleteClientQuery struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
}
type DeleteClientReply struct {
}
// calculate-purchase
// deprecated
type CalculatePurchaseQuery struct {
Calculate CalculatePurchaseQueryCalculate `json:"calculate"`
}
// deprecated
type CalculatePurchaseQueryCalculate struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
IsAnonymousClient bool `json:"isAnonymousClient,omitempty"`
LoyaltyAction string `json:"loyaltyAction,omitempty"`
TotalAmount decimal.Decimal `json:"totalAmount"`
ApplyingAmount *decimal.Decimal `json:"applyingAmount,omitempty"`
CollectingAmount *decimal.Decimal `json:"collectingAmount,omitempty"`
ApplyBonuses *int `json:"applyBonuses,omitempty"`
CollectBonuses *int `json:"collectBonuses,omitempty"`
Promocode string `json:"promocode,omitempty"`
Units map[string]Unit `json:"units,omitempty"`
OrderID string `json:"orderId,omitempty"`
ExecutedAt *ValidRangeTime `json:"executedAt,omitempty"`
DoApplyBonuses *bool `json:"doApplyBonuses,omitempty"` // obsolete
DoCollectBonuses *bool `json:"doCollectBonuses,omitempty"` // obsolete
}
// deprecated
type Unit struct {
ExternalID string `json:"externalId,omitempty"`
Sku string `json:"sku"`
ItemTitle string `json:"itemTitle"`
ItemCount *float64 `json:"itemCount,omitempty"`
BuyingPrice *decimal.Decimal `json:"buyingPrice,omitempty"`
Price decimal.Decimal `json:"price"`
Category string `json:"category,omitempty"`
CategoryExternalID string `json:"categoryExternalID,omitempty"`
Amount *decimal.Decimal `json:"amount,omitempty"`
MinPrice decimal.Decimal `json:"minPrice,omitempty"`
}
// deprecated
type CalculatePurchaseReply struct {
Calculation CalculatePurchaseReplyCalculate `json:"calculation"`
CalculatedUnits map[string]CalculatedUnit `json:"calculatedUnits"`
ClientBonuses ClientBonusesReply `json:"clientBonuses"`
}
// deprecated
type CalculatedUnit struct {
IsPromocodeApplicable bool `json:"isPromocodeApplicable"`
PromocodeDiscount decimal.Decimal `json:"promocodeDiscount"`
BonusesDiscount decimal.Decimal `json:"bonusesDiscount"`
TotalDiscount decimal.Decimal `json:"totalDiscount"`
OriginalPrice decimal.Decimal `json:"originalPrice"`
OriginalAmount decimal.Decimal `json:"originalAmount"`
CalculatedAmount decimal.Decimal `json:"calculatedAmount"`
}
// deprecated
type CalculatePurchaseReplyCalculate struct {
AppliedBonuses int `json:"appliedBonuses"`
CollectedBonuses int `json:"collectedBonuses"`
AppliableBonuses int `json:"appliableBonuses"` // obsolete
CollectableBonuses int `json:"collectableBonuses"` // obsolete
MaxBonuses int `json:"maxBonuses"`
PromocodeDiscount decimal.Decimal `json:"promocodeDiscount"`
BonusesDiscount decimal.Decimal `json:"bonusesDiscount"`
TotalDiscount decimal.Decimal `json:"totalDiscount"`
TotalAmount decimal.Decimal `json:"totalAmount"` // obsolete
RemainingAmount decimal.Decimal `json:"remainingAmount"`
PhoneNumber string `json:"phoneNumber,omitempty"` // obsolete`
}
// apply-purchase
// deprecated
type ApplyPurchaseQuery struct {
Transaction ApplyPurchaseTransaction `json:"transaction"`
}
// deprecated
type ApplyPurchaseTransaction struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
IsAnonymousClient bool `json:"isAnonymousClient,omitempty"`
ID string `json:"id"`
ExecutedAt ValidRangeTime `json:"executedAt"`
ReceiptID IntAsIntOrString `json:"receiptId,omitempty"`
SessionID IntAsIntOrString `json:"sessionId,omitempty"`
ShopCode string `json:"shopCode"`
ShopName string `json:"shopName"`
Cashier string `json:"cashier,omitempty"`
CashierID string `json:"cashierId,omitempty"`
LoyaltyAction string `json:"loyaltyAction"`
TotalAmount decimal.Decimal `json:"totalAmount"`
ApplyingAmount *decimal.Decimal `json:"applyingAmount,omitempty"`
CollectingAmount *decimal.Decimal `json:"collectingAmount,omitempty"`
ApplyBonuses int `json:"applyBonuses"`
CollectBonuses *int `json:"collectBonuses,omitempty"`
Promocode *ApplyPurchaseTransactionPromocode `json:"promocode,omitempty"`
Items []Item `json:"items,omitempty"`
IsConfirmationCodeRequired bool `json:"isConfirmationCodeRequired,omitempty"`
ConfirmationCode string `json:"confirmationCode,omitempty"`
}
type Item struct {
ExternalID string `json:"externalId,omitempty"`
SKU string `json:"sku"`
ItemTitle string `json:"itemTitle"`
ItemCount float64 `json:"itemCount"`
BuyingPrice *decimal.Decimal `json:"buyingPrice,omitempty"`
Price decimal.Decimal `json:"price"`
Amount *decimal.Decimal `json:"amount,omitempty"`
Category string `json:"category,omitempty"`
CategoryExternalID string `json:"categoryExternalID,omitempty"`
MinPrice *decimal.Decimal `json:"minPrice,omitempty"`
}
// deprecated
type ApplyPurchaseTransactionPromocode struct {
Promocode string `json:"promocode"`
PromocodeDiscount decimal.Decimal `json:"promocodeDiscount"`
}
// deprecated
type ApplyPurchaseReply struct {
Confirmation ApplyPurchaseReplyConfirmation `json:"confirmation"`
}
// deprecated
type ApplyPurchaseReplyConfirmation struct {
PhoneNumber string `json:"phoneNumber"`
PurchaseID string `json:"purchaseId"`
TotalAmount decimal.Decimal `json:"totalAmount"`
PaidAmount decimal.Decimal `json:"paidAmount"`
Bonuses ApplyPurchaseReplyBonuses `json:"bonuses"`
}
// deprecated
type ApplyPurchaseReplyBonuses struct {
Applied int `json:"applied"`
Collected int `json:"collected"`
Pending int `json:"pending"`
Available int `json:"available"`
}
// calculate-return
// CalculateReturnQuery is a request model for /calculate-return API
type CalculateReturnQuery struct {
Calculate CalculateReturnQueryCalculate `json:"calculate"`
}
// CalculateReturnQueryCalculate holds info for return calculation
type CalculateReturnQueryCalculate struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
PurchaseID string `json:"purchaseId"`
RefundAmount decimal.Decimal `json:"refundAmount"`
Items []ReturnItem `json:"items,omitempty"`
}
// CalculateReturnReply is a response model for /calculate-return API
type CalculateReturnReply struct {
Calculation CalculateReturnReplyCalculate `json:"calculation"`
}
// CalculateReturnReplyCalculate holds results of return calculation
type CalculateReturnReplyCalculate struct {
PurchaseID string `json:"purchaseId"`
RefundAmount decimal.Decimal `json:"refundAmount"`
RecoveredBonuses int `json:"recoveredBonuses"`
CancelledBonuses int `json:"cancelledBonuses"`
}
// apply-return
// ApplyReturnQuery is a request model for /apply-return API
type ApplyReturnQuery struct {
Transaction ApplyReturnTransaction `json:"transaction"`
}
// ApplyReturnTransaction holds info for apply return
type ApplyReturnTransaction struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
IsAnonymousClient bool `json:"isAnonymousClient,omitempty"`
ID string `json:"id"`
ExecutedAt ValidRangeTime `json:"executedAt"`
PurchaseID string `json:"purchaseId"`
ReceiptID IntAsIntOrString `json:"receiptId,omitempty"`
SessionID IntAsIntOrString `json:"sessionId,omitempty"`
ShopCode string `json:"shopCode"`
ShopName string `json:"shopName"`
Cashier string `json:"cashier,omitempty"`
CashierID string `json:"cashierId,omitempty"`
RefundAmount decimal.Decimal `json:"refundAmount"`
Items []ReturnItem `json:"items,omitempty"`
}
type ReturnItem struct {
SKU string `json:"sku"`
ItemCount float64 `json:"itemCount"`
}
// ApplyReturnReply is a response model for /apply-return API
type ApplyReturnReply struct {
Confirmation ApplyReturnReplyConfirmation `json:"confirmation"`
}
// ApplyReturnReplyConfirmation holds results for apply return
type ApplyReturnReplyConfirmation struct {
PhoneNumber string `json:"phoneNumber"` // deprecated
RefundID string `json:"refundId"`
RefundAmount decimal.Decimal `json:"refundAmount"`
RecoveredBonuses int `json:"recoveredBonuses"`
CancelledBonuses int `json:"cancelledBonuses"`
}
// adjust-balance
type AdjustBalanceQuery struct {
Client ClientQuery `json:"client"`
BalanceAdjustment BalanceAdjustmentQuery `json:"balanceAdjustment"`
}
type ClientQuery struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
}
type BalanceAdjustmentQuery struct {
AmountDelta Int `json:"amountDelta"`
ExpirationPeriodDays Int `json:"expirationPeriodDays,omitempty"`
Comment string `json:"comment,omitempty"`
Notify bool `json:"notify,omitempty"`
}
type AdjustBalanceReply struct {
ClientBonuses ClientBonusesReply `json:"clientBonuses"`
}
type ClientBonusesReply struct {
Available int `json:"available"`
Pending int `json:"pending"`
Reserved int `json:"reserved"`
Total int `json:"total,omitempty"`
}
// set-order
// deprecated
type SetOrderQuery struct {
Client ClientQuery `json:"client"`
Order OrderQuery `json:"order"`
}
// deprecated
type OrderQuery struct {
ID string `json:"id"`
ExecutedAt *ValidRangeTime `json:"executedAt,omitempty"`
ShopCode string `json:"shopCode"`
ShopName string `json:"shopName"`
TotalAmount decimal.Decimal `json:"totalAmount"`
Loyalty *SetOrderLoyalty `json:"loyalty,omitempty"`
Promocode string `json:"promocode,omitempty"`
Items []Item `json:"items,omitempty"`
}
// deprecated
type SetOrderLoyalty struct {
Action string `json:"action"`
ApplyingAmount *decimal.Decimal `json:"applyingAmount,omitempty"`
CollectingAmount *decimal.Decimal `json:"collectingAmount,omitempty"`
ApplyBonuses *IntAsIntOrString `json:"applyBonuses"`
CollectBonuses *int `json:"collectBonuses,omitempty"`
IsConfirmationCodeRequired bool `json:"isConfirmationCodeRequired,omitempty"`
ConfirmationCode string `json:"confirmationCode,omitempty"`
}
// deprecated
type SetOrderReply struct {
OperationResult SetOrderOperationResult `json:"operationResult"`
ClientBonuses ClientBonusesReply `json:"clientBonuses"`
}
// deprecated
type SetOrderOperationResult struct {
AppliedBonuses int `json:"appliedBonuses"`
CollectedBonuses int `json:"collectedBonuses"`
RemainingAmount decimal.Decimal `json:"remainingAmount"`
}
// confirm-order
type ConfirmOrderQuery struct {
OrderID string `json:"orderId"`
ExecutedAt *ValidRangeTime `json:"executedAt,omitempty"`
}
type ConfirmOrderReply struct {
OperationResult SetOrderOperationResult `json:"operationResult"`
ClientBonuses ClientBonusesReply `json:"clientBonuses"`
}
// cancel-order
type CancelOrderQuery struct {
OrderID string `json:"orderId"`
ExecutedAt *ValidRangeTime `json:"executedAt,omitempty"`
}
type CancelOrderReply struct {
OperationResult SetOrderOperationResult `json:"operationResult"`
ClientBonuses ClientBonusesReply `json:"clientBonuses"`
}
// send-confirmation-code
type SendConfirmationCodeQuery struct {
PhoneNumber string `json:"phoneNumber,omitempty"`
Card string `json:"card,omitempty"`
ExternalID string `json:"externalId,omitempty"`
IsAnonymousClient bool `json:"isAnonymousClient"` // deprecated
To string `json:"to,omitempty"`
Template string `json:"template,omitempty"`
}
type SendConfirmationCodeReply struct {
Code string `json:"code"`
MsgID string `json:"msgid"`
Channel string `json:"channel"`
ExpiresAt time.Time `json:"expiresAt"`
}
// get-history
type GetHistoryQuery struct {
Client ClientQuery `json:"client"`
Pagination *PaginationQuery `json:"pagination,omitempty"`
}
type PaginationQuery struct {
Limit Int `json:"limit,omitempty"`
Offset Int `json:"offset,omitempty"`
}
type GetHistoryReply struct {
History []HistoryEntry `json:"history"`
Pagination PaginationReply `json:"pagination"`
}
type HistoryEntry struct {
At time.Time `json:"at"`
Amount int `json:"amount"`
Operation string `json:"operation"`
OperationName string `json:"operationName"`
OperationApplied *HistoryPurchaseEntry `json:"OPERATION_APPLIED,omitempty"`
OperationCollected *HistoryPurchaseEntry `json:"OPERATION_COLLECTED,omitempty"`
OperationExpired *struct{} `json:"OPERATION_EXPIRED,omitempty"`
OperationRefunded *HistoryReturnEntry `json:"OPERATION_REFUNDED,omitempty"`
OperationCancelled *HistoryReturnEntry `json:"OPERATION_CANCELLED,omitempty"`
OperationReceived *HistoryReceiveEntry `json:"OPERATION_RECEIVED,omitempty"`
OperationRecalled *HistoryReceiveEntry `json:"OPERATION_RECALLED,omitempty"`
OperationApplyReverted *HistoryPurchaseEntry `json:"OPERATION_APPLY_REVERTED,omitempty"`
OperationCollectReverted *HistoryPurchaseEntry `json:"OPERATION_COLLECT_REVERTED,omitempty"`
OperationCollectedFriend *HistoryPurchaseEntry `json:"OPERATION_COLLECTED_FRIEND,omitempty"`
OperationOther *struct{} `json:"OPERATION_OTHER,omitempty"`
}
type HistoryPurchaseEntry struct {
PurchaseID string `json:"purchaseId"`
ExecutedAt time.Time `json:"executedAt"`
TotalAmount decimal.Decimal `json:"totalAmount"`
}
type HistoryReturnEntry struct {
ReturnID string `json:"returnId"`
ExecutedAt time.Time `json:"executedAt"`
RefundAmount decimal.Decimal `json:"refundAmount"`
}
type HistoryReceiveEntry struct {
ActionName string `json:"actionName"`
Comment string `json:"comment,omitempty"`
}
type PaginationReply struct {
Total int `json:"total"`
}
// issue-promocode
type IssuePromocodeQuery struct {
Client *ClientQuery `json:"client,omitempty"`
Code string `json:"code"`
}
type IssuePromocodeReply struct {
Promocode string `json:"promocode"`
}
// revert-purchase
type RevertPurchaseQuery struct {
Transaction RevertPurchaseTransaction `json:"transaction"`
}
type RevertPurchaseTransaction struct {
ID string `json:"id"`
ExecutedAt string `json:"executedAt"`
PurchaseID string `json:"purchaseId"`
Cashier string `json:"cashier,omitempty"`
CashierID string `json:"cashierId,omitempty"`
}
type RevertPurchaseReply struct {
OperationResult RevertPurchaseOperationResult `json:"operationResult"`
}
type RevertPurchaseOperationResult struct {
RefundedBonuses int `json:"refundedBonuses"`
CancelledBonuses int `json:"cancelledBonuses"`
}
// get-settings
type GetSettingsQuery struct {
Shop *ShopQuery `json:"shop,omitempty"`
}
type GetSettingsReply struct {
PhoneVerification bool `json:"phoneVerification"`
BonusApplyingConfirmation bool `json:"bonusApplyingConfirmation"`
ClientFieldCardRequired bool `json:"clientFieldCardRequired"`
ClientFieldSurname bool `json:"clientFieldSurname"`
ClientFieldPatronymic bool `json:"clientFieldPatronymic"`
ClientFieldChildren bool `json:"clientFieldChildren"`
ClientExtraFields []ClientExtraFieldConfig `json:"clientExtraFields,omitempty"`
ExtraProperties ExtraFields `json:"extraProperties,omitempty"`
}
type ClientExtraFieldConfig struct {
Name string `json:"name"`
Title string `json:"title"`
Type string `json:"type"`
Options []string `json:"options,omitempty"`
}