-
Notifications
You must be signed in to change notification settings - Fork 6
Add exchanging tickets to reusable media #78
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
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3cd69c8
Add support for already exchanged ticket error
robbi5 97c5222
Add server side identfier to MediaPolicy enum
robbi5 8a9e4d3
Return checkin type EXCHANGE_REQUIRED for server responding with stat…
robbi5 3d1fdc3
Rename .java to .kt
robbi5 795cedd
Enable lookup of MediaPolicy and ResuableMediaType by server side id…
robbi5 728cefb
Add API calls for loading and linking resuable media
robbi5 16973fe
Handle exchange required in AsyncCheckProvider too, gate already_exch…
robbi5 1c58073
Add support for reusable media exchange to checkinrpc
robbi5 9b3be03
Add media exchange parameters to FakePretixApi too
robbi5 f049a27
Use exchange_ prefix and singular for api properties
robbi5 01ada72
Add new error types for reusable medium exchange
robbi5 d978e9f
Fix ambiguous null ReusableMediaType
robbi5 a7f59fe
Remove exchange_link_action, server knows best
robbi5 d5a6723
Add MediaPolicy.APPEND and MediaPolicy.APPEND_OR_NEW
robbi5 71815c9
Don't try to support media exchange while offline
robbi5 302482b
Remove loadMedium and linkMedium from API again
robbi5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
19 changes: 13 additions & 6 deletions
19
libpretixsync/src/main/java/eu/pretix/libpretixsync/db/MediaPolicy.kt
This file contains hidden or 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,8 +1,15 @@ | ||
| package eu.pretix.libpretixsync.db | ||
|
|
||
| enum class MediaPolicy { | ||
| NONE, | ||
| REUSE, | ||
| NEW, | ||
| REUSE_OR_NEW, | ||
| } | ||
| enum class MediaPolicy(val serverName: String?) { | ||
| NONE(null), | ||
| NEW("new"), | ||
| REUSE("reuse"), | ||
| REUSE_OR_NEW("reuse_or_new"), | ||
| APPEND("append"), | ||
| APPEND_OR_NEW("append_or_new"); | ||
|
|
||
| companion object { | ||
| private val map = entries.associateBy(MediaPolicy::serverName) | ||
| fun getByServerName(serverName: String?) = map[serverName] | ||
| } | ||
| } |
20 changes: 0 additions & 20 deletions
20
libpretixsync/src/main/java/eu/pretix/libpretixsync/db/ReusableMediaType.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
libpretixsync/src/main/java/eu/pretix/libpretixsync/db/ReusableMediaType.kt
This file contains hidden or 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,19 @@ | ||
| package eu.pretix.libpretixsync.db | ||
|
|
||
| enum class ReusableMediaType(val serverName: String?) { | ||
| NONE(null), | ||
| BARCODE("barcode"), | ||
| NFC_UID("nfc_uid"), | ||
|
|
||
| NFC_MF0AES("nfc_mf0aes"), | ||
| UNSUPPORTED("unsupported"); | ||
|
|
||
| fun isNfcBased(): Boolean { | ||
| return this.serverName?.startsWith("nfc_") ?: false; | ||
| } | ||
|
|
||
| companion object { | ||
| private val map = ReusableMediaType.entries.associateBy(ReusableMediaType::serverName) | ||
| fun getByServerName(serverName: String?) = map[serverName] | ||
|
robbi5 marked this conversation as resolved.
|
||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we translate that in the ui? → pretixSCAN