Skip to content

release/v0.4.22 - #107

Merged
roncodes merged 22 commits into
mainfrom
release/v0.4.22
Sep 28, 2026
Merged

roncodes merged 22 commits into
mainfrom
release/v0.4.22

Conversation

@roncodes

Copy link
Copy Markdown
Member

Release branch for v0.4.22: reliable push notifications, a customer notifications inbox, promotions, segments and campaigns.

What this branch carries

  • Version bumped to 0.4.22 in package.json, composer.json and extension.json.
  • RELEASE.md written for v0.4.22.

The feature PRs below are retargeted to this branch and merge into it.

Merge order

Several PRs are stacked, so they must merge in this order. After each merge the next one's diff shrinks to its own changes.

# PR Notes
1 #101 Ukrainian translation. Independent.
2 #102 Push notification rebuild. needs-human-review.
3 #103 Notifications inbox. Stacked on #102 (it contains #102's commits until #102 is merged).
4 #104 Promotions engine. Changes checkout amounts: needs-human-review and needs-product-decision (see its Risk section).
5 #105 Segments and campaigns. Contains #102–#104 through a merge commit; review its own commit. Currently a draft.
6 #106 Console screens. Built on #105; review its own commit. Currently a draft and not yet clicked through in a browser.
7 this PR Merging to main fires the tag job, which pushes v0.4.22 and chains into create-release.yml and the publish jobs.

Before merging this PR

  • All six PRs merged into this branch, with CI and Codecov green on this branch.
  • Manual checks:
    • Push to a real Android device and to iOS dev and App Store builds, using the new "Send test" action.
    • Promotions applied at cash, Stripe and QPay checkout. Confirm eBarimt accepts the negative Discount line.
    • Click through the new Promotions, Campaigns and Segments console screens.
  • Decisions in feat: promotions engine with codes, stacking and checkout integration #104 confirmed:
    • tips are calculated on the pre-discount subtotal
    • the discount transaction item is stored as a positive amount marked as a credit
  • After this release, merge Document Storefront notifications, promotions and device endpoints postman#64 (API reference). If it merges earlier, the Storefront contract check fails on PRs that don't have these routes.

Related, released separately

Upgrade steps

See RELEASE.md: run migrations, and make sure the scheduler and a queue worker are running.

ispdomnet and others added 13 commits September 22, 2026 09:43
Android pushes never worked with store-level FCM credentials and some iOS
devices were rejected, because of several stacked defects:

- configureFcm put the service account JSON into credentials.private_key,
  so no valid Firebase client was ever built from a store channel
- FcmChannel required the platform-wide Firebase project to be configured
- credentials were always resolved from the store, never the network app
- one APNs environment per channel rejected sandbox/dev build tokens
- registerDevice never reassigned a token to the latest customer and did
  not normalize platform casing
- mail/database errors ran before push and stopped it; failures and dead
  tokens were never handled or logged

Introduce Push\StorefrontPushChannel with isolated Firebase/APNs clients,
network-first credential resolution with wrong-app and wrong-environment
retries, dead token pruning, and high priority payloads. Order
notifications share a StorefrontOrderNotification base class. Add a
customers/unregister-device endpoint and an admin test push action.
Codecov requires full patch coverage. Cover the FCM and APNs transport
send paths, PushMessage setters, APNs environment short-circuit, explicit
push routes, and pruning/logging failure handling. Read device
attributes with data_get so devices returned by a custom push route do
not need to be Eloquent models, and drop two unreachable branches.
Storefront order notifications were already stored in the core
notifications table, but customers had no way to read them. Add
storefront/v1/notifications endpoints for the authenticated customer to
list (filter by unread/type, limit/offset), count unread, read, mark as
read, mark all as read and delete their notifications, scoped to the
storefront app (store, or network and its member stores).

Add customer notification preferences (order update pushes, promotions)
stored on the contact meta and honored by the notifications, and
broadcast new notifications in realtime on contact.{uuid} through a
broadcast channel that never fails the send.
…asts

Also drop null values from inbox item data, and read notification data
through the model's array cast.
…ration

Add promotions owned by a store or network: automatic or code based
percentage, fixed amount, free delivery and buy X get Y discounts, with
product/category/store targeting, minimum subtotal and item conditions,
first order only, date ranges and weekly schedule windows, usage limits
(total, per customer, per code), budgets, maximum discounts, stacking and
priorities.

Checkout prices the cart's promotions when a checkout is created, stores
them on the checkout options and reserves each use under a row lock, so
the amount charged (cash, Stripe, QPay) always matches the discount
shown. Capture records a discount transaction item and order meta and
redeems the reservations; multi-store orders split the discount per
store. Stale reservations are released by a scheduled command.

Cart endpoints apply, remove and preview codes; the public API lists the
storefront's live deals; the console API manages promotions and
generates codes.
…campaigns

# Conflicts:
#	server/src/routes.php
Customer segments are rule based audiences of a store's or network's
customers (order count bounds, ordered or lapsed within N days, joined
within N days, minimum spend, reachable by push, explicit customers).

Campaigns send a title/body with an optional image and deep link to a
segment (or explicit recipients, or everyone) by push and/or inbox, now
or at a scheduled time. storefront:dispatch-campaigns claims due
campaigns atomically and queues delivery in batches; customers who
turned promotions off are skipped. Promotions can be announced with a
campaign that goes out when the promotion starts, and announcements for
promotions that stopped running are canceled.

The console API manages segments (with live audience previews) and
campaigns (send now, cancel, audience count). The existing promotional
push action now sends a tracked campaign.
…ampaigns

Promotions now has Promotions, Campaigns, Segments and Push Notifications
tabs (and sidebar entries). Promotions: list with type, trigger, status,
schedule, redemptions and discount given; a form for discounts,
conditions, targeting, limits and stacking; activate/pause/end; promo
code generation and management; and announcing a promotion to a segment.
Segments: rule builder with a live count of matching customers.
Campaigns: message, audience, channels and deep link, saved as a draft,
sent now or scheduled, with send and cancel actions.
after:starts_at failed validation whenever starts_at was empty.
Cuts the release carrying the push notification rebuild (#102), the
customer notifications inbox (#103), the promotions engine (#104),
customer segments and campaigns (#105), their console screens (#106)
and the Ukrainian translation (#101).
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (490f9e5) to head (6f8659d).

Additional details and impacted files
@@              Coverage Diff              @@
##                main      #107     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
- Complexity      1772      2281    +509     
=============================================
  Files            135       182     +47     
  Lines           7778      9080   +1302     
=============================================
+ Hits            7778      9080   +1302     
Flag Coverage Δ
backend 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roncodes
roncodes merged commit 940c5ae into main Sep 28, 2026
11 checks passed
@roncodes
roncodes deleted the release/v0.4.22 branch September 28, 2026 10:52
@roncodes roncodes mentioned this pull request Sep 28, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants