1import { GetCoupon } from "@distilled.cloud/stripe/stripe";
2import * as Layer from "effect/Layer";
3import { RetrieveCoupon } from "./RetrieveCoupon.ts";
4import { makeHttpStripeIdBinding } from "./StripeHttp.ts";
5
6/**
7 * HTTP implementation of {@link RetrieveCoupon}. Provide it on the
8 * Function or Worker Effect.
9 *
10 * @layer
11 * @product Product
12 * @provides Stripe.RetrieveCoupon
13 */
14export const RetrieveCouponHttp = Layer.effect(
15 RetrieveCoupon,
16 makeHttpStripeIdBinding({
17 tag: "Stripe.RetrieveCoupon",
18 operation: GetCoupon,
19 idField: "coupon",
20 permissions: ["coupons_read"],
21 }),
22);