Repository navigation
Conversation
|
@dotnet-policy-service agree |
|
Hi @davidfowl, |
|
Hi, any update @davidfowl ? |
DamianEdwards
left a comment
There was a problem hiding this comment.
Thanks for this, removing stored card data is the right direction, and the overall shape looks good. The app keeps its simulated payment flow (PaymentProcessor is still config-driven) but no longer stores, logs, or emits card details as claims.
There's one blocking issue, and a few smaller ones.
Blocking: the new migrations won't be applied. Neither 20260607000000_RemoveSensitivePaymentMethodData nor 20260607000000_RemoveSensitiveCardProfileData has a .Designer.cs file, so neither has the [DbContext]/[Migration] attributes. EF uses those attributes to find migrations, so MigrateAsync (run at startup through AddMigration<>) will skip both. As a result:
- Identity:
AspNetUserskeeps itsNOT NULLcard columns, but the model no longer writes them, so seeding alice and bob fails. - Ordering:
paymentmethodshas noPaymentMethodIdcolumn, andCardNumber/CardHolderNameare still required, so checkout fails when it creates the buyer and payment method.
This likely explains the functional test timeouts you mentioned. Please remove the hand-written migrations and regenerate them with dotnet ef migrations add ... for each context, so the Designer files and snapshots are produced together.
Smaller items:
- Card types are now unused: the
CardTypeentity, thecardtypestable and seed data, theGET /api/orders/cardtypesendpoint, andClientApp/Models/Orders/CardType.cs. Please remove them (dropping the table in the migration), or explain why they should stay. - The
CreateOrderRequestcontract changes shape (the card fields are replaced byPaymentMethodId). That's fine for this sample, but please mention the breaking change in the PR description. - Please rebase on
main. The branch is about 19 commits behind.
|
Thanks for the feedback, @DamianEdwards. Good catch on the migrations and the extra card type cleanup. I'll regenerate them properly with the CLI, address the rest of your notes, and rebase onto main soon. |
eba9c46 to
00c9f81
Compare
|
Hi @DamianEdwards , |
DamianEdwards
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. This looks good now. I built it locally, and the Ordering unit tests and functional tests pass, so the migrations apply cleanly.
One more request: since neither of the new Ordering migrations has shipped, please combine them into a single migration. Right now RemoveSensitivePaymentMethodData adds a PaymentMethodId column and RenamePaymentMethodTokenColumn immediately renames it to PaymentToken. To do that:
- Delete both migration files and their
.Designer.csfiles, and restoreOrderingContextModelSnapshot.csto the version onmain. - Run
dotnet ef migrations add RemoveSensitivePaymentMethodDataagainstOrderingContext. Pass only the name: EF adds the timestamp itself. The current class names have a doubled timestamp prefix (_20261117125854_...), which suggests the timestamp was included in the name. - Add the
legacy-|| "Id" backfill back into the regenerated migration, so the column is created directly asPaymentToken.
It's also worth checking that the Identity migration's class name doesn't have the same prefix problem.
| namespace Ordering.Infrastructure.Migrations; | ||
|
|
||
| /// <inheritdoc /> | ||
| public partial class _20261117131357_RenamePaymentMethodTokenColumn : Migration |
There was a problem hiding this comment.
Please fold this rename into RemoveSensitivePaymentMethodData, so the column is added as PaymentToken from the start and there is one Ordering migration for this change.
Summary
Verification
Notes
Addresses #979
Breaking contract change: CreateOrderRequest replaces card details with PaymentToken; clients must send an opaque payment provider token.