-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
41 additions
and
17 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
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 |
---|---|---|
|
@@ -56,13 +56,15 @@ import { | |
IBadgeGiftingDB, | ||
IContactSharingDB | ||
} from "../../database/queries/ticketActionDBs"; | ||
import { PCDHTTPError } from "../../routing/pcdHttpError"; | ||
import { ApplicationContext } from "../../types"; | ||
import { logger } from "../../util/logger"; | ||
import { DiscordService } from "../discordService"; | ||
import { EmailService } from "../emailService"; | ||
import { PagerDutyService } from "../pagerDutyService"; | ||
import { PersistentCacheService } from "../persistentCacheService"; | ||
import { InMemoryPipelineAtomDB } from "./InMemoryPipelineAtomDB"; | ||
import { PretixPipeline } from "./pipelines/PretixPipeline"; | ||
import { Pipeline, PipelineUser } from "./pipelines/types"; | ||
import { CredentialSubservice } from "./subservices/CredentialSubservice"; | ||
import { PipelineSubservice } from "./subservices/PipelineSubservice"; | ||
|
@@ -351,16 +353,30 @@ export class GenericIssuanceService { | |
email: string, | ||
orderCode: string | ||
): Promise<TicketPreviewResultValue> { | ||
const devconPipelineId = process.env.DEVCON_PIPELINE_ID; | ||
const devconPipeline = (await this.getAllPipelineInstances()).find( | ||
(p) => p.id === devconPipelineId && PretixPipeline.is(p) | ||
) as PretixPipeline | undefined; | ||
|
||
if (!devconPipeline) { | ||
throw new PCDHTTPError( | ||
400, | ||
"devcon pipeline not found " + devconPipelineId | ||
); | ||
} | ||
|
||
const tickets = await devconPipeline.getAllTickets(); | ||
|
||
const matchingTickets = tickets.atoms.filter( | ||
(atom) => atom.email === email && atom.orderCode === orderCode | ||
); | ||
|
||
const ticketDatas = matchingTickets.map((atom) => | ||
devconPipeline.atomToPODTicketData(atom, "1234") | ||
); | ||
|
||
return { | ||
tickets: [ | ||
{ | ||
name: "Test", | ||
email: "[email protected]", | ||
ticketSecret: "test", | ||
eventName: "Test Event", | ||
productName: "Test Product" | ||
} | ||
] | ||
tickets: ticketDatas | ||
} satisfies TicketPreviewResultValue; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./PODTicketPCD"; | ||
export * from "./PODTicketPCDPackage"; | ||
export * from "./schema"; |