Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ypes Re-export FieldCondition, SubcategoryFieldDef, SubcategoryStructure from funpayparsers.types.subcategory_structure via a new types module. Add field_schema: list[SubcategoryFieldDef] field to OfferFields and a subcategory_structure property that builds a SubcategoryStructure on demand. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FieldCondition, SubcategoryFieldDef and SubcategoryStructure are now proper Pydantic models inheriting from FunPayObject instead of re-exporting the funpayparsers dataclasses directly. Each class owns its _add_raw_source validator: - FieldCondition/SubcategoryStructure: no raw_source on the parser side, generate a stable JSON identifier on construction - SubcategoryFieldDef: raw_source already present on the parser dataclass, let from_attributes carry it through; fallback for dict construction SubcategoryStructure.from_offer_fields is added as a classmethod and used by OfferFields.subcategory_structure property. OfferFields.field_schema now stores engine SubcategoryFieldDef instances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
funpayparsersdependency from>=0.7.0,<0.8.0to>=0.8.0,<0.9.0funpaybotengine.typesChanges
New module —
types/subcategory_structure.pyRe-exports three new types from
funpayparsers.types.subcategory_structure:FieldCondition— visibility condition for a subcategory field (field_id+ set of triggervalues)SubcategoryFieldDef— full definition of a single subcategory field (id, type, label, conditions, options)SubcategoryStructure— derived structure for O(1) lookup by field ID, withlabel_mapandlower_label_map(case-insensitive)Note:
SubcategoryFieldTypeenum is already available viaenums.py(re-exported from funpayparsers).OfferFields— two new membersfield_schema: list[SubcategoryFieldDef]— populated byOfferFieldsParserfrom thedata-fieldsJSON attribute; empty list for chips offerssubcategory_structureproperty — builds aSubcategoryStructurefromfield_schemaon demandBreaking changes
None. All additions are backwards-compatible (
field_schemadefaults to[])