-
Notifications
You must be signed in to change notification settings - Fork 652
Open
Labels
feat/businessesTasks related to the feature of adding business/teams <> customer relationship support.Tasks related to the feature of adding business/teams <> customer relationship support.polar-teamIssues that will be handled by the core Polar teamIssues that will be handled by the core Polar team
Description
Summary
Update the event ingestion API to accept member fields, as part of Phase 6: Event Ingestion (parent issue #7899).
Context
From Slack discussion with Pieter:
- Events should support
member_id/external_member_idto track "who did this" on top of "who pays for this" - B2C (seat_based disabled): Can auto-map customer to owner member (future enhancement)
- B2B: Optionally pass
[external_]member_idfor member-specific attribution - Billing queries remain unchanged (still use
[external_]customer_id)
Changes
Schema Changes (server/polar/event/schemas.py)
- Add
member_id: UUID | NonetoEventCreateCustomerschema - Add
external_member_id: str | NonetoEventCreateExternalCustomerschema
Service Changes (server/polar/event/service.py)
- Update
ingest()method to accept and validate member fields - Store
member_idandexternal_member_idin Event record - Copy member fields to MeterEvent records in
_create_meter_events()
Endpoint Changes (server/polar/event/endpoints.py)
- No changes needed - schemas drive the API contract
Files to Modify
server/polar/event/schemas.pyserver/polar/event/service.py
Deployment
Safe to deploy - optional parameters maintain backward compatibility.
Parent Issue
Part of #7899
Dependencies
Requires #9224 and #9226 (database migrations) to be completed first
Metadata
Metadata
Assignees
Labels
feat/businessesTasks related to the feature of adding business/teams <> customer relationship support.Tasks related to the feature of adding business/teams <> customer relationship support.polar-teamIssues that will be handled by the core Polar teamIssues that will be handled by the core Polar team
Type
Projects
Status
No status