-
Notifications
You must be signed in to change notification settings - Fork 19
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
Perk Fulfillment #491
Perk Fulfillment #491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About 40% through, issuing this review right now as I'm out of time for the day
Staging doesn't mirror production at all iirc
…On Wed, Nov 23, 2022, 13:27 Cassidy Symons ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In microsetta_private_api/db/patches/0108.sql
<#491 (comment)>
:
> +CREATE TYPE FULFILLMENT_SPACING_UNIT AS ENUM ('days', 'months');
+CREATE TABLE campaign.fundrazr_perk_fulfillment_details (
+ perk_id VARCHAR NOT NULL PRIMARY KEY,
+ ffq_quantity INTEGER NOT NULL,
+ kit_quantity INTEGER NOT NULL,
+ dak_article_code VARCHAR, -- Must be nullable, as not all perks include a kit
+ fulfillment_spacing_number INTEGER NOT NULL,
+ fulfillment_spacing_unit FULFILLMENT_SPACING_UNIT,
+ CONSTRAINT fk_perk_to_dak FOREIGN KEY (dak_article_code) REFERENCES barcodes.daklapack_article (dak_article_code)
+);
+
+-- The API will pull down perks automatically, but we need it to exist so we can add the fullfilment info,
+-- so we're just going to insert them here
+INSERT INTO campaign.fundrazr_perk
+ (id, remote_campaign_id, title, price)
+ VALUES ('3QeVd', '4Tqx5', 'Analyze Your Nutrition', 20),
So their production and staging systems have the same content/perks for
our campaigns, but those perks and campaigns are attached to different IDs?
—
Reply to this email directly, view it on GitHub
<#491 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADTZMSSYUTMQHWEIN37ZBLWJ2D47ANCNFSM6AAAAAASIULUJA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@wasade I believe I've either resolved or responded to each comment you left on Wednesday. If I resolved a comment, it means I have updated code ready to push up to address it. Would you prefer I push those updates before you resume the code review? Or do you want to finish looking through the code you haven't reviewed before I push updates? |
@cassidysymons, thanks for checking. I think push now, and I'll re-review -- what I've already gone through will be quick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to render the template emails. There are many instances where quote marks cancel out, and less important but tentatively problematic are the use of non-standard quote marks.
cur_date = datetime.now() | ||
if spacing_unit == "days": | ||
new_date = cur_date + relativedelta( | ||
days=+(spacing_number*multiplier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of the +
? It doesn't ensure the value is positive:
>>> +(-1)
-1
>>>
If that is the intention, I recommend abs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The + is following the recommended usage of the relative keyword arguments from the dateutil docs. That said, adding an abs() around the spacing_number variable is a good call to ensure all scheduling is in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So weird, it seems like it's a noop?
>>> +1
1
>>> +(-1)
-1
>>>
microsetta_private_api/templates/email/thank_you_with_kit.jinja2
Outdated
Show resolved
Hide resolved
microsetta_private_api/templates/email/thank_you_with_kit.jinja2
Outdated
Show resolved
Hide resolved
microsetta_private_api/templates/email/thank_you_with_kit.jinja2
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few what I think are small items and questions
No description provided.