@qazuor/qzpay-drizzle 1.4.0 → 1.5.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.
package/dist/index.cjs CHANGED
@@ -1078,7 +1078,7 @@ function mapDrizzleSubscriptionToCore(drizzle3) {
1078
1078
  };
1079
1079
  }
1080
1080
  function mapCoreSubscriptionCreateToDrizzle(input, defaults) {
1081
- return {
1081
+ const insert = {
1082
1082
  id: input.id,
1083
1083
  customerId: input.customerId,
1084
1084
  planId: input.planId,
@@ -1093,6 +1093,17 @@ function mapCoreSubscriptionCreateToDrizzle(input, defaults) {
1093
1093
  metadata: input.metadata ?? {},
1094
1094
  livemode: defaults.livemode
1095
1095
  };
1096
+ if (input.providerSubscriptionIds) {
1097
+ const stripeId = input.providerSubscriptionIds["stripe"];
1098
+ const mpId = input.providerSubscriptionIds["mercadopago"];
1099
+ if (stripeId !== void 0) {
1100
+ insert.stripeSubscriptionId = stripeId;
1101
+ }
1102
+ if (mpId !== void 0) {
1103
+ insert.mpSubscriptionId = mpId;
1104
+ }
1105
+ }
1106
+ return insert;
1096
1107
  }
1097
1108
  function mapCoreSubscriptionUpdateToDrizzle(input) {
1098
1109
  const update = {};
@@ -1120,6 +1131,16 @@ function mapCoreSubscriptionUpdateToDrizzle(input) {
1120
1131
  if (input.trialEnd !== void 0) {
1121
1132
  update.trialEnd = input.trialEnd;
1122
1133
  }
1134
+ if (input.providerSubscriptionIds) {
1135
+ const stripeId = input.providerSubscriptionIds["stripe"];
1136
+ const mpId = input.providerSubscriptionIds["mercadopago"];
1137
+ if (stripeId !== void 0) {
1138
+ update.stripeSubscriptionId = stripeId;
1139
+ }
1140
+ if (mpId !== void 0) {
1141
+ update.mpSubscriptionId = mpId;
1142
+ }
1143
+ }
1123
1144
  return update;
1124
1145
  }
1125
1146