withBillingPeriod()

in client/fixtures/productBuilder/productBuilder.ts [194:213]


	withBillingPeriod(billingPeriod: BillingPeriod) {
		const { plan, currentPlans, futurePlans } =
			this.productToBuild.subscription;
		if (plan) {
			plan.billingPeriod = billingPeriod;
		}
		for (const currentPlan of currentPlans) {
			if (isPaidSubscriptionPlan(currentPlan)) {
				currentPlan.billingPeriod = billingPeriod;
			}
		}

		for (const futurePlan of futurePlans) {
			if (isPaidSubscriptionPlan(futurePlan)) {
				futurePlan.billingPeriod = billingPeriod;
			}
		}

		return this;
	}