From 143c6f47213501d3ce9c2e94c947965e1469f5e6 Mon Sep 17 00:00:00 2001 From: Bello Babakolo Date: Mon, 14 Oct 2024 14:27:03 +0100 Subject: [PATCH] create fulfillment submission query --- .../fulfillment/fulfullment-submit.gql | 21 +++++ .../graphql/src/lib/generated/generated.ts | 90 +++++++++++++++++++ .../template/order-template.component.ts | 4 - 3 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 packages/core/graphql/src/lib/documents/fulfillment/fulfullment-submit.gql diff --git a/packages/core/graphql/src/lib/documents/fulfillment/fulfullment-submit.gql b/packages/core/graphql/src/lib/documents/fulfillment/fulfullment-submit.gql new file mode 100644 index 00000000..9f2212c9 --- /dev/null +++ b/packages/core/graphql/src/lib/documents/fulfillment/fulfullment-submit.gql @@ -0,0 +1,21 @@ +mutation FulfillmentFulfillmentSubmit( + $input: IIoRestorecommerceFulfillmentFulfillmentList! +) { + fulfillment { + fulfillment { + Submit(input: $input) { + details { + operationStatus { + code + message + } + items { + payload { + ...FulfillmentFragment + } + } + } + } + } + } +} diff --git a/packages/core/graphql/src/lib/generated/generated.ts b/packages/core/graphql/src/lib/generated/generated.ts index 7dc2c358..e53b5d35 100644 --- a/packages/core/graphql/src/lib/generated/generated.ts +++ b/packages/core/graphql/src/lib/generated/generated.ts @@ -7356,6 +7356,58 @@ export type FulfillmentFulfillmentReadQuery = { }; }; +export type FulfillmentFulfillmentSubmitMutationVariables = Exact<{ + input: IIoRestorecommerceFulfillmentFulfillmentList; +}>; + +export type FulfillmentFulfillmentSubmitMutation = { + __typename?: 'Mutation'; + fulfillment: { + __typename?: 'FulfillmentMutation'; + fulfillment: { + __typename?: 'FulfillmentFulfillmentMutation'; + Submit?: { + __typename?: 'ProtoIoRestorecommerceFulfillmentFulfillmentListResponse'; + details?: { + __typename?: 'IoRestorecommerceFulfillmentFulfillmentListResponse'; + operationStatus?: { + __typename?: 'IoRestorecommerceStatusOperationStatus'; + code?: number | null; + message?: string | null; + } | null; + items?: Array<{ + __typename?: 'IoRestorecommerceFulfillmentFulfillmentResponse'; + payload?: { + __typename?: 'IoRestorecommerceFulfillmentFulfillment'; + id?: string | null; + customerId?: string | null; + shopId?: string | null; + userId?: string | null; + meta?: { + __typename?: 'IoRestorecommerceMetaMeta'; + created?: unknown | null; + modified?: unknown | null; + createdBy?: string | null; + modifiedBy?: string | null; + owners?: Array<{ + __typename?: 'IoRestorecommerceAttributeAttribute'; + id?: string | null; + value?: string | null; + attributes?: Array<{ + __typename?: 'IoRestorecommerceAttributeAttribute'; + id?: string | null; + value?: string | null; + }> | null; + }> | null; + } | null; + } | null; + }> | null; + } | null; + } | null; + }; + }; +}; + export type IdentityRoleMutateMutationVariables = Exact<{ input: IIoRestorecommerceRoleRoleList; }>; @@ -11026,6 +11078,44 @@ export class FulfillmentFulfillmentReadGQL extends Apollo.Query< super(apollo); } } +export const FulfillmentFulfillmentSubmitDocument = gql` + mutation FulfillmentFulfillmentSubmit( + $input: IIoRestorecommerceFulfillmentFulfillmentList! + ) { + fulfillment { + fulfillment { + Submit(input: $input) { + details { + operationStatus { + code + message + } + items { + payload { + ...FulfillmentFragment + } + } + } + } + } + } + } + ${FulfillmentFragmentFragmentDoc} +`; + +@Injectable({ + providedIn: 'root', +}) +export class FulfillmentFulfillmentSubmitGQL extends Apollo.Mutation< + FulfillmentFulfillmentSubmitMutation, + FulfillmentFulfillmentSubmitMutationVariables +> { + override document = FulfillmentFulfillmentSubmitDocument; + + constructor(apollo: Apollo.Apollo) { + super(apollo); + } +} export const IdentityRoleMutateDocument = gql` mutation IdentityRoleMutate($input: IIoRestorecommerceRoleRoleList!) { identity { diff --git a/packages/modules/order/src/lib/components/template/order-template.component.ts b/packages/modules/order/src/lib/components/template/order-template.component.ts index b6bfe5e6..dd3e0c44 100644 --- a/packages/modules/order/src/lib/components/template/order-template.component.ts +++ b/packages/modules/order/src/lib/components/template/order-template.component.ts @@ -122,10 +122,6 @@ export class OrderTemplateComponent implements OnInit, OnDestroy { } this.orderFacade.createFulfilment(id); - - // From the Id, we need the Order. - // From this Order, create a Fulfiment Creation Input. - // Finally, dispatch, the create fulfilment action. }) );