Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][REF/ADD] Create membership_type, membership_custom_date #161

Closed
wants to merge 3 commits into from

Conversation

carmenbianca
Copy link
Member

@carmenbianca carmenbianca commented Nov 20, 2023

membership_custom_date is a custom module used by Akretion/UGESS. It used to depend directly on membership_variable_period, which functionally made no sense, but was necessary because we re-used the membership_type field on product.template.

I've factored out that field into membership_type and made both membership_variable_period and membership_custom_date depend on that new module.

(Almost) no history was lost for membership_custom_date in copying the module over. 99% of the code was already in a single commit.

@carmenbianca carmenbianca force-pushed the 16.0-membership_type branch 2 times, most recently from 8778c5b to 6ea6037 Compare November 24, 2023 09:02
@carmenbianca carmenbianca changed the title [16.0][REF] Create membership_type [16.0][REF/ADD] Create membership_type, membership_custom_date Nov 24, 2023
@carmenbianca carmenbianca force-pushed the 16.0-membership_type branch 5 times, most recently from 3078281 to f760603 Compare November 24, 2023 13:52
@carmenbianca carmenbianca marked this pull request as ready for review November 24, 2023 13:54
Copy link

@nayatec nayatec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A part from the comment i made, LGTM

Make membership_variable_period depend on it. This allows future modules
that also use the membership_type field.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
This module is needed for memberships that have a custom date range for
every individual.

The normal workflow when clicking on 'Buy Membership' does not involve
specifying the start and end dates. Rather, those dates are calculated
from the membership product. This calculation happens _after_ clicking
on 'Invoice Membership' in the wizard UI.

If we want to include the dates in the wizard UI, we disrupt this
workflow, and override the default behaviour of using the dates
configured in the membership product.

We circumvent this by only breaking the workflow for membership products
of type 'custom', which would be expected. We keep the workflow for
other types.

An alternative method is to calculate the dates from the product
selected in the wizard (onchange), but this is UX-wise incompatible with
the a downstream (non-OCA) requirement that the dates be changed to the
dates specified on another model (also onchange). So depending on which
field you changed last (product or other model); that's the dates you
get. This is strange and unexpected behaviour.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
…from and date_to on membership line

This was a bit tricky to get right, architecturally, but I think I
arrived at the correct design decision. On the whole, the new
restriction makes sense. Following from the fact that dates are
mandatory on 'fixed dates' (read: default) membership products, and
following from the fact that dates are always set on the membership
lines of 'variable period' membership products, membership lines should
_always_ have values for date_from and date_to. The fact that these
fields are not already required is a strange design decision.

The constraint in membership_extension _effectively_ sets required=True
on these fields.

However, there is a use-case for memberships that do not have an end
date (using the 'custom' membership product). For those scenarios, we
add a toggle on the product (exclusive to 'custom' products) on whether
to apply the constraint.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Copy link

github-actions bot commented Jun 2, 2024

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 2, 2024
@github-actions github-actions bot closed this Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants