Commit Graph

83 Commits

Author SHA1 Message Date
Fabian @ Blax Software 0cfbdf221d BF edgecases, R structure, A tests 2026-05-18 13:05:38 +02:00
Fabian @ Blax Software 1ed301b759 R loan purchase to physical loan, A physical loan stuff 2026-05-17 15:20:58 +02:00
Fabian @ Blax Software da6d89f668 BFI commands, A test 2026-05-17 14:09:03 +02:00
Fabian @ Blax Software 2bc64c6369 BF stocks, A test 2026-05-17 13:57:20 +02:00
Fabian @ Blax Software 99fd71f4ae BF commands, A command tests, I traits
- Implement CommandReinstallTest to verify the behavior of the shop:reinstall command, including force and fresh flags, and confirmation prompts.
- Create CommandReleaseExpiredStocksTest to test the shop:release-expired-stocks command, ensuring it correctly releases expired stock claims based on configuration.
- Add CommandStatsTest to validate the shop:stats command, checking counts and revenue calculations for products, purchases, carts, and orders.
- Introduce LoanShopCommandsTest to cover loanable products in stock management, ensuring accurate reporting of assigned, used, and available stock.
- Implement LoanStockEventsTest to verify that stock events are dispatched correctly during loan operations, including checkouts and returns.
- Add NextAvailableAtTest to ensure the nextAvailableAt method behaves correctly for loanable products, considering loans and claims.
2026-05-17 13:25:34 +02:00
Fabian @ Blax Software f55c7e11df A events, IA commands
- Introduced events for stock management including StockBecameLow, StockClaimed, StockClaimExpired, StockDecreased, StockDepleted, StockIncreased, StockReleased, StockReplenished, StockFullyAvailable, and StockFullyAvailable.
- Added events for Stripe payment processing: StripePaymentFailed, StripePaymentSucceeded, StripePriceSynced, StripeProductSynced, StripeRefundProcessed, and StripeWebhookReceived.
- Created tests for command availability, listing, stocks, and event dispatching to ensure proper functionality and integration.
2026-05-17 11:24:43 +02:00
Fabian @ Blax Software 8eb1802ef8 feat: promote IsLoanableProduct to MayBeLoanableProduct on Product
Renames the host-attached IsLoanableProduct trait to MayBeLoanableProduct
and mixes it directly into Product, matching the existing MayBePoolProduct
shape. Hosts opt in with a single DEFAULT_TYPE constant — no more manual
`use ...Trait` ceremony to forget:

    class Book extends Product
    {
        public const DEFAULT_TYPE = ProductType::LOANABLE;
    }

The boot hook reads DEFAULT_TYPE on the concrete class and only applies
the LOANABLE creating-defaults (type, status, is_visible, manage_stock)
when it matches; type-specific helpers (checkOutTo, total_quantity,
available_quantity) early-out via isLoanable() so they're harmless on
non-loanable products. checkOutTo now throws NotLoanableProductException
when called on the wrong type, mirroring NotPoolProductException.

Also fixes total_quantity for the loan lifecycle: previously summed every
INCREASE entry in product_stocks, which inflated the displayed total
after each loan cycle because returns fire increaseStock(). Now reports
physical inventory as availableStock + activeLoans.

