@pvh-afl/core 1.1.6 → 1.1.7

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.
@@ -4,54 +4,94 @@ import { CouponValidationResult } from '../loyalty/capillary.types';
4
4
  * Shopify Admin API Service
5
5
  *
6
6
  * Handles Shopify Admin API operations for discount code management.
7
- * Uses REST Admin API for price rules and discount codes.
7
+ * Uses GraphQL Admin API for discount operations with tags support.
8
+ *
9
+ * Migration from REST to GraphQL (2024):
10
+ * - REST: price_rules + discount_codes endpoints
11
+ * - GraphQL: discountCodeBasic mutations with tags support
12
+ *
13
+ * All Capillary-synced discounts are tagged with "CAPILLARY" for easy identification.
8
14
  */
9
15
  export declare class ShopifyAdminService {
10
16
  private readonly configService;
11
- private readonly API_VERSION;
17
+ private readonly GRAPHQL_API_VERSION;
18
+ private readonly CAPILLARY_TAG;
12
19
  constructor(configService: ConfigService);
13
20
  /**
14
21
  * Create a Shopify discount code from a validated Capillary coupon.
15
22
  *
16
- * New behavior (no CAP_ prefix):
23
+ * Behavior:
17
24
  * - Uses original Capillary code directly (e.g., "SUMMER20")
18
- * - If code exists: adds customer to prerequisite_customer_ids array
19
- * - If code doesn't exist: creates with customer in prerequisite_customer_ids
20
- * - Uses once_per_customer: true for per-customer usage limit
25
+ * - If code exists: updates properties from Capillary and adds customer to eligibility
26
+ * - If code doesn't exist: creates with customer-specific eligibility
27
+ * - Tags discount with "CAPILLARY" for identification
28
+ * - Uses appliesOncePerCustomer: true for per-customer usage limit
21
29
  */
22
30
  createDiscountFromCapillaryCoupon(brand: string, capillaryValidation: CouponValidationResult, shopifyCustomerId: string): Promise<ShopifyDiscountResult>;
23
31
  /**
24
- * Add a customer to an existing price rule's prerequisite_customer_ids.
32
+ * Create a new discount via GraphQL Admin API.
33
+ */
34
+ private createDiscountViaGraphQL;
35
+ /**
36
+ * Update an existing discount with fresh Capillary data and add customer.
37
+ * This resolves the stale data issue by always syncing latest properties.
38
+ */
39
+ private updateDiscountWithCapillaryData;
40
+ /**
41
+ * Build discount value object based on Capillary discount type.
42
+ */
43
+ private buildDiscountValue;
44
+ /**
45
+ * Add a customer to an existing discount's eligibility.
25
46
  * Used when multiple customers share the same Capillary coupon code.
47
+ *
48
+ * @deprecated Use updateDiscountWithCapillaryData instead which also updates properties
26
49
  */
27
50
  addCustomerToPriceRule(brand: string, priceRuleId: string, shopifyCustomerId: string): Promise<{
28
51
  success: boolean;
29
52
  error?: string;
30
53
  }>;
31
54
  /**
32
- * Extract numeric customer ID from Shopify GID or return as-is if already numeric.
55
+ * Add a customer to an existing discount's eligibility.
56
+ */
57
+ addCustomerToDiscount(brand: string, discountId: string, shopifyCustomerId: string): Promise<{
58
+ success: boolean;
59
+ error?: string;
60
+ }>;
61
+ /**
62
+ * Format customer ID as Shopify GID.
63
+ */
64
+ private formatCustomerGid;
65
+ /**
66
+ * Extract numeric ID from Shopify GID or return as-is if already numeric.
67
+ *
68
+ * @deprecated Use formatCustomerGid instead for GID format
33
69
  */
34
70
  private extractNumericCustomerId;
35
- private createPriceRule;
36
- private createDiscountCode;
71
+ /**
72
+ * Lookup discount code by code string.
73
+ * Returns discount ID if found, null otherwise.
74
+ */
37
75
  private getDiscountCodeByCode;
38
- private findPriceRuleByTitle;
39
- private findDiscountCodeByCode;
40
76
  private getAdminConfig;
77
+ /**
78
+ * Execute a GraphQL query/mutation against Shopify Admin API.
79
+ */
80
+ private executeGraphQL;
41
81
  getWebhookSecret(brand: string): string;
42
82
  /**
43
- * Reactivate a Shopify discount code by resetting its usage count.
83
+ * Reactivate a Shopify discount code by extending its end date and usage limit.
44
84
  * Used when a redeemed coupon needs to be returned to the user (refund/cancellation).
45
85
  */
46
86
  reactivateDiscountCode(brand: string, discountCode: string): Promise<DiscountCodeReactivateResult>;
47
87
  /**
48
- * Disable or delete a Shopify discount code.
88
+ * Disable/delete a Shopify discount code.
49
89
  * Used when an earned coupon needs to be revoked (refund/cancellation).
50
90
  */
51
91
  disableDiscountCode(brand: string, discountCode: string): Promise<DiscountCodeDisableResult>;
52
92
  /**
53
93
  * Sync a used Capillary coupon to Shopify for refund tracking.
54
- * Creates a price rule and discount code marked as already used.
94
+ * Creates a discount code marked as already used (ended).
55
95
  * This is needed when GoKwik applies a coupon that doesn't exist in Shopify.
56
96
  *
57
97
  * Uses original code directly (no prefix).
@@ -62,12 +102,14 @@ export declare class ShopifyAdminService {
62
102
  * Returns a date 30 days from now if the current end date has passed.
63
103
  */
64
104
  private getExtendedEndDate;
65
- private getHeaders;
66
105
  }
