New native mapper - #141
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA PR that replaces the rule-based JSON field mapper with a Scriban template-based mapper implementation. Adds mapper preview and persistence functionality, removes the deprecated field mapper, introduces a new template rendering utility, and updates dependency injection and models to support the migration. Changes
Sequence DiagramsequenceDiagram
participant Client
participant SaveMapper as SaveMapper Handler
participant RequestContext
participant Database as BitweenDbContext
participant Validator as Async Validator
participant Mapper as Native Adapter/Serverless
participant Cache as BitweenCache
Client->>SaveMapper: Handle(key, SubscriptionSaveMapper)
SaveMapper->>RequestContext: EnsureAccess(Admin/Member)
RequestContext-->>SaveMapper: ✓ Access granted
SaveMapper->>Validator: Validate MapperProperties
Validator->>Mapper: Fetch expected startup values<br/>(native or serverless)
Mapper-->>Validator: Expected properties list
Validator-->>SaveMapper: Validation result
alt Validation fails
SaveMapper-->>Client: Response with validation errors
else Validation passes
SaveMapper->>Database: Load Subscription by key
Database-->>SaveMapper: Subscription entity
SaveMapper->>Database: Update MapperId & properties
SaveMapper->>Database: SaveChangesAsync()
Database-->>SaveMapper: Changes persisted
SaveMapper->>Cache: BroadcastRevoke()
Cache-->>SaveMapper: ✓ Cache invalidated
SaveMapper-->>Client: Response with null
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Refactor