README gains a Testing section that surfaces the current phpunit summary
line, plus passing and assertion-count badges linking to it.
2026-05-16 12:17:38 +02:00
Fabian @ Blax Software afdcd8bc75 feat: Enhance traits with strict types and improve method signatures
- Added strict types declaration to multiple traits for better type safety.
- Updated method signatures in traits to use nullable types where applicable.
- Improved documentation for traits, including host-model contracts and method descriptions.
- Added new tests to ensure correct behavior of loan checkout and stock management.
- Fixed regression in order number generation to ensure proper string formatting.
- Ensured that currency codes sent to Stripe are consistently lowercased.
2026-05-15 20:26:24 +02:00
Fabian @ Blax Software fe41475c84 I loanable product type, tiered pricing, lifecycle events, host helpers 2026-05-15 10:27:59 +02:00
Fabian @ Blax Software a66fd7ccb8 BFI cart / orders 2026-01-05 10:30:21 +01:00
Fabian @ Blax Software cbb4b84948 BF cart/pool/booking 2026-01-05 09:07:09 +01:00
Fabian @ Blax Software c0ae7c4927 BF pool cart bug, R structure 2025-12-30 10:56:03 +01:00
Fabian @ Blax Software 2ea8273c29 BF pool cart bug, R structure 2025-12-30 10:55:06 +01:00
Fabian @ Blax Software 136b7ade63 A prompts, I docs/readme, BF orders, R tests locations 2025-12-30 09:29:43 +01:00
Fabian @ Blax Software 9c1fcd6cfd AM orders 2025-12-29 09:59:02 +01:00
Fabian @ Blax Software 1486424229 BF checkout session test 2025-12-29 08:26:09 +01:00
Fabian @ Blax Software 2f3c0dc61f IA stock attributes 2025-12-28 12:05:05 +01:00
Fabian @ Blax Software 7cd11728b1 BFRI cart 2025-12-28 11:12:58 +01:00
Fabian @ Blax Software 6beecf597c BF has_more, I hasprices->fromPrice 2025-12-28 10:48:22 +01:00
Fabian @ Blax Software 37b3e6bdc0 A cart->calendarAvailability, product->has_more 2025-12-28 10:29:23 +01:00
a6a2f5842 fc3ae3e756 A pool availabilities 2025-12-26 16:45:30 +01:00
a6a2f5842 5ac0229555 A stock methods calendarAvailability & dayAvailability 2025-12-26 16:10:40 +01:00
a6a2f5842 38e841a986 I test 2025-12-26 08:46:14 +01:00
a6a2f5842 70adf0b0c6 BFI cart availability 2025-12-26 08:42:59 +01:00
a6a2f5842 9e7812c70e BFI cart single item 2025-12-24 19:40:10 +01:00
Fabian @ Blax Software 816e8661e2 BF cart items 2025-12-20 15:08:08 +01:00
Fabian @ Blax Software 1398fd0c27 BF cart items 2025-12-20 12:43:28 +01:00
Fabian @ Blax Software 0e6b420297 BFI pool cart 2025-12-20 12:19:34 +01:00
Fabian @ Blax Software 20e6538626 BFI pool cart 2025-12-20 11:22:04 +01:00
Fabian @ Blax Software 145c629786 BFI cart stock, A exceptions 2025-12-19 14:26:57 +01:00
Fabian @ Blax Software 317b28af8a BFIM pool cart checkout, stocks/productpurchase 2025-12-19 13:32:00 +01:00
Fabian @ Blax Software d13ac99725 BF pool cart 2025-12-19 12:47:55 +01:00
Fabian @ Blax Software dbc297122e BF pool cart 2025-12-19 12:25:59 +01:00
Fabian @ Blax Software f20637770f I pool cart support, tests 2025-12-19 10:57:26 +01:00
Fabian @ Blax Software 06b45cc9b3 I cart set dates, A test 2025-12-19 10:08:24 +01:00
Fabian @ Blax Software f6c60f3d79 BFI cart conversion product purchase, R cart dates 2025-12-19 09:53:44 +01:00
Fabian @ Blax Software c5b78071e7 IA booking checking & simplifications, A test/trait 2025-12-18 16:54:33 +01:00
Fabian @ Blax Software 2303b9f703 BF decimals, I test consitency 2025-12-18 10:54:42 +01:00
Fabian @ Blax Software a12738db1c BF race condition 2025-12-18 09:57:33 +01:00
Fabian @ Blax Software c43910b927 I checkout session, pool cart price_id 2025-12-17 18:33:34 +01:00
Fabian @ Blax Software abbfbd3649 CAI per minute booking pricing 2025-12-17 17:57:17 +01:00
Fabian @ Blax Software 3d7a273946 BFI cart & tests 2025-12-17 16:43:22 +01:00
Fabian @ Blax Software 9d07523d78 I vendor publish, example products 2025-12-17 13:04:58 +01:00
Fabian @ Blax Software 7360391581 BF pool priority claiming, IA date cast 2025-12-17 12:47:18 +01:00
Fabian @ Blax Software 1b2559b824 RI cartitems, A exceptions, tests 2025-12-17 12:26:26 +01:00
Fabian @ Blax Software 2f0d0757ee BF cart item pool calculation 2025-12-17 10:41:52 +01:00
Fabian @ Blax Software 620c0824de BFR removed test which expects throw 2025-12-17 09:27:48 +01:00
Fabian @ Blax Software 7478f69bcf I cart facade 2025-12-17 09:24:42 +01:00
Fabian @ Blax Software 0e776b6d84 BFM customer uuid morph, RD example product test 2025-12-17 08:29:20 +01:00
Fabian @ Blax Software edbf116c48 AIBFR pool/booking/cart 2025-12-16 13:58:03 +01:00