@wix/table-reservations 1.0.76 → 1.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js +20 -2
  2. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js.map +1 -1
  3. package/build/cjs/src/table-reservations-v1-reservation.context.d.ts +2 -1
  4. package/build/cjs/src/table-reservations-v1-reservation.context.js +18 -1
  5. package/build/cjs/src/table-reservations-v1-reservation.context.js.map +1 -1
  6. package/build/cjs/src/table-reservations-v1-reservation.http.d.ts +1 -0
  7. package/build/cjs/src/table-reservations-v1-reservation.http.js +73 -1
  8. package/build/cjs/src/table-reservations-v1-reservation.http.js.map +1 -1
  9. package/build/cjs/src/table-reservations-v1-reservation.meta.d.ts +1 -0
  10. package/build/cjs/src/table-reservations-v1-reservation.meta.js +20 -1
  11. package/build/cjs/src/table-reservations-v1-reservation.meta.js.map +1 -1
  12. package/build/cjs/src/table-reservations-v1-reservation.public.d.ts +7 -3
  13. package/build/cjs/src/table-reservations-v1-reservation.public.js +8 -1
  14. package/build/cjs/src/table-reservations-v1-reservation.public.js.map +1 -1
  15. package/build/cjs/src/table-reservations-v1-reservation.types.d.ts +113 -2
  16. package/build/cjs/src/table-reservations-v1-reservation.types.js +19 -1
  17. package/build/cjs/src/table-reservations-v1-reservation.types.js.map +1 -1
  18. package/build/cjs/src/table-reservations-v1-reservation.universal.d.ts +123 -2
  19. package/build/cjs/src/table-reservations-v1-reservation.universal.js +93 -3
  20. package/build/cjs/src/table-reservations-v1-reservation.universal.js.map +1 -1
  21. package/build/es/src/table-reservations-v1-reservation-location.universal.js +20 -2
  22. package/build/es/src/table-reservations-v1-reservation-location.universal.js.map +1 -1
  23. package/build/es/src/table-reservations-v1-reservation.context.d.ts +2 -1
  24. package/build/es/src/table-reservations-v1-reservation.context.js +17 -1
  25. package/build/es/src/table-reservations-v1-reservation.context.js.map +1 -1
  26. package/build/es/src/table-reservations-v1-reservation.http.d.ts +1 -0
  27. package/build/es/src/table-reservations-v1-reservation.http.js +71 -0
  28. package/build/es/src/table-reservations-v1-reservation.http.js.map +1 -1
  29. package/build/es/src/table-reservations-v1-reservation.meta.d.ts +1 -0
  30. package/build/es/src/table-reservations-v1-reservation.meta.js +18 -0
  31. package/build/es/src/table-reservations-v1-reservation.meta.js.map +1 -1
  32. package/build/es/src/table-reservations-v1-reservation.public.d.ts +7 -3
  33. package/build/es/src/table-reservations-v1-reservation.public.js +7 -2
  34. package/build/es/src/table-reservations-v1-reservation.public.js.map +1 -1
  35. package/build/es/src/table-reservations-v1-reservation.types.d.ts +113 -2
  36. package/build/es/src/table-reservations-v1-reservation.types.js +18 -0
  37. package/build/es/src/table-reservations-v1-reservation.types.js.map +1 -1
  38. package/build/es/src/table-reservations-v1-reservation.universal.d.ts +123 -2
  39. package/build/es/src/table-reservations-v1-reservation.universal.js +91 -2
  40. package/build/es/src/table-reservations-v1-reservation.universal.js.map +1 -1
  41. package/package.json +3 -3
