@qazuor/qzpay-drizzle 1.7.2 → 1.7.4

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
@@ -5904,13 +5904,14 @@ var QZPayDrizzleStorageAdapter = class {
5904
5904
  const now = /* @__PURE__ */ new Date();
5905
5905
  const hasTrial = input.trialDays !== void 0 && input.trialDays > 0;
5906
5906
  const trialEnd = hasTrial && input.trialDays ? new Date(now.getTime() + input.trialDays * 24 * 60 * 60 * 1e3) : null;
5907
+ const initialStatus = input.mode === "paid" ? "incomplete" : hasTrial ? "trialing" : "active";
5907
5908
  const drizzleInput = mapCoreSubscriptionCreateToDrizzle(input, {
5908
5909
  livemode,
5909
5910
  billingInterval: "month",
5910
5911
  intervalCount: 1,
5911
5912
  currentPeriodStart: now,
5912
5913
  currentPeriodEnd: new Date(now.getTime() + 30 * 24 * 60 * 60 * 1e3),
5913
- status: hasTrial ? "trialing" : "active",
5914
+ status: initialStatus,
5914
5915
  trialStart: hasTrial ? now : null,
5915
5916
  trialEnd
5916
5917
  });