Skip to content

Commit f0d0e25

Browse files
jleclancheclaude
andcommitted
docs: genericize site-specific examples in nk-billing and nk-marketing
Replace product-specific names in code comments, type docs, the README, and a test fixture with generic placeholders, so the public packages carry no references to private downstream sites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3de0862 commit f0d0e25

10 files changed

Lines changed: 36 additions & 23 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ingram-tech/nk-billing": patch
3+
---
4+
5+
Docs only: replace site-specific examples in code comments with generic
6+
placeholders. No runtime or API change.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@ingram-tech/nk-marketing": patch
3+
---
4+
5+
Docs only: replace site-specific examples in the README and type comments with
6+
generic placeholders. No runtime or API change.

packages/nk-billing/src/balance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Customer-balance wallet — Stripe's own credit ledger, for pay-as-you-go sites
3-
* (domains.ingram.tech). Distinct from the in-app credit ledger in
2+
* Customer-balance wallet — Stripe's own credit ledger, for pay-as-you-go
3+
* sites. Distinct from the in-app credit ledger in
44
* `@ingram-tech/nk-billing/credits`: this stores the balance *in Stripe* as a
55
* signed integer (negative = credit available to the customer), so there is no
66
* local table to keep in sync. Pick this when the unit you sell is money;

packages/nk-billing/src/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
*
55
* This is the one pattern every Ingram site had hand-rolled identically (the
66
* `getStripe()` singleton); it lives here once now. Single-mode sites call
7-
* {@link getStripe}; the dual-mode site (cloud.ingram.tech) calls
8-
* {@link stripeFor} with a mode and gets one memoised client per mode.
7+
* {@link getStripe}; a dual-mode site (its own merchant of record, running the
8+
* Stripe sandbox beside live) calls {@link stripeFor} with a mode and gets one
9+
* memoised client per mode.
910
*/
1011

1112
import Stripe from "stripe";

packages/nk-billing/src/credits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* The in-app credit ledger — the stateful half of nk-billing, for sites that
3-
* meter usage in abstract "credits" rather than money (integrain). It follows
3+
* meter usage in abstract "credits" rather than money. It follows
44
* nextkit's Django-app model: this package owns its tables and ships their
55
* migration (`migrations/0001_billing.sql`), and takes the database connection by
66
* **injection** so it never reaches into the consuming site's schema.

packages/nk-billing/src/customers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* then finds it back by metadata search — no local `stripe_customer_id` column is
55
* required just to locate the customer (though sites cache it for speed).
66
*
7-
* The metadata key differs per site (`financica_organization_id`,
8-
* `integrain_org_id`, …), so it is always passed in explicitly via
9-
* {@link CustomerRef} rather than baked in here — that is the framework seam.
7+
* The metadata key differs per site (`acme_organization_id`, `acme_user_id`,
8+
* …), so it is always passed in explicitly via {@link CustomerRef} rather than
9+
* baked in here — that is the framework seam.
1010
*/
1111

1212
import type Stripe from "stripe";
@@ -15,7 +15,7 @@ import { getStripe } from "./client.js";
1515
/** Identifies a Stripe customer by a metadata tag → local entity id. */
1616
export interface CustomerRef {
1717
/** The Stripe `metadata` key the local id is stored under, e.g.
18-
* "integrain_org_id". Choose one per site and use it everywhere. */
18+
* "acme_org_id". Choose one per site and use it everywhere. */
1919
metadataKey: string;
2020
/** The local entity id (org id, user id, …). */
2121
id: string;

packages/nk-billing/src/keys.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
*
99
* Two deployment shapes are supported, picked per call site, never both at once:
1010
*
11-
* 1. Single-mode (the default — financica / integrain / thornhill): one
12-
* account, one key. `getStripe()` reads STRIPE_SECRET_KEY and
13-
* `webhookSecret()` reads STRIPE_WEBHOOK_SECRET.
11+
* 1. Single-mode (the default for most sites): one account, one key.
12+
* `getStripe()` reads STRIPE_SECRET_KEY and `webhookSecret()` reads
13+
* STRIPE_WEBHOOK_SECRET.
1414
*
15-
* 2. Dual-mode (cloud.ingram.tech, which is its own merchant of record and
16-
* runs the Stripe sandbox beside live): `stripeFor("test"|"live")` reads
15+
* 2. Dual-mode (a site that is its own merchant of record and runs the Stripe
16+
* sandbox beside live): `stripeFor("test"|"live")` reads
1717
* STRIPE_SECRET_KEY_{TEST,LIVE} and `webhookSecret(mode)` reads
1818
* STRIPE_WEBHOOK_SECRET_{TEST,LIVE}.
1919
*
2020
* Nothing here hardcodes a price ID. Prices are resolved at runtime by their
21-
* stable Stripe `lookup_key` (set on the Price in the infra Pulumi program), so
21+
* stable Stripe `lookup_key` (set on the Price out of band, e.g. in your IaC), so
2222
* the same key resolves in test and live even though their price IDs differ.
2323
*/
2424

packages/nk-marketing/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ const result = await marketing.sendLifecycle({
7676
campaignKey: "first-invoice-nudge",
7777
email: contact.email,
7878
userId: contact.userId,
79-
from: { name: "Peppost" },
80-
subject: "Send your first Stripe e-invoice with Peppost",
79+
from: { name: "Acme" },
80+
subject: "Send your first invoice with Acme",
8181
content: "You're all set up — here's how to send your first invoice…",
8282
cta: { label: "Open dashboard", href: "https://example.com/dashboard" },
83-
footerReason: "you have a Peppost account",
83+
footerReason: "you have an Acme account",
8484
});
8585
// result.status: "sent" | "duplicate" | "suppressed"
8686
```

packages/nk-marketing/src/client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ describe("sendLifecycle", () => {
310310
email: "a@acme.test",
311311
subject: "Send your first invoice",
312312
content: "Get started.",
313-
from: { name: "Peppost" },
313+
from: { name: "Acme" },
314314
};
315315

316316
it("sends once, then reports duplicate", async () => {
317317
expect(await marketing.sendLifecycle(opts)).toEqual({ status: "sent" });
318318
expect(await marketing.sendLifecycle(opts)).toEqual({ status: "duplicate" });
319319
expect(sendMock).toHaveBeenCalledOnce();
320320
const arg = sendMock.mock.calls[0]?.[0];
321-
expect(arg?.from).toBe("Peppost <notifications@mail.test>");
321+
expect(arg?.from).toBe("Acme <notifications@mail.test>");
322322
expect(arg?.listUnsubscribe?.url).toContain("token=");
323323
});
324324

packages/nk-marketing/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface Cta {
5050

5151
/** Sender identity for a lifecycle send (broadcasts take it from the audience). */
5252
export interface Sender {
53-
/** Display name, e.g. "Peppost". */
53+
/** Display name, e.g. "Acme". */
5454
name: string;
5555
/** Local part of the from address; defaults to "notifications". */
5656
localPart?: string;
@@ -99,8 +99,8 @@ export interface LifecycleOptions {
9999
cta?: Cta;
100100
from: Sender;
101101
/**
102-
* Footer line explaining why the contact received this, e.g. "you have a
103-
* Peppost account". Defaults to a generic account-based reason.
102+
* Footer line explaining why the contact received this, e.g. "you have an
103+
* Acme account". Defaults to a generic account-based reason.
104104
*/
105105
footerReason?: string;
106106
}

0 commit comments

Comments
 (0)