@@ -16,6 +16,7 @@ export interface Reservation {
16
16
  * * `CANCELED`: The reservation is canceled.
17
17
  * * `NO_SHOW`: The customer didn't show up for their reservation.
18
18
  * * `FINISHED`: The reservation completed successfully.
19
+ * * `PAYMENT_PENDING`: The reservation is temporary and will expire in 10 minutes from the created time, during which time the reservee should pay. This status is set automatically when the reservation is in HELD status and reserve reservation endpoint is called and payment is needed. After payment is completed status will be changed automatically to RESERVED.
19
20
  *
20
21
  * See the [Reservation Lifecycle article](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/the-reservation-lifecycle) for an explanation of the role of statuses in the reservation lifecycle.
21
22
  */
@@ -71,6 +72,11 @@ export interface Reservation {
71
72
  revision?: string | null;
72
73
  /** The reason the reservation was declined. */
73
74
  declineReason?: string | null;
75
+ /**
76
+ * Payment status.
77
+ * @readonly
78
+ */
79
+ paymentStatus?: PaymentStatus;
74
80
  }
75
81
  export declare enum Status {
76
82
  UNKNOWN = "UNKNOWN",
@@ -89,7 +95,9 @@ export declare enum Status {
89
95
  /** The reservee requested a reservation and is waiting for manual approval. */
90
96
  REQUESTED = "REQUESTED",
91
97
  /** The owner declined a reservee's request. */
92
- DECLINED = "DECLINED"
98
+ DECLINED = "DECLINED",
99
+ /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
100
+ PAYMENT_PENDING = "PAYMENT_PENDING"
93
101
  }
94
102
  export declare enum Source {
95
103
  UNKNOWN = "UNKNOWN",
@@ -167,6 +175,21 @@ export interface TableWithReservationConflicts {
167
175
  /** List of reservation ids. */
168
176
  reservationIds?: string[];
169
177
  }
178
+ export declare enum PaymentStatus {
179
+ UNKNOWN = "UNKNOWN",
180
+ /** A reservation is free of charge. */
181
+ FREE = "FREE",
182
+ /** A payment is not received yet. */
183
+ NOT_PAID = "NOT_PAID",
184
+ /** A corresponding to reservation order was fully payed. */
185
+ PAID = "PAID",
186
+ /** A corresponding to reservation order was refunded, but refund amount is less than order total price. */
187
+ PARTIALLY_REFUNDED = "PARTIALLY_REFUNDED",
188
+ /** A corresponding to reservation order was fully refunded. The refund amount equals total price. */
189
+ FULLY_REFUNDED = "FULLY_REFUNDED",
190
+ /** A corresponding to reservation order was partially payed. */
191
+ PARTIALLY_PAID = "PARTIALLY_PAID"
192
+ }
170
193
  export interface CreateReservationRequest {
171
194
  /** Reservation details. */
172
195
  reservation: Reservation;
@@ -453,7 +476,7 @@ export interface QueryReservationsResponse {
453
476
  }
454
477
  export interface SearchReservationsRequest {
455
478
  /** Search query. */
456
- search?: CursorSearch;
479
+ search: CursorSearch;
457
480
  }
458
481
  export interface CursorSearch extends CursorSearchPagingMethodOneOf {
459
482
  /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort' */
@@ -813,6 +836,7 @@ export interface CreateReservationResponseNonNullableFields {
813
836
  tableId: string;
814
837
  reservationIds: string[];
815
838
  }[];
839
+ paymentStatus: PaymentStatus;
816
840
  };
817
841
  }
818
842
  export interface GetReservationResponseNonNullableFields {
@@ -824,6 +848,7 @@ export interface GetReservationResponseNonNullableFields {
824
848
  tableId: string;
825
849
  reservationIds: string[];
826
850
  }[];
851
+ paymentStatus: PaymentStatus;
827
852
  };
828
853
  }
829
854
  export interface UpdateReservationResponseNonNullableFields {
@@ -835,6 +860,7 @@ export interface UpdateReservationResponseNonNullableFields {
835
860
  tableId: string;
836
861
  reservationIds: string[];
837
862
  }[];
863
+ paymentStatus: PaymentStatus;
838
864
  };
839
865
  }
840
866
  export interface CreateHeldReservationResponseNonNullableFields {
@@ -846,6 +872,7 @@ export interface CreateHeldReservationResponseNonNullableFields {
846
872
  tableId: string;
847
873
  reservationIds: string[];
848
874
  }[];
875
+ paymentStatus: PaymentStatus;
849
876
  };
850
877
  }
