Skip to content

Add dontSeeOrderInDatabase (order parity with subscriptions) #59

Description

@fafera

Parent

Part of the WC status normalization initiative that supersedes closed PRD issue #18.

What to build

Add a dontSeeOrderInDatabase() assertion to the order method surface, closing an API parity gap: SubscriptionMethods already exposes dontSeeSubscriptionInDatabase(), but orders have no equivalent.

The method asserts that no order row matches the given criteria. It mirrors the existing seeOrderInDatabase() / dontSeeSubscriptionInDatabase() pattern end-to-end: resolve the order table name from the storage layer, map the storage-agnostic criteria through orderStorage()->mapCriteria(), and delegate the negative assertion to the underlying WPDB module.

Because the criteria pass through orderStorage()->mapCriteria(), this method inherits status normalization for free from the normalizeStatusInCriteria() chokepoint introduced in #21. No normalization logic is added here — dontSeeOrderInDatabase(['status' => 'cancelled']) resolves to the canonical wc-cancelled form automatically. This is why the slice is blocked by #21.

It supports the same storage-agnostic keys as seeOrderInDatabase (id, status, etc.) and works under both Legacy and HPOS storage.

Acceptance criteria

  • OrderMethods exposes public function dontSeeOrderInDatabase(array $criteria): void, delegating via the order storage's table name and mapCriteria() to the WPDB negative assertion — mirroring dontSeeSubscriptionInDatabase.
  • Method carries a docblock with an @example and a @param description consistent with the surrounding order assertion methods.
  • vendor/bin/codecept build has been run (new public module method changes the generated actor signature).
  • Acceptance case: write an order with 'wc-active', then dontSeeOrderInDatabase(['status' => 'cancelled']) passes (does NOT match the row) — proving normalization is inherited via mapCriteria().
  • Acceptance case (non-status criteria): dontSeeOrderInDatabase(['id' => 999999]) passes against an empty/non-matching table.
  • Works under both Legacy and HPOS storage (covered in OrderCest and/or OrderHPOSCest).
  • All existing acceptance tests still pass.

Blocked by

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions