Skip to content

Commit

Permalink
chore: account feature
Browse files Browse the repository at this point in the history
  • Loading branch information
yosvelquintero committed Sep 25, 2023
1 parent 2a0ce24 commit c8ef9ce
Show file tree
Hide file tree
Showing 10 changed files with 419 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ query IdentityUserFind($input: IIoRestorecommerceUserFindRequest!) {
message
}
items {
status {
code
message
}
payload {
...UserFields
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
query IdentityUserRead($input: IIoRestorecommerceResourcebaseReadRequest!) {
identity {
user {
Read(input: $input) {
details {
operationStatus {
code
message
}
items {
payload {
id
active
activationCode
email
name
firstName
lastName
defaultScope
localeId
timezoneId
userType
roleAssociations {
id
role
}
meta {
created
modified
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mutation IdentityUserRequestEmailChange(
$input: IIoRestorecommerceUserChangeEmailRequest!
) {
identity {
user {
RequestEmailChange(input: $input) {
details {
operationStatus {
code
message
}
}
}
}
}
}
171 changes: 171 additions & 0 deletions packages/core/graphql/src/lib/generated/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5278,6 +5278,11 @@ export type IdentityUserFindQuery = {
} | null;
items?: Array<{
__typename?: 'IoRestorecommerceUserUserResponse';
status?: {
__typename?: 'IoRestorecommerceStatusStatus';
code?: number | null;
message?: string | null;
} | null;
payload?: {
__typename?: 'IoRestorecommerceUserUser';
id?: string | null;
Expand Down Expand Up @@ -5361,6 +5366,58 @@ export type IdentityUserMutateMutation = {
};
};

export type IdentityUserReadQueryVariables = Exact<{
input: IIoRestorecommerceResourcebaseReadRequest;
}>;

export type IdentityUserReadQuery = {
__typename?: 'Query';
identity: {
__typename?: 'IdentityQuery';
user: {
__typename?: 'IdentityUserQuery';
Read?: {
__typename?: 'ProtoIoRestorecommerceUserUserListWithRoleResponse';
details?: {
__typename?: 'IoRestorecommerceUserUserListWithRoleResponse';
operationStatus?: {
__typename?: 'IoRestorecommerceStatusOperationStatus';
code?: number | null;
message?: string | null;
} | null;
items?: Array<{
__typename?: 'IoRestorecommerceUserUserRoleResponse';
payload?: {
__typename?: 'IoRestorecommerceUserUserRole';
id?: string | null;
active?: boolean | null;
activationCode?: string | null;
email?: string | null;
name?: string | null;
firstName?: string | null;
lastName?: string | null;
defaultScope?: string | null;
localeId?: string | null;
timezoneId?: string | null;
userType?: IoRestorecommerceUserUserType | null;
roleAssociations?: Array<{
__typename?: 'IoRestorecommerceAuthRoleAssociation';
id?: string | null;
role?: string | null;
}> | null;
meta?: {
__typename?: 'IoRestorecommerceMetaMeta';
created?: unknown | null;
modified?: unknown | null;
} | null;
} | null;
}> | null;
} | null;
} | null;
};
};
};

export type IdentityUserRegisterMutationVariables = Exact<{
input: IIoRestorecommerceUserRegisterRequest;
}>;
Expand Down Expand Up @@ -5410,6 +5467,31 @@ export type IdentityUserRegisterMutation = {
};
};

export type IdentityUserRequestEmailChangeMutationVariables = Exact<{
input: IIoRestorecommerceUserChangeEmailRequest;
}>;

export type IdentityUserRequestEmailChangeMutation = {
__typename?: 'Mutation';
identity: {
__typename?: 'IdentityMutation';
user: {
__typename?: 'IdentityUserMutation';
RequestEmailChange?: {
__typename?: 'ProtoIoRestorecommerceStatusOperationStatusObj';
details?: {
__typename?: 'IoRestorecommerceStatusOperationStatusObj';
operationStatus?: {
__typename?: 'IoRestorecommerceStatusOperationStatus';
code?: number | null;
message?: string | null;
} | null;
} | null;
} | null;
};
};
};

export type IdentityUserRequestPasswordChangeMutationVariables = Exact<{
input: IIoRestorecommerceUserRequestPasswordChangeRequest;
}>;
Expand Down Expand Up @@ -5700,6 +5782,10 @@ export const IdentityUserFindDocument = gql`
message
}
items {
status {
code
message
}
payload {
...UserFields
}
Expand Down Expand Up @@ -5761,6 +5847,59 @@ export class IdentityUserMutateGQL extends Apollo.Mutation<
super(apollo);
}
}
export const IdentityUserReadDocument = gql`
query IdentityUserRead($input: IIoRestorecommerceResourcebaseReadRequest!) {
identity {
user {
Read(input: $input) {
details {
operationStatus {
code
message
}
items {
payload {
id
active
activationCode
email
name
firstName
lastName
defaultScope
localeId
timezoneId
userType
roleAssociations {
id
role
}
meta {
created
modified
}
}
}
}
}
}
}
}
`;

@Injectable({
providedIn: 'root',
})
export class IdentityUserReadGQL extends Apollo.Query<
IdentityUserReadQuery,
IdentityUserReadQueryVariables
> {
override document = IdentityUserReadDocument;

constructor(apollo: Apollo.Apollo) {
super(apollo);
}
}
export const IdentityUserRegisterDocument = gql`
mutation IdentityUserRegister(
$input: IIoRestorecommerceUserRegisterRequest!
Expand Down Expand Up @@ -5797,6 +5936,38 @@ export class IdentityUserRegisterGQL extends Apollo.Mutation<
super(apollo);
}
}
export const IdentityUserRequestEmailChangeDocument = gql`
mutation IdentityUserRequestEmailChange(
$input: IIoRestorecommerceUserChangeEmailRequest!
) {
identity {
user {
RequestEmailChange(input: $input) {
details {
operationStatus {
code
message
}
}
}
}
}
}
`;

@Injectable({
providedIn: 'root',
})
export class IdentityUserRequestEmailChangeGQL extends Apollo.Mutation<
IdentityUserRequestEmailChangeMutation,
IdentityUserRequestEmailChangeMutationVariables
> {
override document = IdentityUserRequestEmailChangeDocument;

constructor(apollo: Apollo.Apollo) {
super(apollo);
}
}
export const IdentityUserRequestPasswordChangeDocument = gql`
mutation IdentityUserRequestPasswordChange(
$input: IIoRestorecommerceUserRequestPasswordChangeRequest!
Expand Down
31 changes: 31 additions & 0 deletions packages/core/state/src/lib/+state/account/account.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,29 @@ import { createAction, props } from '@ngrx/store';

import {
IIoRestorecommerceResourcebaseDeleteRequest,
IIoRestorecommerceUserChangeEmailRequest,
IIoRestorecommerceUserChangePasswordRequest,
IIoRestorecommerceUserFindByTokenRequest,
IIoRestorecommerceUserFindRequest,
IIoRestorecommerceUserUser,
IIoRestorecommerceUserUserList,
} from '@console-core/graphql';

export const userFindRequest = createAction(
'[ACCOUNT] User find request',
props<{ payload: IIoRestorecommerceUserFindRequest }>()
);

export const userFindSuccess = createAction(
'[ACCOUNT] User find success',
props<{ payload: IIoRestorecommerceUserUser }>()
);

export const userFindFail = createAction(
'[ACCOUNT] User find fail',
props<{ error: string }>()
);

export const userFindByTokenRequest = createAction(
'[ACCOUNT] Find user by token request',
props<{ payload: IIoRestorecommerceUserFindByTokenRequest }>()
Expand Down Expand Up @@ -38,6 +55,20 @@ export const userMutateFail = createAction(
props<{ error: string }>()
);

export const userChangeEmailRequest = createAction(
'[ACCOUNT] User change email request',
props<{ payload: IIoRestorecommerceUserChangeEmailRequest }>()
);

export const userChangeEmailSuccess = createAction(
'[ACCOUNT] User change email success'
);

export const userChangeEmailFail = createAction(
'[ACCOUNT] User change email fail',
props<{ error: string }>()
);

export const userChangePasswordRequest = createAction(
'[ACCOUNT] User change password request',
props<{ payload: IIoRestorecommerceUserChangePasswordRequest }>()
Expand Down
Loading

0 comments on commit c8ef9ce

Please sign in to comment.