From 9a1f3108ab7eba0ddf21b0b0ab739135725a4d92 Mon Sep 17 00:00:00 2001 From: felipe torres Date: Tue, 2 Jul 2024 17:36:16 -0700 Subject: [PATCH] Revert "Adding event to ticket" This reverts commit b0fcb84a1f88e7e029e5033084dded1f5626a8b4. --- app/api/gql/graphql.ts | 201 +++++++++--------- app/api/gql/schema.gql | 1 - app/components/MyTickets/MyTickets.tsx | 11 - app/components/MyTickets/MyTicketsList.tsx | 28 --- .../MyTickets/graphql/myTickets.gql | 14 -- app/routes/_authenticated/tickets/index.tsx | 6 +- codegen.ts | 7 +- 7 files changed, 102 insertions(+), 166 deletions(-) delete mode 100644 app/components/MyTickets/MyTickets.tsx delete mode 100644 app/components/MyTickets/MyTicketsList.tsx diff --git a/app/api/gql/graphql.ts b/app/api/gql/graphql.ts index 70162ab..e9fbae5 100644 --- a/app/api/gql/graphql.ts +++ b/app/api/gql/graphql.ts @@ -100,13 +100,13 @@ export type CreateCommunityInput = { }; export type CreateCompanyInput = { - description?: InputMaybe; + description: InputMaybe; /** The email domain of the company (What we'll use to match the company to the user on account-creation) */ domain: Scalars["String"]["input"]; - logo?: InputMaybe; - name?: InputMaybe; - status?: InputMaybe; - website?: InputMaybe; + logo: InputMaybe; + name: InputMaybe; + status: InputMaybe; + website: InputMaybe; }; export type CreateSalaryInput = { @@ -161,39 +161,39 @@ export type Event = { /** Representation of an Event (Events and Users, is what tickets are linked to) */ export type EventUsersTicketsArgs = { - input?: InputMaybe; + input: InputMaybe; }; export type EventCreateInput = { - address?: InputMaybe; + address: InputMaybe; communityId: Scalars["String"]["input"]; description: Scalars["String"]["input"]; - endDateTime?: InputMaybe; - latitude?: InputMaybe; - longitude?: InputMaybe; + endDateTime: InputMaybe; + latitude: InputMaybe; + longitude: InputMaybe; maxAttendees: Scalars["Int"]["input"]; - meetingURL?: InputMaybe; + meetingURL: InputMaybe; name: Scalars["String"]["input"]; startDateTime: Scalars["DateTime"]["input"]; - status?: InputMaybe; - timeZone?: InputMaybe; - visibility?: InputMaybe; + status: InputMaybe; + timeZone: InputMaybe; + visibility: InputMaybe; }; export type EventEditInput = { - address?: InputMaybe; - description?: InputMaybe; - endDateTime?: InputMaybe; + address: InputMaybe; + description: InputMaybe; + endDateTime: InputMaybe; eventId: Scalars["String"]["input"]; - latitude?: InputMaybe; - longitude?: InputMaybe; - maxAttendees?: InputMaybe; - meetingURL?: InputMaybe; - name?: InputMaybe; - startDateTime?: InputMaybe; - status?: InputMaybe; - timeZone?: InputMaybe; - visibility?: InputMaybe; + latitude: InputMaybe; + longitude: InputMaybe; + maxAttendees: InputMaybe; + meetingURL: InputMaybe; + name: InputMaybe; + startDateTime: InputMaybe; + status: InputMaybe; + timeZone: InputMaybe; + visibility: InputMaybe; }; /** Search for tags */ @@ -213,19 +213,19 @@ export enum EventVisibility { } export type EventsSearchInput = { - id?: InputMaybe; - name?: InputMaybe; - startDateTimeFrom?: InputMaybe; - startDateTimeTo?: InputMaybe; - status?: InputMaybe; - visibility?: InputMaybe; + id: InputMaybe; + name: InputMaybe; + startDateTimeFrom: InputMaybe; + startDateTimeTo: InputMaybe; + status: InputMaybe; + visibility: InputMaybe; }; export type EventsTicketsSearchInput = { - approvalStatus?: InputMaybe; - id?: InputMaybe; - paymentStatus?: InputMaybe; - redemptionStatus?: InputMaybe; + approvalStatus: InputMaybe; + id: InputMaybe; + paymentStatus: InputMaybe; + redemptionStatus: InputMaybe; }; export enum Gender { @@ -376,15 +376,15 @@ export type MutationValidateWorkEmailArgs = { }; export type MyTicketsSearchValues = { - approvalStatus?: InputMaybe; - eventId?: InputMaybe; - paymentStatus?: InputMaybe; - redemptionStatus?: InputMaybe; + approvalStatus: InputMaybe; + eventId: InputMaybe; + paymentStatus: InputMaybe; + redemptionStatus: InputMaybe; }; export type PaginatedInputMyTicketsSearchValues = { - pagination?: PaginationSearchInputParams; - search?: InputMaybe; + pagination: PaginationSearchInputParams; + search: InputMaybe; }; /** Type used for querying the paginated leaves and it's paginated meta data */ @@ -499,9 +499,9 @@ export type Query = { }; export type QueryCommunitiesArgs = { - id?: InputMaybe; - name?: InputMaybe; - status?: InputMaybe; + id: InputMaybe; + name: InputMaybe; + status: InputMaybe; }; export type QueryCommunityArgs = { @@ -509,7 +509,7 @@ export type QueryCommunityArgs = { }; export type QueryCompaniesArgs = { - input?: InputMaybe; + input: InputMaybe; }; export type QueryCompanyArgs = { @@ -525,7 +525,7 @@ export type QueryEventImagesArgs = { }; export type QueryEventsArgs = { - input?: InputMaybe; + input: InputMaybe; }; export type QueryMyTicketsArgs = { @@ -541,11 +541,11 @@ export type QuerySearchPaymentLogsArgs = { }; export type QueryStatusArgs = { - name?: InputMaybe; + name: InputMaybe; }; export type QueryTagsArgs = { - input?: InputMaybe; + input: InputMaybe; }; export type QueryUserSearchArgs = { @@ -594,14 +594,14 @@ export type SanityAssetRef = { }; export type SearchCompaniesInput = { - companyName?: InputMaybe; - description?: InputMaybe; - domain?: InputMaybe; - website?: InputMaybe; + companyName: InputMaybe; + description: InputMaybe; + domain: InputMaybe; + website: InputMaybe; }; export type SearchPaymentLogsInput = { - endDate?: InputMaybe; + endDate: InputMaybe; startDate: Scalars["DateTime"]["input"]; }; @@ -624,9 +624,9 @@ export type Tag = { }; export type TagSearchInput = { - description?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; + description: InputMaybe; + id: InputMaybe; + name: InputMaybe; }; /** Representation of a ticket */ @@ -659,43 +659,43 @@ export enum TicketApprovalStatus { export type TicketClaimInput = { /** If this field is passed, a purchase order payment link will be generated right away */ - generatePaymentLink?: InputMaybe; + generatePaymentLink: InputMaybe; /** A unique key to prevent duplicate requests, it's optional to send, but it's recommended to send it to prevent duplicate requests. If not sent, it will be created by the server. */ - idempotencyUUIDKey?: InputMaybe; + idempotencyUUIDKey: InputMaybe; purchaseOrder: Array; }; export type TicketCreateInput = { - description?: InputMaybe; - endDateTime?: InputMaybe; + description: InputMaybe; + endDateTime: InputMaybe; eventId: Scalars["String"]["input"]; /** If the ticket is free, the price submitted will be ignored. */ isFree: Scalars["Boolean"]["input"]; name: Scalars["String"]["input"]; - prices?: InputMaybe>; - quantity?: InputMaybe; - requiresApproval?: InputMaybe; + prices: InputMaybe>; + quantity: InputMaybe; + requiresApproval: InputMaybe; startDateTime: Scalars["DateTime"]["input"]; - status?: InputMaybe; + status: InputMaybe; /** If provided, quantity must not be passed. This is for things like online events where there is no limit to the amount of tickets that can be sold. */ unlimitedTickets: Scalars["Boolean"]["input"]; - visibility?: InputMaybe; + visibility: InputMaybe; }; export type TicketEditInput = { - description?: InputMaybe; - endDateTime?: InputMaybe; - eventId?: InputMaybe; - name?: InputMaybe; - prices?: InputMaybe; - quantity?: InputMaybe; - requiresApproval?: InputMaybe; - startDateTime?: InputMaybe; - status?: InputMaybe; + description: InputMaybe; + endDateTime: InputMaybe; + eventId: InputMaybe; + name: InputMaybe; + prices: InputMaybe; + quantity: InputMaybe; + requiresApproval: InputMaybe; + startDateTime: InputMaybe; + status: InputMaybe; ticketId: Scalars["String"]["input"]; /** If provided, quantity must not be passed. This is for things like online events where there is no limit to the amount of tickets that can be sold. */ - unlimitedTickets?: InputMaybe; - visibility?: InputMaybe; + unlimitedTickets: InputMaybe; + visibility: InputMaybe; }; export enum TicketPaymentStatus { @@ -728,33 +728,33 @@ export enum TypeOfEmployment { export type UpdateCommunityInput = { communityId: Scalars["String"]["input"]; - description?: InputMaybe; - name?: InputMaybe; - slug?: InputMaybe; - status?: InputMaybe; + description: InputMaybe; + name: InputMaybe; + slug: InputMaybe; + status: InputMaybe; }; export type UpdateCompanyInput = { companyId: Scalars["String"]["input"]; - description?: InputMaybe; - domain?: InputMaybe; - logo?: InputMaybe; - name?: InputMaybe; - website?: InputMaybe; + description: InputMaybe; + domain: InputMaybe; + logo: InputMaybe; + name: InputMaybe; + website: InputMaybe; }; export type UpdateSalaryInput = { - amount?: InputMaybe; + amount: InputMaybe; confirmationToken: Scalars["String"]["input"]; - countryCode?: InputMaybe; - currencyCode?: InputMaybe; - gender?: InputMaybe; - genderOtherText?: InputMaybe; + countryCode: InputMaybe; + currencyCode: InputMaybe; + gender: InputMaybe; + genderOtherText: InputMaybe; salaryId: Scalars["String"]["input"]; - typeOfEmployment?: InputMaybe; - workMetodology?: InputMaybe; - workSeniorityAndRoleId?: InputMaybe; - yearsOfExperience?: InputMaybe; + typeOfEmployment: InputMaybe; + workMetodology: InputMaybe; + workSeniorityAndRoleId: InputMaybe; + yearsOfExperience: InputMaybe; }; /** Representation of a user */ @@ -773,7 +773,6 @@ export type UserTicket = { approvalStatus: TicketApprovalStatus; id: Scalars["ID"]["output"]; paymentStatus: TicketPaymentStatus; - purchaseOrder: Maybe; redemptionStatus: TicketRedemptionStatus; ticketTemplate: Ticket; }; @@ -831,15 +830,15 @@ export type UpdateUserRoleInCommunityInput = { }; export type UserEditInput = { - bio?: InputMaybe; + bio: InputMaybe; id: Scalars["String"]["input"]; - lastName?: InputMaybe; - name?: InputMaybe; - username?: InputMaybe; + lastName: InputMaybe; + name: InputMaybe; + username: InputMaybe; }; export type UserSearchInput = { - tags?: InputMaybe>; + tags: InputMaybe>; }; export type FetchExampleEventsQueryVariables = Exact<{ [key: string]: never }>; diff --git a/app/api/gql/schema.gql b/app/api/gql/schema.gql index 12b5b5b..256d8d8 100644 --- a/app/api/gql/schema.gql +++ b/app/api/gql/schema.gql @@ -787,7 +787,6 @@ type UserTicket { approvalStatus: TicketApprovalStatus! id: ID! paymentStatus: TicketPaymentStatus! - purchaseOrder: PurchaseOrder redemptionStatus: TicketRedemptionStatus! ticketTemplate: Ticket! } diff --git a/app/components/MyTickets/MyTickets.tsx b/app/components/MyTickets/MyTickets.tsx deleted file mode 100644 index 233f7a6..0000000 --- a/app/components/MyTickets/MyTickets.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { Suspense } from "react"; - -import { MyTicketsList } from "~/components/MyTickets/MyTicketsList"; - -export const MyTickets = () => { - return ( - - - - ); -}; diff --git a/app/components/MyTickets/MyTicketsList.tsx b/app/components/MyTickets/MyTicketsList.tsx deleted file mode 100644 index 568b62c..0000000 --- a/app/components/MyTickets/MyTicketsList.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { TicketApprovalStatus } from "~/api/gql/graphql"; -import { useMyTicketsSuspenseQuery } from "~/components/MyTickets/graphql/myTickets.generated"; - -export const MyTicketsList = () => { - const tickets = useMyTicketsSuspenseQuery({ - variables: { - input: { - pagination: { - page: 0, - pageSize: 10, - }, - search: { - approvalStatus: TicketApprovalStatus.Approved, - }, - }, - }, - }); - - const myTickets = tickets.data.myTickets?.data?.map((ticket) => ticket); - - return ( -
- {myTickets.map((ticket) => ( -
{ticket.id}
- ))} -
- ); -}; diff --git a/app/components/MyTickets/graphql/myTickets.gql b/app/components/MyTickets/graphql/myTickets.gql index 1039f9e..f7b178c 100644 --- a/app/components/MyTickets/graphql/myTickets.gql +++ b/app/components/MyTickets/graphql/myTickets.gql @@ -5,20 +5,6 @@ query myTickets($input: PaginatedInputMyTicketsSearchValues!) { id paymentStatus redemptionStatus - ticketTemplate { - id - name - } - purchaseOrder { - id - currency { - id - currency - validPaymentMethods - } - finalPrice - status - } } pagination { currentPage diff --git a/app/routes/_authenticated/tickets/index.tsx b/app/routes/_authenticated/tickets/index.tsx index cbf973d..5a1dd5a 100644 --- a/app/routes/_authenticated/tickets/index.tsx +++ b/app/routes/_authenticated/tickets/index.tsx @@ -1,13 +1,9 @@ -import { MyTickets } from "~/components/MyTickets/MyTickets"; import { sharedLayoutStyle } from "~/components/sharedLayouts"; export default function Layout() { return (
-
-

Mis Tickets

- -
+

Mis Tickets

); } diff --git a/codegen.ts b/codegen.ts index a3f0eec..08788b0 100644 --- a/codegen.ts +++ b/codegen.ts @@ -23,12 +23,7 @@ const config = { config: { useTypeImports: true, skipTypename: true, - avoidOptionals: { - field: true, - object: false, - inputValue: false, - defaultValue: false, - }, + avoidOptionals: true, nonOptionalTypename: false, // Lamentablemente, code-gen establece "any" como predeterminado, cuando no tiene un // tipo para un "scalar". Esta opciĆ³n nos obliga a definir un tipo cada vez que