-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
1243 lines (1047 loc) · 47.1 KB
/
types.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
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package apaleo
import (
"strings"
"github.com/cydev/zero"
"github.com/omniboost/go-apaleo/omitempty"
)
var (
AccountTypeRevenues AccountType = "Revenues"
AccountTypePayments AccountType = "Payments"
AccountTypeLiabilities AccountType = "Liabilities"
AccountTypeReceivables AccountType = "Receivables"
AccountTypeVat AccountType = "Vat"
AccountTypeHouse AccountType = "House"
AccountTypeAccountsReceivable AccountType = "AccountsReceivable"
AccountTypeCityTaxes AccountType = "CityTaxes"
AccountTypeTransitoryItems AccountType = "TransitoryItems"
AccountTypeVatOnLiabilities AccountType = "VatOnLiabilities"
AccountingSchemaSimple AccountingSchema = "Simple"
AccountingSchemaExtended AccountingSchema = "Extended"
)
type CommaSeparatedQueryParam []string
func (t CommaSeparatedQueryParam) MarshalSchema() string {
return strings.Join(t, ",")
}
type AccountType string
type AccountingSchema string
type ActionReasonModel struct {
Code string `json:"code"`
Message string `json:"message"`
}
type ActionModel struct {
Action string `json:"action"`
IsAllowed bool `json:"isAllowed"`
Reasons []ActionReasonModel `json:"reasons"`
}
type AgeCategoryItemModel struct {
ID string `json:"id"`
Code string `json:"code"`
PropertyID string `json:"propertyId"`
Name string `json:"name"`
MinAge int32 `json:"minAge"`
MaxAge int32 `json:"maxAge"`
}
type AgeCategories []AgeCategoryItemModel
type CancellationPolicyItemModel struct {
ID string `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
Description string `json:"description"`
PropertyID string `json:"propertyId"`
PeriodFromReference PeriodModel `json:"periodFromReference"`
Reference string `json:"reference"`
Fee FeeDetailsModel `json:"fee"`
}
type CancellationPolicies []CancellationPolicyItemModel
type NoShowPolicyItemModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
PropertyID string `json:"propertyId"`
Fee FeeDetailsModel `json:"fee"`
}
type NoShowPolicies []NoShowPolicyItemModel
type FeeDetailsModel struct {
VatType string `json:"vatType"`
FixedValue MonetaryValueModel `json:"fixedValue"`
PercentValue PercentValueModel `json:"percentValue"`
}
type UnitItemModel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Property EmbeddedPropertyModel `json:"property"`
UnitGroup EmbeddedUnitGroupModel `json:"unitGroup"`
ConnectingUnit EmbeddedUnitModel `json:"connectingUnit"`
Status UnitItemStatusModel `json:"status"`
MaxPersons int32 `json:"maxPersons"`
Created DateTime `json:"created"`
Attributes []UnitAttributeModel `json:"attributes"`
ConnectedUnits ConnectedUnitModel `json:"connectedUnits"`
}
type Units []UnitItemModel
type UnitItemStatusModel struct {
IsOccupied bool `json:"isOccupied"`
Condition string `json:"condition"`
Maintenance UnitItemMaintenanceModel `json:"maintenance"`
}
type UnitItemMaintenanceModel struct {
ID string `json:"id"`
Type string `json:"type"`
}
type UnitAttributeModel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
type ConnectedUnitModel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
UnitGroupID string `json:"unitGroupId"`
Condition string `json:"condition"`
MaxPersons int32 `json:"maxPersons"`
}
type UnitAttributeDefinitionModel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
type UnitAttributes []UnitAttributeDefinitionModel
type UnitGroupItemModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
MemberCount int32 `json:"memberCount"`
MaxPersons int32 `json:"maxPersons"`
Rank int32 `json:"rank"`
Type string `json:"type"`
Property EmbeddedPropertyModel `json:"property"`
ConnectedUnitGroups []ConnectedUnitGroupModel `json:"connectedUnitGroups"`
}
type UnitGroups []UnitGroupItemModel
type ConnectedUnitGroupModel struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
MemberCount int32 `json:"memberCount"`
MaxPersons int32 `json:"maxPersons"`
}
type PropertyItemModel struct {
// The property id
ID string `json:"id"`
// The code for the property that can be shown in reports and table views
Code string `json:"code"`
// The id of the property used as a template while creating the property
PropertyTemplateID string `json:"propertyTemplateId"`
// Whether the property can be used as a template for other properties
IsTemplate bool `json:"isTemplate"`
// The name for the property
Name string `json:"name"`
// The description for the property
Description string `json:"description"`
// The legal name of the company running the property.
CompanyName string `json:"companyName"`
// The managing director(s) of the company, as they should appear on invoices
ManagingDirectors string `json:"managingDirectors"`
// The entry in the Commercial Register of the company running the property, as it should appear on invoices
CommercialRegisterEntry string `json:"commercialRegisterEntry"`
// The Tax-ID of the company running the property, as it should appear on invoices
TaxID string `json:"taxId"`
// The location of the property
Location AddressModel `json:"location"`
BankAccount BankAccountModel `json:"bankAccount"`
// The payment terms used for all rate plans
PaymentTerms map[string]string `json:"paymentTerms"`
// The time zone name of the property from the IANA Time Zone Database.
// (see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
TimeZone string `json:"timeZone"`
// The currency a property works with.
CurrencyCode string `json:"currencyCode"`
// Date of creation
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Created Date `json:"created"`
// The status of the property
Status string `json:"status"`
// Is the property archived
IsArchived bool `json:"isArchived"`
// The list of actions for this property
Actions []ActionModel `json:"actions"`
}
type Properties []PropertyItemModel
type AddressModel struct {
AddressLine1 string `json:"addressline1"`
AddressLine2 string `json:"addressline2"`
PostalCode string `json:"postalcode"`
City string `json:"city"`
RegionCode string `json:"regionCode"`
CountryCode string `json:"countryCode"`
}
type PropertyModel struct {
// The property id
ID string `json:"id"`
// The code for the property that can be shown in reports and table views
Code string `json:"code"`
// The id of the property used as a template while creating the property
PropertyTemplateID string `json:"propertyTemplateId"`
// Whether the property can be used as a template for other properties
IsTemplate bool `json:"isTemplate"`
// The name for the property
Name map[string]string `json:"name"`
// The description for the property
Description map[string]string `json:"description"`
// The legal name of the company running the property.
CompanyName string `json:"companyName"`
// The managing director(s) of the company, as they should appear on invoices
ManagingDirectors string `json:"managingDirectors"`
// The entry in the Commercial Register of the company running the property, as it should appear on invoices
CommercialRegisterEntry string `json:"commercialRegisterEntry"`
// The Tax-ID of the company running the property, as it should appear on invoices
TaxID string `json:"taxId"`
// The location of the property
Location AddressModel `json:"location"`
BankAccount BankAccountModel `json:"bankAccount"`
// The payment terms used for all rate plans
PaymentTerms map[string]string `json:"paymentTerms"`
// The time zone name of the property from the IANA Time Zone Database.
// (see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
TimeZone string `json:"timeZone"`
// The currency a property works with.
CurrencyCode string `json:"currencyCode"`
// Date of creation
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Created Date `json:"created"`
// The status of the property
Status string `json:"status"`
// Is the property archived
IsArchived bool `json:"isArchived"`
// The list of actions for this property
Actions []ActionModel `json:"actions"`
}
type BankAccountModel struct {
IBAN string `json:"iban"`
BIC string `json:"bic"`
Bank string `json:"bank"`
}
type EmbeddedCompanyModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
CanCheckOutOnAR bool `json:"canCheckOutOnAr"`
}
type InvoiceItemModel struct {
ID string `json:"id"`
Number string `json:"number"`
Type string `json:"type"`
LanguageCode string `json:"languageCode"`
FolioID string `json:"folioId"`
ReservationID string `json:"reservationId"`
BookingID string `json:"bookingId"`
PropertyID string `json:"propertyId"`
RelatedInvoiceNumber string `json:"relatedInvoiceNumber"`
WriteOffReason string `json:"writeOffReason"`
SubTotal MonetaryValueModel `json:"subTotal"`
OutstandingPayment MonetaryValueModel `json:"outstandingPayment"`
PaymentSettled bool `json:"paymentSettled"`
Status string `json:"status"`
Created string `json:"created"`
GuestName string `json:"guestName"`
GuestCompany string `json:"guestCompany"`
AllowedActions []string `json:"allowedActions"`
Company EmbeddedCompanyModel `json:"company"`
}
type Invoices []InvoiceItemModel
type ExportTransactionItemModel struct {
// Timestamp with time zone information, when the booking was done
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004 ,
Timestamp DateTime `json:"timestamp"`
// The business date when the booking was done
Date Date `json:"date"`
// The account being debited (The 'from' in 'book x from account 1 to
// account 2')
DebitedAccountNumber string `json:"debitedAccountNumber"`
// The parent account of the account being debited
DebitedAccountParentNumber string `json:"debitedAccountParentNumber"`
// The account being credited (The 'to' in 'book x from account 1 to account
// 2')
CreditedAccountNumber string `json:"creditedAccountNumber"`
// The parent account of the account being credited
CreditedAccountParentNumber string `json:"creditedAccountParentNumber"`
// The type of business transaction which triggered the booking =
// ['PostCharge', 'PostPayment', 'MoveLineItem', 'PostPrepayment',
// 'PostToAccountsReceivables', 'PostPrepaymentVat', 'System']
Command string `json:"command"`
// The amount being booked
Amount MonetaryValueModel `json:"amount"`
// The receipt specifying type and number of the receipt for the business
// transaction behind this entry. The receipt cannot be changed. It can be
// identified by the combination of type and number
Receipt ReceiptModel `json:"receipt"`
// All transactions having the same number form one booking
EntryNumber string `json:"entryNumber"`
// The id of the reservation. Can be empty for transactions made on the
// house account
ReservationID string `json:"reservationId"`
}
type AmountModel struct {
GrossAmount float64 `json:"grossAmount"`
NetAmount float64 `json:"netAmount"`
VatType string `json:"vatType"`
VatPercent float64 `json:"vatPercent"`
Currency string `json:"currency"`
}
type MonetaryValueModel struct {
Amount float64 `json:"amount"`
Currency string `json:"currency"`
}
type PercentValueModel struct {
Percent int32 `json:"percent"`
Limit int32 `json:"limit"`
IncludeServiceIDs []string `json:"includeServiceIds"`
}
func (j MonetaryValueModel) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(j)
}
func (j MonetaryValueModel) IsEmpty() bool {
return zero.IsZero(j)
}
type ReceiptModel struct {
// The type of receipt. = ['Custom', 'Reservation', 'Invoice',
// 'PspReference']
Type string `json:"type"`
Number string `json:"number"`
}
type ReservationItemModel struct {
// Reservation id
ID string `json:"id"`
// Booking id
BookingID string `json:"bookingId"`
// Block id
BlockID string `json:"blockId"`
// Status of the reservation = ['Confirmed', 'InHouse', 'CheckedOut',
// 'Canceled', 'NoShow'],
Status string `json:"status"`
// Time of check-in
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
CheckInTime DateTime `json:"checkInTime"`
// Time of check-out
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
CheckOutTime DateTime `json:"checkOutTime"`
// Time of cancellation, if the reservation was canceled
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
CancellationTime DateTime `json:"cancellationTime"`
// Time of setting no-show reservation status
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
NoShowTime DateTime `json:"noShowTime"`
// The property
Property EmbeddedPropertyModel `json:"property"`
// The rate plan
RatePlan EmbeddedRatePlanModel `json:"ratePlan"`
// The unit group
UnitGroup EmbeddedUnitGroupModel `json:"unitGroup"`
// The unit
Unit EmbeddedUnitModel `json:"unit,omitempty"`
// The market segment
MarketSegment EmbeddedMarketSegmentModel `json:"marketSegment,omitempty"`
// Total amount
TotalGrossAmount MonetaryValueModel `json:"totalGrossAmount"`
// Date of arrival
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Arrival DateTime `json:"arrival"`
// Date of departure
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Departure DateTime `json:"departure"`
// Date of creation
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Created DateTime `json:"created"`
// Date of last modification
// Specify a date and time (without fractional second part) in UTC or with
// UTC offset as defined in the ISO8601:2004
Modified DateTime `json:"modified"`
// Number of adults
Adults int `json:"adults"`
// The ages of the children
ChildrenAges []int `json:"childrenAges"`
// Additional information and comments
Comment string `json:"comment"`
// Additional information and comment by the guest
GuestComment string `json:"guestComment"`
// Code in external system
ExternalCode string `json:"externalCode"`
// Channel code = ['Direct', 'BookingCom', 'Ibe', 'ChannelManager']
ChannelCode string `json:"channelCode"`
// Source of the reservation (e.g Hotels.com, Orbitz, etc.)
Source string `json:"source"`
// The primary guest of the reservation
PrimaryGuest GuestModel `json:"primaryGuest"`
// Additional guests of the reservation
AdditionalGuests []GuestModel `json:"additionalGuests"`
// The person who made the booking
Booker BookerModel `json:"booker"`
// Payment information
PaymentAccount PaymentAccountModel `json:"paymentAccountModel"`
// The strongest guarantee for the rate plans booked in this reservation =
// ['PM6Hold', 'CreditCard', 'Prepayment', 'Company', 'Ota']
GuaranteeType string `json:"guaranteeType"`
// Details about the cancellation fee for this reservation<Paste>
CancellationFee ReservationCancellationFeeModel `json:"cancellationFee"`
// Details about the no-show fee for this reservation
NoShowFee ReservationNoShowFeeModel `json:"noShowFee"`
// The purpose of the trip, leisure or business = ['Business', 'Leisure']
TravelPurpose string `json:"travelPurpose"`
// The balance of this reservation
Balance MonetaryValueModel `json:"balance"`
// The list of units assigned to this reservation
AssignedUnits []ReservationAssignedUnitModel `json:"assignedUnits"`
// The list of time slices with the reserved units / unit groups for the
// stay
TimeSlices []TimeSliceModel `json:"timeSlices"`
// The list of additional services (extras, add-ons) reserved for the stay
Services []ReservationServiceItemModel `json:"services"`
// Validation rules are applied to reservations during their lifetime. For
// example a reservation that was created while the house or unit group is
// already fully booked. Whenever a rule was or is currently violated, a
// validation message will be added to this list. They can be deleted
// whenever the hotel staff worked them off.
ValidationMessages []ReservationValidationMessageModel `json:"validationMessages"`
// The list of actions for this reservation
Actions []ActionModel `json:"actions"`
Company EmbeddedCompanyModel `json:"company"`
CorporateCode string `json:"corporateCode"`
AllFoliosHaveInvoice bool `json:"allFoliosHaveInvoice"`
HasCityTax bool `json:"hasCityTax"`
Commission CommissionModel `json:"commission"`
PromoCode string `json:"promoCode"`
}
type Reservations []ReservationItemModel
type EmbeddedPropertyModel struct {
// The property id
ID string `json:"Id"`
// The code for the property that can be shown in reports and table views
Code string `json:"code"`
// The name for the property
Name string `json:"name"`
// The description for the property
Description string `json:"description"`
}
type EmbeddedRatePlanModel struct {
// The rate plan id
ID string `json:"id"`
// The code for the rate plan that can be shown in reports and table views
Code string `json:"code"`
// The name for the rate plan
Name string `json:"name"`
// The description for the rate plan
Description string `json:"description"`
// Whether the rate plan is subject to city tax or not
IsSubjectToCityTax bool `json:"isSubjectToCityTax"`
}
type EmbeddedUnitGroupModel struct {
// The unit group id
ID string `json:"id"`
// The code for the unit group that can be shown in reports and table views
Code string `json:"code"`
// The name for the unit group
Name string `json:"name"`
// The description for the unit group
Description string `json:"description"`
// The unit group type
Type string `json:"type"`
}
type EmbeddedUnitModel struct {
// The unit id
ID string `json:"id"`
// The name for the unit
Name string `json:"name"`
// The description for the unit
Description string `json:"description"`
}
type EmbeddedMarketSegmentModel struct {
// The market segment id
ID string `json:"id"`
// The market segment code
Code string `json:"code"`
// The market segment name
Name string `json:"name"`
}
type EmbeddedServiceModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
}
type EmbeddedCancellationPolicyModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
PeriodPriorToArrival PeriodModel `json:"periodPriorToArrival"`
}
type EmbeddedNoShowPolicyModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
}
type EmbeddedTimeSliceDefinitionModel struct {
ID string `json:"id"`
Name string `json:"name"`
Template string `json:"template"`
CheckInTime Time `json:"checkInTime"`
CheckOutTime Time `json:"checkOutTime"`
}
type PeriodModel struct {
Hours int32 `json:"hours"`
Days int32 `json:"days"`
Months int32 `json:"months"`
}
type GuestModel struct {
Title string `json:"title"`
Gender string `json:"gender"`
FirstName string `json:"firstName"`
MiddleInitial string `json:"middleInitial"`
LastName string `json:"lastName"`
Email string `json:"email"`
Phone string `json:"phone"`
Address PersonAddressModel `json:"address"`
NationalityCountryCode string `json:"nationalityCountryCode,omitempty"`
IdentificationNumber string `json:"identificationNumber,omitempty"`
IdentificationAdditionalNumber string `json:"identificationAdditionalNumber,omitempty"`
IdentificationIssueDate string `json:"identificationIssueDate,omitempty"`
IdentificationExpiryDate string `json:"identificationExpiryDate,omitempty"`
IdentificationIssuePlace string `json:"identificationIssuePlace,omitempty"`
IdentificationType string `json:"identificationType,omitempty"`
PersonalTaxID string `json:"personalTaxId"`
Company PersonCompanyModel `json:"company"`
PreferredLanguage string `json:"preferredLanguage,omitempty"`
BirthDate Date `json:"birthDate,omitempty"`
BirthFirstName string `json:"birthFirstName,omitempty"`
BirthLastName string `json:"birthLastName,omitempty"`
MotherFirstName string `json:"motherFirstName,omitempty"`
MotherLastName string `json:"motherLastName,omitempty"`
BorderCrossingPlace string `json:"borderCrossingPlace,omitempty"`
BorderCrossingDate string `json:"borderCrossingDate,omitempty"`
}
type BookingItemModel struct {
ID string `json:"id"`
GroupID string `json:"groupId"`
Booker BookerModel `json:"booker"`
PaymentAccount PaymentAccountModel `json:"paymentAccount"`
Comment string `json:"comment"`
BookerComment string `json:"bookerComment"`
Created string `json:"created"`
Modified string `json:"modified"`
Reservations Reservations `json:"reservations"`
}
type BookerModel struct {
Title string `json:"title"`
Gender string `json:"gender"`
FirstName string `json:"firstName"`
MiddleInitial string `json:"middleInitial"`
LastName string `json:"lastName"`
Email string `json:"email"`
Phone string `json:"phone"`
Address PersonAddressModel `json:"address"`
NationalityCountryCode string `json:"nationalityCountryCode"`
IdentificationNumber string `json:"identificationNumber,omitempty"`
IdentificationIssueDate string `json:"identificationIssueDate,omitempty"`
IdentificationExpiryDate string `json:"identificationExpiryDate,omitempty"`
IdentificationType string `json:"identificationType,omitempty"`
Company PersonCompanyModel `json:"company"`
PreferredLanguage string `json:"preferredLanguage,omitempty"`
BirthDate Date `json:"birthDate,omitempty"`
BirthPlace string `json:"birthPlace,omitempty"`
}
type PersonAddressModel struct {
AddressLine1 string `json:"addressLine1"`
AddressLine2 string `json:"addressLine2"`
PostalCode string `json:"postalCode"`
City string `json:"city"`
RegionCode string `json:"regionCode"`
CountryCode string `json:"countryCode"`
}
type PersonCompanyModel struct {
Name string `json:"name"`
TaxID string `json:"taxId"`
}
type PaymentAccountModel struct {
AccountNumber string `json:"accountNumber"`
AccountHolder string `json:"accountHolder"`
ExpiryMonth string `json:"expiryMonth"`
ExpiryYear string `json:"expiryYear"`
PaymentMethod string `json:"paymentMethod"`
PayerEmail string `json:"payerEmail"`
PayerReference string `json:"payerReference"`
IsVirtual bool `json:"isVirtual"`
InactiveReason string `json:"inactiveReason"`
}
type BookingReservationModel struct {
ID string `json:"id"`
Status string `json:"status"`
ExternalCode string `json:"externalCode"`
ChannelCode string `json:"channelCode"`
Source string `json:"source"`
PaymentAccount PaymentAccountModel `json:"paymentAccount"`
Arrival string `json:"arrival"`
Departure string `json:"departure"`
Adults int32 `json:"adults"`
ChildrenAges []int32 `json:"childrenAges"`
TotalGrossAmount MonetaryValueModel `json:"totalGrossAmount"`
Property EmbeddedPropertyModel `json:"property"`
RatePlan EmbeddedRatePlanModel `json:"ratePlan"`
UnitGroup EmbeddedUnitGroupModel `json:"unitGroup"`
Services []ReservationServiceItemModel `json:"services"`
GuestComment string `json:"guestComment"`
CancellationFee ReservationCancellationFeeModel `json:"cancellationFee"`
NoShowFee ReservationNoShowFeeModel `json:"noShowFee"`
Company EmbeddedCompanyModel `json:"company"`
}
type ReservationCancellationFeeModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
DueDateTime string `json:"dueDateTime"`
Fee MonetaryValueModel `json:"fee"`
}
type ReservationNoShowFeeModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
Fee MonetaryValueModel `json:"fee"`
}
type ReservationAssignedUnitModel struct {
Unit EmbeddedUnitModel `json:"unit"`
TimeRange []ReservationAssignedUnitTimeRangeModel `json:"timeRanges"`
}
type ReservationAssignedUnitTimeRangeModel struct {
From DateTime `json:"from"`
To DateTime `json:"to"`
}
type ReservationServiceModel struct {
Service EmbeddedServiceModel `json:"service"`
ServiceDate string `json:"serviceDate"`
Count int32 `json:"count"`
Amount AmountModel `json:"amount"`
BookedAsExtra bool `json:"bookedAsExtra"`
}
type ReservationServiceItemModel struct {
Service ServiceModel `json:"service"`
TotalAmount AmountModel `json:"totalAmount"`
Dates []ServiceDateItemModel `json:"dates"`
}
type ServiceModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
PricingUnit string `json:"pricingUnit"`
DefaultGrossPrice MonetaryValueModel `json:"defaultGrossPrice"`
}
type ServiceDateItemModel struct {
ServiceDate string `json:"serviceDate"`
Count int32 `json:"count"`
Amount AmountModel `json:"amount"`
IsMandatory bool `json:"isMandatory"`
}
type ReservationValidationMessageModel struct {
Service ServiceModel `json:"service"`
TotalAmount AmountModel `json:"totalAmount"`
Dates []ServiceDateItemModel `json:"dates"`
}
type TimeSliceModel struct {
From DateTime `json:"from"`
To DateTime `json:"to"`
ServiceDate string `json:"serviceDate"`
RatePlan EmbeddedRatePlanModel `json:"ratePlan"`
UnitGroup EmbeddedUnitGroupModel `json:"unitGroup"`
Unit EmbeddedUnitModel `json:"unit"`
BaseAmount AmountModel `json:"baseAmount"`
TotalGrossAmount MonetaryValueModel `json:"totalGrossAmount"`
IncludedServices []ReservationServiceModel `json:"includedServices"`
Actions ActionModel `json:"actions"`
}
type ServiceItemModel struct {
ID string `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
Description string `json:"description"`
DefaultGrossPrice MonetaryValueModel `json:"defaultGrossPrice"`
PricingUnit string `json:"pricingUnit"`
PostNextDay bool `json:"postNextDay"`
ServiceType string `json:"serviceType"`
VatType string `json:"vatType"`
Availability AvailabilityModel `json:"availability"`
Property EmbeddedPropertyModel `json:"property"`
SubAccountID string `json:"subAccountId"`
ChannelCodes []string `json:"channelCodes"`
AgeCategoryID string `json:"ageCategoryId"`
}
type Services []ServiceItemModel
type AvailabilityModel struct {
Mode string `json:"mode"`
Quantity int32 `json:"quantity"`
DaysOfWeek []string `json:"daysOfWeek"`
}
type RatePlanItemModel struct {
ID string `json:"id"`
Code string `json:"code"`
Name string `json:"name"`
Description string `json:"description"`
MinGuaranteeType string `json:"minGuaranteeType"`
PriceCalculationMode string `json:"priceCalculationMode"`
Property EmbeddedPropertyModel `json:"property"`
UnitGroup EmbeddedUnitGroupModel `json:"unitGroup"`
CancellationPolicy EmbeddedCancellationPolicyModel `json:"cancellationPolicy"`
NoShowPolicy EmbeddedNoShowPolicyModel `json:"noShowPolicy"`
ChannelCodes []string `json:"channelCodes"`
PromoCodes []string `json:"promoCodes"`
TimeSliceDefinition EmbeddedTimeSliceDefinitionModel `json:"timeSliceDefinition"`
Restrictions BookingRestrictionsModel `json:"restrictions"`
BookingPeriods []BookingPeriodModel `json:"bookingPeriods"`
IsBookable bool `json:"isBookable"`
IsSubjectToCityTax bool `json:"isSubjectToCityTax"`
PricingRule PricingRuleModel `json:"pricingRule"`
IsDerived bool `json:"isDerived"`
DerivationLevel int32 `json:"derivationLevel"`
Surcharges []SurchargeModel `json:"surcharges"`
AgeCategories []RatePlanAgeCategoryModel `json:"ageCategories"`
IncludedServices []RatePlanServiceItemModel `json:"includedServices"`
Companies []CompanyRatePlanModel `json:"companies"`
RatesRange RatesRangeModel `json:"ratesRange"`
AccountingConfigs []AccountingConfigModel `json:"accountingConfigs"`
}
type RatePlans []RatePlanItemModel
type CompanyModel struct {
ID string `json:"id"`
Code string `json:"code"`
PropertyID string `json:"propertyId"`
Name string `json:"name"`
TaxID string `json:"taxId"`
AdditionalTaxID string `json:"additionalTaxId"`
Address CompanyAddressModel `json:"address"`
CanCheckOutOnAr bool `json:"canCheckOutOnAr"`
RatePlans []RatePlanCompanyModel `json:"ratePlans"`
}
type Companies []CompanyModel
type CompanyAddressModel struct {
AddressLine1 string `json:"addressLine1"`
AddressLine2 string `json:"addressLine2"`
PostalCode string `json:"postalCode"`
City string `json:"city"`
RegionCode string `json:"regionCode"`
CountryCode string `json:"countryCode"`
}
type RatePlanCompanyModel struct {
ID string `json:"id"`
Code string `json:"code"`
CorporateCode string `json:"corporateCode"`
Name string `json:"name"`
}
type CreateCompanyModel struct {
Code string `json:"code"`
PropertyID string `json:"propertyId"`
Name string `json:"name"`
TaxID string `json:"taxId"`
AdditionalTaxID string `json:"additionalTaxId"`
Address CompanyAddressModel `json:"address"`
CanCheckOutOnAr bool `json:"canCheckOutOnAr"`
RatePlans []RatePlanCompanyModel `json:"ratePlans"`
}
func (j CreateCompanyModel) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(j)
}
func (j CreateCompanyModel) IsEmpty() bool {
return zero.IsZero(j)
}
type CreateRatePlanCompanyModel struct {
ID string `json:"id"`
CorporateCode string `json:"corporateCode,omitempty"`
}
func (j CreateRatePlanCompanyModel) MarshalJSON() ([]byte, error) {
return omitempty.MarshalJSON(j)
}
func (j CreateRatePlanCompanyModel) IsEmpty() bool {
return zero.IsZero(j)
}
type BookingRestrictionsModel struct {
MinAdvance PeriodModel `json:"minAdvance"`
MaxAdvance PeriodModel `json:"maxAdvance"`
LateBookingUntil Time `json:"lateBookingUntil"`
}
type BookingPeriodModel struct {
From DateTime `json:"from"`
To DateTime `json:"to"`
}
type PricingRuleModel struct {
BaseRatePlan EmbeddedRatePlanModel `json:"baseRatePlan"`
Type string `json:"type"`
Value float64 `json:"value"`
}
type SurchargeModel struct {
Adults int32 `json:"adults"`
Type string `json:"type"`
Value float64 `json:"value"`
}
type RatePlanAgeCategoryModel struct {
ID string `json:"id"`
Surcharges []AgeCategorySurchageModel
}
type AgeCategorySurchageModel struct {
Adults int32 `json:"adults"`
Value float64 `json:"value"`
}
type RatePlanServiceItemModel struct {
Service EmbeddedServiceModel `json:"service"`
GrossPrice MonetaryValueModel `json:"grossPrice"`
PricingMode string `json:"pricingMode"`
}
type CompanyRatePlanModel struct {
ID string `json:"id"`
Code string `json:"code"`
CorporateCode string `json:"corporateCode"`
Name string `json:"name"`
}
type RatesRangeModel struct {
From Date `json:"from"`
To Date `json:"to"`
}
type AccountingConfigModel struct {
VatType string `json:"vatType"`
ServiceType string `json:"serviceType"`
SubAccountID string `json:"subAccountId"`
ValidFrom Date `json:"validFrom"`
}