-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rarimo/feature/referral-events
Feature: referral events
- Loading branch information
Showing
36 changed files
with
712 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.21-alpine as buildbase | ||
FROM golang:1.22-alpine as buildbase | ||
|
||
RUN apk add git build-base | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
allOf: | ||
- $ref: '#/components/schemas/CreateBalanceKey' | ||
- type: object | ||
x-go-is-request: true | ||
properties: | ||
attributes: | ||
type: object | ||
required: | ||
- referred_by | ||
properties: | ||
referred_by: | ||
type: string | ||
description: ID of the referrer from the link | ||
example: "rCx18MZ4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package evtypes | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type filter func(EventConfig) bool | ||
|
||
func FilterExpired(ev EventConfig) bool { | ||
return ev.ExpiresAt != nil && ev.ExpiresAt.Before(time.Now().UTC()) | ||
} | ||
|
||
func FilterInactive(ev EventConfig) bool { | ||
return ev.Disabled || FilterExpired(ev) | ||
} | ||
|
||
func FilterNotOpenable(ev EventConfig) bool { | ||
return FilterInactive(ev) || ev.NoAutoOpen | ||
} | ||
|
||
func FilterByFrequency(f Frequency) func(EventConfig) bool { | ||
return func(ev EventConfig) bool { | ||
return ev.Frequency != f | ||
} | ||
} | ||
|
||
func isFiltered(ev EventConfig, filters ...filter) bool { | ||
for _, f := range filters { | ||
if f(ev) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
Oops, something went wrong.