mitodl / mitodl/ol-data-platform

Create dimensional models for MITx Pro coupon/B2B ecommerce layer

Open
#2,297 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement product:data-platform
Dominant language
Python
Stars
51
Forks
6
Avg merge
2d 19h
Merged PRs (30d)
113

Description

What are the relevant tickets?

Part of epic #2072

Description

Two mart models cannot be migrated to the dimensional layer because the required dimensional abstractions do not yet exist:

  • marts__mitxpro_all_coupons (#2099) — references 12 MITxPro-specific ecommerce int__ models including B2B orders, coupons, coupon payment versions, coupon products, and company data. No dimensional equivalent exists.
  • marts__combined_discounts (#2081) — partially depends on marts__mitxpro_all_coupons and MITxOnline discount int__ models. Blocked by the coupon mart.
Scope

Investigate and create the dimensional models needed to support these marts. Candidates include:

  • dim_coupon — coupon definitions, types, discount amounts across MITxOnline and MITxPro
  • dim_b2b_contract (or extend dim_contract) — B2B company/contract-level order grouping
  • tfact_coupon_redemption — coupon application events tied to orders

Source intermediates to consolidate:

  • int__mitxpro__ecommerce_allcoupons, int__mitxpro__ecommerce_coupon, int__mitxpro__ecommerce_couponpaymentversion, int__mitxpro__ecommerce_couponproduct
  • int__mitxpro__b2becommerce_b2border, int__mitxpro__b2becommerce_b2breceipt, int__mitxpro__ecommerce_company
  • int__mitxonline__ecommerce_discount, int__mitxonline__ecommerce_discountproduct
Definition of Done
  • New dimensional coupon/B2B models exist in models/dimensional/
  • Models pass dbt tests
  • Unblocks migration of #2081 (marts__combined_discounts) and #2099 (marts__mitxpro_all_coupons)
Additional Context

dim_discount and dim_discount_type already exist for MITxOnline discounts. The gap is specifically the MITxPro coupon/B2B layer which has no dimensional equivalent. Review existing dim_discount.sql and dim_contract.sql before designing new models.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing models/dimensional/dim_discount.sql and dim_contract.sql, then trace the listed MITxPro and MITxOnline intermediate models. Determine the dimensional coupon and B2B abstractions needed by #2081 and #2099. Run the dbt tests for the new models; done means the models exist in models/dimensional/ and unblock both mart migrations.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.