feat(enums): add SUBSCRIPTION product type
Real consumer data has products typed 'subscription' (a service sold on a recurring basis) alongside 'service'/'simple'. Add ProductType::SUBSCRIPTION so a host whose catalogue uses that value can cast products through the enum without a value clash. No stock semantics (like SERVICE).
This commit is contained in:
parent
db827bbb8c
commit
02fd5640b4
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
[](https://github.com/blax-software/laravel-shop/actions/workflows/tests.yml)
|
||||
[](#testing)
|
||||
[](#testing)
|
||||
[](#testing)
|
||||
[](https://packagist.org/packages/blax-software/laravel-shop)
|
||||
[](https://packagist.org/packages/blax-software/laravel-shop)
|
||||
[](https://packagist.org/packages/blax-software/laravel-shop)
|
||||
|
|
@ -192,7 +192,7 @@ booking, Stripe sync and the event surface — so host applications can lean
|
|||
on the behaviour with confidence.
|
||||
|
||||
```
|
||||
Tests: 1409, Assertions: 3773
|
||||
Tests: 1409, Assertions: 3774
|
||||
```
|
||||
|
||||
CI runs the full suite on every push (see the badge above). To run it
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@ enum ProductType: string
|
|||
* from services apart.
|
||||
*/
|
||||
case SERVICE = 'service';
|
||||
/**
|
||||
* Subscription: a service sold on a recurring basis (the actual cadence
|
||||
* lives on the {@see \Blax\Shop\Models\ProductPrice} as a recurring price).
|
||||
* Like SERVICE it carries no physical stock; the distinct type lets hosts
|
||||
* model "this product is fundamentally a subscription" for catalogue and
|
||||
* reporting.
|
||||
*/
|
||||
case SUBSCRIPTION = 'subscription';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
|
|
@ -39,6 +47,7 @@ enum ProductType: string
|
|||
self::POOL => 'Pool',
|
||||
self::LOANABLE => 'Loanable',
|
||||
self::SERVICE => 'Service',
|
||||
self::SUBSCRIPTION => 'Subscription',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue