laravel-shop/src/Events
Fabian @ Blax Software b154d8fea2 feat(seats): assignable license seats — buy N, assign/reassign/reclaim per user
A seat-based product (meta.seat_based) sold at quantity N provisions N
assignable LicenseSeat rows instead of granting the buyer. Assigning a seat
runs the product's existing ProductAction grants against the seat holder via
an explicit `grantee` (resolution: grantee ?? purchaser ?? subscription->user),
so a seat confers exactly the product's access with zero duplicated grant logic.

- LicenseSeat model: assign / reassign / reclaim / retire / refreshGrant
- SeatService: idempotent provisioning for one-time purchases and subscriptions
  (sizes the pool to quantity; renewal extends expiry + re-grants held seats)
- SeatAssigned / SeatReassigned / SeatRevoked events
- Product::isSeatBased(); ProductPurchase + Subscription provision on
  completion / lifecycle hooks
- license_seats migration + factory; config `shop.seats` block
- 15 new tests (purchase, subscription, renewal, retire, delegation, gating)

Backward compatible: with no `grantee` the buyer grant is unchanged, and seat
behavior is gated behind the per-product meta flag + config `shop.seats.enabled`.
Full package suite green: 1425 tests / 3812 assertions / 0 failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 10:07:58 +02:00
..
BookingCancelled.php A events, IA commands 2026-05-17 11:24:43 +02:00
BookingConfirmed.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartAbandoned.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartConverted.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartCreated.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartExpired.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartItemAdded.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartItemRemoved.php A events, IA commands 2026-05-17 11:24:43 +02:00
CartItemUpdated.php A events, IA commands 2026-05-17 11:24:43 +02:00
LoanCreated.php feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
LoanExtended.php feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
LoanReturned.php feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
OrderCancelled.php A events, IA commands 2026-05-17 11:24:43 +02:00
OrderCreated.php A events, IA commands 2026-05-17 11:24:43 +02:00
OrderFulfilled.php A events, IA commands 2026-05-17 11:24:43 +02:00
OrderPaid.php A events, IA commands 2026-05-17 11:24:43 +02:00
OrderRefunded.php A events, IA commands 2026-05-17 11:24:43 +02:00
ProductCreated.php feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
ProductDeleted.php A events, IA commands 2026-05-17 11:24:43 +02:00
ProductPublished.php A events, IA commands 2026-05-17 11:24:43 +02:00
ProductUnpublished.php A events, IA commands 2026-05-17 11:24:43 +02:00
ProductUpdated.php feat: Enhance traits with strict types and improve method signatures 2026-05-15 20:26:24 +02:00
PurchaseCompleted.php feat(fulfillment): add model-agnostic PurchaseCompleted event 2026-06-02 11:19:21 +02:00
PurchaseCreated.php A events, IA commands 2026-05-17 11:24:43 +02:00
PurchaseRefunded.php A events, IA commands 2026-05-17 11:24:43 +02:00
SeatAssigned.php feat(seats): assignable license seats — buy N, assign/reassign/reclaim per user 2026-07-29 10:07:58 +02:00
SeatReassigned.php feat(seats): assignable license seats — buy N, assign/reassign/reclaim per user 2026-07-29 10:07:58 +02:00
SeatRevoked.php feat(seats): assignable license seats — buy N, assign/reassign/reclaim per user 2026-07-29 10:07:58 +02:00
StockBecameLow.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockClaimExpired.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockClaimed.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockDecreased.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockDepleted.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockFullyAvailable.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockIncreased.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockReleased.php A events, IA commands 2026-05-17 11:24:43 +02:00
StockReplenished.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripePaymentFailed.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripePaymentSucceeded.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripePriceSynced.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripeProductSynced.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripeRefundProcessed.php A events, IA commands 2026-05-17 11:24:43 +02:00
StripeWebhookReceived.php A events, IA commands 2026-05-17 11:24:43 +02:00
SubscriptionCanceled.php feat(subscriptions): Cashier-backed subscription lifecycle with product link + events 2026-06-02 11:40:15 +02:00
SubscriptionRenewed.php feat(subscriptions): Cashier-backed subscription lifecycle with product link + events 2026-06-02 11:40:15 +02:00
SubscriptionStarted.php feat(subscriptions): Cashier-backed subscription lifecycle with product link + events 2026-06-02 11:40:15 +02:00