Repository navigation
feat(mock-server): sales-guaranteed forecast endpoints + hello_seller_adapter_guaranteed example - #1391
Closed
bokelley wants to merge 3 commits into
Closed
feat(mock-server): sales-guaranteed forecast endpoints + hello_seller_adapter_guaranteed example#1391bokelley wants to merge 3 commits into
bokelley wants to merge 3 commits into
Conversation
- Remove invalid ReturnType generic annotation on createMediaBuy - Make generated_at deterministic via seedToTimestamp() in both forecast builders - Fix status: 'active' as const on sync approval path - Fix OpenAPI $ref + sibling description via allOf - FIXME → TODO for adopter comment https://claude.ai/code/session_01Qf2uPL7iSb54kgCRiXUtzP
- Handle total_budget as { amount, currency } object (AdCP 3.x shape)
- Replace "field names match" comment with explicit field-by-field mapping;
note valid_until omission and SWAP hint
- Expand forecast_range_unit cast to all eight ForecastRangeUnit values
- Add /_debug/traffic curl line to demo block
- SWAP → FIXME(adopter) in getMediaBuys and updateMediaBuy stubs
https://claude.ai/code/session_01Qf2uPL7iSb54kgCRiXUtzP
Contributor
Author
|
Superseded by #1414, which has broader scope: covers both #1375 + #1378 (sales-guaranteed AND sales-social planning surface), wires the new endpoints into the existing 788-line hello_seller_adapter_guaranteed.ts from #1373, adds 24 tests + comply_test_controller wiring + cascade-scenario coverage, and files three SDK follow-ups (#1415, #1416, #1417) for the gaps the cascade work uncovered. |
Contributor
Author
|
Acknowledged — noted that this PR is superseded by #1414. No further action needed here. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1375
Summary
The
sales-guaranteedmock server'sProduct.forecastfield was never exercised —MockProduct.availabilitywas a static seed value and no adapter example existed for guaranteed sellers. This PR adds the forecast layer and a worked example.src/lib/mock-server/sales-guaranteed/server.tsPOST /v1/forecast— accepts{ product_id, flight_dates, budget? }. Whenbudgetis absent returns an availability forecast (forecast_range_unit: 'availability'); when present returns a spend curve (forecast_range_unit: 'spend'). All response fields are deterministic given the same inputs viacreateHash+seedToTimestamp.GET /v1/productsto accept?start_date=&end_date=— when both are present, each product carries an inlineDeliveryForecast(availability shape), eliminating N per-product round-trips in the adapter.src/lib/mock-server/sales-guaranteed/openapi.yamlPOST /v1/forecast, the newForecastRange/ForecastPoint/DeliveryForecastschemas, and the new query params onGET /v1/products.examples/hello_seller_adapter_guaranteed.ts(new file)hello_seller_adapter_signal_marketplace.ts.getProductscallsGET /v1/products?start_date=&end_date=(single upstream call) and maps the inlineforecastfield ontoAdCP Product.forecast.createMediaBuyusesctx.handoffToTaskfor IO approval polling.syncCreatives,getMediaBuyDeliveryfully implemented..changeset/mock-server-guaranteed-forecast.md— minor bump.What was tested
npx tsc --noEmit— clean (pre-existingmoduleResolutiondeprecation warning only, present onmain)node --test test/handler-return-tightness.test.js— passdist/not built in this environment)Pre-PR review
DeliveryForecast.methodrequired field populated,ForecastPoint.budgetabsent on availability points,DeliveryForecast.currencypopulated,generated_atmade deterministic viaseedToTimestamp, invalidReturnTypegeneric annotation removedtotal_budgethandles AdCP 3.x{ amount, currency }shape, misleading "field names match" comment replaced with explicit field-by-field mapping,valid_untilSWAP hint added,/_debug/trafficcurl line added to demo,FIXME(adopter)on production-silent stubsNits noted but not fixed (surfaced for reviewer):
buildSpendCurveCPM formula producesInfinityif a custom fixture setscpm: 0(no seeded product does today)forecast_range_unitcast fromstring— widened to all 8 enum values rather than guarded at runtime; adequate for an example fileSession: https://claude.ai/code/session_01Qf2uPL7iSb54kgCRiXUtzP
Generated by Claude Code