Skip to content
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

Add order purchase callback #37

Merged
merged 7 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/api/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-
* Therefore it is highly recommended to use the babel or swc plugin for production.
*/
const documents = {
"query FetchExampleEvents {\n events {\n id\n description\n community {\n id\n name\n }\n tags {\n id\n name\n description\n }\n }\n}":
types.FetchExampleEventsDocument,
"query myTickets($input: PaginatedInputMyTicketsSearchValues!) {\n myTickets(input: $input) {\n data {\n approvalStatus\n id\n paymentStatus\n redemptionStatus\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}":
types.MyTicketsDocument,
"mutation CheckPurchaseOrderStatus($input: CheckForPurchaseOrderInput!) {\n checkPurchaseOrderStatus(input: $input) {\n status\n tickets {\n approvalStatus\n paymentStatus\n redemptionStatus\n }\n }\n}":
types.CheckPurchaseOrderStatusDocument,
"mutation createPurchaseOrder($input: TicketClaimInput!) {\n claimUserTicket(input: $input) {\n __typename\n ... on PurchaseOrder {\n __typename\n id\n currency {\n id\n }\n finalPrice\n paymentLink\n status\n tickets {\n id\n approvalStatus\n redemptionStatus\n paymentStatus\n }\n }\n ... on RedeemUserTicketError {\n __typename\n error\n errorMessage\n }\n }\n}":
types.CreatePurchaseOrderDocument,
"fragment EventTicketFragment on Ticket {\n id\n name\n description\n quantity\n isFree\n startDateTime\n status\n isUnlimited\n prices {\n id\n amount\n currency {\n currency\n id\n }\n }\n}":
Expand All @@ -43,14 +43,14 @@ export function graphql(source: string): unknown;
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "query FetchExampleEvents {\n events {\n id\n description\n community {\n id\n name\n }\n tags {\n id\n name\n description\n }\n }\n}",
): (typeof documents)["query FetchExampleEvents {\n events {\n id\n description\n community {\n id\n name\n }\n tags {\n id\n name\n description\n }\n }\n}"];
source: "query myTickets($input: PaginatedInputMyTicketsSearchValues!) {\n myTickets(input: $input) {\n data {\n approvalStatus\n id\n paymentStatus\n redemptionStatus\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}",
): (typeof documents)["query myTickets($input: PaginatedInputMyTicketsSearchValues!) {\n myTickets(input: $input) {\n data {\n approvalStatus\n id\n paymentStatus\n redemptionStatus\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "query myTickets($input: PaginatedInputMyTicketsSearchValues!) {\n myTickets(input: $input) {\n data {\n approvalStatus\n id\n paymentStatus\n redemptionStatus\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}",
): (typeof documents)["query myTickets($input: PaginatedInputMyTicketsSearchValues!) {\n myTickets(input: $input) {\n data {\n approvalStatus\n id\n paymentStatus\n redemptionStatus\n }\n pagination {\n currentPage\n pageSize\n totalPages\n totalRecords\n }\n }\n}"];
source: "mutation CheckPurchaseOrderStatus($input: CheckForPurchaseOrderInput!) {\n checkPurchaseOrderStatus(input: $input) {\n status\n tickets {\n approvalStatus\n paymentStatus\n redemptionStatus\n }\n }\n}",
): (typeof documents)["mutation CheckPurchaseOrderStatus($input: CheckForPurchaseOrderInput!) {\n checkPurchaseOrderStatus(input: $input) {\n status\n tickets {\n approvalStatus\n paymentStatus\n redemptionStatus\n }\n }\n}"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
178 changes: 106 additions & 72 deletions app/api/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export type EventsSearchInput = {
startDateTimeFrom: InputMaybe<Scalars["DateTime"]["input"]>;
startDateTimeTo: InputMaybe<Scalars["DateTime"]["input"]>;
status: InputMaybe<EventStatus>;
userHasTickets: InputMaybe<Scalars["Boolean"]["input"]>;
visibility: InputMaybe<EventVisibility>;
};

Expand Down Expand Up @@ -382,6 +383,17 @@ export type MyTicketsSearchValues = {
redemptionStatus: InputMaybe<TicketRedemptionStatus>;
};

/** Type used for querying the paginated leaves and it's paginated meta data */
export type PaginatedEvent = {
data: Array<Event>;
pagination: Pagination;
};

export type PaginatedInputEventsSearchInput = {
pagination: PaginationSearchInputParams;
search: InputMaybe<EventsSearchInput>;
};

export type PaginatedInputMyTicketsSearchValues = {
pagination: PaginationSearchInputParams;
search: InputMaybe<MyTicketsSearchValues>;
Expand Down Expand Up @@ -469,8 +481,6 @@ export type Query = {
event: Maybe<Event>;
/** Get a list of images, that are attached to an event */
eventImages: Array<SanityAssetRef>;
/** Get a list of events. Filter by name, id, status or date */
events: Array<Event>;
/** Get the current user */
me: User;
/** Get a list of tickets for the current user */
Expand All @@ -479,6 +489,8 @@ export type Query = {
salaries: Array<Salary>;
/** Search a consolidated payment logs, by date, aggregated by platform and currency_id */
searchConsolidatedPaymentLogs: Array<ConsolidatedPaymentLogEntry>;
/** Get a list of events. Filter by name, id, status or date */
searchEvents: PaginatedEvent;
/** Search on the payment logs by date, and returns a list of payment logs */
searchPaymentLogs: Array<PublicFinanceEntryRef>;
status: Scalars["String"]["output"];
Expand Down Expand Up @@ -524,10 +536,6 @@ export type QueryEventImagesArgs = {
input: EventImageSearch;
};

export type QueryEventsArgs = {
input: InputMaybe<EventsSearchInput>;
};

export type QueryMyTicketsArgs = {
input: PaginatedInputMyTicketsSearchValues;
};
Expand All @@ -536,6 +544,10 @@ export type QuerySearchConsolidatedPaymentLogsArgs = {
input: SearchPaymentLogsInput;
};

export type QuerySearchEventsArgs = {
input: PaginatedInputEventsSearchInput;
};

export type QuerySearchPaymentLogsArgs = {
input: SearchPaymentLogsInput;
};
Expand Down Expand Up @@ -761,7 +773,9 @@ export type UpdateSalaryInput = {
export type User = {
bio: Maybe<Scalars["String"]["output"]>;
communities: Array<Community>;
email: Maybe<Scalars["String"]["output"]>;
id: Scalars["String"]["output"];
imageUrl: Maybe<Scalars["String"]["output"]>;
isSuperAdmin: Maybe<Scalars["Boolean"]["output"]>;
lastName: Maybe<Scalars["String"]["output"]>;
name: Maybe<Scalars["String"]["output"]>;
Expand Down Expand Up @@ -842,21 +856,6 @@ export type UserSearchInput = {
tags: InputMaybe<Array<SearchableUserTags>>;
};

export type FetchExampleEventsQueryVariables = Exact<{ [key: string]: never }>;

export type FetchExampleEventsQuery = {
events: Array<{
id: string;
description: string | null;
community: { id: string; name: string | null } | null;
tags: Array<{
id: string;
name: string | null;
description: string | null;
}>;
}>;
};

export type MyTicketsQueryVariables = Exact<{
input: PaginatedInputMyTicketsSearchValues;
}>;
Expand All @@ -878,6 +877,21 @@ export type MyTicketsQuery = {
};
};

export type CheckPurchaseOrderStatusMutationVariables = Exact<{
input: CheckForPurchaseOrderInput;
}>;

export type CheckPurchaseOrderStatusMutation = {
checkPurchaseOrderStatus: {
status: PurchaseOrderStatusEnum | null;
tickets: Array<{
approvalStatus: TicketApprovalStatus;
paymentStatus: TicketPaymentStatus;
redemptionStatus: TicketRedemptionStatus;
}>;
};
};

export type CreatePurchaseOrderMutationVariables = Exact<{
input: TicketClaimInput;
}>;
Expand Down Expand Up @@ -996,46 +1010,94 @@ export const EventTicketFragmentFragmentDoc = {
},
],
} as unknown as DocumentNode<EventTicketFragmentFragment, unknown>;
export const FetchExampleEventsDocument = {
export const MyTicketsDocument = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "FetchExampleEvents" },
name: { kind: "Name", value: "myTickets" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: {
kind: "Variable",
name: { kind: "Name", value: "input" },
},
type: {
kind: "NonNullType",
type: {
kind: "NamedType",
name: {
kind: "Name",
value: "PaginatedInputMyTicketsSearchValues",
},
},
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "events" },
name: { kind: "Name", value: "myTickets" },
arguments: [
{
kind: "Argument",
name: { kind: "Name", value: "input" },
value: {
kind: "Variable",
name: { kind: "Name", value: "input" },
},
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "description" } },
{
kind: "Field",
name: { kind: "Name", value: "community" },
name: { kind: "Name", value: "data" },
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "approvalStatus" },
},
{ kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "name" } },
{
kind: "Field",
name: { kind: "Name", value: "paymentStatus" },
},
{
kind: "Field",
name: { kind: "Name", value: "redemptionStatus" },
},
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "tags" },
name: { kind: "Name", value: "pagination" },
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "id" } },
{ kind: "Field", name: { kind: "Name", value: "name" } },
{
kind: "Field",
name: { kind: "Name", value: "description" },
name: { kind: "Name", value: "currentPage" },
},
{
kind: "Field",
name: { kind: "Name", value: "pageSize" },
},
{
kind: "Field",
name: { kind: "Name", value: "totalPages" },
},
{
kind: "Field",
name: { kind: "Name", value: "totalRecords" },
},
],
},
Expand All @@ -1047,17 +1109,14 @@ export const FetchExampleEventsDocument = {
},
},
],
} as unknown as DocumentNode<
FetchExampleEventsQuery,
FetchExampleEventsQueryVariables
>;
export const MyTicketsDocument = {
} as unknown as DocumentNode<MyTicketsQuery, MyTicketsQueryVariables>;
export const CheckPurchaseOrderStatusDocument = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "myTickets" },
operation: "mutation",
name: { kind: "Name", value: "CheckPurchaseOrderStatus" },
variableDefinitions: [
{
kind: "VariableDefinition",
Expand All @@ -1069,10 +1128,7 @@ export const MyTicketsDocument = {
kind: "NonNullType",
type: {
kind: "NamedType",
name: {
kind: "Name",
value: "PaginatedInputMyTicketsSearchValues",
},
name: { kind: "Name", value: "CheckForPurchaseOrderInput" },
},
},
},
Expand All @@ -1082,7 +1138,7 @@ export const MyTicketsDocument = {
selections: [
{
kind: "Field",
name: { kind: "Name", value: "myTickets" },
name: { kind: "Name", value: "checkPurchaseOrderStatus" },
arguments: [
{
kind: "Argument",
Expand All @@ -1096,17 +1152,17 @@ export const MyTicketsDocument = {
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "status" } },
{
kind: "Field",
name: { kind: "Name", value: "data" },
name: { kind: "Name", value: "tickets" },
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "approvalStatus" },
},
{ kind: "Field", name: { kind: "Name", value: "id" } },
{
kind: "Field",
name: { kind: "Name", value: "paymentStatus" },
Expand All @@ -1118,39 +1174,17 @@ export const MyTicketsDocument = {
],
},
},
{
kind: "Field",
name: { kind: "Name", value: "pagination" },
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "currentPage" },
},
{
kind: "Field",
name: { kind: "Name", value: "pageSize" },
},
{
kind: "Field",
name: { kind: "Name", value: "totalPages" },
},
{
kind: "Field",
name: { kind: "Name", value: "totalRecords" },
},
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<MyTicketsQuery, MyTicketsQueryVariables>;
} as unknown as DocumentNode<
CheckPurchaseOrderStatusMutation,
CheckPurchaseOrderStatusMutationVariables
>;
export const CreatePurchaseOrderDocument = {
kind: "Document",
definitions: [
Expand Down
Loading
Loading