feat: new attach / update subscription params

This commit is contained in:
John Yeo
2026-02-17 12:48:11 +00:00
parent a668c5d9e9
commit e6077458a2
112 changed files with 2555 additions and 419 deletions

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ExistingRollover } from "@autumn/shared";
import { type ExistingRollover, RolloverExpiryDurationType } from "@autumn/shared";
import { customerEntitlements } from "@tests/utils/fixtures/db/customerEntitlements";
import { customerProducts } from "@tests/utils/fixtures/db/customerProducts";
import chalk from "chalk";
@@ -16,6 +16,7 @@ describe(chalk.yellowBright("applyExistingRollovers"), () => {
featureName: "Words",
allowance: 5000,
balance: 5000,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const newCusProduct = customerProducts.create({

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ExistingRollover } from "@autumn/shared";
import { type ExistingRollover, RolloverExpiryDurationType } from "@autumn/shared";
import { customerEntitlements } from "@tests/utils/fixtures/db/customerEntitlements";
import { customerProducts } from "@tests/utils/fixtures/db/customerProducts";
import chalk from "chalk";
@@ -19,6 +19,7 @@ describe(
featureName: "Words",
allowance: 5000,
balance: 5000,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const newCusProduct = customerProducts.create({

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ExistingRollover } from "@autumn/shared";
import { type ExistingRollover, RolloverExpiryDurationType } from "@autumn/shared";
import { customerEntitlements } from "@tests/utils/fixtures/db/customerEntitlements";
import { customerProducts } from "@tests/utils/fixtures/db/customerProducts";
import chalk from "chalk";
@@ -15,6 +15,7 @@ describe(
featureName: "Feature A",
allowance: 100,
balance: 100,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const cusEntB = customerEntitlements.create({
@@ -23,6 +24,7 @@ describe(
featureName: "Feature B",
allowance: 200,
balance: 200,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const newCusProduct = customerProducts.create({

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ExistingRollover } from "@autumn/shared";
import { type ExistingRollover, RolloverExpiryDurationType } from "@autumn/shared";
import { customerEntitlements } from "@tests/utils/fixtures/db/customerEntitlements";
import { customerProducts } from "@tests/utils/fixtures/db/customerProducts";
import chalk from "chalk";
@@ -18,6 +18,7 @@ describe(
featureName: "Words",
allowance: 100,
balance: 100,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const cusEntSecond = customerEntitlements.create({
@@ -27,6 +28,7 @@ describe(
featureName: "Words",
allowance: 200,
balance: 200,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const newCusProduct = customerProducts.create({

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { ExistingRollover } from "@autumn/shared";
import { type ExistingRollover, RolloverExpiryDurationType } from "@autumn/shared";
import { customerEntitlements } from "@tests/utils/fixtures/db/customerEntitlements";
import { customerProducts } from "@tests/utils/fixtures/db/customerProducts";
import chalk from "chalk";
@@ -19,6 +19,7 @@ describe(
featureName: "Seats",
allowance: 10,
balance: 10,
rollover: { max: null, duration: RolloverExpiryDurationType.Month, length: 1 },
});
const newCusProduct = customerProducts.create({