refactor: Repository updates for nullable stripe_customer_id (#205) #208

Closed
opened 2026-02-16 14:53:05 +00:00 by egullickson · 0 comments
Owner

Relates to #205

Milestone 2: Repository layer updates

Files

  • backend/src/features/subscriptions/data/subscriptions.repository.ts

Changes

  1. createForAdminOverride() (lines 576-611):

    • Remove placeholder generation (admin_override_{userId}_{timestamp})
    • INSERT with stripe_customer_id = NULL instead
  2. mapSubscriptionRow() (lines 622-638):

    • Handle NULL from database: stripeCustomerId: row.stripe_customer_id || null
  3. create() method (lines 30-57):

    • Make stripeCustomerId optional in parameter type
    • Default to NULL in INSERT when not provided

Acceptance Criteria

  • Admin override creates records with NULL stripe_customer_id
  • Mapper handles NULL correctly
  • Existing Stripe-based creates still work
  • No placeholder strings generated anywhere
Relates to #205 ## Milestone 2: Repository layer updates ### Files - `backend/src/features/subscriptions/data/subscriptions.repository.ts` ### Changes 1. **`createForAdminOverride()`** (lines 576-611): - Remove placeholder generation (`admin_override_{userId}_{timestamp}`) - INSERT with `stripe_customer_id = NULL` instead 2. **`mapSubscriptionRow()`** (lines 622-638): - Handle NULL from database: `stripeCustomerId: row.stripe_customer_id || null` 3. **`create()` method** (lines 30-57): - Make `stripeCustomerId` optional in parameter type - Default to NULL in INSERT when not provided ### Acceptance Criteria - [ ] Admin override creates records with NULL stripe_customer_id - [ ] Mapper handles NULL correctly - [ ] Existing Stripe-based creates still work - [ ] No placeholder strings generated anywhere
egullickson added the
status
backlog
type
feature
labels 2026-02-16 14:53:32 +00:00
egullickson added this to the Sprint 2026-02-02 milestone 2026-02-16 14:53:35 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#208