Skip to content

Commit bbf917b

Browse files
authored
fix: "public user ticket info" userName and userUsername test (#255)
1 parent 27b461f commit bbf917b

5 files changed

Lines changed: 59 additions & 11 deletions

File tree

src/generated/schema.gql

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ type Event {
156156
longitude: String
157157
meetingURL: String
158158
name: String!
159+
schedules: [Schedule!]!
159160
speakers: [Speaker!]!
160161
startDateTime: DateTime!
161162
status: EventStatus!
@@ -600,6 +601,7 @@ type PublicUserTicket {
600601
ticket: Ticket!
601602
userImage: String
602603
userName: String
604+
userUsername: String
603605
}
604606

605607
"""
@@ -704,6 +706,11 @@ type Query {
704706
"""
705707
salaries: [Salary!]!
706708

709+
"""
710+
Get a schedule by its ID
711+
"""
712+
schedule(scheduleId: String!): Schedule!
713+
707714
"""
708715
Search a consolidated payment logs, by date, aggregated by platform and currency_id
709716
"""
@@ -809,6 +816,19 @@ type SanityAssetRef {
809816
url: String!
810817
}
811818

819+
"""
820+
Representation of a Schedule
821+
"""
822+
type Schedule {
823+
description: String
824+
endTimestamp: DateTime!
825+
event: Event!
826+
id: ID!
827+
sessions: [Session!]!
828+
startTimestamp: DateTime!
829+
title: String!
830+
}
831+
812832
input SearchCompaniesInput {
813833
companyName: String
814834
description: String
@@ -842,12 +862,12 @@ enum ServiceErrors {
842862
"""
843863
Representation of a Session
844864
"""
845-
type SessionRef {
865+
type Session {
846866
description: String
847-
endTimestamp: Date!
867+
endTimestamp: DateTime!
848868
id: ID!
849869
speakers: [Speaker!]!
850-
startTimestamp: Date!
870+
startTimestamp: DateTime!
851871
title: String!
852872
}
853873

@@ -870,7 +890,8 @@ type Speaker {
870890
company: String
871891
id: ID!
872892
name: String!
873-
sessions: [SessionRef!]!
893+
rol: String
894+
sessions: [Session!]!
874895
socials: [String!]!
875896
}
876897

@@ -1150,6 +1171,7 @@ type UserTicket {
11501171
createdAt: DateTime!
11511172
id: ID!
11521173
paymentStatus: PurchaseOrderPaymentStatusEnum
1174+
publicId: String!
11531175
purchaseOrder: PurchaseOrder
11541176
redemptionStatus: TicketRedemptionStatus!
11551177
ticketTemplate: Ticket!

src/generated/types.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export type Event = {
172172
longitude?: Maybe<Scalars["String"]["output"]>;
173173
meetingURL?: Maybe<Scalars["String"]["output"]>;
174174
name: Scalars["String"]["output"];
175+
schedules: Array<Schedule>;
175176
speakers: Array<Speaker>;
176177
startDateTime: Scalars["DateTime"]["output"];
177178
status: EventStatus;
@@ -645,6 +646,7 @@ export type PublicUserTicket = {
645646
ticket: Ticket;
646647
userImage?: Maybe<Scalars["String"]["output"]>;
647648
userName?: Maybe<Scalars["String"]["output"]>;
649+
userUsername?: Maybe<Scalars["String"]["output"]>;
648650
};
649651

650652
/** Representation of a Purchase Order */
@@ -706,6 +708,8 @@ export type Query = {
706708
publicTicketInfo: PublicUserTicket;
707709
/** Get a list of salaries associated to the user */
708710
salaries: Array<Salary>;
711+
/** Get a schedule by its ID */
712+
schedule: Schedule;
709713
/** Search a consolidated payment logs, by date, aggregated by platform and currency_id */
710714
searchConsolidatedPaymentLogs: Array<ConsolidatedPaymentLogEntry>;
711715
/** Get a list of events. Filter by name, id, status or date */
@@ -776,6 +780,10 @@ export type QueryPublicTicketInfoArgs = {
776780
input: PublicTicketInput;
777781
};
778782

783+
export type QueryScheduleArgs = {
784+
scheduleId: Scalars["String"]["input"];
785+
};
786+
779787
export type QuerySearchConsolidatedPaymentLogsArgs = {
780788
input: SearchPaymentLogsInput;
781789
};
@@ -861,6 +869,18 @@ export type SanityAssetRef = {
861869
url: Scalars["String"]["output"];
862870
};
863871

872+
/** Representation of a Schedule */
873+
export type Schedule = {
874+
__typename?: "Schedule";
875+
description?: Maybe<Scalars["String"]["output"]>;
876+
endTimestamp: Scalars["DateTime"]["output"];
877+
event: Event;
878+
id: Scalars["ID"]["output"];
879+
sessions: Array<Session>;
880+
startTimestamp: Scalars["DateTime"]["output"];
881+
title: Scalars["String"]["output"];
882+
};
883+
864884
export type SearchCompaniesInput = {
865885
companyName?: InputMaybe<Scalars["String"]["input"]>;
866886
description?: InputMaybe<Scalars["String"]["input"]>;
@@ -892,13 +912,13 @@ export enum ServiceErrors {
892912
}
893913

894914
/** Representation of a Session */
895-
export type SessionRef = {
896-
__typename?: "SessionRef";
915+
export type Session = {
916+
__typename?: "Session";
897917
description?: Maybe<Scalars["String"]["output"]>;
898-
endTimestamp: Scalars["Date"]["output"];
918+
endTimestamp: Scalars["DateTime"]["output"];
899919
id: Scalars["ID"]["output"];
900920
speakers: Array<Speaker>;
901-
startTimestamp: Scalars["Date"]["output"];
921+
startTimestamp: Scalars["DateTime"]["output"];
902922
title: Scalars["String"]["output"];
903923
};
904924

@@ -920,7 +940,8 @@ export type Speaker = {
920940
company?: Maybe<Scalars["String"]["output"]>;
921941
id: Scalars["ID"]["output"];
922942
name: Scalars["String"]["output"];
923-
sessions: Array<SessionRef>;
943+
rol?: Maybe<Scalars["String"]["output"]>;
944+
sessions: Array<Session>;
924945
socials: Array<Scalars["String"]["output"]>;
925946
};
926947

@@ -1176,6 +1197,7 @@ export type UserTicket = {
11761197
createdAt: Scalars["DateTime"]["output"];
11771198
id: Scalars["ID"]["output"];
11781199
paymentStatus?: Maybe<PurchaseOrderPaymentStatusEnum>;
1200+
publicId: Scalars["String"]["output"];
11791201
purchaseOrder?: Maybe<PurchaseOrder>;
11801202
redemptionStatus: TicketRedemptionStatus;
11811203
ticketTemplate: Ticket;

src/schema/userTickets/tests/publicTicketInfo/publicTicketInfo.generated.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type PublicTicketInfoQueryVariables = Types.Exact<{
1111
}>;
1212

1313

14-
export type PublicTicketInfoQuery = { __typename?: 'Query', publicTicketInfo: { __typename?: 'PublicUserTicket', id: string, userImage: string | null, userName: string | null } };
14+
export type PublicTicketInfoQuery = { __typename?: 'Query', publicTicketInfo: { __typename?: 'PublicUserTicket', id: string, userImage: string | null, userName: string | null, userUsername: string | null } };
1515

1616

1717
export const PublicTicketInfo = gql`
@@ -20,6 +20,7 @@ export const PublicTicketInfo = gql`
2020
id
2121
userImage
2222
userName
23+
userUsername
2324
}
2425
}
2526
`;

src/schema/userTickets/tests/publicTicketInfo/publicTicketInfo.gql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ query PublicTicketInfo($input: PublicTicketInput!) {
33
id
44
userImage
55
userName
6+
userUsername
67
}
78
}

src/schema/userTickets/tests/publicTicketInfo/publicTicketInfo.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ describe("public user ticket information", () => {
3939

4040
assert.equal(response.data?.publicTicketInfo.id, ticket.publicId);
4141

42-
assert.equal(response.data?.publicTicketInfo.userName, user.username);
42+
assert.equal(response.data?.publicTicketInfo.userName, user.name);
43+
44+
assert.equal(response.data?.publicTicketInfo.userUsername, user.username);
4345
});
4446

4547
describe("Should not work", () => {

0 commit comments

Comments
 (0)