Skip to content

Conversation

@EmmaLouise2018
Copy link
Contributor

Summary

  • Add auction pricing variants for all pricing models (previously only CPM and vCPM supported both fixed and auction)
  • New auction schemas for CPC, CPCV, CPV, CPP, and Flat Rate
  • Renamed existing schemas to -fixed-option.json for consistency

Test plan

  • All schema validation tests pass
  • Build succeeds
  • Changeset added for version tracking

Previously only CPM and vCPM supported both fixed and auction pricing.
This change adds auction variants for CPC, CPCV, CPV, CPP, and Flat Rate.

New schemas:
- cpc-auction-option.json
- cpcv-auction-option.json
- cpv-auction-option.json
- cpp-auction-option.json
- flat-rate-auction-option.json

Renamed for consistency:
- cpc-option.json → cpc-fixed-option.json
- cpcv-option.json → cpcv-fixed-option.json
- cpv-option.json → cpv-fixed-option.json
- cpp-option.json → cpp-fixed-option.json
- flat-rate-option.json → flat-rate-fixed-option.json
@@ -0,0 +1,68 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we really have to enumerate every combination in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed! Refactored to use 7 schema files (one per pricing model) instead of 14 separate files. Each pricing model schema now uses a discriminated union with is_fixed to support both fixed and auction variants in a single file.

Schema structure:

  • cpm-option.json - both fixed and auction
  • vcpm-option.json - both fixed and auction
  • cpc-option.json - both fixed and auction
  • cpcv-option.json - both fixed and auction
  • cpv-option.json - both fixed and auction
  • cpp-option.json - both fixed and auction
  • flat-rate-option.json - both fixed and auction

This eliminates the fixed vs auction duplication while keeping each pricing model in its own maintainable file.

}
```

**Auction Example**:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly use the testable code to make these maintainable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion! For pricing-models.mdx, the JSON examples are schema documentation rather than API calls, so testable: true isn't directly applicable here (those tests validate executable code against the test agent API).

However, the schema validation tests do indirectly validate these structures since they test the pricing option schemas. The examples in the doc should match the schema definitions.

If we want explicit validation of doc examples, we could add a test that extracts JSON from the mdx and validates against schemas - happy to add that if useful.

Address PR feedback to avoid enumerating every pricing model + type combination.

Changes:
- Consolidated 14 individual pricing option schemas into single pricing-option.json
- Uses two-level discriminated union: is_fixed (true/false) × pricing_model enum
- Removed pricing-options directory entirely
- Updated schema registry index.json

This makes it trivial to add new pricing models (just add to enum) rather than
creating 2 new schema files per model.
Address PR feedback to avoid enumerating every pricing model + type combination.

Changes:
- Create 7 pricing model schemas (cpm, vcpm, cpc, cpcv, cpv, cpp, flat-rate)
- Each schema supports both fixed and auction variants via discriminated union
- Use is_fixed boolean as discriminator (true=rate, false=price_guidance)
- Update pricing-option.json to reference 7 model schemas
- Update index.json registry with pricing-options section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants