Skip to content

Commit 0cafad2

Browse files
committed
Allow to set sales channel for ticket layout
1 parent 3e58a93 commit 0cafad2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

libpretixsync/src/main/java/eu/pretix/libpretixsync/sync/SyncManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public enum Profile {
5555
protected String software_brand;
5656
protected String software_version;
5757
protected String rsa_pubkey;
58+
protected String salesChannel;
5859
protected CheckConnectivityFeedback connectivityFeedback;
5960

6061
public class CanceledState {
@@ -112,6 +113,7 @@ public SyncManager(
112113
String software_brand,
113114
String software_version,
114115
String rsa_pubkey,
116+
String salesChannel,
115117
CheckConnectivityFeedback connectivityFeedback
116118
) {
117119
this.configStore = configStore;
@@ -133,6 +135,7 @@ public SyncManager(
133135
this.software_brand = software_brand;
134136
this.software_version = software_version;
135137
this.rsa_pubkey = rsa_pubkey;
138+
this.salesChannel = salesChannel;
136139
this.connectivityFeedback = connectivityFeedback;
137140
}
138141

@@ -426,7 +429,7 @@ protected void downloadData(ProgressFeedback feedback, Boolean skip_orders, Stri
426429
if (profile == Profile.PRETIXPOS) {
427430
download(new QuotaSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), feedback, subEvent));
428431
download(new TaxRuleSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), feedback));
429-
download(new TicketLayoutSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), feedback));
432+
download(new TicketLayoutSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), salesChannel, feedback));
430433
}
431434
download(new BadgeLayoutSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), feedback));
432435
download(new BadgeLayoutItemSyncAdapter(dataStore, fileStorage, eventSlug, api, configStore.getSyncCycleId(), feedback));

libpretixsync/src/main/java/eu/pretix/libpretixsync/sync/TicketLayoutSyncAdapter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
import io.requery.util.CloseableIterator;
2222

2323
public class TicketLayoutSyncAdapter extends BaseDownloadSyncAdapter<TicketLayout, Long> {
24+
String salesChannel = "pretixpos";
2425

25-
public TicketLayoutSyncAdapter(BlockingEntityStore<Persistable> store, FileStorage fileStorage, String eventSlug, PretixApi api, String syncCycleId, SyncManager.ProgressFeedback feedback) {
26+
public TicketLayoutSyncAdapter(BlockingEntityStore<Persistable> store, FileStorage fileStorage, String eventSlug, PretixApi api, String syncCycleId, String salesChannel, SyncManager.ProgressFeedback feedback) {
2627
super(store, fileStorage, eventSlug, api, syncCycleId, feedback);
28+
this.salesChannel = salesChannel;
2729
}
2830

2931
@Override
@@ -57,7 +59,7 @@ public void updateObject(TicketLayout obj, JSONObject jsonobj) throws JSONExcept
5759
itemobj.setTicket_layout_id(obj.getServer_id());
5860
store.update(itemobj, Item.TICKET_LAYOUT_ID);
5961
}
60-
} else if (sc.equals("pretixpos")) {
62+
} else if (sc.equals(salesChannel)) {
6163
itemids_pretixpos.add(item);
6264

6365
Item itemobj = store.select(Item.class).where(

0 commit comments

Comments
 (0)