851
878
  export interface ReserveReservationResponseNonNullableFields {
@@ -857,6 +884,7 @@ export interface ReserveReservationResponseNonNullableFields {
857
884
  tableId: string;
858
885
  reservationIds: string[];
859
886
  }[];
887
+ paymentStatus: PaymentStatus;
860
888
  };
861
889
  }
862
890
  export interface CancelReservationResponseNonNullableFields {
@@ -868,6 +896,7 @@ export interface CancelReservationResponseNonNullableFields {
868
896
  tableId: string;
869
897
  reservationIds: string[];
870
898
  }[];
899
+ paymentStatus: PaymentStatus;
871
900
  };
872
901
  }
873
902
  export interface ListReservationsResponseNonNullableFields {
@@ -879,6 +908,7 @@ export interface ListReservationsResponseNonNullableFields {
879
908
  tableId: string;
880
909
  reservationIds: string[];
881
910
  }[];
911
+ paymentStatus: PaymentStatus;
882
912
  }[];
883
913
  }
884
914
  export interface QueryReservationsResponseNonNullableFields {
@@ -890,5 +920,86 @@ export interface QueryReservationsResponseNonNullableFields {
890
920
  tableId: string;
891
921
  reservationIds: string[];
892
922
  }[];
923
+ paymentStatus: PaymentStatus;
893
924
  }[];
894
925
  }
