summaryrefslogtreecommitdiff
path: root/lib/solidus_subscriptions/testing_support
AgeCommit message (Collapse)Author
2021-02-26Load factories using the new standardAlberto Vena
2021-02-19Add currency to subscriptionluca-landa
2021-01-20Streamline and simplify `SolidusSubscriptions::Processor`Alessandro Desantis
The processor was way too complicated, taking on too many responsibilities. As a result, it was complex to reason about and it was a very brittle part of the extension. The new processor simply does two things: it finds all actionable subscriptions and ensures to take the appropriate action on them (e.g., cancel, deactivate), including creating the new installment for later. Then, it finds all the actionable installments (including the ones that were just created), and schedules them for asynchronous processing. One side effect of this refactoring is that installments are not grouped by address and payment method/source anymore: each installment will always correspond to a new order. Any logistics-related optimizations should be implemented by the individual store.
2020-09-25Fix coding style violationsAlessandro Desantis
2020-07-30Implement subscription event trackingAlessandro Desantis
2020-07-24Use parent strategy when building associations in factoriesAlessandro Desantis
This avoids surprising scenarios where we expect a `create` call to result in all records being persisted to the DB, while some associated records are still unsaved. This was especially problematic when building subscription line items, because the order is retrieved through a `has_one :through` association on the `Spree::LineItem` record. If the line item isn't saved, the order cannot be retrieved, resulting in unexpected errors.
2020-06-17Create :with_shipping_address and :with_billing_address traitsAlessandro Desantis
2019-01-25Change static factory attrs to dynamicfastjames
FactoryBot 5.0 will no longer support static factory attributes, so we need to update our factories in advance to silence the deprecation warnings.
2018-12-12Realign specs and solidus versionsfastjames
Update specs for newer versions of Solidus. This only required one version-specific code branch. I know 2.2 is still not EOL but we can reintroduce it to the matrix separately if people want that.
2018-07-31Update factory_girl to factory_botfastjames
2017-05-23Ensure user exists when setting CC#default=trueJohn Hawthorn
This is necessary to support the new wallet schema in Solidus 2.2
2017-02-03Add Subscription configuration valuesBrendan Deere
:end_date, :interval_length and :interval_units are stored on the subscription line items before the order is completed. Once the order is completed we want a canonical source for these values. These values will now be stored on the subscription itself, once it is created
2017-01-12Merge pull request #121 from brendandeere/change_dates_to_date_timesBrendan Deere
Change dates to date times
2017-01-12Subscription actionable_date is a DateTimeBrendan Deere
Migrate away from tracking this value as simply a date and track it as a date time. This gives us more granularity to work with
2017-01-12Use subscription address for consolidated intallmentBrendan Deere
Try to send the consolidated installment order to the address associated to the subscription and gracefully fallback to then the user
2017-01-09Subs have many subs line itemsBrendan Deere
We are going to support multiple items per subscription. This commit changes the subscription -> subscription_line_item relationship from a has_one to a has_many. Most of the changes here are simply pluralization changes. Somethat are not: Api params now take: `line_items_attributes instead` of `line_item_attributes` for nested params to a subscription `subscription_line_items_attributes` instead of `subscription_line_item_attributes` Only the interval of the first subscription_line_item is considered
2017-01-06Remove root order referencesBrendan Deere
The subscription must always have an associated user. use the ship address and last default credit cards from the users. And not from the root order which is deprecated
2017-01-06Add user trait to include addressesBrendan Deere
This included in solidus in > v1.1. but for compatibility (and it will likely become more useful as the requirements for a user associated to a subscription grow) I am adding a special trait to the user factory
2017-01-06Subscriptions belong to a storeBrendan Deere
Given that not all subscriptions will have a root order (example: a subscription created by an admin in the admin interface) We should be tracking which store a subscription belongs to on the subscription itself
2016-10-19Installments no longer track their order directlyBrendan Deere
An order is generated with every attept to fulfill the installment. Each installment detail now has its own order
2016-10-05Merge pull request #80 from brendandeere/config_minimum_cancellation_noticeBrendan Deere
Config minimum cancellation notice
2016-10-04Set the Completed at time for fulfilled installmentsBrendan Deere
the completed_order_with_totals factory doesnt set the completed_at time
2016-10-04Processor cancels subsBrendan Deere
If the processor processed a subscription in the pending_cancellation state, it cancels the subscription after creating one last installment for it
2016-09-28Merge pull request #47 from brendandeere/rake_task_and_jobBrendan Deere
Rake task and job
2016-09-28Change interval enum units to singularAlex Blackie
This makes it easier for people on the frontend to pluralize, instead of conditionally singularizing. Since this is an enum, this change makes virtually no difference to us.
2016-09-23Add some improved factoriesBrendan Deere
Add some traits for the different installment and subscriptions states Subscriptions now initialize with user that owns a credit card
2016-09-22Refactor interval to be stored more genericallyAlex Blackie
Forcing consumers of the API to calculate and provide the interval in seconds is messy and unnecessary. Instead, we can store the interval as length and units, and do the math ourselves. This makes the API much easier to use and understand.
2016-09-22Move factories to testing supportBrendan Deere
So that parent applications can use them