Skip to content

Commit

Permalink
Add optional reminderCreatedAt
Browse files Browse the repository at this point in the history
  • Loading branch information
tompretty committed Feb 12, 2021
1 parent f1954d9 commit 4d5d7ee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/create-reminder-signup/lambda/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function isValidReminderPeriod(reminderPeriod: string): boolean {
export interface BaseSignupRequest {
email: Email;
country?: string;
reminderCreatedAt?: string;
reminderPlatform: ReminderPlatform;
reminderComponent: ReminderComponent;
reminderStage: ReminderStage;
Expand Down Expand Up @@ -106,7 +107,10 @@ export const oneOffSignupFromRequest = (
identity_id: identityId,
country: request.country,
reminder_period: toDate(request.reminderPeriod),
reminder_created_at: new Date().toISOString(),
reminder_created_at: (request.reminderCreatedAt
? new Date(request.reminderCreatedAt)
: new Date()
).toISOString(),
reminder_platform: request.reminderPlatform,
reminder_component: request.reminderComponent,
reminder_stage: request.reminderStage,
Expand All @@ -120,7 +124,10 @@ export const recurringSignupFromRequest = (
identity_id: identityId,
country: request.country,
reminder_frequency_months: request.reminderFrequencyMonths,
reminder_created_at: new Date().toISOString(),
reminder_created_at: (request.reminderCreatedAt
? new Date(request.reminderCreatedAt)
: new Date()
).toISOString(),
reminder_platform: request.reminderPlatform,
reminder_component: request.reminderComponent,
reminder_stage: request.reminderStage,
Expand Down

0 comments on commit 4d5d7ee

Please sign in to comment.