btrz-api-client 8.48.0 → 8.49.0
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.
|
@@ -28,6 +28,14 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
28
28
|
* @property {string} [orderDir] - 'asc' (1) or 'desc' (-1)
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Promo create / PATCH update body (subset; see inventory API models for full shape).
|
|
33
|
+
* @typedef {Object} PromoUpdateRequest
|
|
34
|
+
* @property {boolean} [groupDiscount] - When true, min passenger rules use group semantics in sales.
|
|
35
|
+
* @property {boolean} [requireSameOperation] - When true with group discount, cart context is scoped by journeyId.
|
|
36
|
+
* @property {string[]} [groupDiscountEligibleFareIds] - Non-empty: only these fare IDs count toward minimum and may receive discount; empty: all fares.
|
|
37
|
+
*/
|
|
38
|
+
|
|
31
39
|
/**
|
|
32
40
|
* Factory for promos API (btrz-api-inventory).
|
|
33
41
|
* @param {Object} deps
|
|
@@ -91,7 +99,7 @@ function promosFactory(_ref) {
|
|
|
91
99
|
* @param {Object} opts
|
|
92
100
|
* @param {string} [opts.token] - API key
|
|
93
101
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
94
|
-
* @param {
|
|
102
|
+
* @param {PromoUpdateRequest} opts.promo - Promo payload; must not include _id.
|
|
95
103
|
* @param {Object} [opts.headers] - Optional headers
|
|
96
104
|
* @returns {Promise<import("axios").AxiosResponse<object>>} Resolves with created Promo.
|
|
97
105
|
* @throws When the request fails (400/401/500). Body: WRONG_DATA, INTERNALID_USED,
|
|
@@ -140,7 +148,7 @@ function promosFactory(_ref) {
|
|
|
140
148
|
* @param {string} [opts.token] - API key
|
|
141
149
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
142
150
|
* @param {string} opts.promoId - Promo id
|
|
143
|
-
* @param {
|
|
151
|
+
* @param {PromoUpdateRequest} opts.update - Partial update.
|
|
144
152
|
* @param {Object} [opts.headers] - Optional headers
|
|
145
153
|
* @returns {Promise<import("axios").AxiosResponse<object>>} Resolves with updated Promo.
|
|
146
154
|
* @throws When the request fails (400/401/404/500). Body: WRONG_DATA, INTERNALID_USED, PROMO_NOT_FOUND, etc.
|
package/package.json
CHANGED
|
@@ -25,6 +25,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
25
25
|
* @property {string} [orderDir] - 'asc' (1) or 'desc' (-1)
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Promo create / PATCH update body (subset; see inventory API models for full shape).
|
|
30
|
+
* @typedef {Object} PromoUpdateRequest
|
|
31
|
+
* @property {boolean} [groupDiscount] - When true, min passenger rules use group semantics in sales.
|
|
32
|
+
* @property {boolean} [requireSameOperation] - When true with group discount, cart context is scoped by journeyId.
|
|
33
|
+
* @property {string[]} [groupDiscountEligibleFareIds] - Non-empty: only these fare IDs count toward minimum and may receive discount; empty: all fares.
|
|
34
|
+
*/
|
|
35
|
+
|
|
28
36
|
/**
|
|
29
37
|
* Factory for promos API (btrz-api-inventory).
|
|
30
38
|
* @param {Object} deps
|
|
@@ -72,7 +80,7 @@ function promosFactory({client, internalAuthTokenProvider}) {
|
|
|
72
80
|
* @param {Object} opts
|
|
73
81
|
* @param {string} [opts.token] - API key
|
|
74
82
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
75
|
-
* @param {
|
|
83
|
+
* @param {PromoUpdateRequest} opts.promo - Promo payload; must not include _id.
|
|
76
84
|
* @param {Object} [opts.headers] - Optional headers
|
|
77
85
|
* @returns {Promise<import("axios").AxiosResponse<object>>} Resolves with created Promo.
|
|
78
86
|
* @throws When the request fails (400/401/500). Body: WRONG_DATA, INTERNALID_USED,
|
|
@@ -111,7 +119,7 @@ function promosFactory({client, internalAuthTokenProvider}) {
|
|
|
111
119
|
* @param {string} [opts.token] - API key
|
|
112
120
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
113
121
|
* @param {string} opts.promoId - Promo id
|
|
114
|
-
* @param {
|
|
122
|
+
* @param {PromoUpdateRequest} opts.update - Partial update.
|
|
115
123
|
* @param {Object} [opts.headers] - Optional headers
|
|
116
124
|
* @returns {Promise<import("axios").AxiosResponse<object>>} Resolves with updated Promo.
|
|
117
125
|
* @throws When the request fails (400/401/404/500). Body: WRONG_DATA, INTERNALID_USED, PROMO_NOT_FOUND, etc.
|