Conversation
0a7a318 to
dba8949
Compare
| // Map known prefixes to Stripe product groups (singular per resource naming spec). | ||
| const REFINEMENTS: Record<string, string> = { | ||
| subscription: 'Billing', | ||
| subscriptions: 'Billing', |
There was a problem hiding this comment.
not blocking: we should remove this, this should not be manually defined
| // `_updated_at` is hardcoded below; upsertMany writes it (DDR-009). | ||
| if (name === '_updated_at') continue | ||
| // System columns are hardcoded below; upsertMany writes both. | ||
| if (name === '_updated_at' || name === '_synced_at') continue |
There was a problem hiding this comment.
what is the difference between synced at and updated at? we should remove updated at if its just a duplicate
There was a problem hiding this comment.
_synced_at is the last time the record was seen by sync-engine, regardless of whether the record changed. It can be used to detect missed delete events or webhooks.
_updated_at represents the freshness of the record, to the best of our knowledge. It's used to determine the latest version of an object and determine if we should upsert or not.
We determine its value using the following priority order:
- The native
updatedfield - The event
createdtimestamp, if the update came from a webhook. - The Stripe response header time (during backfill).
now()as a fallback.
| export const OPENAPI_RESOURCE_TABLE_ALIASES: Record<string, string> = { | ||
| 'radar.early_fraud_warning': 'early_fraud_warnings', | ||
| 'entitlements.active_entitlement': 'active_entitlements', | ||
| 'entitlements.feature': 'features', | ||
| item: 'checkout_session_line_items', | ||
| } | ||
|
|
||
| /** | ||
| * Compatibility columns that should exist even if not present in the current OpenAPI shape. | ||
| * This preserves backwards compatibility for existing queries and write paths. | ||
| * todo: Remove this | ||
| */ | ||
| export const OPENAPI_COMPATIBILITY_COLUMNS: Record<string, ParsedColumn[]> = { | ||
| active_entitlements: [ | ||
| { name: 'customer', type: 'text', nullable: true }, | ||
| { name: 'object', type: 'text', nullable: true }, | ||
| { name: 'feature', type: 'text', nullable: true }, | ||
| { name: 'livemode', type: 'boolean', nullable: true }, | ||
| { name: 'lookup_key', type: 'text', nullable: true }, | ||
| ], | ||
| checkout_session_line_items: [ | ||
| { name: 'checkout_session', type: 'text', nullable: true }, | ||
| { name: 'amount_discount', type: 'bigint', nullable: true }, | ||
| { name: 'amount_tax', type: 'bigint', nullable: true }, | ||
| ], | ||
| customers: [{ name: 'deleted', type: 'boolean', nullable: true }], | ||
| early_fraud_warnings: [{ name: 'payment_intent', type: 'text', nullable: true }], | ||
| features: [ | ||
| { name: 'object', type: 'text', nullable: true }, | ||
| { name: 'name', type: 'text', nullable: true }, | ||
| { name: 'lookup_key', type: 'text', nullable: true }, | ||
| { name: 'active', type: 'boolean', nullable: true }, | ||
| { name: 'livemode', type: 'boolean', nullable: true }, | ||
| { name: 'metadata', type: 'json', nullable: true }, | ||
| ], | ||
| subscription_items: [ | ||
| { name: 'deleted', type: 'boolean', nullable: true }, | ||
| { name: 'subscription', type: 'text', nullable: true }, | ||
| ], | ||
| 'radar.early_fraud_warning': 'early_fraud_warning', | ||
| 'entitlements.active_entitlement': 'active_entitlement', | ||
| 'entitlements.feature': 'feature', | ||
| item: 'checkout_session_line_item', |
There was a problem hiding this comment.
can we also remove these?
Reverts back to 5024aac (change soft to hard delete). Reverted commits: - 921fe63 Add source and destination for custom object support (#356) - 95eaaa9 chore: remove Vercel docs deploy CI jobs (#360) - 822000f squash (#352) Committed-By-Agent: claude Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Stripe Data Schema Projection Alignment Plan
Requirements To Align
Stopped and left to be done as a part of the follow-on PR. (The diff grew to a size that is really hard to review)