-
Notifications
You must be signed in to change notification settings - Fork 0
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
Expeditions with campaigns #138
base: development
Are you sure you want to change the base?
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.
Awesome job!
*/ | ||
type: WeeklyFragmentsType; | ||
|
||
campaign_id: Types.ObjectId; |
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.
Can this also be camel case? :)
common = 'common', | ||
uncommon = 'uncommon', | ||
rare = 'rare', | ||
epic = 'epic', | ||
legendary = 'legendary', |
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.
enums should be all caps
address: string; | ||
lastVisit: Date; | ||
allVisits: number; | ||
campaign_id: Types.ObjectId; |
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.
Same here
|
||
export interface AddressWithId { | ||
address: string; | ||
campaign_id: Types.ObjectId; |
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.
Here too
required: true, | ||
default: 0, | ||
}, | ||
campaign_id: { |
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.
Here?
max: MAX_WEEKLY_CLAIM_FRAGMENT, | ||
min: 0, | ||
}, | ||
campaign_id: { |
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.
This
@@ -0,0 +1 @@ | |||
export const ADD_CAMPAIGN_MESSAGE = 'AddCampaign'; |
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.
constants?
validateSignature({ | ||
address, | ||
signature, | ||
message: ADD_CAMPAIGN_MESSAGE, | ||
}); |
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.
Nice implementation!
const newCampaign = await campaignsService.addCampaign({ | ||
address, | ||
endDate, | ||
startDate, | ||
redeemEndDate, | ||
}); | ||
|
||
return { | ||
startDate: newCampaign.startDate, | ||
endDate: newCampaign.endDate, | ||
redeemEndDate: newCampaign.redeemEndDate, | ||
initiatorAddress: newCampaign.initiatorAddress, | ||
}; |
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.
Destruct and return?
import { VisitModel } from '../../models/Visit.model'; | ||
|
||
export enum DailyFragmentsTypes { | ||
VISIT = 'DAILY_VISIT', |
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.
VISIT = 'DAILY_VISIT', | |
DAILY_VISIT = 'DAILY_VISIT', |
Key takeaways: