sailfork / t3code-github / .repos/ alchemy-effect/ packages/ stripe/ src/ RetrievePlanHttp.ts

import { GetPlan } from "@distilled.cloud/stripe/stripe";
import * as Layer from "effect/Layer";
import { RetrievePlan } from "./RetrievePlan.ts";
import { makeHttpStripeIdBinding } from "./StripeHttp.ts";

/**
 * HTTP implementation of {@link RetrievePlan}. Provide it on the
 * Function or Worker Effect.
 *
 * @layer
 * @product Product
 * @provides Stripe.RetrievePlan
 */
export const RetrievePlanHttp = Layer.effect(
  RetrievePlan,
  makeHttpStripeIdBinding({
    tag: "Stripe.RetrievePlan",
    operation: GetPlan,
    idField: "plan",
    permissions: ["plans_read"],
  }),
);