This PR introduces support for associating ProdIntent with specific product_types and transitions the feature from being user-scoped to merchant-scoped, enabling more flexible usage across different products.
Changes Introduced
1. New V2 Routes for Dashboard Metadata
Added v2 routes to support ProdIntent creation and retrieval with respect to product_type.
2. Product-Type Context for ProdIntent
While inserting the ProdIntent into the dashboard_metadata table (for both v1 and v2 schemas), the product_type is now included in the metadata.
3. Merchant-Scoped ProdIntent
Before:ProdIntent was user-scoped, allowing a single request per user.
Now: It is merchant-scoped, allowing a user to raise separate ProdIntent requests for different merchant accounts for each product by the same user.
4. Enhanced Email Body
The email body sent for ProdIntent now includes the product_type context, helping understand for which product the prod intent was raised.
Additional Changes
This PR modifies the API contract
This PR modifies the database schema
This PR modifies application configuration/environment variables
Motivation and Context
Enable requesting for Production Access for every product type merchant account.
tsdk02
changed the title feat(users): add v2 routes for dashboard_metadata feat(users): refactor `ProdIntent` to support product-type context and merchant-scope28 days ago
minor nits
9353361c
feat(users): make prodIntent merchant-scoped
1df4975a
merged main
9251a082
chore: run formatter
8d9d3e28
feat(users): extract product_type through merchant_account db call
Type of Change
Description
This PR introduces support for associating ProdIntent with specific product_types and transitions the feature from being user-scoped to merchant-scoped, enabling more flexible usage across different products.
Changes Introduced
1. New V2 Routes for Dashboard Metadata
ProdIntent
creation and retrieval with respect toproduct_type
.2. Product-Type Context for ProdIntent
ProdIntent
into thedashboard_metadata
table (for both v1 and v2 schemas), theproduct_type
is now included in the metadata.3. Merchant-Scoped ProdIntent
ProdIntent
was user-scoped, allowing a single request per user.ProdIntent
requests for different merchant accounts for each product by the same user.4. Enhanced Email Body
ProdIntent
now includes theproduct_type
context, helping understand for which product the prod intent was raised.Additional Changes
Motivation and Context
Enable requesting for Production Access for every product type merchant account.
How did you test it?
Hit the curl:
Dashboard Metadata table should get inserted/updated with the record along with the product_type in the json body.

Sample entry to table:
Also, product_type should also be sent in the email body to the configured recepient email-id.

Expected Output:
Similarly v2 routes:
http://localhost:8080/v2/user/data
(POST)http://localhost:8080/v2/user/data?keys=ProdIntent
(GET)Checklist
cargo +nightly fmt --all
cargo clippy