mcp-prqx-pricer 1.0.12 → 1.0.14
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.
- package/README.md +3 -0
- package/build/index.js +16 -14
- package/build/tools/createPricingGroup.js +39 -21
- package/build/tools/deletePricingGroups.js +11 -11
- package/build/tools/updatePricingGroup.js +194 -0
- package/package.json +1 -1
- package/prompts/mcp-n8n-4.1-instructions.md +37 -0
- package/prompts/mcp-n8n-4.1-instructions.xml +20 -0
- package/src/index.ts +74 -62
- package/src/tools/createPricingGroup.ts +43 -22
- package/src/tools/deletePricingGroups.ts +44 -30
- package/src/tools/updatePricingGroup.ts +255 -0
- package/src/types/pricingGroup.ts +78 -1
- package/openapi/pricer.json +0 -7208
@@ -1,7 +1,7 @@
|
|
1
1
|
import { McpTool } from "../types/tool";
|
2
2
|
import { CallToolRequest, ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
3
3
|
import axios from "axios";
|
4
|
-
import { CeilingPricingMethod, CustomSharingMethod, FloorPricingMethod, NoCompPricingMethod, PricingGroupRequest, PricingGroupRequestType, PricingGroupResponse, ShareOptionsType, TicketGroupRequestRank } from "../types/pricingGroup";
|
4
|
+
import { CeilingPricingMethod, CustomSharingMethod, FloorPricingMethod, NoCompPricingMethod, PricingGroupRequest, PricingGroupRequestType, PricingGroupResponse, ShareOptionsType, TicketGroupOrgDefaultResponse, TicketGroupRequestRank } from "../types/pricingGroup";
|
5
5
|
|
6
6
|
export class CreatePricingGroupTool implements McpTool {
|
7
7
|
name = 'CreatePricingGroup';
|
@@ -106,28 +106,37 @@ export class CreatePricingGroupTool implements McpTool {
|
|
106
106
|
throw new Error('Missing arguments');
|
107
107
|
}
|
108
108
|
|
109
|
+
const pricingGroupRequestRanks = request.params.arguments.pricingGroupRequestRanks as TicketGroupRequestRank[];
|
110
|
+
|
111
|
+
const anchorTicketGroupId = pricingGroupRequestRanks.find(rank => rank.rank === 0)?.ticketGroupId;
|
112
|
+
if (!anchorTicketGroupId) {
|
113
|
+
throw new Error('Anchor ticket group ID is required');
|
114
|
+
}
|
115
|
+
|
116
|
+
const defaultsResponse = await httpClient.get<TicketGroupOrgDefaultResponse>('/v1/client/org-defaults/calculate-defaults/' + anchorTicketGroupId);
|
117
|
+
const defaults = defaultsResponse.data;
|
118
|
+
|
109
119
|
const productionId = request.params.arguments.productionId as number;
|
110
120
|
const name = request.params.arguments.name as string;
|
111
|
-
const ceilingPrice = request.params.arguments.ceilingPrice as number;
|
112
|
-
const floorPrice = request.params.arguments.floorPrice as number;
|
121
|
+
const ceilingPrice = request.params.arguments.ceilingPrice as number ?? defaults.ruleSet.ceiling;
|
122
|
+
const floorPrice = request.params.arguments.floorPrice as number ?? defaults.ruleSet.floor;
|
113
123
|
const pricingGroupRequestType = request.params.arguments.pricingGroupMode as PricingGroupRequestType;
|
114
|
-
const amount = request.params.arguments.amount as number;
|
115
|
-
const increment = request.params.arguments.increment as string;
|
116
|
-
const incrementMethod = request.params.arguments.incrementMethod as string;
|
117
|
-
const offsetAmount = request.params.arguments.offsetAmount as number | undefined;
|
118
|
-
const offsetIncrement = request.params.arguments.offsetIncrement as string | undefined;
|
119
|
-
const offsetIncrementMethod = request.params.arguments.offsetIncrementMethod as string | undefined;
|
120
|
-
const enableShareOptions = request.params.arguments.enableShareOptions as boolean | undefined;
|
121
|
-
const shareOptionsType = request.params.arguments.shareOptionsType as ShareOptionsType | undefined;
|
122
|
-
const shareAnchor = request.params.arguments.shareAnchor as boolean | undefined;
|
123
|
-
const customSharingAmount = request.params.arguments.customSharingAmount as number | undefined;
|
124
|
-
const customSharingMethod = request.params.arguments.customSharingMethod as CustomSharingMethod | undefined;
|
125
|
-
const applyCeilingOnlyToAnchor = request.params.arguments.applyCeilingOnlyToAnchor as boolean | undefined;
|
126
|
-
const applyFloorOnlyToAnchor = request.params.arguments.applyFloorOnlyToAnchor as boolean | undefined;
|
127
|
-
const floorPricingMethod = request.params.arguments.floorPricingMethod as FloorPricingMethod | undefined;
|
128
|
-
const ceilingPricingMethod = request.params.arguments.ceilingPricingMethod as CeilingPricingMethod | undefined;
|
129
|
-
const noCompPricingMethod = request.params.arguments.noCompPricingMethod as NoCompPricingMethod | undefined;
|
130
|
-
const pricingGroupRequestRanks = request.params.arguments.pricingGroupRequestRanks as TicketGroupRequestRank[];
|
124
|
+
const amount = request.params.arguments.amount as number ?? defaults.ruleSet.amount;
|
125
|
+
const increment = request.params.arguments.increment as string ?? defaults.ruleSet.increment;
|
126
|
+
const incrementMethod = request.params.arguments.incrementMethod as string ?? defaults.ruleSet.incrementMethod;
|
127
|
+
const offsetAmount = request.params.arguments.offsetAmount as number | undefined ?? defaults.ruleSet.offsetAmount;
|
128
|
+
const offsetIncrement = request.params.arguments.offsetIncrement as string | undefined ?? defaults.ruleSet.offsetIncrement;
|
129
|
+
const offsetIncrementMethod = request.params.arguments.offsetIncrementMethod as string | undefined ?? defaults.ruleSet.offsetIncrementMethod;
|
130
|
+
const enableShareOptions = request.params.arguments.enableShareOptions as boolean | undefined ?? defaults.ruleSet.enableShareOptions;
|
131
|
+
const shareOptionsType = request.params.arguments.shareOptionsType as ShareOptionsType | undefined ?? defaults.ruleSet.shareOptionsType;
|
132
|
+
const shareAnchor = request.params.arguments.shareAnchor as boolean | undefined ?? defaults.ruleSet.shareAnchor;
|
133
|
+
const customSharingAmount = request.params.arguments.customSharingAmount as number | undefined ?? defaults.ruleSet.customSharingAmount;
|
134
|
+
const customSharingMethod = request.params.arguments.customSharingMethod as CustomSharingMethod | undefined ?? defaults.ruleSet.customSharingMethod;
|
135
|
+
const applyCeilingOnlyToAnchor = request.params.arguments.applyCeilingOnlyToAnchor as boolean | undefined ?? defaults.ruleSet.applyCeilingOnlyToAnchor;
|
136
|
+
const applyFloorOnlyToAnchor = request.params.arguments.applyFloorOnlyToAnchor as boolean | undefined ?? defaults.ruleSet.applyFloorOnlyToAnchor;
|
137
|
+
const floorPricingMethod = request.params.arguments.floorPricingMethod as FloorPricingMethod | undefined ?? defaults.ruleSet.floorPricingMethod;
|
138
|
+
const ceilingPricingMethod = request.params.arguments.ceilingPricingMethod as CeilingPricingMethod | undefined ?? defaults.ruleSet.ceilingPricingMethod;
|
139
|
+
const noCompPricingMethod = request.params.arguments.noCompPricingMethod as NoCompPricingMethod | undefined ?? defaults.ruleSet.noCompPricingMethod;
|
131
140
|
|
132
141
|
const args : PricingGroupRequest = {
|
133
142
|
productionId: productionId,
|
@@ -153,13 +162,25 @@ export class CreatePricingGroupTool implements McpTool {
|
|
153
162
|
ceilingPricingMethod: ceilingPricingMethod,
|
154
163
|
noCompPricingMethod: noCompPricingMethod
|
155
164
|
},
|
156
|
-
marketGroupCriteria: {
|
165
|
+
marketGroupCriteria: {
|
166
|
+
sections: defaults?.marketGroupCriteria?.sections ?? [],
|
167
|
+
validSplitsIncludeV2: defaults?.marketGroupCriteria?.validSplitsIncludeV2,
|
168
|
+
validSplitsIncludeMax: defaults?.marketGroupCriteria?.validSplitsIncludeMax,
|
169
|
+
deliveryMethodInclude: defaults?.marketGroupCriteria?.deliveryMethodInclude,
|
170
|
+
attributesExclude: defaults?.marketGroupCriteria?.attributesExclude,
|
171
|
+
lowerOutlierMethod: defaults?.marketGroupCriteria?.lowerOutlierMethod,
|
172
|
+
lowerOutlierAmount: defaults?.marketGroupCriteria?.lowerOutlierAmount,
|
173
|
+
lowerOutlierThreshold: defaults?.marketGroupCriteria?.lowerOutlierThreshold,
|
174
|
+
includeSpeculativeTickets: defaults?.marketGroupCriteria?.includeSpeculativeTickets,
|
175
|
+
isSplitsDynamic: defaults?.marketGroupCriteria?.isSplitsDynamic,
|
176
|
+
rowRanges: defaults?.marketGroupCriteria?.rowRanges
|
177
|
+
},
|
157
178
|
pricingGroupRequestRanks: pricingGroupRequestRanks
|
158
179
|
};
|
159
180
|
console.error('[API] Create Pricing Group with arguments:', args);
|
160
181
|
const response = await httpClient.post<PricingGroupResponse>(`/v2/client/pricing-group`, args);
|
161
182
|
if (response.status !== 200) {
|
162
|
-
throw new Error(
|
183
|
+
throw new Error("API error: " + response.statusText);
|
163
184
|
}
|
164
185
|
return { content: [{ type: 'text', text: JSON.stringify([response.data]) }] };
|
165
186
|
} catch (error) {
|
@@ -1,36 +1,50 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
CallToolRequest,
|
3
|
+
ErrorCode,
|
4
|
+
McpError,
|
5
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
2
6
|
import { AxiosInstance } from "axios";
|
3
7
|
import { McpTool } from "../types/tool";
|
4
8
|
|
5
9
|
export class DeletePricingGroupsTool implements McpTool {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
name = "DeletePricingGroups";
|
11
|
+
description = "Delete multiple pricing groups in bulk";
|
12
|
+
inputSchema = {
|
13
|
+
type: "object",
|
14
|
+
properties: {
|
15
|
+
pricingGroupIds: {
|
16
|
+
type: "array",
|
17
|
+
description:
|
18
|
+
"Array of IDs (numbers) of the pricing groups that will be deleted. They can belong to multiple productions.",
|
19
|
+
},
|
20
|
+
},
|
21
|
+
required: ["pricingGroupIds"],
|
22
|
+
};
|
18
23
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
24
|
+
async toolHandler(
|
25
|
+
request: CallToolRequest,
|
26
|
+
axiosInstance: AxiosInstance
|
27
|
+
): Promise<any> {
|
28
|
+
try {
|
29
|
+
const args = request.params.arguments as { pricingGroupIds: [number] };
|
30
|
+
if (!args) {
|
31
|
+
throw new Error("Missing argument pricingGroupIds");
|
32
|
+
}
|
33
|
+
console.error("[API] Delete Pricing Group with arguments:", args);
|
34
|
+
const response = await axiosInstance.delete(
|
35
|
+
`/v2/client/pricing-group/bulk`,
|
36
|
+
{ data: args }
|
37
|
+
);
|
38
|
+
return { content: [{ type: "text", text: "Operation Completed!" }] };
|
39
|
+
} catch (error) {
|
40
|
+
if (error instanceof Error) {
|
41
|
+
console.error("Error in Delete Pricing Groups:", error);
|
42
|
+
throw new McpError(
|
43
|
+
ErrorCode.InternalError,
|
44
|
+
`Failed to delete pricing groups: ${error.message}`
|
45
|
+
);
|
46
|
+
}
|
47
|
+
throw error;
|
35
48
|
}
|
36
|
-
}
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,255 @@
|
|
1
|
+
import { McpTool } from "../types/tool";
|
2
|
+
import {
|
3
|
+
CallToolRequest,
|
4
|
+
ErrorCode,
|
5
|
+
McpError,
|
6
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
7
|
+
import { AxiosInstance } from "axios";
|
8
|
+
import {
|
9
|
+
CeilingPricingMethod,
|
10
|
+
CustomSharingMethod,
|
11
|
+
FloorPricingMethod,
|
12
|
+
NoCompPricingMethod,
|
13
|
+
PricingGroupRequestType,
|
14
|
+
PricingGroupResponse,
|
15
|
+
PricingGroupUpdateRequest,
|
16
|
+
ShareOptionsType,
|
17
|
+
} from "../types/pricingGroup";
|
18
|
+
|
19
|
+
export class UpdatePricingGroupTool implements McpTool {
|
20
|
+
name = "UpdatePricingGroup";
|
21
|
+
description =
|
22
|
+
"Allows to update any individual property of an existing pricing group";
|
23
|
+
inputSchema = {
|
24
|
+
type: "object",
|
25
|
+
properties: {
|
26
|
+
pricingGroupId: {
|
27
|
+
type: "number",
|
28
|
+
description: "ID of the pricing group to modify",
|
29
|
+
},
|
30
|
+
name: {
|
31
|
+
type: "string",
|
32
|
+
description: "Name of the pricing group",
|
33
|
+
},
|
34
|
+
ceilingPrice: {
|
35
|
+
type: "number",
|
36
|
+
description: "Maximum price that the pricing group tickets can have",
|
37
|
+
},
|
38
|
+
floorPrice: {
|
39
|
+
type: "number",
|
40
|
+
description: "Minimum price that the pricing group tickets can have",
|
41
|
+
},
|
42
|
+
pricingGroupMode: {
|
43
|
+
type: "string",
|
44
|
+
description: "(AutoPrice or SimulationOnly) Mode of the pricing group",
|
45
|
+
},
|
46
|
+
amount: {
|
47
|
+
type: "number",
|
48
|
+
description:
|
49
|
+
"Amount used to price the anchor ticket of the pricing group based on the first market comparable",
|
50
|
+
},
|
51
|
+
increment: {
|
52
|
+
type: "string",
|
53
|
+
description:
|
54
|
+
"(increase or decrease) Decides if the amount is applied to increase or decrease the price of the anchor ticket of the pricing group based on the first market comparable",
|
55
|
+
},
|
56
|
+
incrementMethod: {
|
57
|
+
type: "string",
|
58
|
+
description:
|
59
|
+
"( % or $ ) Decides if the amount is applied as a percentage or a dollar amount",
|
60
|
+
},
|
61
|
+
offsetAmount: {
|
62
|
+
type: "number",
|
63
|
+
description:
|
64
|
+
"Offset amount used to price the other tickets in the group based of the previously ranked ticket",
|
65
|
+
},
|
66
|
+
offsetIncrement: {
|
67
|
+
type: "string",
|
68
|
+
description:
|
69
|
+
"(increase or decrease) Decides if the offset amount is applied to increase or decrease the price of the other tickets in the group based of the previously ranked ticket",
|
70
|
+
},
|
71
|
+
offsetIncrementMethod: {
|
72
|
+
type: "string",
|
73
|
+
description:
|
74
|
+
"( % or $ ) Decides if the offset amount is applied as a percentage or a dollar amount",
|
75
|
+
},
|
76
|
+
enableShareOptions: {
|
77
|
+
type: "boolean",
|
78
|
+
description:
|
79
|
+
"Decides if the pricing group will control the sharing of tickets in a marketplace or not",
|
80
|
+
},
|
81
|
+
shareOptionsType: {
|
82
|
+
type: "string",
|
83
|
+
description:
|
84
|
+
"(all or custom) Decides if we use custom parameters to share the tickets in the group or if we share them all. Default all.",
|
85
|
+
},
|
86
|
+
shareAnchor: {
|
87
|
+
type: "boolean",
|
88
|
+
description:
|
89
|
+
"Controls if the anchor ticket of the pricing group will be shared or not",
|
90
|
+
},
|
91
|
+
customSharingAmount: {
|
92
|
+
type: "number",
|
93
|
+
description:
|
94
|
+
"Custom sharing amount use to determine which tickets to share of this pricing group",
|
95
|
+
},
|
96
|
+
customSharingMethod: {
|
97
|
+
type: "string",
|
98
|
+
description:
|
99
|
+
"( $ or % ) Decides if the custom sharing amount is applied as a percentage or a dollar amount.",
|
100
|
+
},
|
101
|
+
applyCeilingOnlyToAnchor: {
|
102
|
+
type: "boolean",
|
103
|
+
description:
|
104
|
+
"Decides if the ceiling price will be applied only to the anchor ticket of the pricing group",
|
105
|
+
},
|
106
|
+
applyFloorOnlyToAnchor: {
|
107
|
+
type: "boolean",
|
108
|
+
description:
|
109
|
+
"Decides if the floor price will be applied only to the anchor ticket of the pricing group",
|
110
|
+
},
|
111
|
+
floorPricingMethod: {
|
112
|
+
type: "string",
|
113
|
+
description:
|
114
|
+
"(standard, variable, useFloor or floorRandomize) Decides what method to apply for pricing when the market comparable for the pricing group hits the floor price",
|
115
|
+
},
|
116
|
+
ceilingPricingMethod: {
|
117
|
+
type: "string",
|
118
|
+
description:
|
119
|
+
"(standard, variable, useCeiling or ceilingRandomize) Decides what method to apply for pricing when the market comparable for the pricing group hits the ceiling price",
|
120
|
+
},
|
121
|
+
noCompPricingMethod: {
|
122
|
+
type: "string",
|
123
|
+
description:
|
124
|
+
"(standard, variable, ceiling, freezePricing, useFloorForAnchor, useCeilingForAnchor, useCeiling, ceilingRandomize) Decides what method to apply for pricing when there is no market comparables for the pricing group",
|
125
|
+
},
|
126
|
+
pricingGroupRequestRanks: {
|
127
|
+
type: "array",
|
128
|
+
description:
|
129
|
+
'Array of objects containing pricing group request ranks starting at 0 (anchor ticket). i.e [{"ticketGroupId": 1, "rank": 0},...]',
|
130
|
+
},
|
131
|
+
},
|
132
|
+
mandatory: ["pricingGroupId"],
|
133
|
+
};
|
134
|
+
|
135
|
+
toolHandler = async (request: CallToolRequest, httpClient: AxiosInstance) => {
|
136
|
+
try {
|
137
|
+
const pricingGroupId = request?.params?.arguments
|
138
|
+
?.pricingGroupId as number;
|
139
|
+
if (!pricingGroupId) {
|
140
|
+
throw new Error("Missing argument pricingGroupId");
|
141
|
+
}
|
142
|
+
const originalResponse = await httpClient.get<PricingGroupResponse>(
|
143
|
+
`/v2/client/pricing-group/${pricingGroupId}`
|
144
|
+
);
|
145
|
+
if (originalResponse.status !== 200) {
|
146
|
+
throw new Error(`API error: ${originalResponse.statusText}`);
|
147
|
+
}
|
148
|
+
if (!originalResponse.data) {
|
149
|
+
throw new Error(`Pricing group ${pricingGroupId} not found`);
|
150
|
+
}
|
151
|
+
const originalData = originalResponse.data;
|
152
|
+
|
153
|
+
const modifyArgs: PricingGroupUpdateRequest = {
|
154
|
+
productionId: originalData.productionId,
|
155
|
+
name: (request?.params?.arguments?.name as string) ?? originalData.name,
|
156
|
+
ceilingPrice:
|
157
|
+
(request?.params?.arguments?.ceilingPrice as number) ??
|
158
|
+
originalData.ceilingPrice,
|
159
|
+
floorPrice:
|
160
|
+
(request?.params?.arguments?.floorPrice as number) ??
|
161
|
+
originalData.floorPrice,
|
162
|
+
pricingGroupRequestType:
|
163
|
+
(request?.params?.arguments
|
164
|
+
?.pricingGroupRequestType as PricingGroupRequestType) ??
|
165
|
+
originalData.isAutoPricingEnabled
|
166
|
+
? PricingGroupRequestType.AutoPrice
|
167
|
+
: PricingGroupRequestType.SimulationOnly,
|
168
|
+
ruleSet: {
|
169
|
+
amount:
|
170
|
+
(request?.params?.arguments?.amount as number) ??
|
171
|
+
originalData.ruleSet.amount,
|
172
|
+
increment:
|
173
|
+
(request?.params?.arguments?.increment as string) ??
|
174
|
+
originalData.ruleSet.increment,
|
175
|
+
incrementMethod:
|
176
|
+
(request?.params?.arguments?.incrementMethod as string) ??
|
177
|
+
originalData.ruleSet.incrementMethod,
|
178
|
+
offsetAmount:
|
179
|
+
(request?.params?.arguments?.offsetAmount as number) ??
|
180
|
+
originalData.ruleSet.offsetAmount,
|
181
|
+
offsetIncrement:
|
182
|
+
(request?.params?.arguments?.offsetIncrement as string) ??
|
183
|
+
originalData.ruleSet.offsetIncrement,
|
184
|
+
offsetIncrementMethod:
|
185
|
+
(request?.params?.arguments?.offsetIncrementMethod as string) ??
|
186
|
+
originalData.ruleSet.offsetIncrementMethod,
|
187
|
+
enableShareOptions:
|
188
|
+
(request?.params?.arguments?.enableShareOptions as boolean) ??
|
189
|
+
originalData.ruleSet.enableShareOptions,
|
190
|
+
shareOptionsType:
|
191
|
+
(request?.params?.arguments
|
192
|
+
?.shareOptionsType as ShareOptionsType) ??
|
193
|
+
originalData.ruleSet.shareOptionsType,
|
194
|
+
shareAnchor:
|
195
|
+
(request?.params?.arguments?.shareAnchor as boolean) ??
|
196
|
+
originalData.ruleSet.shareAnchor,
|
197
|
+
customSharingAmount:
|
198
|
+
(request?.params?.arguments?.customSharingAmount as number) ??
|
199
|
+
originalData.ruleSet.customSharingAmount,
|
200
|
+
customSharingMethod:
|
201
|
+
(request?.params?.arguments
|
202
|
+
?.customSharingMethod as CustomSharingMethod) ??
|
203
|
+
originalData.ruleSet.customSharingMethod,
|
204
|
+
applyCeilingOnlyToAnchor:
|
205
|
+
(request?.params?.arguments?.applyCeilingOnlyToAnchor as boolean) ??
|
206
|
+
originalData.ruleSet.applyCeilingOnlyToAnchor,
|
207
|
+
applyFloorOnlyToAnchor:
|
208
|
+
(request?.params?.arguments?.applyFloorOnlyToAnchor as boolean) ??
|
209
|
+
originalData.ruleSet.applyFloorOnlyToAnchor,
|
210
|
+
floorPricingMethod:
|
211
|
+
(request?.params?.arguments
|
212
|
+
?.floorPricingMethod as FloorPricingMethod) ??
|
213
|
+
originalData.ruleSet.floorPricingMethod,
|
214
|
+
ceilingPricingMethod:
|
215
|
+
(request?.params?.arguments
|
216
|
+
?.ceilingPricingMethod as CeilingPricingMethod) ??
|
217
|
+
originalData.ruleSet.ceilingPricingMethod,
|
218
|
+
noCompPricingMethod:
|
219
|
+
(request?.params?.arguments
|
220
|
+
?.noCompPricingMethod as NoCompPricingMethod) ??
|
221
|
+
originalData.ruleSet.noCompPricingMethod,
|
222
|
+
},
|
223
|
+
pricingGroupRequestRanks: request?.params?.arguments
|
224
|
+
?.pricingGroupRequestRanks as {
|
225
|
+
ticketGroupId: number;
|
226
|
+
rank: number;
|
227
|
+
}[] ?? originalData.pricingGroupTickets?.map((ticket) => ({
|
228
|
+
ticketGroupId: ticket.ticketGroupId,
|
229
|
+
rank: ticket.rank
|
230
|
+
})),
|
231
|
+
marketGroupCriteria: originalData.marketGroupCriteria,
|
232
|
+
};
|
233
|
+
console.error("[API] Update Pricing Group:", modifyArgs);
|
234
|
+
const response = await httpClient.put<PricingGroupResponse>(
|
235
|
+
`/v2/client/pricing-group/${pricingGroupId}`,
|
236
|
+
modifyArgs
|
237
|
+
);
|
238
|
+
if (response.status !== 200) {
|
239
|
+
throw new Error(`API error: ${response.statusText}`);
|
240
|
+
}
|
241
|
+
return {
|
242
|
+
content: [{ type: "text", text: JSON.stringify([response.data]) }],
|
243
|
+
};
|
244
|
+
} catch (error) {
|
245
|
+
if (error instanceof Error) {
|
246
|
+
console.error("Error in Update Pricing Group:", error);
|
247
|
+
throw new McpError(
|
248
|
+
ErrorCode.InternalError,
|
249
|
+
`Failed to update pricing group: ${error.message}`
|
250
|
+
);
|
251
|
+
}
|
252
|
+
throw error;
|
253
|
+
}
|
254
|
+
};
|
255
|
+
}
|
@@ -13,6 +13,7 @@ export interface PricingGroupResponse {
|
|
13
13
|
dynamicMarketGroupCriteria: DynamicMarketGroupCriteriaDto;
|
14
14
|
pricingGroupTickets?: PricingGroupTicketsResult[] | null;
|
15
15
|
isAutoPricingEnabled: boolean;
|
16
|
+
productionId: number;
|
16
17
|
}
|
17
18
|
|
18
19
|
export enum LowerOutlierMethod{
|
@@ -127,7 +128,8 @@ export enum NoCompPricingMethod{
|
|
127
128
|
CeilingRandomize
|
128
129
|
}
|
129
130
|
|
130
|
-
export interface
|
131
|
+
export interface PricingGroupUpdateRequest{
|
132
|
+
productionId: number;
|
131
133
|
name?: string;
|
132
134
|
ceilingPrice?: number;
|
133
135
|
floorPrice?: number;
|
@@ -135,6 +137,17 @@ export interface PricingGroupRequest{
|
|
135
137
|
pricingGroupRequestRanks: TicketGroupRequestRank[];
|
136
138
|
ruleSet: RuleDto;
|
137
139
|
marketGroupCriteria: MarketCriteriaDto;
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
export interface PricingGroupRequest{
|
144
|
+
name?: string;
|
145
|
+
ceilingPrice?: number;
|
146
|
+
floorPrice?: number;
|
147
|
+
pricingGroupRequestType: PricingGroupRequestType;
|
148
|
+
pricingGroupRequestRanks: TicketGroupRequestRank[];
|
149
|
+
ruleSet: RuleDto;
|
150
|
+
marketGroupCriteria: MarketCriteriaDto;
|
138
151
|
productionId: number;
|
139
152
|
pricingTemplateId?: number;
|
140
153
|
}
|
@@ -144,5 +157,69 @@ export interface TicketGroupRequestRank{
|
|
144
157
|
rank: number;
|
145
158
|
}
|
146
159
|
|
160
|
+
export interface TicketGroupOrgDefaultResponse{
|
161
|
+
ruleSet: {
|
162
|
+
ceiling?: number;
|
163
|
+
isCeilingOrgDefault: boolean;
|
164
|
+
floor?: number;
|
165
|
+
isFloorOrgDefault: boolean;
|
166
|
+
increment?: string;
|
167
|
+
isIncrementOrgDefault: boolean;
|
168
|
+
incrementMethod?: string;
|
169
|
+
isIncrementMethodOrgDefault: boolean;
|
170
|
+
amount?: number;
|
171
|
+
isAmountOrgDefault: boolean;
|
172
|
+
offsetIncrement?: string;
|
173
|
+
isOffsetIncrementOrgDefault: boolean;
|
174
|
+
offsetIncrementMethod?: string;
|
175
|
+
isOffsetIncrementMethodOrgDefault: boolean;
|
176
|
+
offsetAmount?: number;
|
177
|
+
isOffsetAmountOrgDefault: boolean,
|
178
|
+
enableShareOptions?: boolean;
|
179
|
+
isEnableShareOptionsOrgDefault: boolean;
|
180
|
+
shareOptionsType?: ShareOptionsType;
|
181
|
+
isShareOptionsTypeOrgDefault: boolean;
|
182
|
+
shareAnchor?: boolean;
|
183
|
+
isShareAnchorOrgDefault: boolean;
|
184
|
+
pricingGroupRequestType?: PricingGroupRequestType;
|
185
|
+
isPricingGroupRequestTypeOrgDefault: boolean;
|
186
|
+
floorPricingMethod?: FloorPricingMethod;
|
187
|
+
isFloorPricingMethodOrgDefault: boolean;
|
188
|
+
ceilingPricingMethod?: CeilingPricingMethod;
|
189
|
+
isCeilingPricingMethodOrgDefault: boolean;
|
190
|
+
noCompPricingMethod?: NoCompPricingMethod;
|
191
|
+
isNoCompPricingMethodOrgDefault: boolean;
|
192
|
+
customSharingAmount?: number;
|
193
|
+
isCustomSharingAmountOrgDefault: boolean;
|
194
|
+
customSharingMethod?: CustomSharingMethod;
|
195
|
+
isCustomSharingMethodOrgDefault: boolean;
|
196
|
+
applyCeilingOnlyToAnchor?: boolean;
|
197
|
+
isApplyCeilingOnlyToAnchorOrgDefault: boolean;
|
198
|
+
applyFloorOnlyToAnchor?: boolean;
|
199
|
+
isApplyFloorOnlyToAnchorOrgDefault: boolean
|
200
|
+
},
|
201
|
+
marketGroupCriteria?: {
|
202
|
+
sections?: SectionDto[],
|
203
|
+
validSplitsIncludeV2?: number[],
|
204
|
+
validSplitsIncludeMax?: boolean,
|
205
|
+
deliveryMethodInclude?: string[],
|
206
|
+
attributesExclude?: string[],
|
207
|
+
lowerOutlierMethod?: LowerOutlierMethod,
|
208
|
+
lowerOutlierAmount?: number,
|
209
|
+
lowerOutlierThreshold?: number,
|
210
|
+
includeSpeculativeTickets?: boolean,
|
211
|
+
isSplitsDynamic?: boolean,
|
212
|
+
isSectionEnabled?: boolean,
|
213
|
+
rowRanges?: RowRange[]
|
214
|
+
},
|
215
|
+
dynamicMarketGroupCriteria?: {
|
216
|
+
validSplitsV2?: {
|
217
|
+
splits?: number[] | null;
|
218
|
+
includeMax?: boolean;
|
219
|
+
}
|
220
|
+
},
|
221
|
+
isCeilingRequired: boolean
|
222
|
+
}
|
223
|
+
|
147
224
|
// The response for the endpoint is an array of PricingGroupResponse
|
148
225
|
export type GetPricingGroupByProductionIdResponse = PricingGroupResponse[];
|