Commit Graph

14 Commits

Author SHA1 Message Date
Gaetan Craig-Riou
d6ef56af6e Fix existing code to support webhook_type 2025-12-10 10:28:11 +11:00
rahsheen
0b6e7593db Set oc.opened at nil when cloning service 2025-11-22 10:51:17 -05:00
Gaetan Craig-Riou
7633af8ff2 Call VariantTagRulesFilterer when variant_tag feature is enabled
We only support either inventory or variant_tag feature, with the later
taking precedence if both are turned on.
2025-11-03 14:25:05 +11:00
Gaetan Craig-Riou
cd8b7cd239 First step disable inventory 2025-07-09 11:35:26 +10:00
David Cook
a8490a9b11 Record the exact event time for the webhook
There might be a delay before it gets sent, so it's better to record the time the event occurred at.
It would have been simpler to just add it to the data hash, but I felt it was an important detail for an event and should be at the top level along with event name.

In the case of order cycle opening, this is the same as opened_at. I've included this in the payload for clarity too.
2025-03-25 10:38:30 +11:00
wandji20
95135ca526 Move order_cycle datetime verification logic to service files [OFN-12775] 2024-08-22 22:17:12 +01:00
cyrillefr
05ed4639b2 Fixes 422 error due to bad sql building
- first part of query use supplier_properties parameter, but not
  second part, that can leads to mismatch between the 2 parts.
  Remove supplier_properties parameter + modify SQL to get it right.
- spec tests category filtering & sorting + producer properties
2024-07-24 21:49:11 +02:00
Gaetan Craig-Riou
686fe8c028 Per review, remove flag argument from products_relation
products_relation is now split in two, products_relation and
products_relation_incl_supplier_properties.
It avoids using a flag argument which is not a a good practice see:
https://martinfowler.com/bliki/FlagArgument.html
2024-07-10 13:19:08 +10:00
Gaetan Craig-Riou
5c3acbbcaf Per review, remove instance variable @query 2024-07-10 11:45:39 +10:00
Gaetan Craig-Riou
79a22aefc3 Refactor #products_relation
Due to primary_taxon and supplier having moved to the variant, filtering
by_producer and by_category with a custom order involves some
complicated sql queries. So we moved the sorting logic from
ProductsRenderer to OrderCycles::DistributedProductsService so we can
keep the complicated SQL logic contained in one place
2024-07-08 10:35:57 +10:00
Gaetan Craig-Riou
84197aca19 Fix the filtering by properties/supplier properties
- Apply OR when filtering by both product properties and supplier
properties
- Apply AND when filtering by supplier properties and taxon
Filtering by product properties and taxon is handled by ransack, so
no change there
2024-07-03 11:21:28 +10:00
Gaetan Craig-Riou
0c9223809b Fix with_properties scope to accept any number of arguments 2024-07-03 10:17:49 +10:00
Matt-Yorkley
a55931c081 Reinstate sorting by arbitrary list of product categories 2024-04-02 09:42:43 +11:00
Feruz Oripov
9d919938f3 Group Order && OrderCycle related services and specs 2024-03-16 19:07:08 +05:00