diff --git a/amplify/auth/pre-sign-up/graphql/API.ts b/amplify/auth/pre-sign-up/graphql/API.ts index 62512ab..90bd582 100644 --- a/amplify/auth/pre-sign-up/graphql/API.ts +++ b/amplify/auth/pre-sign-up/graphql/API.ts @@ -3,63 +3,73 @@ // This file was automatically generated and should not be edited. export type SessionAttended = { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: User | null; + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: User | null, }; export type User = { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: ModelSessionAttendedConnection | null; - totalEarnings?: number | null; - updatedAt: string; + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: ModelSessionAttendedConnection | null, + totalEarnings?: number | null, + updatedAt: string, }; export type ModelSessionAttendedConnection = { - __typename: "ModelSessionAttendedConnection"; - items: Array; - nextToken?: string | null; + __typename: "ModelSessionAttendedConnection", + items: Array, + nextToken?: string | null, +}; + +export type Timer = { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, }; export type ModelSessionAttendedFilterInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - date?: ModelStringInput | null; - earningsThatSession?: ModelFloatInput | null; - id?: ModelIDInput | null; - not?: ModelSessionAttendedFilterInput | null; - or?: Array | null; - sessionAttendedId?: ModelIDInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelSessionAttendedFilterInput | null > | null, + createdAt?: ModelStringInput | null, + date?: ModelStringInput | null, + earningsThatSession?: ModelFloatInput | null, + id?: ModelIDInput | null, + not?: ModelSessionAttendedFilterInput | null, + or?: Array< ModelSessionAttendedFilterInput | null > | null, + sessionAttendedId?: ModelIDInput | null, + updatedAt?: ModelStringInput | null, }; export type ModelStringInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - size?: ModelSizeInput | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + size?: ModelSizeInput | null, }; export enum ModelAttributeTypes { @@ -75,42 +85,43 @@ export enum ModelAttributeTypes { stringSet = "stringSet", } + export type ModelSizeInput = { - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - le?: number | null; - lt?: number | null; - ne?: number | null; + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelFloatInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - le?: number | null; - lt?: number | null; - ne?: number | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelIDInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - size?: ModelSizeInput | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + size?: ModelSizeInput | null, }; export enum ModelSortDirection { @@ -118,606 +129,835 @@ export enum ModelSortDirection { DESC = "DESC", } + +export type ModelTimerFilterInput = { + and?: Array< ModelTimerFilterInput | null > | null, + createdAt?: ModelStringInput | null, + id?: ModelIDInput | null, + nextSessionDate?: ModelStringInput | null, + nextSessionTime?: ModelStringInput | null, + not?: ModelTimerFilterInput | null, + or?: Array< ModelTimerFilterInput | null > | null, + updatedAt?: ModelStringInput | null, +}; + +export type ModelTimerConnection = { + __typename: "ModelTimerConnection", + items: Array, + nextToken?: string | null, +}; + export type ModelUserFilterInput = { - and?: Array | null; - completedRegistration?: ModelBooleanInput | null; - createdAt?: ModelStringInput | null; - email?: ModelStringInput | null; - firstName?: ModelStringInput | null; - id?: ModelIDInput | null; - lastName?: ModelStringInput | null; - not?: ModelUserFilterInput | null; - or?: Array | null; - profileOwner?: ModelStringInput | null; - role?: ModelStringInput | null; - totalEarnings?: ModelFloatInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelUserFilterInput | null > | null, + completedRegistration?: ModelBooleanInput | null, + createdAt?: ModelStringInput | null, + email?: ModelStringInput | null, + firstName?: ModelStringInput | null, + id?: ModelIDInput | null, + lastName?: ModelStringInput | null, + not?: ModelUserFilterInput | null, + numberSessionsAttended?: ModelIntInput | null, + or?: Array< ModelUserFilterInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelStringInput | null, + totalEarnings?: ModelFloatInput | null, + updatedAt?: ModelStringInput | null, }; export type ModelBooleanInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - eq?: boolean | null; - ne?: boolean | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + eq?: boolean | null, + ne?: boolean | null, +}; + +export type ModelIntInput = { + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelUserConnection = { - __typename: "ModelUserConnection"; - items: Array; - nextToken?: string | null; + __typename: "ModelUserConnection", + items: Array, + nextToken?: string | null, }; export type ModelSessionAttendedConditionInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - date?: ModelStringInput | null; - earningsThatSession?: ModelFloatInput | null; - not?: ModelSessionAttendedConditionInput | null; - or?: Array | null; - sessionAttendedId?: ModelIDInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelSessionAttendedConditionInput | null > | null, + createdAt?: ModelStringInput | null, + date?: ModelStringInput | null, + earningsThatSession?: ModelFloatInput | null, + not?: ModelSessionAttendedConditionInput | null, + or?: Array< ModelSessionAttendedConditionInput | null > | null, + sessionAttendedId?: ModelIDInput | null, + updatedAt?: ModelStringInput | null, }; export type CreateSessionAttendedInput = { - date: string; - earningsThatSession?: number | null; - id?: string | null; - sessionAttendedId: string; + date: string, + earningsThatSession?: number | null, + id?: string | null, + sessionAttendedId: string, +}; + +export type ModelTimerConditionInput = { + and?: Array< ModelTimerConditionInput | null > | null, + createdAt?: ModelStringInput | null, + nextSessionDate?: ModelStringInput | null, + nextSessionTime?: ModelStringInput | null, + not?: ModelTimerConditionInput | null, + or?: Array< ModelTimerConditionInput | null > | null, + updatedAt?: ModelStringInput | null, +}; + +export type CreateTimerInput = { + id?: string | null, + nextSessionDate?: string | null, + nextSessionTime?: string | null, }; export type ModelUserConditionInput = { - and?: Array | null; - completedRegistration?: ModelBooleanInput | null; - createdAt?: ModelStringInput | null; - email?: ModelStringInput | null; - firstName?: ModelStringInput | null; - lastName?: ModelStringInput | null; - not?: ModelUserConditionInput | null; - or?: Array | null; - profileOwner?: ModelStringInput | null; - role?: ModelStringInput | null; - totalEarnings?: ModelFloatInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelUserConditionInput | null > | null, + completedRegistration?: ModelBooleanInput | null, + createdAt?: ModelStringInput | null, + email?: ModelStringInput | null, + firstName?: ModelStringInput | null, + lastName?: ModelStringInput | null, + not?: ModelUserConditionInput | null, + numberSessionsAttended?: ModelIntInput | null, + or?: Array< ModelUserConditionInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelStringInput | null, + totalEarnings?: ModelFloatInput | null, + updatedAt?: ModelStringInput | null, }; export type CreateUserInput = { - completedRegistration?: boolean | null; - email?: string | null; - firstName?: string | null; - id?: string | null; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; + completedRegistration?: boolean | null, + email?: string | null, + firstName?: string | null, + id?: string | null, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, }; export type DeleteSessionAttendedInput = { - id: string; + id: string, +}; + +export type DeleteTimerInput = { + id: string, }; export type DeleteUserInput = { - id: string; + id: string, }; export type UpdateSessionAttendedInput = { - date?: string | null; - earningsThatSession?: number | null; - id: string; - sessionAttendedId?: string | null; + date?: string | null, + earningsThatSession?: number | null, + id: string, + sessionAttendedId?: string | null, +}; + +export type UpdateTimerInput = { + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, }; export type UpdateUserInput = { - completedRegistration?: boolean | null; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; + completedRegistration?: boolean | null, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, }; export type ModelSubscriptionSessionAttendedFilterInput = { - and?: Array | null; - createdAt?: ModelSubscriptionStringInput | null; - date?: ModelSubscriptionStringInput | null; - earningsThatSession?: ModelSubscriptionFloatInput | null; - id?: ModelSubscriptionIDInput | null; - or?: Array | null; - sessionAttendedId?: ModelSubscriptionIDInput | null; - updatedAt?: ModelSubscriptionStringInput | null; + and?: Array< ModelSubscriptionSessionAttendedFilterInput | null > | null, + createdAt?: ModelSubscriptionStringInput | null, + date?: ModelSubscriptionStringInput | null, + earningsThatSession?: ModelSubscriptionFloatInput | null, + id?: ModelSubscriptionIDInput | null, + or?: Array< ModelSubscriptionSessionAttendedFilterInput | null > | null, + sessionAttendedId?: ModelSubscriptionIDInput | null, + updatedAt?: ModelSubscriptionStringInput | null, }; export type ModelSubscriptionStringInput = { - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - in?: Array | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - notIn?: Array | null; + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + in?: Array< string | null > | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + notIn?: Array< string | null > | null, }; export type ModelSubscriptionFloatInput = { - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - in?: Array | null; - le?: number | null; - lt?: number | null; - ne?: number | null; - notIn?: Array | null; + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + in?: Array< number | null > | null, + le?: number | null, + lt?: number | null, + ne?: number | null, + notIn?: Array< number | null > | null, }; export type ModelSubscriptionIDInput = { - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - in?: Array | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - notIn?: Array | null; + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + in?: Array< string | null > | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + notIn?: Array< string | null > | null, +}; + +export type ModelSubscriptionTimerFilterInput = { + and?: Array< ModelSubscriptionTimerFilterInput | null > | null, + createdAt?: ModelSubscriptionStringInput | null, + id?: ModelSubscriptionIDInput | null, + nextSessionDate?: ModelSubscriptionStringInput | null, + nextSessionTime?: ModelSubscriptionStringInput | null, + or?: Array< ModelSubscriptionTimerFilterInput | null > | null, + updatedAt?: ModelSubscriptionStringInput | null, }; export type ModelSubscriptionUserFilterInput = { - and?: Array | null; - completedRegistration?: ModelSubscriptionBooleanInput | null; - createdAt?: ModelSubscriptionStringInput | null; - email?: ModelSubscriptionStringInput | null; - firstName?: ModelSubscriptionStringInput | null; - id?: ModelSubscriptionIDInput | null; - lastName?: ModelSubscriptionStringInput | null; - or?: Array | null; - profileOwner?: ModelStringInput | null; - role?: ModelSubscriptionStringInput | null; - totalEarnings?: ModelSubscriptionFloatInput | null; - updatedAt?: ModelSubscriptionStringInput | null; + and?: Array< ModelSubscriptionUserFilterInput | null > | null, + completedRegistration?: ModelSubscriptionBooleanInput | null, + createdAt?: ModelSubscriptionStringInput | null, + email?: ModelSubscriptionStringInput | null, + firstName?: ModelSubscriptionStringInput | null, + id?: ModelSubscriptionIDInput | null, + lastName?: ModelSubscriptionStringInput | null, + numberSessionsAttended?: ModelSubscriptionIntInput | null, + or?: Array< ModelSubscriptionUserFilterInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelSubscriptionStringInput | null, + totalEarnings?: ModelSubscriptionFloatInput | null, + updatedAt?: ModelSubscriptionStringInput | null, }; export type ModelSubscriptionBooleanInput = { - eq?: boolean | null; - ne?: boolean | null; + eq?: boolean | null, + ne?: boolean | null, +}; + +export type ModelSubscriptionIntInput = { + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + in?: Array< number | null > | null, + le?: number | null, + lt?: number | null, + ne?: number | null, + notIn?: Array< number | null > | null, }; export type GetSessionAttendedQueryVariables = { - id: string; + id: string, }; export type GetSessionAttendedQuery = { - getSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + getSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type GetTimerQueryVariables = { + id: string, +}; + +export type GetTimerQuery = { + getTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type GetUserQueryVariables = { - id: string; + id: string, }; export type GetUserQuery = { - getUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + getUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type ListSessionAttendedsQueryVariables = { - filter?: ModelSessionAttendedFilterInput | null; - id?: string | null; - limit?: number | null; - nextToken?: string | null; - sortDirection?: ModelSortDirection | null; + filter?: ModelSessionAttendedFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, }; export type ListSessionAttendedsQuery = { - listSessionAttendeds?: { - __typename: "ModelSessionAttendedConnection"; - items: Array<{ - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - } | null>; - nextToken?: string | null; - } | null; + listSessionAttendeds?: { + __typename: "ModelSessionAttendedConnection", + items: Array< { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, +}; + +export type ListTimersQueryVariables = { + filter?: ModelTimerFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, +}; + +export type ListTimersQuery = { + listTimers?: { + __typename: "ModelTimerConnection", + items: Array< { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, }; export type ListUsersQueryVariables = { - filter?: ModelUserFilterInput | null; - id?: string | null; - limit?: number | null; - nextToken?: string | null; - sortDirection?: ModelSortDirection | null; + filter?: ModelUserFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, }; export type ListUsersQuery = { - listUsers?: { - __typename: "ModelUserConnection"; - items: Array<{ - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null>; - nextToken?: string | null; - } | null; + listUsers?: { + __typename: "ModelUserConnection", + items: Array< { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, }; export type CreateSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: CreateSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: CreateSessionAttendedInput, }; export type CreateSessionAttendedMutation = { - createSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + createSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type CreateTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: CreateTimerInput, +}; + +export type CreateTimerMutation = { + createTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type CreateUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: CreateUserInput; + condition?: ModelUserConditionInput | null, + input: CreateUserInput, }; export type CreateUserMutation = { - createUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + createUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type DeleteSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: DeleteSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: DeleteSessionAttendedInput, }; export type DeleteSessionAttendedMutation = { - deleteSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + deleteSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type DeleteTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: DeleteTimerInput, +}; + +export type DeleteTimerMutation = { + deleteTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type DeleteUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: DeleteUserInput; + condition?: ModelUserConditionInput | null, + input: DeleteUserInput, }; export type DeleteUserMutation = { - deleteUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + deleteUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type UpdateSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: UpdateSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: UpdateSessionAttendedInput, }; export type UpdateSessionAttendedMutation = { - updateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + updateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type UpdateTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: UpdateTimerInput, +}; + +export type UpdateTimerMutation = { + updateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type UpdateUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: UpdateUserInput; + condition?: ModelUserConditionInput | null, + input: UpdateUserInput, }; export type UpdateUserMutation = { - updateUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + updateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnCreateSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnCreateSessionAttendedSubscription = { - onCreateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onCreateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnCreateTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnCreateTimerSubscription = { + onCreateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnCreateUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; - profileOwner?: string | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnCreateUserSubscription = { - onCreateUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onCreateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnDeleteSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnDeleteSessionAttendedSubscription = { - onDeleteSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onDeleteSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnDeleteTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnDeleteTimerSubscription = { + onDeleteTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnDeleteUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; - profileOwner?: string | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnDeleteUserSubscription = { - onDeleteUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onDeleteUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnUpdateSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnUpdateSessionAttendedSubscription = { - onUpdateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onUpdateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnUpdateTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnUpdateTimerSubscription = { + onUpdateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnUpdateUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; - profileOwner?: string | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnUpdateUserSubscription = { - onUpdateUser?: { - __typename: "User"; - completedRegistration?: boolean | null; - createdAt: string; - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - profileOwner?: string | null; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onUpdateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; diff --git a/amplify/auth/pre-sign-up/graphql/mutations.ts b/amplify/auth/pre-sign-up/graphql/mutations.ts index f909024..8a5209e 100644 --- a/amplify/auth/pre-sign-up/graphql/mutations.ts +++ b/amplify/auth/pre-sign-up/graphql/mutations.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedMutation = string & { __generatedMutationInput: InputType; __generatedMutationOutput: OutputType; }; -export const createSessionAttended = - /* GraphQL */ `mutation CreateSessionAttended( +export const createSessionAttended = /* GraphQL */ `mutation CreateSessionAttended( $condition: ModelSessionAttendedConditionInput $input: CreateSessionAttendedInput! ) { @@ -28,6 +26,7 @@ export const createSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -38,9 +37,26 @@ export const createSessionAttended = } } ` as GeneratedMutation< - APITypes.CreateSessionAttendedMutationVariables, - APITypes.CreateSessionAttendedMutation - >; + APITypes.CreateSessionAttendedMutationVariables, + APITypes.CreateSessionAttendedMutation +>; +export const createTimer = /* GraphQL */ `mutation CreateTimer( + $condition: ModelTimerConditionInput + $input: CreateTimerInput! +) { + createTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.CreateTimerMutationVariables, + APITypes.CreateTimerMutation +>; export const createUser = /* GraphQL */ `mutation CreateUser( $condition: ModelUserConditionInput $input: CreateUserInput! @@ -52,6 +68,7 @@ export const createUser = /* GraphQL */ `mutation CreateUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { @@ -67,8 +84,7 @@ export const createUser = /* GraphQL */ `mutation CreateUser( APITypes.CreateUserMutationVariables, APITypes.CreateUserMutation >; -export const deleteSessionAttended = - /* GraphQL */ `mutation DeleteSessionAttended( +export const deleteSessionAttended = /* GraphQL */ `mutation DeleteSessionAttended( $condition: ModelSessionAttendedConditionInput $input: DeleteSessionAttendedInput! ) { @@ -86,6 +102,7 @@ export const deleteSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -96,9 +113,26 @@ export const deleteSessionAttended = } } ` as GeneratedMutation< - APITypes.DeleteSessionAttendedMutationVariables, - APITypes.DeleteSessionAttendedMutation - >; + APITypes.DeleteSessionAttendedMutationVariables, + APITypes.DeleteSessionAttendedMutation +>; +export const deleteTimer = /* GraphQL */ `mutation DeleteTimer( + $condition: ModelTimerConditionInput + $input: DeleteTimerInput! +) { + deleteTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.DeleteTimerMutationVariables, + APITypes.DeleteTimerMutation +>; export const deleteUser = /* GraphQL */ `mutation DeleteUser( $condition: ModelUserConditionInput $input: DeleteUserInput! @@ -110,6 +144,7 @@ export const deleteUser = /* GraphQL */ `mutation DeleteUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { @@ -125,8 +160,7 @@ export const deleteUser = /* GraphQL */ `mutation DeleteUser( APITypes.DeleteUserMutationVariables, APITypes.DeleteUserMutation >; -export const updateSessionAttended = - /* GraphQL */ `mutation UpdateSessionAttended( +export const updateSessionAttended = /* GraphQL */ `mutation UpdateSessionAttended( $condition: ModelSessionAttendedConditionInput $input: UpdateSessionAttendedInput! ) { @@ -144,6 +178,7 @@ export const updateSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -154,9 +189,26 @@ export const updateSessionAttended = } } ` as GeneratedMutation< - APITypes.UpdateSessionAttendedMutationVariables, - APITypes.UpdateSessionAttendedMutation - >; + APITypes.UpdateSessionAttendedMutationVariables, + APITypes.UpdateSessionAttendedMutation +>; +export const updateTimer = /* GraphQL */ `mutation UpdateTimer( + $condition: ModelTimerConditionInput + $input: UpdateTimerInput! +) { + updateTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.UpdateTimerMutationVariables, + APITypes.UpdateTimerMutation +>; export const updateUser = /* GraphQL */ `mutation UpdateUser( $condition: ModelUserConditionInput $input: UpdateUserInput! @@ -168,6 +220,7 @@ export const updateUser = /* GraphQL */ `mutation UpdateUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { diff --git a/amplify/auth/pre-sign-up/graphql/queries.ts b/amplify/auth/pre-sign-up/graphql/queries.ts index 1eea61d..b79d32f 100644 --- a/amplify/auth/pre-sign-up/graphql/queries.ts +++ b/amplify/auth/pre-sign-up/graphql/queries.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedQuery = string & { __generatedQueryInput: InputType; __generatedQueryOutput: OutputType; }; -export const getSessionAttended = - /* GraphQL */ `query GetSessionAttended($id: ID!) { +export const getSessionAttended = /* GraphQL */ `query GetSessionAttended($id: ID!) { getSessionAttended(id: $id) { createdAt date @@ -25,6 +23,7 @@ export const getSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -35,9 +34,20 @@ export const getSessionAttended = } } ` as GeneratedQuery< - APITypes.GetSessionAttendedQueryVariables, - APITypes.GetSessionAttendedQuery - >; + APITypes.GetSessionAttendedQueryVariables, + APITypes.GetSessionAttendedQuery +>; +export const getTimer = /* GraphQL */ `query GetTimer($id: ID!) { + getTimer(id: $id) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedQuery; export const getUser = /* GraphQL */ `query GetUser($id: ID!) { getUser(id: $id) { completedRegistration @@ -46,6 +56,7 @@ export const getUser = /* GraphQL */ `query GetUser($id: ID!) { firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { @@ -89,6 +100,36 @@ export const listSessionAttendeds = /* GraphQL */ `query ListSessionAttendeds( APITypes.ListSessionAttendedsQueryVariables, APITypes.ListSessionAttendedsQuery >; +export const listTimers = /* GraphQL */ `query ListTimers( + $filter: ModelTimerFilterInput + $id: ID + $limit: Int + $nextToken: String + $sortDirection: ModelSortDirection +) { + listTimers( + filter: $filter + id: $id + limit: $limit + nextToken: $nextToken + sortDirection: $sortDirection + ) { + items { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } + nextToken + __typename + } +} +` as GeneratedQuery< + APITypes.ListTimersQueryVariables, + APITypes.ListTimersQuery +>; export const listUsers = /* GraphQL */ `query ListUsers( $filter: ModelUserFilterInput $id: ID @@ -110,6 +151,7 @@ export const listUsers = /* GraphQL */ `query ListUsers( firstName id lastName + numberSessionsAttended profileOwner role totalEarnings diff --git a/amplify/auth/pre-sign-up/graphql/subscriptions.ts b/amplify/auth/pre-sign-up/graphql/subscriptions.ts index 4d85939..e003a89 100644 --- a/amplify/auth/pre-sign-up/graphql/subscriptions.ts +++ b/amplify/auth/pre-sign-up/graphql/subscriptions.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedSubscription = string & { __generatedSubscriptionInput: InputType; __generatedSubscriptionOutput: OutputType; }; -export const onCreateSessionAttended = - /* GraphQL */ `subscription OnCreateSessionAttended( +export const onCreateSessionAttended = /* GraphQL */ `subscription OnCreateSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onCreateSessionAttended(filter: $filter) { @@ -27,6 +25,7 @@ export const onCreateSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -37,9 +36,23 @@ export const onCreateSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnCreateSessionAttendedSubscriptionVariables, - APITypes.OnCreateSessionAttendedSubscription - >; + APITypes.OnCreateSessionAttendedSubscriptionVariables, + APITypes.OnCreateSessionAttendedSubscription +>; +export const onCreateTimer = /* GraphQL */ `subscription OnCreateTimer($filter: ModelSubscriptionTimerFilterInput) { + onCreateTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnCreateTimerSubscriptionVariables, + APITypes.OnCreateTimerSubscription +>; export const onCreateUser = /* GraphQL */ `subscription OnCreateUser( $filter: ModelSubscriptionUserFilterInput $profileOwner: String @@ -51,6 +64,7 @@ export const onCreateUser = /* GraphQL */ `subscription OnCreateUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { @@ -66,8 +80,7 @@ export const onCreateUser = /* GraphQL */ `subscription OnCreateUser( APITypes.OnCreateUserSubscriptionVariables, APITypes.OnCreateUserSubscription >; -export const onDeleteSessionAttended = - /* GraphQL */ `subscription OnDeleteSessionAttended( +export const onDeleteSessionAttended = /* GraphQL */ `subscription OnDeleteSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onDeleteSessionAttended(filter: $filter) { @@ -84,6 +97,7 @@ export const onDeleteSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -94,9 +108,23 @@ export const onDeleteSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnDeleteSessionAttendedSubscriptionVariables, - APITypes.OnDeleteSessionAttendedSubscription - >; + APITypes.OnDeleteSessionAttendedSubscriptionVariables, + APITypes.OnDeleteSessionAttendedSubscription +>; +export const onDeleteTimer = /* GraphQL */ `subscription OnDeleteTimer($filter: ModelSubscriptionTimerFilterInput) { + onDeleteTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnDeleteTimerSubscriptionVariables, + APITypes.OnDeleteTimerSubscription +>; export const onDeleteUser = /* GraphQL */ `subscription OnDeleteUser( $filter: ModelSubscriptionUserFilterInput $profileOwner: String @@ -108,6 +136,7 @@ export const onDeleteUser = /* GraphQL */ `subscription OnDeleteUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { @@ -123,8 +152,7 @@ export const onDeleteUser = /* GraphQL */ `subscription OnDeleteUser( APITypes.OnDeleteUserSubscriptionVariables, APITypes.OnDeleteUserSubscription >; -export const onUpdateSessionAttended = - /* GraphQL */ `subscription OnUpdateSessionAttended( +export const onUpdateSessionAttended = /* GraphQL */ `subscription OnUpdateSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onUpdateSessionAttended(filter: $filter) { @@ -141,6 +169,7 @@ export const onUpdateSessionAttended = firstName id lastName + numberSessionsAttended profileOwner role totalEarnings @@ -151,9 +180,23 @@ export const onUpdateSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnUpdateSessionAttendedSubscriptionVariables, - APITypes.OnUpdateSessionAttendedSubscription - >; + APITypes.OnUpdateSessionAttendedSubscriptionVariables, + APITypes.OnUpdateSessionAttendedSubscription +>; +export const onUpdateTimer = /* GraphQL */ `subscription OnUpdateTimer($filter: ModelSubscriptionTimerFilterInput) { + onUpdateTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnUpdateTimerSubscriptionVariables, + APITypes.OnUpdateTimerSubscription +>; export const onUpdateUser = /* GraphQL */ `subscription OnUpdateUser( $filter: ModelSubscriptionUserFilterInput $profileOwner: String @@ -165,6 +208,7 @@ export const onUpdateUser = /* GraphQL */ `subscription OnUpdateUser( firstName id lastName + numberSessionsAttended profileOwner role sessionsAttended { diff --git a/amplify/auth/pre-sign-up/handler.ts b/amplify/auth/pre-sign-up/handler.ts index 7f96ef0..799189b 100644 --- a/amplify/auth/pre-sign-up/handler.ts +++ b/amplify/auth/pre-sign-up/handler.ts @@ -48,6 +48,7 @@ export const handler: PreSignUpTriggerHandler = async (event) => { id: event.userName, email: event.request.userAttributes.email, totalEarnings: 0, + numberSessionsAttended: 0, completedRegistration: false, profileOwner: `${event.userName}::${event.userName}`, }, diff --git a/amplify/data/resource.ts b/amplify/data/resource.ts index fb7ce85..5fa0206 100644 --- a/amplify/data/resource.ts +++ b/amplify/data/resource.ts @@ -20,6 +20,7 @@ const schema = a role: a.string().default("FirstTimeUser"), totalEarnings: a.float(), completedRegistration: a.boolean(), + numberSessionsAttended: a.integer(), profileOwner: a .string() .authorization((allow) => [ diff --git a/amplify/functions/dynamoDB-function/graphql/API.ts b/amplify/functions/dynamoDB-function/graphql/API.ts index ad703d9..90bd582 100644 --- a/amplify/functions/dynamoDB-function/graphql/API.ts +++ b/amplify/functions/dynamoDB-function/graphql/API.ts @@ -3,61 +3,73 @@ // This file was automatically generated and should not be edited. export type SessionAttended = { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: User | null; + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: User | null, }; export type User = { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: ModelSessionAttendedConnection | null; - totalEarnings?: number | null; - updatedAt: string; + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: ModelSessionAttendedConnection | null, + totalEarnings?: number | null, + updatedAt: string, }; export type ModelSessionAttendedConnection = { - __typename: "ModelSessionAttendedConnection"; - items: Array; - nextToken?: string | null; + __typename: "ModelSessionAttendedConnection", + items: Array, + nextToken?: string | null, +}; + +export type Timer = { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, }; export type ModelSessionAttendedFilterInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - date?: ModelStringInput | null; - earningsThatSession?: ModelFloatInput | null; - id?: ModelIDInput | null; - not?: ModelSessionAttendedFilterInput | null; - or?: Array | null; - sessionAttendedId?: ModelIDInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelSessionAttendedFilterInput | null > | null, + createdAt?: ModelStringInput | null, + date?: ModelStringInput | null, + earningsThatSession?: ModelFloatInput | null, + id?: ModelIDInput | null, + not?: ModelSessionAttendedFilterInput | null, + or?: Array< ModelSessionAttendedFilterInput | null > | null, + sessionAttendedId?: ModelIDInput | null, + updatedAt?: ModelStringInput | null, }; export type ModelStringInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - size?: ModelSizeInput | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + size?: ModelSizeInput | null, }; export enum ModelAttributeTypes { @@ -73,42 +85,43 @@ export enum ModelAttributeTypes { stringSet = "stringSet", } + export type ModelSizeInput = { - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - le?: number | null; - lt?: number | null; - ne?: number | null; + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelFloatInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - le?: number | null; - lt?: number | null; - ne?: number | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelIDInput = { - attributeExists?: boolean | null; - attributeType?: ModelAttributeTypes | null; - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - size?: ModelSizeInput | null; + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + size?: ModelSizeInput | null, }; export enum ModelSortDirection { @@ -116,551 +129,835 @@ export enum ModelSortDirection { DESC = "DESC", } + +export type ModelTimerFilterInput = { + and?: Array< ModelTimerFilterInput | null > | null, + createdAt?: ModelStringInput | null, + id?: ModelIDInput | null, + nextSessionDate?: ModelStringInput | null, + nextSessionTime?: ModelStringInput | null, + not?: ModelTimerFilterInput | null, + or?: Array< ModelTimerFilterInput | null > | null, + updatedAt?: ModelStringInput | null, +}; + +export type ModelTimerConnection = { + __typename: "ModelTimerConnection", + items: Array, + nextToken?: string | null, +}; + export type ModelUserFilterInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - email?: ModelStringInput | null; - firstName?: ModelStringInput | null; - id?: ModelIDInput | null; - lastName?: ModelStringInput | null; - not?: ModelUserFilterInput | null; - or?: Array | null; - role?: ModelStringInput | null; - totalEarnings?: ModelFloatInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelUserFilterInput | null > | null, + completedRegistration?: ModelBooleanInput | null, + createdAt?: ModelStringInput | null, + email?: ModelStringInput | null, + firstName?: ModelStringInput | null, + id?: ModelIDInput | null, + lastName?: ModelStringInput | null, + not?: ModelUserFilterInput | null, + numberSessionsAttended?: ModelIntInput | null, + or?: Array< ModelUserFilterInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelStringInput | null, + totalEarnings?: ModelFloatInput | null, + updatedAt?: ModelStringInput | null, +}; + +export type ModelBooleanInput = { + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + eq?: boolean | null, + ne?: boolean | null, +}; + +export type ModelIntInput = { + attributeExists?: boolean | null, + attributeType?: ModelAttributeTypes | null, + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + le?: number | null, + lt?: number | null, + ne?: number | null, }; export type ModelUserConnection = { - __typename: "ModelUserConnection"; - items: Array; - nextToken?: string | null; + __typename: "ModelUserConnection", + items: Array, + nextToken?: string | null, }; export type ModelSessionAttendedConditionInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - date?: ModelStringInput | null; - earningsThatSession?: ModelFloatInput | null; - not?: ModelSessionAttendedConditionInput | null; - or?: Array | null; - sessionAttendedId?: ModelIDInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelSessionAttendedConditionInput | null > | null, + createdAt?: ModelStringInput | null, + date?: ModelStringInput | null, + earningsThatSession?: ModelFloatInput | null, + not?: ModelSessionAttendedConditionInput | null, + or?: Array< ModelSessionAttendedConditionInput | null > | null, + sessionAttendedId?: ModelIDInput | null, + updatedAt?: ModelStringInput | null, }; export type CreateSessionAttendedInput = { - date: string; - earningsThatSession?: number | null; - id?: string | null; - sessionAttendedId: string; + date: string, + earningsThatSession?: number | null, + id?: string | null, + sessionAttendedId: string, +}; + +export type ModelTimerConditionInput = { + and?: Array< ModelTimerConditionInput | null > | null, + createdAt?: ModelStringInput | null, + nextSessionDate?: ModelStringInput | null, + nextSessionTime?: ModelStringInput | null, + not?: ModelTimerConditionInput | null, + or?: Array< ModelTimerConditionInput | null > | null, + updatedAt?: ModelStringInput | null, +}; + +export type CreateTimerInput = { + id?: string | null, + nextSessionDate?: string | null, + nextSessionTime?: string | null, }; export type ModelUserConditionInput = { - and?: Array | null; - createdAt?: ModelStringInput | null; - email?: ModelStringInput | null; - firstName?: ModelStringInput | null; - lastName?: ModelStringInput | null; - not?: ModelUserConditionInput | null; - or?: Array | null; - role?: ModelStringInput | null; - totalEarnings?: ModelFloatInput | null; - updatedAt?: ModelStringInput | null; + and?: Array< ModelUserConditionInput | null > | null, + completedRegistration?: ModelBooleanInput | null, + createdAt?: ModelStringInput | null, + email?: ModelStringInput | null, + firstName?: ModelStringInput | null, + lastName?: ModelStringInput | null, + not?: ModelUserConditionInput | null, + numberSessionsAttended?: ModelIntInput | null, + or?: Array< ModelUserConditionInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelStringInput | null, + totalEarnings?: ModelFloatInput | null, + updatedAt?: ModelStringInput | null, }; export type CreateUserInput = { - email: string; - firstName: string; - id?: string | null; - lastName: string; - role?: string | null; - totalEarnings?: number | null; + completedRegistration?: boolean | null, + email?: string | null, + firstName?: string | null, + id?: string | null, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, }; export type DeleteSessionAttendedInput = { - id: string; + id: string, +}; + +export type DeleteTimerInput = { + id: string, }; export type DeleteUserInput = { - id: string; + id: string, }; export type UpdateSessionAttendedInput = { - date?: string | null; - earningsThatSession?: number | null; - id: string; - sessionAttendedId?: string | null; + date?: string | null, + earningsThatSession?: number | null, + id: string, + sessionAttendedId?: string | null, +}; + +export type UpdateTimerInput = { + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, }; export type UpdateUserInput = { - email?: string | null; - firstName?: string | null; - id: string; - lastName?: string | null; - role?: string | null; - totalEarnings?: number | null; + completedRegistration?: boolean | null, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, }; export type ModelSubscriptionSessionAttendedFilterInput = { - and?: Array | null; - createdAt?: ModelSubscriptionStringInput | null; - date?: ModelSubscriptionStringInput | null; - earningsThatSession?: ModelSubscriptionFloatInput | null; - id?: ModelSubscriptionIDInput | null; - or?: Array | null; - sessionAttendedId?: ModelSubscriptionIDInput | null; - updatedAt?: ModelSubscriptionStringInput | null; + and?: Array< ModelSubscriptionSessionAttendedFilterInput | null > | null, + createdAt?: ModelSubscriptionStringInput | null, + date?: ModelSubscriptionStringInput | null, + earningsThatSession?: ModelSubscriptionFloatInput | null, + id?: ModelSubscriptionIDInput | null, + or?: Array< ModelSubscriptionSessionAttendedFilterInput | null > | null, + sessionAttendedId?: ModelSubscriptionIDInput | null, + updatedAt?: ModelSubscriptionStringInput | null, }; export type ModelSubscriptionStringInput = { - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - in?: Array | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - notIn?: Array | null; + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + in?: Array< string | null > | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + notIn?: Array< string | null > | null, }; export type ModelSubscriptionFloatInput = { - between?: Array | null; - eq?: number | null; - ge?: number | null; - gt?: number | null; - in?: Array | null; - le?: number | null; - lt?: number | null; - ne?: number | null; - notIn?: Array | null; + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + in?: Array< number | null > | null, + le?: number | null, + lt?: number | null, + ne?: number | null, + notIn?: Array< number | null > | null, }; export type ModelSubscriptionIDInput = { - beginsWith?: string | null; - between?: Array | null; - contains?: string | null; - eq?: string | null; - ge?: string | null; - gt?: string | null; - in?: Array | null; - le?: string | null; - lt?: string | null; - ne?: string | null; - notContains?: string | null; - notIn?: Array | null; + beginsWith?: string | null, + between?: Array< string | null > | null, + contains?: string | null, + eq?: string | null, + ge?: string | null, + gt?: string | null, + in?: Array< string | null > | null, + le?: string | null, + lt?: string | null, + ne?: string | null, + notContains?: string | null, + notIn?: Array< string | null > | null, +}; + +export type ModelSubscriptionTimerFilterInput = { + and?: Array< ModelSubscriptionTimerFilterInput | null > | null, + createdAt?: ModelSubscriptionStringInput | null, + id?: ModelSubscriptionIDInput | null, + nextSessionDate?: ModelSubscriptionStringInput | null, + nextSessionTime?: ModelSubscriptionStringInput | null, + or?: Array< ModelSubscriptionTimerFilterInput | null > | null, + updatedAt?: ModelSubscriptionStringInput | null, }; export type ModelSubscriptionUserFilterInput = { - and?: Array | null; - createdAt?: ModelSubscriptionStringInput | null; - email?: ModelSubscriptionStringInput | null; - firstName?: ModelSubscriptionStringInput | null; - id?: ModelSubscriptionIDInput | null; - lastName?: ModelSubscriptionStringInput | null; - or?: Array | null; - role?: ModelSubscriptionStringInput | null; - totalEarnings?: ModelSubscriptionFloatInput | null; - updatedAt?: ModelSubscriptionStringInput | null; + and?: Array< ModelSubscriptionUserFilterInput | null > | null, + completedRegistration?: ModelSubscriptionBooleanInput | null, + createdAt?: ModelSubscriptionStringInput | null, + email?: ModelSubscriptionStringInput | null, + firstName?: ModelSubscriptionStringInput | null, + id?: ModelSubscriptionIDInput | null, + lastName?: ModelSubscriptionStringInput | null, + numberSessionsAttended?: ModelSubscriptionIntInput | null, + or?: Array< ModelSubscriptionUserFilterInput | null > | null, + profileOwner?: ModelStringInput | null, + role?: ModelSubscriptionStringInput | null, + totalEarnings?: ModelSubscriptionFloatInput | null, + updatedAt?: ModelSubscriptionStringInput | null, +}; + +export type ModelSubscriptionBooleanInput = { + eq?: boolean | null, + ne?: boolean | null, +}; + +export type ModelSubscriptionIntInput = { + between?: Array< number | null > | null, + eq?: number | null, + ge?: number | null, + gt?: number | null, + in?: Array< number | null > | null, + le?: number | null, + lt?: number | null, + ne?: number | null, + notIn?: Array< number | null > | null, }; export type GetSessionAttendedQueryVariables = { - id: string; + id: string, }; export type GetSessionAttendedQuery = { - getSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + getSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type GetTimerQueryVariables = { + id: string, +}; + +export type GetTimerQuery = { + getTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type GetUserQueryVariables = { - id: string; + id: string, }; export type GetUserQuery = { - getUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + getUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type ListSessionAttendedsQueryVariables = { - filter?: ModelSessionAttendedFilterInput | null; - id?: string | null; - limit?: number | null; - nextToken?: string | null; - sortDirection?: ModelSortDirection | null; + filter?: ModelSessionAttendedFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, }; export type ListSessionAttendedsQuery = { - listSessionAttendeds?: { - __typename: "ModelSessionAttendedConnection"; - items: Array<{ - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - } | null>; - nextToken?: string | null; - } | null; + listSessionAttendeds?: { + __typename: "ModelSessionAttendedConnection", + items: Array< { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, +}; + +export type ListTimersQueryVariables = { + filter?: ModelTimerFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, +}; + +export type ListTimersQuery = { + listTimers?: { + __typename: "ModelTimerConnection", + items: Array< { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, }; export type ListUsersQueryVariables = { - filter?: ModelUserFilterInput | null; - id?: string | null; - limit?: number | null; - nextToken?: string | null; - sortDirection?: ModelSortDirection | null; + filter?: ModelUserFilterInput | null, + id?: string | null, + limit?: number | null, + nextToken?: string | null, + sortDirection?: ModelSortDirection | null, }; export type ListUsersQuery = { - listUsers?: { - __typename: "ModelUserConnection"; - items: Array<{ - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null>; - nextToken?: string | null; - } | null; + listUsers?: { + __typename: "ModelUserConnection", + items: Array< { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null >, + nextToken?: string | null, + } | null, }; export type CreateSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: CreateSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: CreateSessionAttendedInput, }; export type CreateSessionAttendedMutation = { - createSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + createSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type CreateTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: CreateTimerInput, +}; + +export type CreateTimerMutation = { + createTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type CreateUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: CreateUserInput; + condition?: ModelUserConditionInput | null, + input: CreateUserInput, }; export type CreateUserMutation = { - createUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + createUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type DeleteSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: DeleteSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: DeleteSessionAttendedInput, }; export type DeleteSessionAttendedMutation = { - deleteSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + deleteSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type DeleteTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: DeleteTimerInput, +}; + +export type DeleteTimerMutation = { + deleteTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type DeleteUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: DeleteUserInput; + condition?: ModelUserConditionInput | null, + input: DeleteUserInput, }; export type DeleteUserMutation = { - deleteUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + deleteUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type UpdateSessionAttendedMutationVariables = { - condition?: ModelSessionAttendedConditionInput | null; - input: UpdateSessionAttendedInput; + condition?: ModelSessionAttendedConditionInput | null, + input: UpdateSessionAttendedInput, }; export type UpdateSessionAttendedMutation = { - updateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + updateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type UpdateTimerMutationVariables = { + condition?: ModelTimerConditionInput | null, + input: UpdateTimerInput, +}; + +export type UpdateTimerMutation = { + updateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type UpdateUserMutationVariables = { - condition?: ModelUserConditionInput | null; - input: UpdateUserInput; + condition?: ModelUserConditionInput | null, + input: UpdateUserInput, }; export type UpdateUserMutation = { - updateUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + updateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnCreateSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnCreateSessionAttendedSubscription = { - onCreateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onCreateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnCreateTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnCreateTimerSubscription = { + onCreateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnCreateUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnCreateUserSubscription = { - onCreateUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onCreateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnDeleteSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnDeleteSessionAttendedSubscription = { - onDeleteSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onDeleteSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnDeleteTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnDeleteTimerSubscription = { + onDeleteTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnDeleteUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnDeleteUserSubscription = { - onDeleteUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onDeleteUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; export type OnUpdateSessionAttendedSubscriptionVariables = { - filter?: ModelSubscriptionSessionAttendedFilterInput | null; + filter?: ModelSubscriptionSessionAttendedFilterInput | null, }; export type OnUpdateSessionAttendedSubscription = { - onUpdateSessionAttended?: { - __typename: "SessionAttended"; - createdAt: string; - date: string; - earningsThatSession?: number | null; - id: string; - sessionAttendedId: string; - updatedAt: string; - user?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; - } | null; + onUpdateSessionAttended?: { + __typename: "SessionAttended", + createdAt: string, + date: string, + earningsThatSession?: number | null, + id: string, + sessionAttendedId: string, + updatedAt: string, + user?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, + } | null, +}; + +export type OnUpdateTimerSubscriptionVariables = { + filter?: ModelSubscriptionTimerFilterInput | null, +}; + +export type OnUpdateTimerSubscription = { + onUpdateTimer?: { + __typename: "Timer", + createdAt: string, + id: string, + nextSessionDate?: string | null, + nextSessionTime?: string | null, + updatedAt: string, + } | null, }; export type OnUpdateUserSubscriptionVariables = { - filter?: ModelSubscriptionUserFilterInput | null; + filter?: ModelSubscriptionUserFilterInput | null, + profileOwner?: string | null, }; export type OnUpdateUserSubscription = { - onUpdateUser?: { - __typename: "User"; - createdAt: string; - email: string; - firstName: string; - id: string; - lastName: string; - role?: string | null; - sessionsAttended?: { - __typename: "ModelSessionAttendedConnection"; - nextToken?: string | null; - } | null; - totalEarnings?: number | null; - updatedAt: string; - } | null; + onUpdateUser?: { + __typename: "User", + completedRegistration?: boolean | null, + createdAt: string, + email?: string | null, + firstName?: string | null, + id: string, + lastName?: string | null, + numberSessionsAttended?: number | null, + profileOwner?: string | null, + role?: string | null, + sessionsAttended?: { + __typename: "ModelSessionAttendedConnection", + nextToken?: string | null, + } | null, + totalEarnings?: number | null, + updatedAt: string, + } | null, }; diff --git a/amplify/functions/dynamoDB-function/graphql/mutations.ts b/amplify/functions/dynamoDB-function/graphql/mutations.ts index 6363554..8a5209e 100644 --- a/amplify/functions/dynamoDB-function/graphql/mutations.ts +++ b/amplify/functions/dynamoDB-function/graphql/mutations.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedMutation = string & { __generatedMutationInput: InputType; __generatedMutationOutput: OutputType; }; -export const createSessionAttended = - /* GraphQL */ `mutation CreateSessionAttended( +export const createSessionAttended = /* GraphQL */ `mutation CreateSessionAttended( $condition: ModelSessionAttendedConditionInput $input: CreateSessionAttendedInput! ) { @@ -22,11 +20,14 @@ export const createSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -36,19 +37,39 @@ export const createSessionAttended = } } ` as GeneratedMutation< - APITypes.CreateSessionAttendedMutationVariables, - APITypes.CreateSessionAttendedMutation - >; + APITypes.CreateSessionAttendedMutationVariables, + APITypes.CreateSessionAttendedMutation +>; +export const createTimer = /* GraphQL */ `mutation CreateTimer( + $condition: ModelTimerConditionInput + $input: CreateTimerInput! +) { + createTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.CreateTimerMutationVariables, + APITypes.CreateTimerMutation +>; export const createUser = /* GraphQL */ `mutation CreateUser( $condition: ModelUserConditionInput $input: CreateUserInput! ) { createUser(condition: $condition, input: $input) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -63,8 +84,7 @@ export const createUser = /* GraphQL */ `mutation CreateUser( APITypes.CreateUserMutationVariables, APITypes.CreateUserMutation >; -export const deleteSessionAttended = - /* GraphQL */ `mutation DeleteSessionAttended( +export const deleteSessionAttended = /* GraphQL */ `mutation DeleteSessionAttended( $condition: ModelSessionAttendedConditionInput $input: DeleteSessionAttendedInput! ) { @@ -76,11 +96,14 @@ export const deleteSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -90,19 +113,39 @@ export const deleteSessionAttended = } } ` as GeneratedMutation< - APITypes.DeleteSessionAttendedMutationVariables, - APITypes.DeleteSessionAttendedMutation - >; + APITypes.DeleteSessionAttendedMutationVariables, + APITypes.DeleteSessionAttendedMutation +>; +export const deleteTimer = /* GraphQL */ `mutation DeleteTimer( + $condition: ModelTimerConditionInput + $input: DeleteTimerInput! +) { + deleteTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.DeleteTimerMutationVariables, + APITypes.DeleteTimerMutation +>; export const deleteUser = /* GraphQL */ `mutation DeleteUser( $condition: ModelUserConditionInput $input: DeleteUserInput! ) { deleteUser(condition: $condition, input: $input) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -117,8 +160,7 @@ export const deleteUser = /* GraphQL */ `mutation DeleteUser( APITypes.DeleteUserMutationVariables, APITypes.DeleteUserMutation >; -export const updateSessionAttended = - /* GraphQL */ `mutation UpdateSessionAttended( +export const updateSessionAttended = /* GraphQL */ `mutation UpdateSessionAttended( $condition: ModelSessionAttendedConditionInput $input: UpdateSessionAttendedInput! ) { @@ -130,11 +172,14 @@ export const updateSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -144,19 +189,39 @@ export const updateSessionAttended = } } ` as GeneratedMutation< - APITypes.UpdateSessionAttendedMutationVariables, - APITypes.UpdateSessionAttendedMutation - >; + APITypes.UpdateSessionAttendedMutationVariables, + APITypes.UpdateSessionAttendedMutation +>; +export const updateTimer = /* GraphQL */ `mutation UpdateTimer( + $condition: ModelTimerConditionInput + $input: UpdateTimerInput! +) { + updateTimer(condition: $condition, input: $input) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedMutation< + APITypes.UpdateTimerMutationVariables, + APITypes.UpdateTimerMutation +>; export const updateUser = /* GraphQL */ `mutation UpdateUser( $condition: ModelUserConditionInput $input: UpdateUserInput! ) { updateUser(condition: $condition, input: $input) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken diff --git a/amplify/functions/dynamoDB-function/graphql/queries.ts b/amplify/functions/dynamoDB-function/graphql/queries.ts index bf980f7..b79d32f 100644 --- a/amplify/functions/dynamoDB-function/graphql/queries.ts +++ b/amplify/functions/dynamoDB-function/graphql/queries.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedQuery = string & { __generatedQueryInput: InputType; __generatedQueryOutput: OutputType; }; -export const getSessionAttended = - /* GraphQL */ `query GetSessionAttended($id: ID!) { +export const getSessionAttended = /* GraphQL */ `query GetSessionAttended($id: ID!) { getSessionAttended(id: $id) { createdAt date @@ -19,11 +17,14 @@ export const getSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -33,16 +34,30 @@ export const getSessionAttended = } } ` as GeneratedQuery< - APITypes.GetSessionAttendedQueryVariables, - APITypes.GetSessionAttendedQuery - >; + APITypes.GetSessionAttendedQueryVariables, + APITypes.GetSessionAttendedQuery +>; +export const getTimer = /* GraphQL */ `query GetTimer($id: ID!) { + getTimer(id: $id) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedQuery; export const getUser = /* GraphQL */ `query GetUser($id: ID!) { getUser(id: $id) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -85,6 +100,36 @@ export const listSessionAttendeds = /* GraphQL */ `query ListSessionAttendeds( APITypes.ListSessionAttendedsQueryVariables, APITypes.ListSessionAttendedsQuery >; +export const listTimers = /* GraphQL */ `query ListTimers( + $filter: ModelTimerFilterInput + $id: ID + $limit: Int + $nextToken: String + $sortDirection: ModelSortDirection +) { + listTimers( + filter: $filter + id: $id + limit: $limit + nextToken: $nextToken + sortDirection: $sortDirection + ) { + items { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } + nextToken + __typename + } +} +` as GeneratedQuery< + APITypes.ListTimersQueryVariables, + APITypes.ListTimersQuery +>; export const listUsers = /* GraphQL */ `query ListUsers( $filter: ModelUserFilterInput $id: ID @@ -100,11 +145,14 @@ export const listUsers = /* GraphQL */ `query ListUsers( sortDirection: $sortDirection ) { items { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt diff --git a/amplify/functions/dynamoDB-function/graphql/subscriptions.ts b/amplify/functions/dynamoDB-function/graphql/subscriptions.ts index bce1436..e003a89 100644 --- a/amplify/functions/dynamoDB-function/graphql/subscriptions.ts +++ b/amplify/functions/dynamoDB-function/graphql/subscriptions.ts @@ -1,16 +1,14 @@ /* tslint:disable */ - /* eslint-disable */ // this is an auto generated file. This will be overwritten -import * as APITypes from "./API"; +import * as APITypes from "./API"; type GeneratedSubscription = string & { __generatedSubscriptionInput: InputType; __generatedSubscriptionOutput: OutputType; }; -export const onCreateSessionAttended = - /* GraphQL */ `subscription OnCreateSessionAttended( +export const onCreateSessionAttended = /* GraphQL */ `subscription OnCreateSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onCreateSessionAttended(filter: $filter) { @@ -21,11 +19,14 @@ export const onCreateSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -35,17 +36,36 @@ export const onCreateSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnCreateSessionAttendedSubscriptionVariables, - APITypes.OnCreateSessionAttendedSubscription - >; -export const onCreateUser = - /* GraphQL */ `subscription OnCreateUser($filter: ModelSubscriptionUserFilterInput) { - onCreateUser(filter: $filter) { + APITypes.OnCreateSessionAttendedSubscriptionVariables, + APITypes.OnCreateSessionAttendedSubscription +>; +export const onCreateTimer = /* GraphQL */ `subscription OnCreateTimer($filter: ModelSubscriptionTimerFilterInput) { + onCreateTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnCreateTimerSubscriptionVariables, + APITypes.OnCreateTimerSubscription +>; +export const onCreateUser = /* GraphQL */ `subscription OnCreateUser( + $filter: ModelSubscriptionUserFilterInput + $profileOwner: String +) { + onCreateUser(filter: $filter, profileOwner: $profileOwner) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -57,11 +77,10 @@ export const onCreateUser = } } ` as GeneratedSubscription< - APITypes.OnCreateUserSubscriptionVariables, - APITypes.OnCreateUserSubscription - >; -export const onDeleteSessionAttended = - /* GraphQL */ `subscription OnDeleteSessionAttended( + APITypes.OnCreateUserSubscriptionVariables, + APITypes.OnCreateUserSubscription +>; +export const onDeleteSessionAttended = /* GraphQL */ `subscription OnDeleteSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onDeleteSessionAttended(filter: $filter) { @@ -72,11 +91,14 @@ export const onDeleteSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -86,17 +108,36 @@ export const onDeleteSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnDeleteSessionAttendedSubscriptionVariables, - APITypes.OnDeleteSessionAttendedSubscription - >; -export const onDeleteUser = - /* GraphQL */ `subscription OnDeleteUser($filter: ModelSubscriptionUserFilterInput) { - onDeleteUser(filter: $filter) { + APITypes.OnDeleteSessionAttendedSubscriptionVariables, + APITypes.OnDeleteSessionAttendedSubscription +>; +export const onDeleteTimer = /* GraphQL */ `subscription OnDeleteTimer($filter: ModelSubscriptionTimerFilterInput) { + onDeleteTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnDeleteTimerSubscriptionVariables, + APITypes.OnDeleteTimerSubscription +>; +export const onDeleteUser = /* GraphQL */ `subscription OnDeleteUser( + $filter: ModelSubscriptionUserFilterInput + $profileOwner: String +) { + onDeleteUser(filter: $filter, profileOwner: $profileOwner) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -108,11 +149,10 @@ export const onDeleteUser = } } ` as GeneratedSubscription< - APITypes.OnDeleteUserSubscriptionVariables, - APITypes.OnDeleteUserSubscription - >; -export const onUpdateSessionAttended = - /* GraphQL */ `subscription OnUpdateSessionAttended( + APITypes.OnDeleteUserSubscriptionVariables, + APITypes.OnDeleteUserSubscription +>; +export const onUpdateSessionAttended = /* GraphQL */ `subscription OnUpdateSessionAttended( $filter: ModelSubscriptionSessionAttendedFilterInput ) { onUpdateSessionAttended(filter: $filter) { @@ -123,11 +163,14 @@ export const onUpdateSessionAttended = sessionAttendedId updatedAt user { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role totalEarnings updatedAt @@ -137,17 +180,36 @@ export const onUpdateSessionAttended = } } ` as GeneratedSubscription< - APITypes.OnUpdateSessionAttendedSubscriptionVariables, - APITypes.OnUpdateSessionAttendedSubscription - >; -export const onUpdateUser = - /* GraphQL */ `subscription OnUpdateUser($filter: ModelSubscriptionUserFilterInput) { - onUpdateUser(filter: $filter) { + APITypes.OnUpdateSessionAttendedSubscriptionVariables, + APITypes.OnUpdateSessionAttendedSubscription +>; +export const onUpdateTimer = /* GraphQL */ `subscription OnUpdateTimer($filter: ModelSubscriptionTimerFilterInput) { + onUpdateTimer(filter: $filter) { + createdAt + id + nextSessionDate + nextSessionTime + updatedAt + __typename + } +} +` as GeneratedSubscription< + APITypes.OnUpdateTimerSubscriptionVariables, + APITypes.OnUpdateTimerSubscription +>; +export const onUpdateUser = /* GraphQL */ `subscription OnUpdateUser( + $filter: ModelSubscriptionUserFilterInput + $profileOwner: String +) { + onUpdateUser(filter: $filter, profileOwner: $profileOwner) { + completedRegistration createdAt email firstName id lastName + numberSessionsAttended + profileOwner role sessionsAttended { nextToken @@ -159,6 +221,6 @@ export const onUpdateUser = } } ` as GeneratedSubscription< - APITypes.OnUpdateUserSubscriptionVariables, - APITypes.OnUpdateUserSubscription - >; + APITypes.OnUpdateUserSubscriptionVariables, + APITypes.OnUpdateUserSubscription +>; diff --git a/amplify/functions/dynamoDB-function/handler.ts b/amplify/functions/dynamoDB-function/handler.ts index b91dd07..ba555b1 100644 --- a/amplify/functions/dynamoDB-function/handler.ts +++ b/amplify/functions/dynamoDB-function/handler.ts @@ -57,7 +57,7 @@ export const handler: DynamoDBStreamHandler = async (event) => { logger.info(`New Image: ${JSON.stringify(newImage)}`); - if (record.eventName === "INSERT" || record.eventName === "MODIFY") { + if (record.eventName === "INSERT") { const userId = newImage.sessionAttendedId as string; const earnings = newImage.earningsThatSession; @@ -76,12 +76,16 @@ export const handler: DynamoDBStreamHandler = async (event) => { logger.info(`User: ${user}`); logger.info(`Total Profit: ${totalEarnings}`); + const numberSessionsAttended = + (user.data.getUser?.numberSessionsAttended || 0) + 1; + const response = await dataClient.graphql({ query: updateUser, variables: { input: { id: userId, totalEarnings: totalEarnings, + numberSessionsAttended: numberSessionsAttended, }, }, }); @@ -108,12 +112,16 @@ export const handler: DynamoDBStreamHandler = async (event) => { const totalEarnings = (user.data.getUser?.totalEarnings || 0) - profit; + const numberSessionsAttended = + (user.data.getUser?.numberSessionsAttended || 0) - 1; + const response = await dataClient.graphql({ query: updateUser, variables: { input: { id: userId, totalEarnings: totalEarnings, + numberSessionsAttended: numberSessionsAttended, }, }, }); @@ -123,6 +131,44 @@ export const handler: DynamoDBStreamHandler = async (event) => { } catch (error) { logger.error(`Error fetching user: ${JSON.stringify(error)}`); } + } else if (record.eventName === "MODIFY") { + const oldImage = unmarshall( + record.dynamodb.OldImage as Record, + ); + const newImage = unmarshall( + record.dynamodb.NewImage as Record, + ); + + const oldProfit = oldImage.earningsThatSession; + const newProfit = newImage.earningsThatSession; + const userId = newImage.sessionAttendedId as string; + + try { + const user = await dataClient.graphql({ + query: getUser, + variables: { + id: userId, + }, + }); + + const totalEarnings = + (user.data.getUser?.totalEarnings || 0) - oldProfit + newProfit; + + const response = await dataClient.graphql({ + query: updateUser, + variables: { + input: { + id: userId, + totalEarnings: totalEarnings, + }, + }, + }); + logger.info( + `User updated after modification of session: ${JSON.stringify(response)}`, + ); + } catch (error) { + logger.error(`Error fetching user: ${JSON.stringify(error)}`); + } } } } diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index dc4ff79..b132d4d 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,31 +1,70 @@ "use client"; +import { useRouter } from "next/navigation"; import { useState } from "react"; import AdminForm from "@/components/admin/AdminForm"; +import EditForm from "@/components/admin/EditForm"; import SetTimer from "@/components/admin/SetTimer"; +import { UserType, useUser } from "@/components/contexts/UserContext"; + +enum Tab { + AdminForm = "AdminForm", + SetTimer = "SetTimer", + EditForm = "EditForm", +} export default function Admin() { - const [toggleSession, setToggleSession] = useState(true); + const [toggleSession, setToggleSession] = useState(Tab.AdminForm); + const router = useRouter(); + const user = useUser(); + + if (user.data.type !== UserType.AdminUser) { + router.push("/home"); + } + return (
-
- - -
-
- {toggleSession ? : } -
+ {user.data.type !== UserType.AdminUser ? ( +

Loading...

+ ) : ( + <> +
+ + + +
+
+ {(() => { + switch (toggleSession) { + case Tab.AdminForm: + return ; + case Tab.SetTimer: + return ; + case Tab.EditForm: + return ; + default: + return ; // Optional: handle default case if needed + } + })()} +
+ + )}
); } diff --git a/src/components/admin/EditForm.tsx b/src/components/admin/EditForm.tsx new file mode 100644 index 0000000..500a856 --- /dev/null +++ b/src/components/admin/EditForm.tsx @@ -0,0 +1,99 @@ +"use client"; + +import { generateClient } from "aws-amplify/data"; +import { useState } from "react"; + +import { type Schema } from "@/../amplify/data/resource"; +import EditPanel from "@/components/admin/EditPanel"; +import { useQuery } from "@tanstack/react-query"; + +const client = generateClient(); + +//definition of user, taken directly from Schema, used in Tanstack useQuery +type User = Schema["User"]["type"]; + +export default function EditForm() { + const [searchQuery, setSearchQuery] = useState(""); + const [selectedUser, setSelectedUser] = useState(null); + const [formSubmitted, setFormSubmitted] = useState(false); + + //to get all the users in our database + const { + data: users = [], + isLoading, + error, + } = useQuery({ + queryKey: ["users"], + queryFn: async () => { + const response = await client.models.User.list(); + return response.data as User[]; + }, + }); + + const handleUserClick = (user: User) => { + setSelectedUser(user); + setFormSubmitted(false); // Reset form submitted state + }; + + const handleSearchChange = (event: React.ChangeEvent) => { + setSearchQuery(event.target.value); + }; + + const filteredUsers = users.filter((user) => + `${user.firstName} ${user.lastName}` + .toLowerCase() + .includes(searchQuery.toLowerCase()), + ); + + return ( +
+
+

Select a User

+ + {isLoading ? ( +

Loading users...

+ ) : error ? ( +

Error fetching users

+ ) : ( +
    + {filteredUsers.map((user) => ( +
  • handleUserClick(user)} + className={`mb-1.25 cursor-pointer rounded border border-gray-300 p-2.5 ${ + selectedUser && selectedUser.id === user.id + ? "bg-gray-200" + : "bg-white" + }`} + > + + {user.firstName} {user.lastName} + +
    {user.email}
    +
  • + ))} +
+ )} +
+ + {selectedUser && ( +
+

+ Edit a Session for {selectedUser.firstName} {selectedUser.lastName} +

+ +
+ )} +
+ ); +} diff --git a/src/components/admin/EditPanel.tsx b/src/components/admin/EditPanel.tsx new file mode 100644 index 0000000..0f8134a --- /dev/null +++ b/src/components/admin/EditPanel.tsx @@ -0,0 +1,163 @@ +"use client"; + +import { generateClient } from "aws-amplify/data"; +import { useState } from "react"; +import { useForm } from "react-hook-form"; + +import { type Schema } from "@/../amplify/data/resource"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; + +interface EditPanelProps { + formSubmitted: boolean; + user: Schema["User"]["type"]; + setFormSubmitted: React.Dispatch>; +} + +type SessionFormData = { + sessionAttendedId: string; + earningsThatSession: number; + date: string; +}; + +export default function EditPanel({ + formSubmitted, + user, + setFormSubmitted, +}: EditPanelProps) { + const client = generateClient(); + const queryClient = useQueryClient(); + + const [selectedSession, setSelectedSession] = useState< + Schema["SessionAttended"]["type"] | null + >(null); + + const { register, handleSubmit, reset } = useForm(); + + const { + data: sessions = [], + isLoading, + error, + } = useQuery({ + queryKey: ["sessionsforuser"], + queryFn: async () => { + const response = await client.models.SessionAttended.list({ + filter: { + sessionAttendedId: { + eq: user!.id, + }, + }, + }); + + return response.data; + }, + }); + + const mutation = useMutation({ + mutationFn: async (data: SessionFormData) => { + await client.models.SessionAttended.update({ + id: selectedSession!.id, + ...data, + }); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["sessionforuser"] }); + setFormSubmitted(true); + setTimeout(() => setFormSubmitted(false), 5000); //hide the successs message after 5 seconds + }, + onError: (error) => { + console.error("Error creating session:", error); + }, + }); + + const onSubmit = (data: SessionFormData) => { + mutation.mutate(data); + }; + + const handleSessionClick = (session: Schema["SessionAttended"]["type"]) => { + setSelectedSession(session); + reset(); // Reset the form when a new user is selected + setFormSubmitted(false); // Reset form submitted state + }; + + return ( +
+
+

Select a Session

+ {isLoading ? ( +

Loading sessions...

+ ) : error ? ( +

Error fetching sessions

+ ) : sessions.length === 0 ? ( +

No sessions found

+ ) : ( +
    + {sessions.map((session) => { + const formattedDate = new Date(session.date).toLocaleDateString( + "en-US", + { + year: "numeric", + month: "long", + day: "numeric", + }, + ); + + return ( +
  • handleSessionClick(session)} + className={`mb-1.25 cursor-pointer rounded border border-gray-300 p-2.5 ${ + selectedSession && selectedSession.id === session.id + ? "bg-gray-200" + : "bg-white" + }`} + > + {formattedDate} +
    ${session.earningsThatSession}
    +
  • + ); + })} +
+ )} +
+ {selectedSession && ( +
+
+ + +
+
+ + +
+ + {formSubmitted && ( +
+ Session has been successfully updated! +
+ )} +
+ )} +
+ ); +} diff --git a/src/components/spreadsheet/MainSpreadsheet.tsx b/src/components/spreadsheet/MainSpreadsheet.tsx index 1ae63bf..15fab6a 100644 --- a/src/components/spreadsheet/MainSpreadsheet.tsx +++ b/src/components/spreadsheet/MainSpreadsheet.tsx @@ -16,7 +16,7 @@ const client = generateClient(); const t1: TableColumn<{ gamblerName: string; totalEarnings: Nullable | undefined; - sesssionsAttend: number; + numberSessionsAttended: Nullable | undefined; }>[] = [ { name: "Name", @@ -30,7 +30,7 @@ const t1: TableColumn<{ }, { name: "Sessions Attended", - selector: (row) => row.sesssionsAttend, + selector: (row) => row.numberSessionsAttended ?? 0, sortable: true, }, ]; @@ -66,7 +66,7 @@ export default function MainSpreadsheet() { data?.map((user) => ({ gamblerName: user.firstName + " " + user.lastName, totalEarnings: user.totalEarnings, - sesssionsAttend: user.sessionsAttended.length, + numberSessionsAttended: user.numberSessionsAttended, })) || [] } pagination