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

(PC-34162)[API] feat: credit v3 - create new deposit when v3 active #16105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cnormant-pass
Copy link
Contributor

But de la pull request

Ticket Jira (ou description si BSR) : https://passculture.atlassian.net/browse/PC-34162
Créer le nouveau type de deposit
Vide pour l'instant

Vérifications

  • J'ai écrit les tests nécessaires

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Visit the preview URL for this PR (updated for commit e2e2058):

https://pc-pro-testing--pr16105-pc-34162-vredit-v3-i-6vgv2u35.web.app

(expires Sat, 01 Feb 2025 10:05:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 032d233ee67e1c50d6af12e29c936c7076770eb1

@cnormant-pass cnormant-pass force-pushed the pc-34162-vredit-v3-init branch from f69eed9 to 938eeaa Compare January 30, 2025 09:10
Comment on lines +4367 to +4374
def test_create_deposit_age_18_even_when_ff_credit_v3_is_active(self):
user = users_factories.HonorStatementValidatedUserFactory(validatedBirthDate=datetime.date(2007, 1, 1))
assert user.age == 18

deposit = api.create_deposit(user, "created by test", users_models.EligibilityType.AGE18)

assert deposit.type == models.DepositType.GRANT_18
assert deposit.amount == 300
Copy link
Contributor

Choose a reason for hiding this comment

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

j'avais en tête de toujours créer des vieux deposits 18 pré décret et 17_18 post décret pour les majeurs

je pense que ça simplifiera le travail de la data et les investigations de bugs

scénario rare, mais si on découvre pour une raison x ou y qu'un jeune a 17 ans plutôt que 18, on n'aura pas à changer le type de deposit pour lui donner le recrédit 17

assert deposit.amount == 300

@time_machine.travel("2025-03-03")
def test_17yo_becomes_17_18_when_ff_credit_v3_is_active(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) la classe entière de test est sous FF activé, donc pas besoin de le repréciser dans le nom de test

return compute_underage_deposit_expiration_datetime(beneficiary.birth_date)

# deposit_type == DepositType.GRANT_18
expiration_date = datetime.datetime.utcnow().date() + relativedelta(years=conf.GRANT_18_VALIDITY_IN_YEARS)
Copy link
Contributor

Choose a reason for hiding this comment

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

on n'avait pas dit que les crédits 18 expirent aussi la veille des 21 ans ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants