diff --git a/src/api/gql/graphql.ts b/src/api/gql/graphql.ts index 4f18429..6b48f6f 100644 --- a/src/api/gql/graphql.ts +++ b/src/api/gql/graphql.ts @@ -28,6 +28,7 @@ export type Scalars = { export type AllowedCurrency = { currency: Scalars['String']['output']; id: Scalars['String']['output']; + validPaymentMethods: ValidPaymentMethods; }; export enum CommnunityStatus { @@ -65,6 +66,14 @@ export enum CompanyStatus { Inactive = 'inactive' } +/** Representation of a consolidated payment entry log calculation */ +export type ConsolidatedPaymentLogEntry = { + currencyId: Scalars['String']['output']; + id: Scalars['String']['output']; + platform: Scalars['String']['output']; + totalTransactionAmount: Scalars['Float']['output']; +}; + export type CreateCommunityInput = { description: Scalars['String']['input']; name: Scalars['String']['input']; @@ -86,18 +95,24 @@ export type CreateSalaryInput = { companyId: Scalars['String']['input']; confirmationToken: Scalars['String']['input']; countryCode: Scalars['String']['input']; - currencyId: Scalars['String']['input']; + currencyCode: Scalars['String']['input']; gender: Gender; genderOtherText: Scalars['String']['input']; typeOfEmployment: TypeOfEmployment; workMetodology: WorkMetodology; - workRoleId: Scalars['String']['input']; + workSeniorityAndRoleId: Scalars['String']['input']; yearsOfExperience: Scalars['Int']['input']; }; +export enum EmailStatus { + Confirmed = 'confirmed', + Pending = 'pending', + Rejected = 'rejected' +} + export type EnqueueGoogleAlbumImportInput = { albumId: Scalars['String']['input']; - sanityEventInstanceId: Scalars['String']['input']; + sanityEventId: Scalars['String']['input']; token: Scalars['String']['input']; }; @@ -108,6 +123,7 @@ export type Event = { description: Maybe; endDateTime: Maybe; id: Scalars['String']['output']; + images: Array; latitude: Maybe; longitude: Maybe; maxAttendees: Maybe; @@ -116,14 +132,17 @@ export type Event = { startDateTime: Scalars['DateTime']['output']; status: EventStatus; tags: Array; - tickets: Array; + /** List of tickets for sale or redemption for this event. (If you are looking for a user's tickets, use the usersTickets field) */ + tickets: Array; users: Array; + /** List of tickets that a user owns for this event. */ + usersTickets: Array; visibility: EventVisibility; }; /** Representation of an Event (Events and Users, is what tickets are linked to) */ -export type EventTicketsArgs = { +export type EventUsersTicketsArgs = { input: InputMaybe; }; @@ -159,6 +178,11 @@ export type EventEditInput = { visibility: InputMaybe; }; +/** Search for tags */ +export type EventImageSearch = { + eventId: Scalars['String']['input']; +}; + export enum EventStatus { Active = 'active', Inactive = 'inactive' @@ -206,6 +230,8 @@ export type Mutation = { approvalUserTicket: UserTicket; /** Cancel a ticket */ cancelUserTicket: UserTicket; + /** Attempt to claim a certain ammount of tickets */ + claimUserTicket: RedeemUserTicketResponse; /** Create an community */ createCommunity: Community; /** Create a company */ @@ -214,6 +240,8 @@ export type Mutation = { createEvent: Event; /** Create a salary */ createSalary: Salary; + /** Create a ticket */ + createTicket: Ticket; /** Edit an community */ editCommunity: Community; /** Edit an event */ @@ -249,6 +277,11 @@ export type MutationCancelUserTicketArgs = { }; +export type MutationClaimUserTicketArgs = { + input: TicketClaimInput; +}; + + export type MutationCreateCommunityArgs = { input: CreateCommunityInput; }; @@ -269,6 +302,11 @@ export type MutationCreateSalaryArgs = { }; +export type MutationCreateTicketArgs = { + input: TicketCreateInput; +}; + + export type MutationEditCommunityArgs = { input: UpdateCommunityInput; }; @@ -331,6 +369,35 @@ export type MyTicketsSearchInput = { status: InputMaybe; }; +/** Representation of a TicketPrice */ +export type Price = { + amount: Scalars['Int']['output']; + currency: AllowedCurrency; + id: Scalars['ID']['output']; +}; + +/** Representation of a payment log entry */ +export type PublicFinanceEntryRef = { + createdAt: Scalars['DateTime']['output']; + currencyId: Scalars['String']['output']; + id: Scalars['String']['output']; + platform: Scalars['String']['output']; + transactionAmount: Scalars['Float']['output']; + transactionDate: Maybe; +}; + +/** Representation of a Purchase Order */ +export type PurchaseOrder = { + id: Scalars['ID']['output']; + tickets: Array; + totalAmount: Maybe; +}; + +export type PurchaseOrderInput = { + quantity: Scalars['Int']['input']; + ticketId: Scalars['String']['input']; +}; + export type Query = { /** Get a list of communities. Filter by name, id, or status */ communities: Array; @@ -342,12 +409,20 @@ export type Query = { company: Company; /** Get an event by id */ event: Maybe; + /** Get a list of images, that are attached to an event */ + eventImages: Array; /** Get a list of events. Filter by name, id, status or date */ events: Array; /** Get the current user */ me: User; /** Get a list of tickets for the current user */ myTickets: Array; + /** Get a list of salaries associated to the user */ + salaries: Array; + /** Search a consolidated payment logs, by date, aggregated by platform and currency_id */ + searchConsolidatedPaymentLogs: Array; + /** Search on the payment logs by date, and returns a list of payment logs */ + searchPaymentLogs: Array; status: Scalars['String']['output']; /** Get a list of tags */ tags: Array; @@ -357,6 +432,12 @@ export type Query = { users: Array; /** Get a workEmail and check if its validated for this user */ workEmail: WorkEmail; + /** Get a list of validated work emails for the user */ + workEmails: Array; + /** Get a a work role's seniorities */ + workRoleSeniorities: Array; + /** Get a list of possible work roles */ + workRoles: Array; }; @@ -387,6 +468,11 @@ export type QueryEventArgs = { }; +export type QueryEventImagesArgs = { + input: EventImageSearch; +}; + + export type QueryEventsArgs = { input: InputMaybe; }; @@ -397,6 +483,16 @@ export type QueryMyTicketsArgs = { }; +export type QuerySearchConsolidatedPaymentLogsArgs = { + input: SearchPaymentLogsInput; +}; + + +export type QuerySearchPaymentLogsArgs = { + input: SearchPaymentLogsInput; +}; + + export type QueryStatusArgs = { name: InputMaybe; }; @@ -416,18 +512,31 @@ export type QueryWorkEmailArgs = { email: Scalars['String']['input']; }; + +export type QueryWorkRoleSenioritiesArgs = { + input: WorkRoleSenioritiesInput; +}; + +export type RedeemUserTicketError = { + error: Scalars['Boolean']['output']; + errorMessage: Scalars['String']['output']; +}; + +export type RedeemUserTicketResponse = PurchaseOrder | RedeemUserTicketError; + /** Representation of a workEmail */ export type Salary = { amount: Scalars['Int']['output']; company: Company; countryCode: Scalars['String']['output']; - currency: AllowedCurrency; + currencyCode: Scalars['String']['output']; gender: Maybe; genderOtherText: Maybe; id: Scalars['String']['output']; typeOfEmployment: TypeOfEmployment; workMetodology: WorkMetodology; workRole: WorkRole; + workSeniority: WorkSeniority; yearsOfExperience: Scalars['Int']['output']; }; @@ -448,6 +557,11 @@ export type SearchCompaniesInput = { website: InputMaybe; }; +export type SearchPaymentLogsInput = { + endDate: InputMaybe; + startDate: Scalars['DateTime']['input']; +}; + export enum SearchableUserTags { CoreTeam = 'CORE_TEAM', DevTeam = 'DEV_TEAM', @@ -470,13 +584,13 @@ export type TagSearchInput = { /** Representation of a ticket */ export type Ticket = { - currencyId: Maybe; description: Maybe; endDateTime: Maybe; eventId: Scalars['String']['output']; id: Scalars['ID']['output']; name: Scalars['String']['output']; - price: Maybe; + prices: Maybe>; + /** The number of tickets available for this ticket type */ quantity: Maybe; requiresApproval: Maybe; startDateTime: Scalars['DateTime']['output']; @@ -486,9 +600,30 @@ export type Ticket = { export enum TicketApprovalStatus { Approved = 'approved', - Pending = 'pending' + Pending = 'pending', + Rejected = 'rejected' } +export type TicketClaimInput = { + /** 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; + purchaseOrder: Array; +}; + +export type TicketCreateInput = { + currencyId: InputMaybe; + description: InputMaybe; + endDateTime: InputMaybe; + eventId: Scalars['String']['input']; + name: Scalars['String']['input']; + price: InputMaybe; + quantity: InputMaybe; + requiresApproval: InputMaybe; + startDateTime: Scalars['DateTime']['input']; + status: InputMaybe; + visibility: InputMaybe; +}; + export type TicketEditInput = { currencyId: InputMaybe; description: InputMaybe; @@ -505,6 +640,7 @@ export type TicketEditInput = { }; export enum TicketPaymentStatus { + NotRequired = 'not_required', Paid = 'paid', Unpaid = 'unpaid' } @@ -516,7 +652,7 @@ export enum TicketRedemptionStatus { export enum TicketStatus { Active = 'active', - Cancelled = 'cancelled' + Inactive = 'inactive' } export enum TicketTemplateStatus { @@ -554,18 +690,17 @@ export type UpdateCompanyInput = { }; export type UpdateSalaryInput = { - amount: Scalars['Int']['input']; - companyId: Scalars['String']['input']; + amount: InputMaybe; confirmationToken: Scalars['String']['input']; - countryCode: Scalars['String']['input']; - currencyId: Scalars['String']['input']; - gender: Gender; - genderOtherText: Scalars['String']['input']; + countryCode: InputMaybe; + currencyCode: InputMaybe; + gender: InputMaybe; + genderOtherText: InputMaybe; salaryId: Scalars['String']['input']; - typeOfEmployment: TypeOfEmployment; - workMetodology: WorkMetodology; - workRoleId: Scalars['String']['input']; - yearsOfExperience: Scalars['Int']['input']; + typeOfEmployment: InputMaybe; + workMetodology: InputMaybe; + workSeniorityAndRoleId: InputMaybe; + yearsOfExperience: InputMaybe; }; /** Representation of a user */ @@ -588,7 +723,22 @@ export type UserTicket = { status: TicketStatus; }; -/** Representation of a workEmail */ +export enum ValidPaymentMethods { + MercadoPago = 'mercado_pago', + Stripe = 'stripe' +} + +/** Representation of a work email associated to the current user */ +export type ValidatedWorkEmail = { + company: Maybe; + confirmationDate: Maybe; + id: Scalars['String']['output']; + isValidated: Scalars['Boolean']['output']; + status: EmailStatus; + workEmail: Scalars['String']['output']; +}; + +/** Representation of a (yet to validate) work email */ export type WorkEmail = { id: Scalars['String']['output']; isValidated: Scalars['Boolean']['output']; @@ -600,12 +750,23 @@ export enum WorkMetodology { Remote = 'remote' } -/** Representation of a workEmail */ +/** Representation of a work role */ export type WorkRole = { - description: Scalars['String']['output']; + description: Maybe; + id: Scalars['String']['output']; + name: Scalars['String']['output']; + seniorities: Array; +}; + +export type WorkRoleSenioritiesInput = { + workRoleId: Scalars['String']['input']; +}; + +/** Representation of a work seniority */ +export type WorkSeniority = { + description: Maybe; id: Scalars['String']['output']; name: Scalars['String']['output']; - seniority: Scalars['String']['output']; }; export type UpdateUserRoleInCommunityInput = { diff --git a/src/api/gql/schema.gql b/src/api/gql/schema.gql index 4365780..04a93f1 100644 --- a/src/api/gql/schema.gql +++ b/src/api/gql/schema.gql @@ -2,6 +2,7 @@ type AllowedCurrency { currency: String! id: String! + validPaymentMethods: ValidPaymentMethods! } enum CommnunityStatus { @@ -40,6 +41,14 @@ enum CompanyStatus { inactive } +"""Representation of a consolidated payment entry log calculation""" +type ConsolidatedPaymentLogEntry { + currencyId: String! + id: String! + platform: String! + totalTransactionAmount: Float! +} + input CreateCommunityInput { description: String! name: String! @@ -64,12 +73,12 @@ input CreateSalaryInput { companyId: String! confirmationToken: String! countryCode: String! - currencyId: String! + currencyCode: String! gender: Gender! genderOtherText: String! typeOfEmployment: TypeOfEmployment! workMetodology: WorkMetodology! - workRoleId: String! + workSeniorityAndRoleId: String! yearsOfExperience: Int! } @@ -83,9 +92,15 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `dat """ scalar DateTime +enum EmailStatus { + confirmed + pending + rejected +} + input EnqueueGoogleAlbumImportInput { albumId: String! - sanityEventInstanceId: String! + sanityEventId: String! token: String! } @@ -98,6 +113,7 @@ type Event { description: String endDateTime: DateTime id: String! + images: [SanityAssetRef!]! latitude: String longitude: String maxAttendees: Int @@ -106,8 +122,15 @@ type Event { startDateTime: DateTime! status: EventStatus! tags: [Tag!]! - tickets(input: EventsTicketsSearchInput): [UserTicket!]! + + """ + List of tickets for sale or redemption for this event. (If you are looking for a user's tickets, use the usersTickets field) + """ + tickets: [Ticket!]! users: [User!]! + + """List of tickets that a user owns for this event.""" + usersTickets(input: EventsTicketsSearchInput): [UserTicket!]! visibility: EventVisibility! } @@ -143,6 +166,11 @@ input EventEditInput { visibility: EventVisibility } +"""Search for tags""" +input EventImageSearch { + eventId: String! +} + enum EventStatus { active inactive @@ -192,6 +220,9 @@ type Mutation { """Cancel a ticket""" cancelUserTicket(userTicketId: String!): UserTicket! + """Attempt to claim a certain ammount of tickets""" + claimUserTicket(input: TicketClaimInput!): RedeemUserTicketResponse! + """Create an community""" createCommunity(input: CreateCommunityInput!): Community! @@ -204,6 +235,9 @@ type Mutation { """Create a salary""" createSalary(input: CreateSalaryInput!): Salary! + """Create a ticket""" + createTicket(input: TicketCreateInput!): Ticket! + """Edit an community""" editCommunity(input: UpdateCommunityInput!): Community! @@ -248,6 +282,35 @@ input MyTicketsSearchInput { status: TicketStatus } +"""Representation of a TicketPrice""" +type Price { + amount: Int! + currency: AllowedCurrency! + id: ID! +} + +"""Representation of a payment log entry""" +type PublicFinanceEntryRef { + createdAt: DateTime! + currencyId: String! + id: String! + platform: String! + transactionAmount: Float! + transactionDate: DateTime +} + +"""Representation of a Purchase Order""" +type PurchaseOrder { + id: ID! + tickets: [UserTicket!]! + totalAmount: Float +} + +input PurchaseOrderInput { + quantity: Int! + ticketId: String! +} + type Query { """Get a list of communities. Filter by name, id, or status""" communities(id: String, name: String, status: CommnunityStatus): [Community!]! @@ -264,6 +327,9 @@ type Query { """Get an event by id""" event(id: String!): Event + """Get a list of images, that are attached to an event""" + eventImages(input: EventImageSearch!): [SanityAssetRef!]! + """Get a list of events. Filter by name, id, status or date""" events(input: EventsSearchInput): [Event!]! @@ -272,6 +338,17 @@ type Query { """Get a list of tickets for the current user""" myTickets(input: MyTicketsSearchInput): [UserTicket!]! + + """Get a list of salaries associated to the user""" + salaries: [Salary!]! + + """ + Search a consolidated payment logs, by date, aggregated by platform and currency_id + """ + searchConsolidatedPaymentLogs(input: SearchPaymentLogsInput!): [ConsolidatedPaymentLogEntry!]! + + """Search on the payment logs by date, and returns a list of payment logs""" + searchPaymentLogs(input: SearchPaymentLogsInput!): [PublicFinanceEntryRef!]! status(name: String): String! """Get a list of tags""" @@ -285,20 +362,37 @@ type Query { """Get a workEmail and check if its validated for this user""" workEmail(email: String!): WorkEmail! + + """Get a list of validated work emails for the user""" + workEmails: [ValidatedWorkEmail!]! + + """Get a a work role's seniorities""" + workRoleSeniorities(input: WorkRoleSenioritiesInput!): [WorkSeniority!]! + + """Get a list of possible work roles""" + workRoles: [WorkRole!]! +} + +type RedeemUserTicketError { + error: Boolean! + errorMessage: String! } +union RedeemUserTicketResponse = PurchaseOrder | RedeemUserTicketError + """Representation of a workEmail""" type Salary { amount: Int! company: Company! countryCode: String! - currency: AllowedCurrency! + currencyCode: String! gender: Gender genderOtherText: String id: String! typeOfEmployment: TypeOfEmployment! workMetodology: WorkMetodology! workRole: WorkRole! + workSeniority: WorkSeniority! yearsOfExperience: Int! } @@ -319,6 +413,11 @@ input SearchCompaniesInput { website: String } +input SearchPaymentLogsInput { + endDate: DateTime + startDate: DateTime! +} + enum SearchableUserTags { CORE_TEAM DEV_TEAM @@ -343,13 +442,14 @@ input TagSearchInput { """Representation of a ticket""" type Ticket { - currencyId: String description: String endDateTime: DateTime eventId: String! id: ID! name: String! - price: Int + prices: [Price!] + + """The number of tickets available for this ticket type""" quantity: Int requiresApproval: Boolean startDateTime: DateTime! @@ -360,6 +460,29 @@ type Ticket { enum TicketApprovalStatus { approved pending + rejected +} + +input TicketClaimInput { + """ + 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: String + purchaseOrder: [PurchaseOrderInput!]! +} + +input TicketCreateInput { + currencyId: String + description: String + endDateTime: DateTime + eventId: String! + name: String! + price: Int + quantity: Int + requiresApproval: Boolean + startDateTime: DateTime! + status: TicketTemplateStatus + visibility: TicketTemplateVisibility } input TicketEditInput { @@ -378,6 +501,7 @@ input TicketEditInput { } enum TicketPaymentStatus { + not_required paid unpaid } @@ -389,7 +513,7 @@ enum TicketRedemptionStatus { enum TicketStatus { active - cancelled + inactive } enum TicketTemplateStatus { @@ -427,18 +551,17 @@ input UpdateCompanyInput { } input UpdateSalaryInput { - amount: Int! - companyId: String! + amount: Int confirmationToken: String! - countryCode: String! - currencyId: String! - gender: Gender! - genderOtherText: String! + countryCode: String + currencyCode: String + gender: Gender + genderOtherText: String salaryId: String! - typeOfEmployment: TypeOfEmployment! - workMetodology: WorkMetodology! - workRoleId: String! - yearsOfExperience: Int! + typeOfEmployment: TypeOfEmployment + workMetodology: WorkMetodology + workSeniorityAndRoleId: String + yearsOfExperience: Int } """Representation of a user""" @@ -461,7 +584,22 @@ type UserTicket { status: TicketStatus! } -"""Representation of a workEmail""" +enum ValidPaymentMethods { + mercado_pago + stripe +} + +"""Representation of a work email associated to the current user""" +type ValidatedWorkEmail { + company: Company + confirmationDate: DateTime + id: String! + isValidated: Boolean! + status: EmailStatus! + workEmail: String! +} + +"""Representation of a (yet to validate) work email""" type WorkEmail { id: String! isValidated: Boolean! @@ -473,12 +611,23 @@ enum WorkMetodology { remote } -"""Representation of a workEmail""" +"""Representation of a work role""" type WorkRole { - description: String! + description: String + id: String! + name: String! + seniorities: [WorkSeniority!]! +} + +input WorkRoleSenioritiesInput { + workRoleId: String! +} + +"""Representation of a work seniority""" +type WorkSeniority { + description: String id: String! name: String! - seniority: String! } input updateUserRoleInCommunityInput {