Slug-based scenarios, quests and offers per the environments contract; regenerated models; e2e seed passes environment to admin mirrors
Claude-Session: https://claude.ai/code/session_01SMCvdwDmuxoaqGgvGBLk1V
This commit is contained in:
@@ -14,7 +14,7 @@ import type { PurchaseOfferResponse } from '../generated/stores.js';
|
||||
export class StoresDomain extends SyncedState<ShopHandle[]> {
|
||||
readonly syncKey = 'stores';
|
||||
|
||||
/** Shared purchase executor: `stores.purchase(slug, offerId, opts)`. */
|
||||
/** Shared purchase executor: `stores.purchase(slug, offerSlug, opts)`. */
|
||||
readonly purchase: PurchaseOffer;
|
||||
|
||||
private readonly ctx: RudderContext;
|
||||
@@ -24,15 +24,15 @@ export class StoresDomain extends SyncedState<ShopHandle[]> {
|
||||
// handles created in the loader all delegate to this one executor.
|
||||
const purchase: PurchaseOffer = async (
|
||||
storeSlug: string,
|
||||
offerId: string,
|
||||
offerSlug: string,
|
||||
options: BuyOptions = {},
|
||||
): Promise<PurchaseOfferResponse> => {
|
||||
const response = await api.purchaseOffer(
|
||||
ctx,
|
||||
{ storeSlug, offerId },
|
||||
{ storeSlug, offerSlug },
|
||||
{
|
||||
storeSlug,
|
||||
offerId,
|
||||
offerSlug,
|
||||
idempotencyKey: options.idempotencyKey ?? crypto.randomUUID(),
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user