67
106
  export interface ShopifyDiscountResult {
68
107
  success: boolean;
69
108
  discountCode: string;
109
+ discountId?: string;
110
+ /** @deprecated Use discountId instead */
70
111
  priceRuleId?: string;
112
+ /** @deprecated Use discountId instead */
71
113
  discountCodeId?: string;
72
114
  alreadyExists?: boolean;
73
115
  error?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"shopify-admin.service.d.ts","sourceRoot":"","sources":["../../../src/integrations/commerce/shopify-admin.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;GAKG;AACH,qBACa,mBAAmB;IAGlB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;gBAEZ,aAAa,EAAE,aAAa;IAEzD;;;;;;;;OAQG;IACG,iCAAiC,CACrC,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,sBAAsB,EAC3C,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,qBAAqB,CAAC;IAkGjC;;;OAGG;IACG,sBAAsB,CAC1B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;I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M,CAAC;CAChB"}
1
+ {"version":3,"file":"shopify-admin.service.d.ts","sourceRoot":"","sources":["../../../src/integrations/commerce/shopify-admin.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,qBACa,mBAAmB;IAIlB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAH1C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAa;IACjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;gBAEhB,aAAa,EAAE,aAAa;IAEzD;;;;;;;;;OASG;IACG,iCAAiC,CACrC,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,sBAAsB,EAC3C,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,qBAAqB,CAAC;IA6EjC;;OAEG;YACW,wBAAwB;IA6EtC;;;OAGG;YACW,+BAA+B;IA+E7C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAiB1B;;;;;OAKG;IACG,sBAAsB,CAC1B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAUhD;;OAEG;IACG,qBAAqB,CACzB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA2DhD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAQhC;;;OAGG;YACW,qBAAqB;IA8CnC,OAAO,CAAC,cAAc;IA6BtB;;OAEG;YACW,cAAc;IAsB5B,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAKvC;;;OAGG;IACG,sBAAsB,CAC1B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,4BAA4B,CAAC;IAsGxC;;;OAGG;IACG,mBAAmB,CACvB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IA8DrC;;;;;;OAMG;IACG,uBAAuB,CAC3B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,KAAK,GAAG,MAAM,EAC5B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC;IA+FjC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CAe3B;AAsED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -9,359 +9,373 @@ const logger_1 = require("../../common/logger");
9
9
  * Shopify Admin API Service
10
10
  *
11
11
  * Handles Shopify Admin API operations for discount code management.
12
- * Uses REST Admin API for price rules and discount codes.
12
+ * Uses GraphQL Admin API for discount operations with tags support.
13
+ *
14
+ * Migration from REST to GraphQL (2024):
15
+ * - REST: price_rules + discount_codes endpoints
16
+ * - GraphQL: discountCodeBasic mutations with tags support
17
+ *
18
+ * All Capillary-synced discounts are tagged with "CAPILLARY" for easy identification.
13
19
  */
14
20
  let ShopifyAdminService = class ShopifyAdminService {
15
21
  configService;
16
- API_VERSION = '2024-01';
22
+ GRAPHQL_API_VERSION = '2026-04';
23
+ CAPILLARY_TAG = 'CAPILLARY';
17
24
  constructor(configService) {
18
25
  this.configService = configService;
19
26
  }
20
27
  /**
21
28
  * Create a Shopify discount code from a validated Capillary coupon.
22
29
  *
23
- * New behavior (no CAP_ prefix):
30
+ * Behavior:
24
31
  * - Uses original Capillary code directly (e.g., "SUMMER20")
25
- * - If code exists: adds customer to prerequisite_customer_ids array
26
- * - If code doesn't exist: creates with customer in prerequisite_customer_ids
27
- * - Uses once_per_customer: true for per-customer usage limit
32
+ * - If code exists: updates properties from Capillary and adds customer to eligibility
33
+ * - If code doesn't exist: creates with customer-specific eligibility
34
+ * - Tags discount with "CAPILLARY" for identification
35
+ * - Uses appliesOncePerCustomer: true for per-customer usage limit
28
36
  */
29
37
  async createDiscountFromCapillaryCoupon(brand, capillaryValidation, shopifyCustomerId) {
30
- // Use original code directly - no prefix, no suffix
31
38
  const shopifyCode = capillaryValidation.couponCode;
32
39
  // Check if discount code already exists
33
40
  const existing = await this.getDiscountCodeByCode(brand, shopifyCode);
34
41
  if (existing) {
35
- // Discount code exists - add customer to the price rule's prerequisite_customer_ids
36
- logger_1.logger.info('Shopify discount code exists, adding customer to eligibility', {
42
+ // Discount code exists - update properties and add customer to eligibility
43
+ logger_1.logger.info('Shopify discount code exists, updating properties and adding customer', {
37
44
  brand,
38
45
  shopifyCode,
39
46
  shopifyCustomerId,
47
+ discountId: existing.discountId,
40
48
  });
41
- const addResult = await this.addCustomerToPriceRule(brand, existing.priceRuleId, shopifyCustomerId);
42
- if (!addResult.success) {
49
+ const updateResult = await this.updateDiscountWithCapillaryData(brand, existing.discountId, capillaryValidation, shopifyCustomerId);
50
+ if (!updateResult.success) {
43
51
  return {
44
52
  success: false,
45
53
  discountCode: shopifyCode,
46
- priceRuleId: existing.priceRuleId,
47
- error: addResult.error,
54
+ discountId: existing.discountId,
55
+ error: updateResult.error,
48
56
  };
49
57
  }
50
58
  return {
51
59
  success: true,
52
60
  discountCode: shopifyCode,
53
- priceRuleId: existing.priceRuleId,
54
- discountCodeId: existing.discountCodeId,
61
+ discountId: existing.discountId,
55
62
  alreadyExists: true,
56
63
  };
57
64
  }
58
- // Discount code doesn't exist - create new price rule and discount code
59
- logger_1.logger.info('Creating new Shopify discount code', {
65
+ // Discount code doesn't exist - create new discount
66
+ logger_1.logger.info('Creating new Shopify discount code via GraphQL', {
60
67
  brand,
61
68
  shopifyCode,
62
69
  shopifyCustomerId,
63
70
  });
64
- // Extract numeric customer ID if it's a GID
65
- const numericCustomerId = this.extractNumericCustomerId(shopifyCustomerId);
66
- const priceRuleConfig = {
67
- title: shopifyCode,
68
- valueType: capillaryValidation.discountType === 'PERC' ? 'percentage' : 'fixed_amount',
69
- value: -capillaryValidation.discountValue,
70
- usageLimit: capillaryValidation.redemptionsLeft ?? 1,
71
- oncePerCustomer: true,
72
- startsAt: capillaryValidation.validFrom
73
- ? new Date(capillaryValidation.validFrom).toISOString()
74
- : new Date().toISOString(),
75
- endsAt: capillaryValidation.validTill,
76
- allocationMethod: 'across',
77
- targetType: 'line_item',
78
- targetSelection: 'all',
79
- customerSelection: 'prerequisite',
80
- prerequisiteCustomerIds: [numericCustomerId],
81
- };
82
- const priceRule = await this.createPriceRule(brand, priceRuleConfig);
83
- if (!priceRule.success) {
84
- return {
85
- success: false,
86
- discountCode: shopifyCode,
87
- error: priceRule.error,
88
- };
89
- }
90
- const discountCode = await this.createDiscountCode(brand, priceRule.priceRuleId, shopifyCode);
91
- if (!discountCode.success) {
71
+ // Format customer ID as GID if needed
72
+ const customerGid = this.formatCustomerGid(shopifyCustomerId);
73
+ const createResult = await this.createDiscountViaGraphQL(brand, shopifyCode, capillaryValidation, customerGid);
74
+ if (!createResult.success) {
92
75
  return {
93
76
  success: false,
94
77
  discountCode: shopifyCode,
95
- priceRuleId: priceRule.priceRuleId,
96
- error: discountCode.error,
78
+ error: createResult.error,
97
79
  };
98
80
  }
99
- logger_1.logger.info('Shopify discount code created', {
81
+ logger_1.logger.info('Shopify discount code created via GraphQL', {
100
82
  brand,
101
83
  shopifyCode,
102
- priceRuleId: priceRule.priceRuleId,
103
- discountCodeId: discountCode.discountCodeId,
84
+ discountId: createResult.discountId,
104
85
  });
105
86
  return {
106
87
  success: true,
107
88
  discountCode: shopifyCode,
108
- priceRuleId: priceRule.priceRuleId,
109
- discountCodeId: discountCode.discountCodeId,
89
+ discountId: createResult.discountId,
110
90
  };
111
91
  }
112
92
  /**
113
- * Add a customer to an existing price rule's prerequisite_customer_ids.
114
- * Used when multiple customers share the same Capillary coupon code.
93
+ * Create a new discount via GraphQL Admin API.
115
94
  */
116
- async addCustomerToPriceRule(brand, priceRuleId, shopifyCustomerId) {
95
+ async createDiscountViaGraphQL(brand, code, capillaryValidation, customerGid) {
117
96
  const config = this.getAdminConfig(brand);
118
- const priceRuleUrl = `${config.baseUrl}/price_rules/${priceRuleId}.json`;
97
+ const mutation = `
98
+ mutation discountCodeBasicCreate($basicCodeDiscount: DiscountCodeBasicInput!) {
99
+ discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
100
+ codeDiscountNode {
101
+ id
102
+ }
103
+ userErrors {
104
+ field
105
+ message
106
+ }
107
+ }
108
+ }
109
+ `;
110
+ // Build discount value based on type
111
+ const discountValue = this.buildDiscountValue(capillaryValidation);
112
+ const variables = {
113
+ basicCodeDiscount: {
114
+ title: code,
115
+ code: code,
116
+ startsAt: capillaryValidation.validFrom
117
+ ? new Date(capillaryValidation.validFrom).toISOString()
118
+ : new Date().toISOString(),
119
+ endsAt: capillaryValidation.validTill
120
+ ? new Date(capillaryValidation.validTill).toISOString()
121
+ : null,
122
+ usageLimit: capillaryValidation.redemptionsLeft ?? 1,
123
+ appliesOncePerCustomer: true,
124
+ tags: [this.CAPILLARY_TAG],
125
+ customerGets: {
126
+ value: discountValue,
127
+ items: { all: true },
128
+ },
129
+ context: {
130
+ customers: {
131
+ add: [customerGid],
132
+ },
133
+ },
134
+ },
135
+ };
119
136
  try {
120
- // Get current price rule
121
- const getResponse = await fetch(priceRuleUrl, {
122
- method: 'GET',
123
- headers: this.getHeaders(config),
124
- });
125
- if (!getResponse.ok) {
126
- const errorText = await getResponse.text();
127
- logger_1.logger.error('Failed to get price rule for customer addition', {
128
- brand,
129
- priceRuleId,
130
- error: errorText,
131
- });
132
- return { success: false, error: `Failed to get price rule: ${getResponse.status}` };
133
- }
134
- const priceRuleData = (await getResponse.json());
135
- // Extract numeric customer ID
136
- const numericCustomerId = parseInt(this.extractNumericCustomerId(shopifyCustomerId), 10);
137
- // Get existing customer IDs
138
- const existingCustomerIds = priceRuleData.price_rule.prerequisite_customer_ids ?? [];
139
- // Check if customer already exists
140
- if (existingCustomerIds.includes(numericCustomerId)) {
141
- logger_1.logger.info('Customer already in price rule prerequisite_customer_ids', {
142
- brand,
143
- priceRuleId,
144
- shopifyCustomerId,
145
- });
146
- return { success: true };
137
+ const response = await this.executeGraphQL(config, mutation, variables);
138
+ if (response.errors && response.errors.length > 0) {
139
+ const errorMsg = response.errors.map((e) => e.message).join(', ');
140
+ logger_1.logger.error('GraphQL errors creating discount', { brand, code, errors: response.errors });
141
+ return { success: false, error: errorMsg };
147
142
  }
148
- // Add customer to the array (never remove)
149
- const updatedCustomerIds = [...existingCustomerIds, numericCustomerId];
150
- // Update price rule
151
- const updateResponse = await fetch(priceRuleUrl, {
152
- method: 'PUT',
153
- headers: this.getHeaders(config),
154
- body: JSON.stringify({
155
- price_rule: {
156
- prerequisite_customer_ids: updatedCustomerIds,
157
- customer_selection: 'prerequisite',
158
- },
159
- }),
160
- });
161
- if (!updateResponse.ok) {
162
- const errorText = await updateResponse.text();
163
- logger_1.logger.error('Failed to update price rule with new customer', {
164
- brand,
165
- priceRuleId,
166
- shopifyCustomerId,
167
- numericCustomerId,
168
- status: updateResponse.status,
169
- error: errorText,
170
- });
171
- // Include actual error details in response
172
- let errorDetail = `Failed to update price rule: ${updateResponse.status}`;
173
- try {
174
- const errorJson = JSON.parse(errorText);
175
- if (errorJson.errors) {
176
- errorDetail = `Shopify error: ${JSON.stringify(errorJson.errors)}`;
177
- }
178
- }
179
- catch {
180
- // errorText is not JSON
181
- }
182
- return { success: false, error: errorDetail };
143
+ const result = response.data?.discountCodeBasicCreate;
144
+ if (result?.userErrors && result.userErrors.length > 0) {
145
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
146
+ logger_1.logger.error('User errors creating discount', { brand, code, userErrors: result.userErrors });
147
+ return { success: false, error: errorMsg };
183
148
  }
184
- logger_1.logger.info('Customer added to price rule prerequisite_customer_ids', {
185
- brand,
186
- priceRuleId,
187
- shopifyCustomerId,
188
- totalCustomers: updatedCustomerIds.length,
189
- });
190
- return { success: true };
149
+ return {
150
+ success: true,
151
+ discountId: result?.codeDiscountNode?.id,
152
+ };
191
153
  }
192
154
  catch (error) {
193
155
  const errorMsg = error instanceof Error ? error.message : 'Unknown error';
194
- logger_1.logger.error('Error adding customer to price rule', {
195
- brand,
196
- priceRuleId,
197
- shopifyCustomerId,
198
- error: errorMsg,
199
- });
156
+ logger_1.logger.error('Failed to create discount via GraphQL', { brand, code, error: errorMsg });
200
157
  return { success: false, error: errorMsg };
201
158
  }
202
159
  }
203
160
  /**
204
- * Extract numeric customer ID from Shopify GID or return as-is if already numeric.
161
+ * Update an existing discount with fresh Capillary data and add customer.
162
+ * This resolves the stale data issue by always syncing latest properties.
205
163
  */
206
- extractNumericCustomerId(shopifyCustomerId) {
207
- if (shopifyCustomerId.startsWith('gid://shopify/Customer/')) {
208
- const match = shopifyCustomerId.match(/\/(\d+)$/);
209
- return match ? match[1] : shopifyCustomerId;
210
- }
211
- return shopifyCustomerId;
212
- }
213
- async createPriceRule(brand, params) {
164
+ async updateDiscountWithCapillaryData(brand, discountId, capillaryValidation, shopifyCustomerId) {
214
165
  const config = this.getAdminConfig(brand);
215
- const url = `${config.baseUrl}/price_rules.json`;
216
- const body = {
217
- price_rule: {
218
- title: params.title,
219
- target_type: params.targetType,
220
- target_selection: params.targetSelection,
221
- allocation_method: params.allocationMethod,
222
- value_type: params.valueType,
223
- value: params.value.toString(),
224
- customer_selection: params.customerSelection,
225
- prerequisite_customer_ids: params.prerequisiteCustomerIds,
226
- usage_limit: params.usageLimit,
227
- once_per_customer: params.oncePerCustomer ?? true,
228
- starts_at: params.startsAt,
229
- ends_at: params.endsAt,
166
+ const customerGid = this.formatCustomerGid(shopifyCustomerId);
167
+ const mutation = `
168
+ mutation discountCodeBasicUpdate($id: ID!, $basicCodeDiscount: DiscountCodeBasicInput!) {
169
+ discountCodeBasicUpdate(id: $id, basicCodeDiscount: $basicCodeDiscount) {
170
+ codeDiscountNode {
171
+ id
172
+ }
173
+ userErrors {
174
+ field
175
+ message
176
+ }
177
+ }
178
+ }
179
+ `;
180
+ // Build discount value based on type
181
+ const discountValue = this.buildDiscountValue(capillaryValidation);
182
+ const variables = {
183
+ id: discountId,
184
+ basicCodeDiscount: {
185
+ // Update properties from fresh Capillary validation
186
+ endsAt: capillaryValidation.validTill
187
+ ? new Date(capillaryValidation.validTill).toISOString()
188
+ : null,
189
+ usageLimit: capillaryValidation.redemptionsLeft ?? 1,
190
+ customerGets: {
191
+ value: discountValue,
192
+ items: { all: true },
193
+ },
194
+ // Add customer to eligibility
195
+ context: {
196
+ customers: {
197
+ add: [customerGid],
198
+ },
199
+ },
230
200
  },
231
201
  };
232
202
  try {
233
- const response = await fetch(url, {
234
- method: 'POST',
235
- headers: this.getHeaders(config),
236
- body: JSON.stringify(body),
237
- });
238
- if (!response.ok) {
239
- const errorData = (await response.json());
240
- const errorMsg = errorData.errors
241
- ? JSON.stringify(errorData.errors)
242
- : `HTTP ${response.status}`;
243
- if (response.status === 422 && errorMsg.includes('title')) {
244
- logger_1.logger.warn('Price rule naming collision, looking up existing', { brand, title: params.title });
245
- const existing = await this.findPriceRuleByTitle(brand, params.title);
246
- if (existing) {
247
- return { success: true, priceRuleId: existing };
248
- }
249
- }
250
- logger_1.logger.error('Failed to create Shopify price rule', { brand, error: errorMsg });
203
+ const response = await this.executeGraphQL(config, mutation, variables);
204
+ if (response.errors && response.errors.length > 0) {
205
+ const errorMsg = response.errors.map((e) => e.message).join(', ');
206
+ logger_1.logger.error('GraphQL errors updating discount', { brand, discountId, errors: response.errors });
251
207
  return { success: false, error: errorMsg };
252
208
  }
253
- const data = (await response.json());
254
- return {
255
- success: true,
256
- priceRuleId: data.price_rule.id.toString(),
257
- };
209
+ const result = response.data?.discountCodeBasicUpdate;
210
+ if (result?.userErrors && result.userErrors.length > 0) {
211
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
212
+ logger_1.logger.error('User errors updating discount', { brand, discountId, userErrors: result.userErrors });
213
+ return { success: false, error: errorMsg };
214
+ }
215
+ logger_1.logger.info('Discount updated with fresh Capillary data', {
216
+ brand,
217
+ discountId,
218
+ shopifyCustomerId,
219
+ endsAt: capillaryValidation.validTill,
220
+ discountValue: capillaryValidation.discountValue,
221
+ });
222
+ return { success: true };
258
223
  }
259
224
  catch (error) {
260
225
  const errorMsg = error instanceof Error ? error.message : 'Unknown error';
261
- logger_1.logger.error('Shopify price rule creation failed', { brand, error: errorMsg });
226
+ logger_1.logger.error('Failed to update discount via GraphQL', { brand, discountId, error: errorMsg });
262
227
  return { success: false, error: errorMsg };
263
228
  }
264
229
  }
265
- async createDiscountCode(brand, priceRuleId, code) {
230
+ /**
231
+ * Build discount value object based on Capillary discount type.
232
+ */
233
+ buildDiscountValue(capillaryValidation) {
234
+ if (capillaryValidation.discountType === 'PERC') {
235
+ // GraphQL expects percentage as decimal (0.10 for 10%)
236
+ return { percentage: (capillaryValidation.discountValue ?? 0) / 100 };
237
+ }
238
+ else {
239
+ // Fixed amount discount
240
+ return {
241
+ discountAmount: {
242
+ amount: capillaryValidation.discountValue ?? 0,
243
+ appliesOnEachItem: false,
244
+ },
245
+ };
246
+ }
247
+ }
248
+ /**
249
+ * Add a customer to an existing discount's eligibility.
250
+ * Used when multiple customers share the same Capillary coupon code.
251
+ *
252
+ * @deprecated Use updateDiscountWithCapillaryData instead which also updates properties
253
+ */
254
+ async addCustomerToPriceRule(brand, priceRuleId, shopifyCustomerId) {
255
+ // For backwards compatibility, map priceRuleId to discountId
256
+ // In the new GraphQL model, we use discount GIDs
257
+ const discountId = priceRuleId.startsWith('gid://')
258
+ ? priceRuleId
259
+ : `gid://shopify/DiscountCodeNode/${priceRuleId}`;
260
+ return this.addCustomerToDiscount(brand, discountId, shopifyCustomerId);
261
+ }
262
+ /**
263
+ * Add a customer to an existing discount's eligibility.
264
+ */
265
+ async addCustomerToDiscount(brand, discountId, shopifyCustomerId) {
266
266
  const config = this.getAdminConfig(brand);
267
- const url = `${config.baseUrl}/price_rules/${priceRuleId}/discount_codes.json`;
268
- const body = {
269
- discount_code: {
270
- code,
267
+ const customerGid = this.formatCustomerGid(shopifyCustomerId);
268
+ const mutation = `
269
+ mutation discountCodeBasicUpdate($id: ID!, $basicCodeDiscount: DiscountCodeBasicInput!) {
270
+ discountCodeBasicUpdate(id: $id, basicCodeDiscount: $basicCodeDiscount) {
271
+ codeDiscountNode {
272
+ id
273
+ }
274
+ userErrors {
275
+ field
276
+ message
277
+ }
278
+ }
279
+ }
280
+ `;
281
+ const variables = {
282
+ id: discountId,
283
+ basicCodeDiscount: {
284
+ context: {
285
+ customers: {
286
+ add: [customerGid],
287
+ },
288
+ },
271
289
  },
272
290
  };
273
291
  try {
274
- const response = await fetch(url, {
275
- method: 'POST',
276
- headers: this.getHeaders(config),
277
- body: JSON.stringify(body),
278
- });
279
- if (!response.ok) {
280
- const errorData = (await response.json());
281
- const errorMsg = errorData.errors
282
- ? JSON.stringify(errorData.errors)
283
- : `HTTP ${response.status}`;
284
- if (response.status === 422 && errorMsg.includes('code')) {
285
- logger_1.logger.warn('Discount code already exists', { brand, code, priceRuleId });
286
- const existing = await this.findDiscountCodeByCode(brand, priceRuleId, code);
287
- if (existing) {
288
- return { success: true, discountCodeId: existing };
289
- }
290
- }
291
- logger_1.logger.error('Failed to create Shopify discount code', { brand, error: errorMsg });
292
+ const response = await this.executeGraphQL(config, mutation, variables);
293
+ if (response.errors && response.errors.length > 0) {
294
+ const errorMsg = response.errors.map((e) => e.message).join(', ');
295
+ logger_1.logger.error('GraphQL errors adding customer to discount', { brand, discountId, errors: response.errors });
292
296
  return { success: false, error: errorMsg };
293
297
  }
294
- const data = (await response.json());
295
- return {
296
- success: true,
297
- discountCodeId: data.discount_code.id.toString(),
298
- };
298
+ const result = response.data?.discountCodeBasicUpdate;
299
+ if (result?.userErrors && result.userErrors.length > 0) {
300
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
301
+ logger_1.logger.error('User errors adding customer to discount', { brand, discountId, userErrors: result.userErrors });
302
+ return { success: false, error: errorMsg };
303
+ }
304
+ logger_1.logger.info('Customer added to discount eligibility', {
305
+ brand,
306
+ discountId,
307
+ shopifyCustomerId,
308
+ });
309
+ return { success: true };
299
310
  }
300
311
  catch (error) {
301
312
  const errorMsg = error instanceof Error ? error.message : 'Unknown error';
302
- logger_1.logger.error('Shopify discount code creation failed', { brand, error: errorMsg });
313
+ logger_1.logger.error('Failed to add customer to discount', { brand, discountId, error: errorMsg });
303
314
  return { success: false, error: errorMsg };
304
315
  }
305
316
  }
306
- async getDiscountCodeByCode(brand, code) {
307
- const config = this.getAdminConfig(brand);
308
- const url = `${config.baseUrl}/discount_codes/lookup.json?code=${encodeURIComponent(code)}`;
309
- try {
310
- const response = await fetch(url, {
311
- method: 'GET',
312
- headers: this.getHeaders(config),
313
- });
314
- if (!response.ok) {
315
- return null;
316
- }
317
- const data = (await response.json());
318
- if (data.discount_code) {
319
- return {
320
- priceRuleId: data.discount_code.price_rule_id.toString(),
321
- discountCodeId: data.discount_code.id.toString(),
322
- };
323
- }
324
- return null;
317
+ /**
318
+ * Format customer ID as Shopify GID.
319
+ */
320
+ formatCustomerGid(shopifyCustomerId) {
321
+ if (shopifyCustomerId.startsWith('gid://shopify/Customer/')) {
322
+ return shopifyCustomerId;
325
323
  }
326
- catch {
327
- return null;
324
+ // Extract numeric ID if needed
325
+ const numericId = shopifyCustomerId.replace(/\D/g, '');
326
+ return `gid://shopify/Customer/${numericId}`;
327
+ }
328
+ /**
329
+ * Extract numeric ID from Shopify GID or return as-is if already numeric.
330
+ *
331
+ * @deprecated Use formatCustomerGid instead for GID format
332
+ */
333
+ extractNumericCustomerId(shopifyCustomerId) {
334
+ if (shopifyCustomerId.startsWith('gid://shopify/Customer/')) {
335
+ const match = shopifyCustomerId.match(/\/(\d+)$/);
336
+ return match ? match[1] : shopifyCustomerId;
328
337
  }
338
+ return shopifyCustomerId;
329
339
  }
330
- async findPriceRuleByTitle(brand, title) {
340
+ /**
341
+ * Lookup discount code by code string.
342
+ * Returns discount ID if found, null otherwise.
343
+ */
344
+ async getDiscountCodeByCode(brand, code) {
331
345
  const config = this.getAdminConfig(brand);
332
- const url = `${config.baseUrl}/price_rules.json?limit=250`;
333
- try {
334
- const response = await fetch(url, {
335
- method: 'GET',
336
- headers: this.getHeaders(config),
337
- });
338
- if (!response.ok) {
339
- return null;
346
+ const query = `
347
+ query codeDiscountNodeByCode($code: String!) {
348
+ codeDiscountNodeByCode(code: $code) {
349
+ id
350
+ codeDiscount {
351
+ ... on DiscountCodeBasic {
352
+ title
353
+ tags
340
354
  }
341
- const data = (await response.json());
342
- const rule = data.price_rules?.find((r) => r.title === title);
343
- return rule ? rule.id.toString() : null;
344
- }
345
- catch {
346
- return null;
355
+ }
347
356
  }
348
- }
349
- async findDiscountCodeByCode(brand, priceRuleId, code) {
350
- const config = this.getAdminConfig(brand);
351
- const url = `${config.baseUrl}/price_rules/${priceRuleId}/discount_codes.json`;
357
+ }
358
+ `;
352
359
  try {
353
- const response = await fetch(url, {
354
- method: 'GET',
355
- headers: this.getHeaders(config),
356
- });
357
- if (!response.ok) {
360
+ const response = await this.executeGraphQL(config, query, { code });
361
+ if (response.errors && response.errors.length > 0) {
362
+ logger_1.logger.warn('GraphQL errors looking up discount', { brand, code, errors: response.errors });
358
363
  return null;
359
364
  }
360
- const data = (await response.json());
361
- const dc = data.discount_codes?.find((d) => d.code === code);
362
- return dc ? dc.id.toString() : null;
365
+ const node = response.data?.codeDiscountNodeByCode;
366
+ if (node?.id) {
367
+ // For backwards compatibility, extract numeric ID for priceRuleId/discountCodeId
368
+ const numericId = node.id.match(/\/(\d+)$/)?.[1] ?? node.id;
369
+ return {
370
+ discountId: node.id,
371
+ priceRuleId: numericId, // Legacy field for backwards compatibility
372
+ discountCodeId: numericId, // Legacy field for backwards compatibility
373
+ };
374
+ }
375
+ return null;
363
376
  }
364
- catch {
377
+ catch (error) {
378
+ logger_1.logger.warn('Failed to lookup discount code', { brand, code, error });
365
379
  return null;
366
380
  }
367
381
  }
@@ -371,18 +385,47 @@ let ShopifyAdminService = class ShopifyAdminService {
371
385
  if (!adminConfig) {
372
386
  throw new Error(`Shopify Admin API not configured for brand: ${brand}`);
373
387
  }
388
+ // Build GraphQL URL from base URL
389
+ // baseUrl format: https://store.myshopify.com/admin/api/VERSION
390
+ // graphqlUrl format: https://store.myshopify.com/admin/api/VERSION/graphql.json
391
+ let graphqlUrl = adminConfig.baseUrl;
392
+ // Replace version in URL with GraphQL version
393
+ graphqlUrl = graphqlUrl.replace(/\/api\/[^/]+/, `/api/${this.GRAPHQL_API_VERSION}`);
394
+ // Ensure it ends with graphql.json
395
+ if (!graphqlUrl.endsWith('/graphql.json')) {
396
+ graphqlUrl = graphqlUrl.replace(/\/?$/, '/graphql.json');
397
+ }
374
398
  return {
375
- baseUrl: `${adminConfig.baseUrl}`,
399
+ baseUrl: adminConfig.baseUrl,
400
+ graphqlUrl,
376
401
  apiKey: adminConfig.apiKey,
377
402
  webhookSecret: adminConfig.options?.webhookSecret,
378
403
  };
379
404
  }
405
+ /**
406
+ * Execute a GraphQL query/mutation against Shopify Admin API.
407
+ */
408
+ async executeGraphQL(config, query, variables) {
409
+ const response = await fetch(config.graphqlUrl, {
410
+ method: 'POST',
411
+ headers: {
412
+ 'Content-Type': 'application/json',
413
+ 'X-Shopify-Access-Token': config.apiKey,
414
+ },
415
+ body: JSON.stringify({ query, variables }),
416
+ });
417
+ if (!response.ok) {
418
+ const errorText = await response.text();
419
+ throw new Error(`GraphQL request failed: ${response.status} - ${errorText}`);
420
+ }
421
+ return response.json();
422
+ }
380
423
  getWebhookSecret(brand) {
381
424
  const config = this.getAdminConfig(brand);
382
425
  return config.webhookSecret;
383
426
  }
384
427
  /**
385
- * Reactivate a Shopify discount code by resetting its usage count.
428
+ * Reactivate a Shopify discount code by extending its end date and usage limit.
386
429
  * Used when a redeemed coupon needs to be returned to the user (refund/cancellation).
387
430
  */
388
431
  async reactivateDiscountCode(brand, discountCode) {
@@ -395,77 +438,86 @@ let ShopifyAdminService = class ShopifyAdminService {
395
438
  };
396
439
  }
397
440
  const config = this.getAdminConfig(brand);
398
- // Update the price rule to reset usage and ensure it's enabled
399
- const priceRuleUrl = `${config.baseUrl}/price_rules/${existing.priceRuleId}.json`;
441
+ // First, get current discount state
442
+ const getQuery = `
443
+ query getDiscount($id: ID!) {
444
+ discountNode(id: $id) {
445
+ ... on DiscountCodeNode {
446
+ codeDiscount {
447
+ ... on DiscountCodeBasic {
448
+ usageLimit
449
+ endsAt
450
+ }
451
+ }
452
+ }
453
+ }
454
+ }
455
+ `;
400
456
  try {
401
- // First, get current price rule to check its state
402
- const getResponse = await fetch(priceRuleUrl, {
403
- method: 'GET',
404
- headers: this.getHeaders(config),
405
- });
406
- if (!getResponse.ok) {
407
- logger_1.logger.error('Failed to get price rule for reactivation', {
408
- brand,
409
- discountCode,
410
- priceRuleId: existing.priceRuleId,
411
- });
457
+ const getResponse = await this.executeGraphQL(config, getQuery, { id: existing.discountId });
458
+ if (getResponse.errors && getResponse.errors.length > 0) {
459
+ logger_1.logger.error('Failed to get discount for reactivation', { brand, discountCode, errors: getResponse.errors });
412
460
  return {
413
461
  success: false,
414
462
  discountCode,
415
- error: `Failed to get price rule: ${getResponse.status}`,
463
+ error: `Failed to get discount: ${getResponse.errors[0].message}`,
416
464
  };
417
465
  }
418
- const priceRuleData = (await getResponse.json());
419
- // Update price rule: increment usage_limit by 1 to allow one more use
420
- // and extend end date if it has passed
421
- const currentUsageLimit = priceRuleData.price_rule.usage_limit || 1;
422
- const newEndDate = this.getExtendedEndDate(priceRuleData.price_rule.ends_at);
423
- const updateResponse = await fetch(priceRuleUrl, {
424
- method: 'PUT',
425
- headers: this.getHeaders(config),
426
- body: JSON.stringify({
427
- price_rule: {
428
- usage_limit: currentUsageLimit + 1,
429
- ...(newEndDate && { ends_at: newEndDate }),
430
- },
431
- }),
432
- });
433
- if (!updateResponse.ok) {
434
- const errorText = await updateResponse.text();
435
- logger_1.logger.error('Failed to update price rule for reactivation', {
436
- brand,
437
- discountCode,
438
- error: errorText,
439
- });
440
- return {
441
- success: false,
442
- discountCode,
443
- error: `Failed to update price rule: ${updateResponse.status}`,
444
- };
466
+ const currentDiscount = getResponse.data?.discountNode?.codeDiscount;
467
+ const currentUsageLimit = currentDiscount?.usageLimit ?? 1;
468
+ const currentEndsAt = currentDiscount?.endsAt;
469
+ // Calculate new values
470
+ const newUsageLimit = currentUsageLimit + 1;
471
+ const newEndsAt = this.getExtendedEndDate(currentEndsAt);
472
+ // Update discount
473
+ const updateMutation = `
474
+ mutation discountCodeBasicUpdate($id: ID!, $basicCodeDiscount: DiscountCodeBasicInput!) {
475
+ discountCodeBasicUpdate(id: $id, basicCodeDiscount: $basicCodeDiscount) {
476
+ codeDiscountNode {
477
+ id
478
+ }
479
+ userErrors {
480
+ field
481
+ message
482
+ }
483
+ }
484
+ }
485
+ `;
486
+ const updateVariables = {
487
+ id: existing.discountId,
488
+ basicCodeDiscount: {
489
+ usageLimit: newUsageLimit,
490
+ ...(newEndsAt && { endsAt: newEndsAt }),
491
+ },
492
+ };
493
+ const updateResponse = await this.executeGraphQL(config, updateMutation, updateVariables);
494
+ if (updateResponse.errors && updateResponse.errors.length > 0) {
495
+ const errorMsg = updateResponse.errors.map((e) => e.message).join(', ');
496
+ logger_1.logger.error('Failed to reactivate discount', { brand, discountCode, errors: updateResponse.errors });
497
+ return { success: false, discountCode, error: errorMsg };
498
+ }
499
+ const result = updateResponse.data?.discountCodeBasicUpdate;
500
+ if (result?.userErrors && result.userErrors.length > 0) {
501
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
502
+ logger_1.logger.error('User errors reactivating discount', { brand, discountCode, userErrors: result.userErrors });
503
+ return { success: false, discountCode, error: errorMsg };
445
504
  }
446
505
  logger_1.logger.info('Shopify discount code reactivated', {
447
506
  brand,
448
507
  discountCode,
449
- priceRuleId: existing.priceRuleId,
450
- newUsageLimit: currentUsageLimit + 1,
508
+ discountId: existing.discountId,
509
+ newUsageLimit,
451
510
  });
452
- return {
453
- success: true,
454
- discountCode,
455
- };
511
+ return { success: true, discountCode };
456
512
  }
457
513
  catch (error) {
458
514
  const errorMsg = error instanceof Error ? error.message : 'Unknown error';
459
515
  logger_1.logger.error('Discount code reactivation failed', { brand, discountCode, error: errorMsg });
460
- return {
461
- success: false,
462
- discountCode,
463
- error: errorMsg,
464
- };
516
+ return { success: false, discountCode, error: errorMsg };
465
517
  }
466
518
  }
467
519
  /**
468
- * Disable or delete a Shopify discount code.
520
+ * Disable/delete a Shopify discount code.
469
521
  * Used when an earned coupon needs to be revoked (refund/cancellation).
470
522
  */
471
523
  async disableDiscountCode(brand, discountCode) {
@@ -481,43 +533,34 @@ let ShopifyAdminService = class ShopifyAdminService {
481
533
  };
482
534
  }
483
535
  const config = this.getAdminConfig(brand);
536
+ const mutation = `
537
+ mutation discountCodeDelete($id: ID!) {
538
+ discountCodeDelete(id: $id) {
539
+ deletedCodeDiscountId
540
+ userErrors {
541
+ field
542
+ message
543
+ }
544
+ }
545
+ }
546
+ `;
484
547
  try {
485
- // Delete the discount code
486
- const deleteCodeUrl = `${config.baseUrl}/price_rules/${existing.priceRuleId}/discount_codes/${existing.discountCodeId}.json`;
487
- const deleteCodeResponse = await fetch(deleteCodeUrl, {
488
- method: 'DELETE',
489
- headers: this.getHeaders(config),
490
- });
491
- if (!deleteCodeResponse.ok && deleteCodeResponse.status !== 404) {
492
- logger_1.logger.error('Failed to delete discount code', {
493
- brand,
494
- discountCode,
495
- status: deleteCodeResponse.status,
496
- });
497
- return {
498
- success: false,
499
- discountCode,
500
- error: `Failed to delete discount code: ${deleteCodeResponse.status}`,
501
- };
548
+ const response = await this.executeGraphQL(config, mutation, { id: existing.discountId });
549
+ if (response.errors && response.errors.length > 0) {
550
+ const errorMsg = response.errors.map((e) => e.message).join(', ');
551
+ logger_1.logger.error('Failed to delete discount', { brand, discountCode, errors: response.errors });
552
+ return { success: false, discountCode, error: errorMsg };
502
553
  }
503
- // Also delete the price rule since it's customer-specific and no longer needed
504
- const deletePriceRuleUrl = `${config.baseUrl}/price_rules/${existing.priceRuleId}.json`;
505
- const deletePriceRuleResponse = await fetch(deletePriceRuleUrl, {
506
- method: 'DELETE',
507
- headers: this.getHeaders(config),
508
- });
509
- if (!deletePriceRuleResponse.ok && deletePriceRuleResponse.status !== 404) {
510
- logger_1.logger.warn('Failed to delete price rule (discount code was deleted)', {
511
- brand,
512
- discountCode,
513
- priceRuleId: existing.priceRuleId,
514
- });
554
+ const result = response.data?.discountCodeDelete;
555
+ if (result?.userErrors && result.userErrors.length > 0) {
556
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
557
+ logger_1.logger.error('User errors deleting discount', { brand, discountCode, userErrors: result.userErrors });
558
+ return { success: false, discountCode, error: errorMsg };
515
559
  }
516
- logger_1.logger.info('Shopify discount code disabled/deleted', {
560
+ logger_1.logger.info('Shopify discount code deleted', {
517
561
  brand,
518
562
  discountCode,
519
- priceRuleId: existing.priceRuleId,
520
- discountCodeId: existing.discountCodeId,
563
+ discountId: existing.discountId,
521
564
  });
522
565
  return {
523
566
  success: true,
@@ -527,23 +570,18 @@ let ShopifyAdminService = class ShopifyAdminService {
527
570
  }
528
571
  catch (error) {
529
572
  const errorMsg = error instanceof Error ? error.message : 'Unknown error';
530
- logger_1.logger.error('Discount code disable failed', { brand, discountCode, error: errorMsg });
531
- return {
532
- success: false,
533
- discountCode,
534
- error: errorMsg,
535
- };
573
+ logger_1.logger.error('Discount code delete failed', { brand, discountCode, error: errorMsg });
574
+ return { success: false, discountCode, error: errorMsg };
536
575
  }
537
576
  }
538
577
  /**
539
578
  * Sync a used Capillary coupon to Shopify for refund tracking.
540
- * Creates a price rule and discount code marked as already used.
579
+ * Creates a discount code marked as already used (ended).
541
580
  * This is needed when GoKwik applies a coupon that doesn't exist in Shopify.
542
581
  *
543
582
  * Uses original code directly (no prefix).
544
583
  */
545
584
  async syncUsedCouponToShopify(brand, couponCode, discountType, discountValue, shopifyCustomerId, orderId) {
546
- // Use original code directly - no prefix
547
585
  const shopifyCode = couponCode;
548
586
  // Check if already exists
549
587
  const existing = await this.getDiscountCodeByCode(brand, shopifyCode);
@@ -552,57 +590,80 @@ let ShopifyAdminService = class ShopifyAdminService {
552
590
  return {
553
591
  success: true,
554
592
  discountCode: shopifyCode,
555
- priceRuleId: existing.priceRuleId,
556
- discountCodeId: existing.discountCodeId,
593
+ discountId: existing.discountId,
557
594
  alreadyExists: true,
558
595
  };
559
596
  }
560
- // Extract numeric customer ID
561
- const numericCustomerId = this.extractNumericCustomerId(shopifyCustomerId);
562
- // Create price rule with usage_limit=1 and mark as already used
563
- const priceRuleConfig = {
564
- title: `${shopifyCode}_USED_${orderId}`,
565
- valueType: discountType === 'PERC' ? 'percentage' : 'fixed_amount',
566
- value: -discountValue,
567
- usageLimit: 1, // Already used once
568
- oncePerCustomer: true,
569
- startsAt: new Date(Date.now() - 86400000).toISOString(), // Started yesterday
570
- endsAt: new Date(Date.now() - 1000).toISOString(), // Already ended (prevents reuse)
571
- allocationMethod: 'across',
572
- targetType: 'line_item',
573
- targetSelection: 'all',
574
- customerSelection: 'prerequisite',
575
- prerequisiteCustomerIds: [numericCustomerId],
597
+ const config = this.getAdminConfig(brand);
598
+ const customerGid = this.formatCustomerGid(shopifyCustomerId);
599
+ const mutation = `
600
+ mutation discountCodeBasicCreate($basicCodeDiscount: DiscountCodeBasicInput!) {
601
+ discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
602
+ codeDiscountNode {
603
+ id
604
+ }
605
+ userErrors {
606
+ field
607
+ message
608
+ }
609
+ }
610
+ }
611
+ `;
612
+ // Build discount value
613
+ const discountValueObj = discountType === 'PERC'
614
+ ? { percentage: discountValue / 100 }
615
+ : { discountAmount: { amount: discountValue, appliesOnEachItem: false } };
616
+ const variables = {
617
+ basicCodeDiscount: {
618
+ title: `${shopifyCode}_USED_${orderId}`,
619
+ code: shopifyCode,
620
+ startsAt: new Date(Date.now() - 86400000).toISOString(), // Started yesterday
621
+ endsAt: new Date(Date.now() - 1000).toISOString(), // Already ended
622
+ usageLimit: 1,
623
+ appliesOncePerCustomer: true,
624
+ tags: [this.CAPILLARY_TAG, 'USED'],
625
+ customerGets: {
626
+ value: discountValueObj,
627
+ items: { all: true },
628
+ },
629
+ context: {
630
+ customers: {
631
+ add: [customerGid],
632
+ },
633
+ },
634
+ },
576
635
  };
577
- const priceRule = await this.createPriceRule(brand, priceRuleConfig);
578
- if (!priceRule.success) {
636
+ try {
637
+ const response = await this.executeGraphQL(config, mutation, variables);
638
+ if (response.errors && response.errors.length > 0) {
639
+ const errorMsg = response.errors.map((e) => e.message).join(', ');
640
+ logger_1.logger.error('Failed to sync used coupon', { brand, shopifyCode, errors: response.errors });
641
+ return { success: false, discountCode: shopifyCode, error: errorMsg };
642
+ }
643
+ const result = response.data?.discountCodeBasicCreate;
644
+ if (result?.userErrors && result.userErrors.length > 0) {
645
+ const errorMsg = result.userErrors.map((e) => e.message).join(', ');
646
+ logger_1.logger.error('User errors syncing used coupon', { brand, shopifyCode, userErrors: result.userErrors });
647
+ return { success: false, discountCode: shopifyCode, error: errorMsg };
648
+ }
649
+ const discountId = result?.codeDiscountNode?.id;
650
+ logger_1.logger.info('Synced used coupon to Shopify for refund tracking', {
651
+ brand,
652
+ shopifyCode,
653
+ orderId,
654
+ discountId,
655
+ });
579
656
  return {
580
- success: false,
657
+ success: true,
581
658
  discountCode: shopifyCode,
582
- error: priceRule.error,
659
+ discountId,
583
660
  };
584
661
  }
585
- const discountCodeResult = await this.createDiscountCode(brand, priceRule.priceRuleId, shopifyCode);
586
- if (!discountCodeResult.success) {
587
- return {
588
- success: false,
589
- discountCode: shopifyCode,
590
- priceRuleId: priceRule.priceRuleId,
591
- error: discountCodeResult.error,
592
- };
662
+ catch (error) {
663
+ const errorMsg = error instanceof Error ? error.message : 'Unknown error';
664
+ logger_1.logger.error('Failed to sync used coupon', { brand, shopifyCode, error: errorMsg });
665
+ return { success: false, discountCode: shopifyCode, error: errorMsg };
593
666
  }
594
- logger_1.logger.info('Synced used coupon to Shopify for refund tracking', {
595
- brand,
596
- shopifyCode,
597
- orderId,
598
- priceRuleId: priceRule.priceRuleId,
599
- });
600
- return {
601
- success: true,
602
- discountCode: shopifyCode,
603
- priceRuleId: priceRule.priceRuleId,
604
- discountCodeId: discountCodeResult.discountCodeId,
605
- };
606
667
  }
607
668
  /**
608
669
  * Get extended end date for reactivating an expired discount.
@@ -621,12 +682,6 @@ let ShopifyAdminService = class ShopifyAdminService {
621
682
  }
622
683
  return null; // No need to extend
623
684
  }
624
- getHeaders(config) {
625
- return {
626
- 'Content-Type': 'application/json',
627
- 'X-Shopify-Access-Token': config.apiKey,
628
- };
629
- }
630
685
  };
631
686
  exports.ShopifyAdminService = ShopifyAdminService;
632
687
  exports.ShopifyAdminService = ShopifyAdminService = tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"shopify-admin.service.js","sourceRoot":"","sources":["../../../src/integrations/commerce/shopify-admin.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,gEAA4D;AAC5D,gDAA6C;AAG7C;;;;;GAKG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGD;IAFZ,WAAW,GAAG,SAAS,CAAC;IAEzC,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D;;;;;;;;OAQG;IACH,KAAK,CAAC,iCAAiC,CACrC,KAAa,EACb,mBAA2C,EAC3C,iBAAyB;QAEzB,oDAAoD;QACpD,MAAM,WAAW,GAAG,mBAAmB,CAAC,UAAU,CAAC;QAEnD,wCAAwC;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAEtE,IAAI,QAAQ,EAAE,CAAC;YACb,oFAAoF;YACpF,eAAM,CAAC,IAAI,CAAC,8DAA8D,EAAE;gBAC1E,KAAK;gBACL,WAAW;gBACX,iBAAiB;aAClB,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;YAEpG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBACvB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,YAAY,EAAE,WAAW;oBACzB,WAAW,EAAE,QAAQ,CAAC,WAAW;oBACjC,KAAK,EAAE,SAAS,CAAC,KAAK;iBACvB,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,WAAW;gBACzB,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,cAAc,EAAE,QAAQ,CAAC,cAAc;gBACvC,aAAa,EAAE,IAAI;aACpB,CAAC;QACJ,CAAC;QAED,wEAAwE;Q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I,OAAO,GAAG,GAAG,EAAE,CAAC;YAClB,6BAA6B;YAC7B,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;YACjC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;YAC9C,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,CAAC,oBAAoB;IACnC,CAAC;IAEO,UAAU,CAAC,MAA0B;QAC3C,OAAO;YACL,cAAc,EAAE,kBAAkB;YAClC,wBAAwB,EAAE,MAAM,CAAC,MAAM;SACxC,CAAC;IACJ,CAAC;CACF,CAAA;AA5uBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;6CAIiC,8BAAa;GAH9C,mBAAmB,CA4uB/B"}
1
+ {"version":3,"file":"shopify-admin.service.js","sourceRoot":"","sources":["../../../src/integrations/commerce/shopify-admin.service.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,gEAA4D;AAC5D,gDAA6C;AAG7C;;;;;;;;;;;GAWG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAID;IAHZ,mBAAmB,GAAG,SAAS,CAAC;IAChC,aAAa,GAAG,WAAW,CAAC;IAE7C,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D;;;;;;;;;OASG;IACH,KAAK,CAAC,iCAAiC,CACrC,KAAa,EACb,mBAA2C,EAC3C,iBAAyB;QAEzB,MAAM,WAAW,GAAG,mBAAmB,CAAC,UAAU,CAAC;QAEnD,wCAAwC;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAEtE,IAAI,QAAQ,EAAE,CAAC;YACb,2EAA2E;YAC3E,eAAM,CAAC,IAAI,CAAC,uEAAuE,EAAE;gBACnF,KAAK;gBACL,WAAW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",
3
+ "version": "1.1.7",
4
4
  "description": "AFL Core - Shared services for multi-brand commerce platform",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",