Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/minting-service/scripts/remint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function makeLicense(overrides: Partial<License> = {}): License {
stripeCustomerId: 'cus_1',
stripeSubscriptionId: 'sub_1',
customerEmail: 'a@example.com',
tier: 'developer-seat',
tier: 'developer_seat',
seats: 3,
expiresAt: new Date('2027-01-01T00:00:00Z'),
revokedAt: null,
Expand Down
4 changes: 2 additions & 2 deletions apps/minting-service/scripts/remint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function runRemint(args: RemintArgs, deps: RemintDeps): Promise<Rem
token = await deps.mintToken(
{
stripeCustomerId: license.stripeCustomerId,
tier: license.tier as 'developer-seat' | 'app-deployment',
tier: license.tier as 'indie' | 'developer_seat' | 'app_deployment',
seats: license.seats,
expiresAt: license.expiresAt,
},
Expand All @@ -68,7 +68,7 @@ export async function runRemint(args: RemintArgs, deps: RemintDeps): Promise<Rem

const to = args.to ?? license.customerEmail;
const vars = {
tier: license.tier as 'developer-seat' | 'app-deployment',
tier: license.tier as 'indie' | 'developer_seat' | 'app_deployment',
seats: license.seats,
token,
expiresAt: license.expiresAt,
Expand Down
14 changes: 7 additions & 7 deletions apps/minting-service/src/lib/email.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderLicenseEmail } from './email.js';
describe('renderLicenseEmail', () => {
it('includes the token wrapped in BEGIN/END delimiters in the text body', () => {
const out = renderLicenseEmail({
tier: 'developer-seat',
tier: 'developer_seat',
seats: 3,
token: 'PAYLOAD.SIG',
expiresAt: new Date('2027-04-20T00:00:00Z'),
Expand All @@ -17,27 +17,27 @@ describe('renderLicenseEmail', () => {

it('subject includes tier and seat count with plural s for seats > 1', () => {
const out = renderLicenseEmail({
tier: 'developer-seat',
tier: 'developer_seat',
seats: 3,
token: 't.s',
expiresAt: new Date('2027-04-20T00:00:00Z'),
});
expect(out.subject).toBe('Your ThreadPlane license — developer-seat (3 seats)');
expect(out.subject).toBe('Your ThreadPlane license — developer_seat (3 seats)');
});

it('subject uses singular seat for seats === 1', () => {
const out = renderLicenseEmail({
tier: 'app-deployment',
tier: 'app_deployment',
seats: 1,
token: 't.s',
expiresAt: new Date('2027-04-20T00:00:00Z'),
});
expect(out.subject).toBe('Your ThreadPlane license — app-deployment (1 seat)');
expect(out.subject).toBe('Your ThreadPlane license — app_deployment (1 seat)');
});

it('includes ISO 8601 UTC expiry in text body', () => {
const out = renderLicenseEmail({
tier: 'developer-seat',
tier: 'developer_seat',
seats: 1,
token: 't.s',
expiresAt: new Date('2027-04-20T00:00:00Z'),
Expand All @@ -47,7 +47,7 @@ describe('renderLicenseEmail', () => {

it('html body wraps the token in a monospace pre block', () => {
const out = renderLicenseEmail({
tier: 'developer-seat',
tier: 'developer_seat',
seats: 1,
token: 'PAYLOAD.SIG',
expiresAt: new Date('2027-04-20T00:00:00Z'),
Expand Down
Loading
Loading