926
+ export interface SearchReservationsResponseNonNullableFields {
927
+ reservations: {
928
+ status: Status;
929
+ source: Source;
930
+ migrationNotes: MigrationNote[];
931
+ tablesWithReservationConflicts: {
932
+ tableId: string;
933
+ reservationIds: string[];
934
+ }[];
935
+ paymentStatus: PaymentStatus;
936
+ }[];
937
+ aggregationData?: {
938
+ results: {
939
+ values?: {
940
+ results: {
941
+ value: string;
942
+ count: number;
943
+ }[];
944
+ };
945
+ ranges?: {
946
+ results: {
947
+ count: number;
948
+ }[];
949
+ };
950
+ scalar?: {
951
+ type: ScalarType;
952
+ value: number;
953
+ };
954
+ groupedByValue?: {
955
+ results: {
956
+ value: string;
957
+ nestedResults?: {
958
+ values?: {
959
+ results: {
960
+ value: string;
961
+ count: number;
962
+ }[];
963
+ };
964
+ ranges?: {
965
+ results: {
966
+ count: number;
967
+ }[];
968
+ };
969
+ scalar?: {
970
+ type: ScalarType;
971
+ value: number;
972
+ };
973
+ name: string;
974
+ type: AggregationType;
975
+ fieldPath: string;
976
+ };
977
+ }[];
978
+ };
979
+ dateHistogram?: {
980
+ results: {
981
+ value: string;
982
+ count: number;
983
+ }[];
984
+ };
985
+ nested?: {
986
+ results: {
987
+ results?: {
988
+ value?: {
989
+ value: string;
990
+ };
991
+ scalar?: {
992
+ value: number;
993
+ };
994
+ dateHistogram?: {
995
+ value: string;
996
+ };
997
+ };
998
+ }[];
999
+ };
1000
+ name: string;
1001
+ type: AggregationType;
1002
+ fieldPath: string;
1003
+ }[];
1004
+ };
1005
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.Set = exports.Type = exports.TableCombinationConflictType = exports.Source = exports.Status = void 0;
3
+ exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.Set = exports.Type = exports.TableCombinationConflictType = exports.PaymentStatus = exports.Source = exports.Status = void 0;
4
4
  var Status;
5
5
  (function (Status) {
6
6
  Status["UNKNOWN"] = "UNKNOWN";
@@ -20,6 +20,8 @@ var Status;
20
20
  Status["REQUESTED"] = "REQUESTED";
21
21
  /** The owner declined a reservee's request. */
22
22
  Status["DECLINED"] = "DECLINED";
23
+ /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
24
+ Status["PAYMENT_PENDING"] = "PAYMENT_PENDING";
23
25
  })(Status || (exports.Status = Status = {}));
24
26
  var Source;
25
27
  (function (Source) {
@@ -31,6 +33,22 @@ var Source;
31
33
  /** The reservation is created by a User. It can be created without reservee data. */
32
34
  Source["WALK_IN"] = "WALK_IN";
33
35
  })(Source || (exports.Source = Source = {}));
36
+ var PaymentStatus;
37
+ (function (PaymentStatus) {
38
+ PaymentStatus["UNKNOWN"] = "UNKNOWN";
39
+ /** A reservation is free of charge. */
40
+ PaymentStatus["FREE"] = "FREE";
41
+ /** A payment is not received yet. */
42
+ PaymentStatus["NOT_PAID"] = "NOT_PAID";
43
+ /** A corresponding to reservation order was fully payed. */
44
+ PaymentStatus["PAID"] = "PAID";
45
+ /** A corresponding to reservation order was refunded, but refund amount is less than order total price. */
46
+ PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
47
+ /** A corresponding to reservation order was fully refunded. The refund amount equals total price. */
48
+ PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
49
+ /** A corresponding to reservation order was partially payed. */
50
+ PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
51
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
34
52
  var TableCombinationConflictType;
35
53
  (function (TableCombinationConflictType) {
36
54
  TableCombinationConflictType["UNKNOWN"] = "UNKNOWN";
@@ -1 +1 @@
1
- {"version":3,"file":"table-reservations-v1-reservation.types.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-reservation.types.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I,oBAAJ,IAAI,QAKf"}
1
+ {"version":3,"file":"table-reservations-v1-reservation.types.js","sourceRoot":"","sources":["../../../src/table-reservations-v1-reservation.types.ts"],"names":[],"mappings":";;;AAiFA,IAAY,MAoBX;AApBD,WAAY,MAAM;IAChB,6BAAmB,CAAA;IACnB,2GAA2G;IAC3G,uBAAa,CAAA;IACb,yCAAyC;IACzC,+BAAqB,CAAA;IACrB,yCAAyC;IACzC,+BAAqB,CAAA;IACrB,iDAAiD;IACjD,+BAAqB,CAAA;IACrB,kCAAkC;IAClC,6BAAmB,CAAA;IACnB,uCAAuC;IACvC,2BAAiB,CAAA;IACjB,+EAA+E;IAC/E,iCAAuB,CAAA;IACvB,+CAA+C;IAC/C,+BAAqB,CAAA;IACrB,4LAA4L;IAC5L,6CAAmC,CAAA;AACrC,CAAC,EApBW,MAAM,sBAAN,MAAM,QAoBjB;AAED,IAAY,MAQX;AARD,WAAY,MAAM;IAChB,6BAAmB,CAAA;IACnB,4CAA4C;IAC5C,6BAAmB,CAAA;IACnB,yCAAyC;IACzC,2BAAiB,CAAA;IACjB,qFAAqF;IACrF,6BAAmB,CAAA;AACrB,CAAC,EARW,MAAM,sBAAN,MAAM,QAQjB;AAyED,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,uCAAuC;IACvC,8BAAa,CAAA;IACb,qCAAqC;IACrC,sCAAqB,CAAA;IACrB,4DAA4D;IAC5D,8BAAa,CAAA;IACb,2GAA2G;IAC3G,0DAAyC,CAAA;IACzC,qGAAqG;IACrG,kDAAiC,CAAA;IACjC,gEAAgE;IAChE,kDAAiC,CAAA;AACnC,CAAC,EAdW,aAAa,6BAAb,aAAa,QAcxB;AAyBD,IAAY,4BAMX;AAND,WAAY,4BAA4B;IACtC,mDAAmB,CAAA;IACnB,qDAAqB,CAAA;IACrB,mDAAmB,CAAA;IACnB,uDAAuB,CAAA;IACvB,6DAA6B,CAAA;AAC/B,CAAC,EANW,4BAA4B,4CAA5B,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BAAa,CAAA;IACb,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;AACnB,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB;AAoBD,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,kCAAe,CAAA;IACf,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;IACjC,oCAAiB,CAAA;AACnB,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AA4BD,IAAY,IAKX;AALD,WAAY,IAAI;IACd,UAAU;IACV,iBAAS,CAAA;IACT,UAAU;IACV,mBAAW,CAAA;AACb,CAAC,EALW,IAAI,oBAAJ,IAAI,QAKf"}
@@ -75,6 +75,11 @@ export interface Reservation {
75
75
  revision?: string | null;
76
76
  /** The reason the reservation was declined. */
77
77
  declineReason?: string | null;
78
+ /**
79
+ * Payment status.
80
+ * @readonly
81
+ */
82
+ paymentStatus?: PaymentStatus;
78
83
  }
79
84
  export declare enum Status {
80
85
  UNKNOWN = "UNKNOWN",
@@ -93,7 +98,9 @@ export declare enum Status {
93
98
  /** The reservee requested a reservation and is waiting for manual approval. */
94
99
  REQUESTED = "REQUESTED",
95
100
  /** The owner declined a reservee's request. */
96
- DECLINED = "DECLINED"
101
+ DECLINED = "DECLINED",
102
+ /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
103
+ PAYMENT_PENDING = "PAYMENT_PENDING"
97
104
  }
98
105
  export declare enum Source {
99
106
  UNKNOWN = "UNKNOWN",
@@ -171,6 +178,21 @@ export interface TableWithReservationConflicts {
171
178
  /** List of reservation ids. */
172
179
  reservationIds?: string[];
173
180
  }
181
+ export declare enum PaymentStatus {
182
+ UNKNOWN = "UNKNOWN",
183
+ /** A reservation is free of charge. */
184
+ FREE = "FREE",
185
+ /** A payment is not received yet. */
186
+ NOT_PAID = "NOT_PAID",
187
+ /** A corresponding to reservation order was fully payed. */
188
+ PAID = "PAID",
189
+ /** A corresponding to reservation order was refunded, but refund amount is less than order total price. */
190
+ PARTIALLY_REFUNDED = "PARTIALLY_REFUNDED",
191
+ /** A corresponding to reservation order was fully refunded. The refund amount equals total price. */
192
+ FULLY_REFUNDED = "FULLY_REFUNDED",
193
+ /** A corresponding to reservation order was partially payed. */
194
+ PARTIALLY_PAID = "PARTIALLY_PAID"
195
+ }
174
196
  export interface CreateReservationRequest {
175
197
  /** Reservation details. */
176
198
  reservation: Reservation;
@@ -455,7 +477,7 @@ export interface QueryReservationsResponse {
455
477
  }
456
478
  export interface SearchReservationsRequest {
457
479
  /** Search query. */
458
- search?: CursorSearch;
480
+ search: CursorSearch;
459
481
  }
460
482
  export interface CursorSearch extends CursorSearchPagingMethodOneOf {
461
483
  /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort' */
@@ -820,50 +842,133 @@ export interface CreateReservationResponseNonNullableFields {
820
842
  reservation?: {
821
843
  status: Status;
822
844
  source: Source;
845
+ paymentStatus: PaymentStatus;
823
846
  };
824
847
  }
825
848
  export interface GetReservationResponseNonNullableFields {
826
849
  reservation?: {
827
850
  status: Status;
828
851
  source: Source;
852
+ paymentStatus: PaymentStatus;
829
853
  };
830
854
  }
831
855
  export interface UpdateReservationResponseNonNullableFields {
832
856
  reservation?: {
833
857
  status: Status;
834
858
  source: Source;
859
+ paymentStatus: PaymentStatus;
835
860
  };
836
861
  }
837
862
  export interface CreateHeldReservationResponseNonNullableFields {
838
863
  reservation?: {
839
864
  status: Status;
840
865
  source: Source;
866
+ paymentStatus: PaymentStatus;
841
867
  };
842
868
  }
843
869
  export interface ReserveReservationResponseNonNullableFields {
844
870
  reservation?: {
845
871
  status: Status;
846
872
  source: Source;
873
+ paymentStatus: PaymentStatus;
847
874
  };
848
875
  }
849
876
  export interface CancelReservationResponseNonNullableFields {
850
877
  reservation?: {
851
878
  status: Status;
852
879
  source: Source;
880
+ paymentStatus: PaymentStatus;
853
881
  };
854
882
  }
855
883
  export interface ListReservationsResponseNonNullableFields {
856
884
  reservations: {
857
885
  status: Status;
858
886
  source: Source;
887
+ paymentStatus: PaymentStatus;
859
888
  }[];
860
889
  }
861
890
  export interface QueryReservationsResponseNonNullableFields {
862
891
  reservations: {
863
892
  status: Status;
864
893
  source: Source;
894
+ paymentStatus: PaymentStatus;
865
895
  }[];
866
896
  }
897
+ export interface SearchReservationsResponseNonNullableFields {
898
+ reservations: {
899
+ status: Status;
900
+ source: Source;
901
+ paymentStatus: PaymentStatus;
902
+ }[];
903
+ aggregationData?: {
904
+ results: {
905
+ values?: {
906
+ results: {
907
+ value: string;
908
+ count: number;
909
+ }[];
910
+ };
911
+ ranges?: {
912
+ results: {
913
+ count: number;
914
+ }[];
915
+ };
916
+ scalar?: {
917
+ type: ScalarType;
918
+ value: number;
919
+ };
920
+ groupedByValue?: {
921
+ results: {
922
+ value: string;
923
+ nestedResults?: {
924
+ values?: {
925
+ results: {
926
+ value: string;
927
+ count: number;
928
+ }[];
929
+ };
930
+ ranges?: {
931
+ results: {
932
+ count: number;
933
+ }[];
934
+ };
935
+ scalar?: {
936
+ type: ScalarType;
937
+ value: number;
938
+ };
939
+ name: string;
940
+ type: AggregationType;
941
+ fieldPath: string;
942
+ };
943
+ }[];
944
+ };
945
+ dateHistogram?: {
946
+ results: {
947
+ value: string;
948
+ count: number;
949
+ }[];
950
+ };
951
+ nested?: {
952
+ results: {
953
+ results?: {
954
+ value?: {
955
+ value: string;
956
+ };
957
+ scalar?: {
958
+ value: number;
959
+ };
960
+ dateHistogram?: {
961
+ value: string;
962
+ };
963
+ };
964
+ }[];
965
+ };
966
+ name: string;
967
+ type: AggregationType;
968
+ fieldPath: string;
969
+ }[];
970
+ };
971
+ }
867
972
  export declare const onReservationCreated: EventDefinition<DomainCreatedEvent<Reservation>, "wix.table_reservations.v1.reservation_created">;
868
973
  export declare const onReservationUpdated: EventDefinition<DomainUpdatedEvent<Reservation>, "wix.table_reservations.v1.reservation_updated">;
869
974
  /**
@@ -1052,6 +1157,11 @@ export interface UpdateReservation {
1052
1157
  revision?: string | null;
1053
1158
  /** The reason the reservation was declined. */
1054
1159
  declineReason?: string | null;
1160
+ /**
1161
+ * Payment status.
1162
+ * @readonly
1163
+ */
1164
+ paymentStatus?: PaymentStatus;
1055
1165
  }
1056
1166
  export interface UpdateReservationOptions {
1057
1167
  /**
@@ -1292,4 +1402,15 @@ export interface ReservationsQueryBuilder {
1292
1402
  /** @documentationMaturity preview */
1293
1403
  find: () => Promise<ReservationsQueryResult>;
1294
1404
  }
1405
+ /** @param search - Search query.
1406
+ * @public
1407
+ * @documentationMaturity preview
1408
+ * @requiredField search
1409
+ * @permissionScope Manage Reservations (Medium)
1410
+ * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1411
+ * @permissionScope Manage Reservations (Full)
1412
+ * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1413
+ * @applicableIdentity APP
1414
+ */
1415
+ export declare function searchReservations(search: CursorSearch): Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
1295
1416
  export {};
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.queryReservations = exports.listReservations = exports.cancelReservation = exports.reserveReservation = exports.createHeldReservation = exports.updateReservation = exports.getReservation = exports.createReservation = exports.onReservationUpdated = exports.onReservationCreated = exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.Set = exports.Type = exports.TableCombinationConflictType = exports.Source = exports.Status = void 0;
35
+ exports.searchReservations = exports.queryReservations = exports.listReservations = exports.cancelReservation = exports.reserveReservation = exports.createHeldReservation = exports.updateReservation = exports.getReservation = exports.createReservation = exports.onReservationUpdated = exports.onReservationCreated = exports.Mode = exports.AggregationType = exports.Interval = exports.NestedAggregationType = exports.ScalarType = exports.MissingValues = exports.SortDirection = exports.SortType = exports.SortOrder = exports.Set = exports.Type = exports.TableCombinationConflictType = exports.PaymentStatus = exports.Source = exports.Status = void 0;
36
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
37
  const transform_error_1 = require("@wix/sdk-runtime/transform-error");
38
38
  const sdk_types_1 = require("@wix/sdk-types");
@@ -60,6 +60,8 @@ var Status;
60
60
  Status["REQUESTED"] = "REQUESTED";
61
61
  /** The owner declined a reservee's request. */
62
62
  Status["DECLINED"] = "DECLINED";
63
+ /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
64
+ Status["PAYMENT_PENDING"] = "PAYMENT_PENDING";
63
65
  })(Status || (exports.Status = Status = {}));
64
66
  var Source;
65
67
  (function (Source) {
@@ -71,6 +73,22 @@ var Source;
71
73
  /** The reservation is created by a User. It can be created without reservee data. */
72
74
  Source["WALK_IN"] = "WALK_IN";
73
75
  })(Source || (exports.Source = Source = {}));
76
+ var PaymentStatus;
77
+ (function (PaymentStatus) {
78
+ PaymentStatus["UNKNOWN"] = "UNKNOWN";
79
+ /** A reservation is free of charge. */
80
+ PaymentStatus["FREE"] = "FREE";
81
+ /** A payment is not received yet. */
82
+ PaymentStatus["NOT_PAID"] = "NOT_PAID";
83
+ /** A corresponding to reservation order was fully payed. */
84
+ PaymentStatus["PAID"] = "PAID";
85
+ /** A corresponding to reservation order was refunded, but refund amount is less than order total price. */
86
+ PaymentStatus["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
87
+ /** A corresponding to reservation order was fully refunded. The refund amount equals total price. */
88
+ PaymentStatus["FULLY_REFUNDED"] = "FULLY_REFUNDED";
89
+ /** A corresponding to reservation order was partially payed. */
90
+ PaymentStatus["PARTIALLY_PAID"] = "PARTIALLY_PAID";
91
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
74
92
  var TableCombinationConflictType;
75
93
  (function (TableCombinationConflictType) {
76
94
  TableCombinationConflictType["UNKNOWN"] = "UNKNOWN";
@@ -168,10 +186,27 @@ const _queryReservationsRequest = {};
168
186
  const _queryReservationsResponse = {};
169
187
  const _reserveReservationRequest = {};
170
188
  const _reserveReservationResponse = {};
189
+ const _searchReservationsRequest = {};
190
+ const _searchReservationsResponse = {};
171
191
  const _updateReservationRequest = {};
172
192
  const _updateReservationResponse = {};
173
- exports.onReservationCreated = (0, sdk_types_1.EventDefinition)('wix.table_reservations.v1.reservation_created')();
174
- exports.onReservationUpdated = (0, sdk_types_1.EventDefinition)('wix.table_reservations.v1.reservation_updated')();
193
+ const _details = {
194
+ startDate: 'google.protobuf.Timestamp',
195
+ endDate: 'google.protobuf.Timestamp',
196
+ };
197
+ const _reservation = {
198
+ createdDate: 'google.protobuf.Timestamp',
199
+ updatedDate: 'google.protobuf.Timestamp',
200
+ details: '_details',
201
+ };
202
+ exports.onReservationCreated = (0, sdk_types_1.EventDefinition)('wix.table_reservations.v1.reservation_created', true, {
203
+ rootSchema: _reservation,
204
+ depSchemas: { _details },
205
+ })();
206
+ exports.onReservationUpdated = (0, sdk_types_1.EventDefinition)('wix.table_reservations.v1.reservation_updated', true, {
207
+ rootSchema: _reservation,
208
+ depSchemas: { _details },
209
+ })();
175
210
  /**
176
211
  * Creates a new reservation.
177
212
  *
@@ -795,4 +830,59 @@ function queryReservations() {
795
830
  })({ cursorWithEmptyFilterAndSort: true });
796
831
  }
797
832
  exports.queryReservations = queryReservations;
833
+ /** @param search - Search query.
834
+ * @public
835
+ * @documentationMaturity preview
836
+ * @requiredField search
837
+ * @permissionScope Manage Reservations (Medium)
838
+ * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
839
+ * @permissionScope Manage Reservations (Full)
840
+ * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
841
+ * @applicableIdentity APP
842
+ */
843
+ function searchReservations(search) {
844
+ var _a, _b, _c;
845
+ return __awaiter(this, arguments, void 0, function* () {
846
+ const requestTransformation = { search: '$[0]' };
847
+ const responseTransformation = '$';
848
+ // @ts-ignore
849
+ const { httpClient, sideEffects } = arguments[1];
850
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
851
+ rootSchema: _searchReservationsRequest,
852
+ depSchemas: {},
853
+ fqdnTransformation: {
854
+ paths: [],
855
+ transformation: _fromVeloEntity,
856
+ },
857
+ customTransformation: requestTransformation,
858
+ });
859
+ const { fromJSON } = (0, velo_1.serializer)({
860
+ rootSchema: _searchReservationsResponse,
861
+ depSchemas: {},
862
+ fqdnTransformation: {
863
+ paths: [...['Array#reservations']],
864
+ transformation: _toVeloEntity,
865
+ },
866
+ customTransformation: responseTransformation,
867
+ });
868
+ const payload = toAmbassadorRequest([search]);
869
+ const reqOpts = ambassadorWixTableReservationsV1Reservation.searchReservations(payload);
870
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
871
+ try {
872
+ const result = yield httpClient.request(reqOpts);
873
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
874
+ return fromJSON(result.data);
875
+ }
876
+ catch (err) {
877
+ const transformedError = (0, transform_error_1.transformError)(err, {
878
+ spreadPathsToArguments: {},
879
+ explicitPathsToArguments: { search: '$[0]' },
880
+ singleArgumentUnchanged: false,
881
+ }, ['search']);
882
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
883
+ throw transformedError;
884
+ }
885
+ });
886
+ }
887
+ exports.searchReservations = searchReservations;
798
888
  //# sourceMappingURL=table-reservations-v1-reservation.universal.js.map