From 949d69282b188bb8703b4e13dc44c3d43e181c3c Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Thu, 24 Oct 2024 12:57:41 +1300 Subject: [PATCH 01/23] Add delete response requisition service layer --- server/service/src/requisition_line/mod.rs | 12 ++++ .../response_requisition_line/delete.rs | 72 +++++++++++++++++++ .../response_requisition_line/mod.rs | 3 + 3 files changed, 87 insertions(+) create mode 100644 server/service/src/requisition_line/response_requisition_line/delete.rs diff --git a/server/service/src/requisition_line/mod.rs b/server/service/src/requisition_line/mod.rs index 878a3c127a..81c4fe4877 100644 --- a/server/service/src/requisition_line/mod.rs +++ b/server/service/src/requisition_line/mod.rs @@ -25,6 +25,10 @@ use super::{ListError, ListResult}; use crate::service_provider::ServiceContext; use repository::{RequisitionLine, RequisitionLineFilter}; +use response_requisition_line::{ + delete_response_requisition_line, DeleteResponseRequisitionLine, + DeleteResponseRequisitionLineError, +}; pub mod chart; pub mod common; @@ -96,6 +100,14 @@ pub trait RequisitionLineServiceTrait: Sync + Send { ) -> Result { get_response_requisition_line_stats(ctx, requisition_line_id) } + + fn delete_requisition_line( + &self, + ctx: &ServiceContext, + input: DeleteResponseRequisitionLine, + ) -> Result { + delete_response_requisition_line(ctx, input) + } } pub struct RequisitionLineService {} diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs new file mode 100644 index 0000000000..94de6e4586 --- /dev/null +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -0,0 +1,72 @@ +use repository::{ + requisition_row::{RequisitionStatus, RequisitionType}, + RepositoryError, RequisitionLineRowRepository, StorageConnection, +}; + +use crate::{ + requisition::common::check_requisition_row_exists, + requisition_line::common::check_requisition_line_exists, service_provider::ServiceContext, +}; + +#[derive(Debug, PartialEq, Clone, Default)] +pub struct DeleteResponseRequisitionLine { + pub id: String, +} + +#[derive(Debug, PartialEq)] + +pub enum DeleteResponseRequisitionLineError { + RequisitionLineDoesNotExist, + NotThisStoreRequisition, + NotAResponseRequisition, + RequisitionDoesNotExist, + DatabaseError(RepositoryError), +} + +type OutError = DeleteResponseRequisitionLineError; + +pub fn delete_response_requisition_line( + ctx: &ServiceContext, + input: DeleteResponseRequisitionLine, +) -> Result { + ctx.connection + .transaction_sync(|connection| { + validate(connection, &ctx.store_id, &input)?; + + RequisitionLineRowRepository::new(connection) + .delete(&input.id) + .map_err(OutError::DatabaseError) + }) + .map_err(|error| error.to_inner_error())?; + Ok(input.id) +} + +fn validate( + connection: &StorageConnection, + store_id: &str, + input: &DeleteResponseRequisitionLine, +) -> Result<(), OutError> { + let requisition_line_row = check_requisition_line_exists(connection, &input.id)? + .ok_or(OutError::RequisitionLineDoesNotExist)? + .requisition_line_row; + + let requisition_row = + check_requisition_row_exists(connection, &requisition_line_row.requisition_id)? + .ok_or(OutError::RequisitionDoesNotExist)?; + + if requisition_row.store_id != store_id { + return Err(OutError::NotThisStoreRequisition); + } + + if requisition_row.r#type != RequisitionType::Request { + return Err(OutError::NotAResponseRequisition); + } + + Ok(()) +} + +impl From for DeleteResponseRequisitionLineError { + fn from(error: RepositoryError) -> Self { + DeleteResponseRequisitionLineError::DatabaseError(error) + } +} diff --git a/server/service/src/requisition_line/response_requisition_line/mod.rs b/server/service/src/requisition_line/response_requisition_line/mod.rs index aa4093f7b3..c62270eb32 100644 --- a/server/service/src/requisition_line/response_requisition_line/mod.rs +++ b/server/service/src/requisition_line/response_requisition_line/mod.rs @@ -1,2 +1,5 @@ mod update; pub use update::*; + +mod delete; +pub use delete::*; From 18a745b82b6f9c8514c041c50e63b92e00a70a4a Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Thu, 24 Oct 2024 13:51:20 +1300 Subject: [PATCH 02/23] Add service layer tests --- .../src/mock/test_requisition_service.rs | 2 +- server/service/src/requisition_line/mod.rs | 2 +- .../response_requisition_line/delete.rs | 112 +++++++++++++++++- 3 files changed, 111 insertions(+), 5 deletions(-) diff --git a/server/repository/src/mock/test_requisition_service.rs b/server/repository/src/mock/test_requisition_service.rs index 6a6baef660..cbe9647482 100644 --- a/server/repository/src/mock/test_requisition_service.rs +++ b/server/repository/src/mock/test_requisition_service.rs @@ -209,7 +209,7 @@ pub fn mock_full_draft_response_requisition_for_update_test() -> FullMockRequisi r.name_link_id = "name_a".to_string(); r.store_id = mock_store_a().id; r.r#type = RequisitionType::Response; - r.status = RequisitionStatus::Draft; + r.status = RequisitionStatus::New; r.created_datetime = NaiveDate::from_ymd_opt(2021, 1, 1) .unwrap() .and_hms_opt(0, 0, 0) diff --git a/server/service/src/requisition_line/mod.rs b/server/service/src/requisition_line/mod.rs index 81c4fe4877..4985b28867 100644 --- a/server/service/src/requisition_line/mod.rs +++ b/server/service/src/requisition_line/mod.rs @@ -101,7 +101,7 @@ pub trait RequisitionLineServiceTrait: Sync + Send { get_response_requisition_line_stats(ctx, requisition_line_id) } - fn delete_requisition_line( + fn delete_response_requisition_line( &self, ctx: &ServiceContext, input: DeleteResponseRequisitionLine, diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index 94de6e4586..9c5b7adeab 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -1,6 +1,6 @@ use repository::{ - requisition_row::{RequisitionStatus, RequisitionType}, - RepositoryError, RequisitionLineRowRepository, StorageConnection, + requisition_row::RequisitionType, RepositoryError, RequisitionLineRowRepository, + StorageConnection, }; use crate::{ @@ -58,7 +58,7 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.r#type != RequisitionType::Request { + if requisition_row.r#type != RequisitionType::Response { return Err(OutError::NotAResponseRequisition); } @@ -70,3 +70,109 @@ impl From for DeleteResponseRequisitionLineError { DeleteResponseRequisitionLineError::DatabaseError(error) } } + +#[cfg(test)] +mod test { + use repository::{ + mock::{ + mock_full_draft_response_requisition_for_update_test, + mock_request_draft_requisition_calculation_test, mock_store_a, mock_store_b, + MockDataInserts, + }, + test_db::setup_all, + RequisitionLineRowRepository, + }; + + use crate::{ + requisition_line::response_requisition_line::{ + DeleteResponseRequisitionLine, DeleteResponseRequisitionLineError as ServiceError, + }, + service_provider::ServiceProvider, + }; + + #[actix_rt::test] + async fn delete_response_requisition_line_errors() { + let (_, _, connection_manager, _) = setup_all( + "delete_response_requisition_line_errors", + MockDataInserts::all(), + ) + .await; + + let service_provider = ServiceProvider::new(connection_manager, "app_data"); + let mut context = service_provider + .context(mock_store_a().id, "".to_string()) + .unwrap(); + let service = service_provider.requisition_line_service; + + // RequisitionLineDoesNotExist + assert_eq!( + service.delete_response_requisition_line( + &context, + DeleteResponseRequisitionLine { + id: "invalid".to_owned(), + }, + ), + Err(ServiceError::RequisitionLineDoesNotExist) + ); + + // NotAResponseRequisition + assert_eq!( + service.delete_response_requisition_line( + &context, + DeleteResponseRequisitionLine { + id: mock_request_draft_requisition_calculation_test().lines[0] + .id + .clone(), + }, + ), + Err(ServiceError::NotAResponseRequisition) + ); + + // NotThisStoreRequisition + context.store_id = mock_store_b().id; + assert_eq!( + service.delete_response_requisition_line( + &context, + DeleteResponseRequisitionLine { + id: mock_full_draft_response_requisition_for_update_test().lines[0] + .id + .clone(), + }, + ), + Err(ServiceError::NotThisStoreRequisition) + ); + } + + #[actix_rt::test] + async fn delete_response_requisition_line_success() { + let (_, connection, connection_manager, _) = setup_all( + "delete_response_requisition_line_success", + MockDataInserts::all(), + ) + .await; + + let service_provider = ServiceProvider::new(connection_manager, "app_data"); + let context = service_provider + .context(mock_store_a().id, "".to_string()) + .unwrap(); + let service = service_provider.requisition_line_service; + + let test_line = mock_full_draft_response_requisition_for_update_test().lines[0].clone(); + + service + .delete_response_requisition_line( + &context, + DeleteResponseRequisitionLine { + id: test_line.id.clone(), + }, + ) + .unwrap(); + + assert_eq!( + RequisitionLineRowRepository::new(&connection) + .find_one_by_id(&test_line.id) + .unwrap(), + None + ); + } +} From a9bb8019ba5ffd4d87c33f51ad6132ac52c183ca Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Thu, 24 Oct 2024 14:16:14 +1300 Subject: [PATCH 03/23] Add graphql layer delete response requisition line --- server/graphql/requisition_line/src/lib.rs | 9 ++ .../response_requisition_line/delete.rs | 103 ++++++++++++++++++ .../response_requisition_line/mod.rs | 3 + 3 files changed, 115 insertions(+) create mode 100644 server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs diff --git a/server/graphql/requisition_line/src/lib.rs b/server/graphql/requisition_line/src/lib.rs index fec4a753b9..887dd382d9 100644 --- a/server/graphql/requisition_line/src/lib.rs +++ b/server/graphql/requisition_line/src/lib.rs @@ -44,4 +44,13 @@ impl RequisitionLineMutations { ) -> Result { response_requisition_line::update(ctx, &store_id, input) } + + async fn delete_response_requisition_line( + &self, + ctx: &Context<'_>, + store_id: String, + input: response_requisition_line::DeleteInput, + ) -> Result { + response_requisition_line::delete(ctx, &store_id, input) + } } diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs new file mode 100644 index 0000000000..8048b7beac --- /dev/null +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs @@ -0,0 +1,103 @@ +use async_graphql::*; +use graphql_core::{ + simple_generic_errors::{CannotEditRequisition, ForeignKey, ForeignKeyError, RecordNotFound}, + standard_graphql_error::{validate_auth, StandardGraphqlError}, + ContextExt, +}; +use graphql_types::types::DeleteResponse as GenericDeleteResponse; + +use service::{ + auth::{Resource, ResourceAccessRequest}, + requisition_line::response_requisition_line::{ + DeleteResponseRequisitionLine as ServiceInput, + DeleteResponseRequisitionLineError as ServiceError, + }, +}; + +#[derive(InputObject)] +#[graphql(name = "DeleteResponseRequisitionLineInput")] +pub struct DeleteInput { + pub id: String, +} + +#[derive(Interface)] +#[graphql(name = "DeleteResponseRequisitionLineErrorInterface")] +#[graphql(field(name = "description", ty = "String"))] +pub enum DeleteErrorInterface { + RecordNotFound(RecordNotFound), + RequisitionDoesNotExist(ForeignKeyError), + CannotEditRequisition(CannotEditRequisition), +} + +#[derive(SimpleObject)] +#[graphql(name = "DeleteResponseRequisitionLineError")] +pub struct DeleteError { + pub error: DeleteErrorInterface, +} + +#[derive(Union)] +#[graphql(name = "DeleteResponseRequisitionLineResponse")] +pub enum DeleteResponse { + Error(DeleteError), + Response(GenericDeleteResponse), +} + +pub fn delete(ctx: &Context<'_>, store_id: &str, input: DeleteInput) -> Result { + let user = validate_auth( + ctx, + &ResourceAccessRequest { + resource: Resource::MutateRequisition, + store_id: Some(store_id.to_string()), + }, + )?; + + let service_provider = ctx.service_provider(); + let service_context = service_provider.context(store_id.to_string(), user.user_id)?; + + map_response( + service_provider + .requisition_line_service + .delete_response_requisition_line(&service_context, input.to_domain()), + ) +} + +impl DeleteInput { + pub fn to_domain(self) -> ServiceInput { + let DeleteInput { id } = self; + ServiceInput { id } + } +} + +pub fn map_response(from: Result) -> Result { + let result = match from { + Ok(deleted_id) => DeleteResponse::Response(GenericDeleteResponse(deleted_id)), + Err(error) => DeleteResponse::Error(DeleteError { + error: map_error(error)?, + }), + }; + + Ok(result) +} + +fn map_error(error: ServiceError) -> Result { + use StandardGraphqlError::*; + let formatted_error = format!("{:#?}", error); + + let graphql_error = match error { + // Structured Errors + ServiceError::RequisitionLineDoesNotExist => { + return Ok(DeleteErrorInterface::RecordNotFound(RecordNotFound {})) + } + ServiceError::RequisitionDoesNotExist => { + return Ok(DeleteErrorInterface::RequisitionDoesNotExist( + ForeignKeyError(ForeignKey::RequisitionId), + )) + } + // Standard Graphql Errors + ServiceError::NotThisStoreRequisition => BadUserInput(formatted_error), + ServiceError::NotAResponseRequisition => BadUserInput(formatted_error), + ServiceError::DatabaseError(_) => InternalError(formatted_error), + }; + + Err(graphql_error.extend()) +} diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs index aa4093f7b3..c62270eb32 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs @@ -1,2 +1,5 @@ mod update; pub use update::*; + +mod delete; +pub use delete::*; From 88953a67fb12e52ec33952c45c500bd72d095f0d Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Thu, 24 Oct 2024 14:27:36 +1300 Subject: [PATCH 04/23] Add check for status as per update response requisition line --- .../response_requisition_line/delete.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index 9c5b7adeab..78804a4373 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -4,8 +4,9 @@ use repository::{ }; use crate::{ - requisition::common::check_requisition_row_exists, - requisition_line::common::check_requisition_line_exists, service_provider::ServiceContext, + requisition::common::{check_approval_status, check_requisition_row_exists}, + requisition_line::common::check_requisition_line_exists, + service_provider::ServiceContext, }; #[derive(Debug, PartialEq, Clone, Default)] @@ -20,6 +21,7 @@ pub enum DeleteResponseRequisitionLineError { NotThisStoreRequisition, NotAResponseRequisition, RequisitionDoesNotExist, + CannotEditRequisition, DatabaseError(RepositoryError), } @@ -54,6 +56,10 @@ fn validate( check_requisition_row_exists(connection, &requisition_line_row.requisition_id)? .ok_or(OutError::RequisitionDoesNotExist)?; + if check_approval_status(&requisition_row) { + return Err(OutError::CannotEditRequisition); + } + if requisition_row.store_id != store_id { return Err(OutError::NotThisStoreRequisition); } From 32c14fb4494fc7e72804a12ca10e200a7f3a946e Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Thu, 24 Oct 2024 14:40:32 +1300 Subject: [PATCH 05/23] Add tests to graphql layer --- .../response_requisition_line/delete.rs | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs index 8048b7beac..e2449d49fa 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs @@ -93,6 +93,11 @@ fn map_error(error: ServiceError) -> Result { ForeignKeyError(ForeignKey::RequisitionId), )) } + ServiceError::CannotEditRequisition => { + return Ok(DeleteErrorInterface::CannotEditRequisition( + CannotEditRequisition {}, + )) + } // Standard Graphql Errors ServiceError::NotThisStoreRequisition => BadUserInput(formatted_error), ServiceError::NotAResponseRequisition => BadUserInput(formatted_error), @@ -101,3 +106,219 @@ fn map_error(error: ServiceError) -> Result { Err(graphql_error.extend()) } + +#[cfg(test)] +mod test { + use crate::RequisitionLineMutations; + use async_graphql::EmptyMutation; + use graphql_core::{ + assert_graphql_query, assert_standard_graphql_error, test_helpers::setup_graphql_test, + }; + use repository::{mock::MockDataInserts, StorageConnectionManager}; + use serde_json::json; + + use service::{ + requisition_line::{ + response_requisition_line::{ + DeleteResponseRequisitionLine as ServiceInput, + DeleteResponseRequisitionLineError as ServiceError, + }, + RequisitionLineServiceTrait, + }, + service_provider::{ServiceContext, ServiceProvider}, + }; + + type DeleteLineMethod = dyn Fn(ServiceInput) -> Result + Sync + Send; + + pub struct TestService(pub Box); + + impl RequisitionLineServiceTrait for TestService { + fn delete_response_requisition_line( + &self, + _: &ServiceContext, + input: ServiceInput, + ) -> Result { + self.0(input) + } + } + + fn service_provider( + test_service: TestService, + connection_manager: &StorageConnectionManager, + ) -> ServiceProvider { + let mut service_provider = ServiceProvider::new(connection_manager.clone(), "app_data"); + service_provider.requisition_line_service = Box::new(test_service); + service_provider + } + + fn empty_variables() -> serde_json::Value { + json!({ + "input": { + "id": "n/a", + }, + "storeId": "n/a" + }) + } + + #[actix_rt::test] + async fn test_graphql_update_response_requisition_line_errors() { + let (_, _, connection_manager, settings) = setup_graphql_test( + EmptyMutation, + RequisitionLineMutations, + "test_graphql_delete_response_requisition_line_structured_errors", + MockDataInserts::all(), + ) + .await; + + let mutation = r#" + mutation ($input: DeleteResponseRequisitionLineInput!, $storeId: String) { + deleteResponseRequisitionLine(storeId: $storeId, input: $input) { + ... on DeleteResponseRequisitionLineError { + error { + __typename + } + } + } + } + "#; + + // RecordNotFound + let test_service = + TestService(Box::new(|_| Err(ServiceError::RequisitionLineDoesNotExist))); + + let expected = json!({ + "deleteResponseRequisitionLine": { + "error": { + "__typename": "RecordNotFound" + } + } + } + ); + + assert_graphql_query!( + &settings, + mutation, + &Some(empty_variables()), + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + + // RequisitionDoesNotExist + let test_service = TestService(Box::new(|_| Err(ServiceError::RequisitionDoesNotExist))); + + let expected = json!({ + "deleteResponseRequisitionLine": { + "error": { + "__typename": "ForeignKeyError" + } + } + } + ); + + assert_graphql_query!( + &settings, + mutation, + &Some(empty_variables()), + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + + // CannotEditRequisition + let test_service = TestService(Box::new(|_| Err(ServiceError::CannotEditRequisition))); + + let expected = json!({ + "deleteResponseRequisitionLine": { + "error": { + "__typename": "CannotEditRequisition" + } + } + } + ); + + assert_graphql_query!( + &settings, + mutation, + &Some(empty_variables()), + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + + // NotThisStoreRequisition + let test_service = TestService(Box::new(|_| Err(ServiceError::NotThisStoreRequisition))); + let expected_message = "Bad user input"; + assert_standard_graphql_error!( + &settings, + &mutation, + &Some(empty_variables()), + &expected_message, + None, + Some(service_provider(test_service, &connection_manager)) + ); + + // NotAResponseRequisition + let test_service = TestService(Box::new(|_| Err(ServiceError::NotAResponseRequisition))); + let expected_message = "Bad user input"; + assert_standard_graphql_error!( + &settings, + &mutation, + &Some(empty_variables()), + &expected_message, + None, + Some(service_provider(test_service, &connection_manager)) + ); + } + + #[actix_rt::test] + async fn test_graphql_delete_response_requisition_line_success() { + let (_, _, connection_manager, settings) = setup_graphql_test( + EmptyMutation, + RequisitionLineMutations, + "test_graphql_delete_response_requisition_line_success", + MockDataInserts::all(), + ) + .await; + + let mutation = r#" + mutation ($storeId: String, $input: DeleteResponseRequisitionLineInput!) { + deleteResponseRequisitionLine(storeId: $storeId, input: $input) { + ... on DeleteResponse { + id + } + } + } + "#; + + // Success + let test_service = TestService(Box::new(|input| { + assert_eq!( + input, + ServiceInput { + id: "delete line id input".to_string(), + } + ); + Ok("deleted id".to_owned()) + })); + + let variables = json!({ + "input": { + "id": "delete line id input", + }, + "storeId": "store_a" + }); + + let expected = json!({ + "deleteResponseRequisitionLine": { + "id": "deleted id" + } + } + ); + + assert_graphql_query!( + &settings, + mutation, + &Some(variables), + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + } +} From fcad1b2fa6489a9e2d195f9bfcbc69668d205170 Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 09:05:30 +1300 Subject: [PATCH 06/23] Add front end deleteResponseLines --- client/packages/common/src/types/schema.ts | 60 ++++++++++++++++++- .../DetailView/DetailView.tsx | 2 +- .../DetailView/{ => Toolbar}/Toolbar.tsx | 20 ++----- .../DetailView/Toolbar/ToolbarDropDown.tsx | 29 +++++++++ .../DetailView/Toolbar/index.ts | 1 + .../src/ResponseRequisition/api/api.ts | 30 +++++----- .../api/hooks/line/useDeleteResponseLines.ts | 39 ++++++------ .../api/operations.generated.ts | 42 +++++++++++++ .../api/operations.graphql | 33 ++++++++++ 9 files changed, 202 insertions(+), 54 deletions(-) rename client/packages/requisitions/src/ResponseRequisition/DetailView/{ => Toolbar}/Toolbar.tsx (88%) create mode 100644 client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx create mode 100644 client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/index.ts diff --git a/client/packages/common/src/types/schema.ts b/client/packages/common/src/types/schema.ts index 6102cf7406..e91e14a1ad 100644 --- a/client/packages/common/src/types/schema.ts +++ b/client/packages/common/src/types/schema.ts @@ -760,6 +760,16 @@ export type BatchRequestRequisitionResponse = { updateRequestRequisitions?: Maybe>; }; +export type BatchResponseRequisitionInput = { + continueOnError?: InputMaybe; + deleteResponseRequisitionLines?: InputMaybe>; +}; + +export type BatchResponseRequisitionResponse = { + __typename: 'BatchResponseRequisitionResponse'; + deleteResponseRequisitionLines?: Maybe>; +}; + export type BatchStocktakeInput = { continueOnError?: InputMaybe; deleteStocktakeLines?: InputMaybe>; @@ -823,7 +833,7 @@ export type CannotEditInvoice = AddToInboundShipmentFromMasterListErrorInterface description: Scalars['String']['output']; }; -export type CannotEditRequisition = AddFromMasterListErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UseSuggestedQuantityErrorInterface & { +export type CannotEditRequisition = AddFromMasterListErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UseSuggestedQuantityErrorInterface & { __typename: 'CannotEditRequisition'; description: Scalars['String']['output']; }; @@ -1511,6 +1521,27 @@ export type DeleteResponse = { id: Scalars['String']['output']; }; +export type DeleteResponseRequisitionLineError = { + __typename: 'DeleteResponseRequisitionLineError'; + error: DeleteResponseRequisitionLineErrorInterface; +}; + +export type DeleteResponseRequisitionLineErrorInterface = { + description: Scalars['String']['output']; +}; + +export type DeleteResponseRequisitionLineInput = { + id: Scalars['String']['input']; +}; + +export type DeleteResponseRequisitionLineResponse = DeleteResponse | DeleteResponseRequisitionLineError; + +export type DeleteResponseRequisitionLineResponseWithId = { + __typename: 'DeleteResponseRequisitionLineResponseWithId'; + id: Scalars['String']['output']; + response: DeleteResponseRequisitionLineResponse; +}; + export type DeleteStocktakeError = { __typename: 'DeleteStocktakeError'; error: DeleteStocktakeErrorInterface; @@ -2120,7 +2151,7 @@ export enum ForeignKey { StockLineId = 'stockLineId' } -export type ForeignKeyError = DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionLineErrorInterface & InsertInboundShipmentLineErrorInterface & InsertInboundShipmentServiceLineErrorInterface & InsertOutboundShipmentLineErrorInterface & InsertOutboundShipmentServiceLineErrorInterface & InsertOutboundShipmentUnallocatedLineErrorInterface & InsertPrescriptionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionLineErrorInterface & { +export type ForeignKeyError = DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & InsertInboundShipmentLineErrorInterface & InsertInboundShipmentServiceLineErrorInterface & InsertOutboundShipmentLineErrorInterface & InsertOutboundShipmentServiceLineErrorInterface & InsertOutboundShipmentUnallocatedLineErrorInterface & InsertPrescriptionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionLineErrorInterface & { __typename: 'ForeignKeyError'; description: Scalars['String']['output']; key: ForeignKey; @@ -2542,6 +2573,7 @@ export type InsertLocationErrorInterface = { export type InsertLocationInput = { code: Scalars['String']['input']; + coldStorageTypeId?: InputMaybe; id: Scalars['String']['input']; name?: InputMaybe; onHold?: InputMaybe; @@ -3792,6 +3824,7 @@ export type Mutations = { batchOutboundShipment: BatchOutboundShipmentResponse; batchPrescription: BatchPrescriptionResponse; batchRequestRequisition: BatchRequestRequisitionResponse; + batchResponseRequisition: BatchResponseRequisitionResponse; batchStocktake: BatchStocktakeResponse; centralServer: CentralServerMutationNode; createInventoryAdjustment: CreateInventoryAdjustmentResponse; @@ -3816,6 +3849,7 @@ export type Mutations = { deletePrescriptionLine: DeletePrescriptionLineResponse; deleteRequestRequisition: DeleteRequestRequisitionResponse; deleteRequestRequisitionLine: DeleteRequestRequisitionLineResponse; + deleteResponseRequisitionLine: DeleteResponseRequisitionLineResponse; deleteStocktake: DeleteStocktakeResponse; deleteStocktakeLine: DeleteStocktakeLineResponse; deleteSupplierReturn: DeleteSupplierReturnResponse; @@ -3974,6 +4008,12 @@ export type MutationsBatchRequestRequisitionArgs = { }; +export type MutationsBatchResponseRequisitionArgs = { + input: BatchResponseRequisitionInput; + storeId: Scalars['String']['input']; +}; + + export type MutationsBatchStocktakeArgs = { input: BatchStocktakeInput; storeId: Scalars['String']['input']; @@ -4076,6 +4116,12 @@ export type MutationsDeleteRequestRequisitionLineArgs = { }; +export type MutationsDeleteResponseRequisitionLineArgs = { + input: DeleteResponseRequisitionLineInput; + storeId: Scalars['String']['input']; +}; + + export type MutationsDeleteStocktakeArgs = { input: DeleteStocktakeInput; storeId: Scalars['String']['input']; @@ -6136,7 +6182,7 @@ export type RecordBelongsToAnotherStore = DeleteAssetErrorInterface & DeleteAsse description: Scalars['String']['output']; }; -export type RecordNotFound = AddFromMasterListErrorInterface & AddToInboundShipmentFromMasterListErrorInterface & AddToOutboundShipmentFromMasterListErrorInterface & AllocateOutboundShipmentUnallocatedLineErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteAssetCatalogueItemErrorInterface & DeleteAssetErrorInterface & DeleteAssetLogReasonErrorInterface & DeleteCustomerReturnErrorInterface & DeleteErrorInterface & DeleteInboundShipmentErrorInterface & DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteLocationErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionErrorInterface & DeletePrescriptionLineErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & DeleteSupplierReturnErrorInterface & DeleteVaccineCourseErrorInterface & NodeErrorInterface & RequisitionLineChartErrorInterface & RequisitionLineStatsErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateAssetErrorInterface & UpdateErrorInterface & UpdateInboundShipmentErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateLocationErrorInterface & UpdateNameErrorInterface & UpdateNamePropertiesErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UpdateReturnOtherPartyErrorInterface & UpdateSensorErrorInterface & UpdateStockLineErrorInterface & UseSuggestedQuantityErrorInterface & { +export type RecordNotFound = AddFromMasterListErrorInterface & AddToInboundShipmentFromMasterListErrorInterface & AddToOutboundShipmentFromMasterListErrorInterface & AllocateOutboundShipmentUnallocatedLineErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteAssetCatalogueItemErrorInterface & DeleteAssetErrorInterface & DeleteAssetLogReasonErrorInterface & DeleteCustomerReturnErrorInterface & DeleteErrorInterface & DeleteInboundShipmentErrorInterface & DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteLocationErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionErrorInterface & DeletePrescriptionLineErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & DeleteSupplierReturnErrorInterface & DeleteVaccineCourseErrorInterface & NodeErrorInterface & RequisitionLineChartErrorInterface & RequisitionLineStatsErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateAssetErrorInterface & UpdateErrorInterface & UpdateInboundShipmentErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateLocationErrorInterface & UpdateNameErrorInterface & UpdateNamePropertiesErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UpdateReturnOtherPartyErrorInterface & UpdateSensorErrorInterface & UpdateStockLineErrorInterface & UseSuggestedQuantityErrorInterface & { __typename: 'RecordNotFound'; description: Scalars['String']['output']; }; @@ -6315,14 +6361,19 @@ export type RequisitionLineConnector = { export type RequisitionLineNode = { __typename: 'RequisitionLineNode'; + additionInUnits: Scalars['Float']['output']; /** Quantity already issued in outbound shipments */ alreadyIssued: Scalars['Float']['output']; approvalComment?: Maybe; approvedQuantity: Scalars['Float']['output']; comment?: Maybe; + daysOutOfStock: Scalars['Float']['output']; + expiringUnits: Scalars['Float']['output']; id: Scalars['String']['output']; /** InboundShipment lines linked to requisitions line */ inboundShipmentLines: InvoiceLineConnector; + incomingUnits: Scalars['Float']['output']; + initialStockOnHandUnits: Scalars['Float']['output']; item: ItemNode; itemId: Scalars['String']['output']; itemName: Scalars['String']['output']; @@ -6332,8 +6383,11 @@ export type RequisitionLineNode = { */ itemStats: ItemStatsNode; linkedRequisitionLine?: Maybe; + lossInUnits: Scalars['Float']['output']; + optionId?: Maybe; /** OutboundShipment lines linked to requisitions line */ outboundShipmentLines: InvoiceLineConnector; + outgoingUnits: Scalars['Float']['output']; /** * Quantity remaining to supply * supplyQuantity minus all (including unallocated) linked invoice lines numberOfPacks * packSize diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/DetailView.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/DetailView.tsx index f1194094ba..23ab4b0ac5 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/DetailView.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/DetailView.tsx @@ -13,7 +13,7 @@ import { } from '@openmsupply-client/common'; import { AppRoute } from '@openmsupply-client/config'; import { ActivityLogList } from '@openmsupply-client/system'; -import { Toolbar } from './Toolbar'; +import { Toolbar } from './Toolbar/Toolbar'; import { Footer } from './Footer'; import { AppBarButtons } from './AppBarButtons'; import { SidePanel } from './SidePanel'; diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx similarity index 88% rename from client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar.tsx rename to client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx index 7419aaae50..07d222552b 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx @@ -4,9 +4,6 @@ import { Box, InputWithLabelRow, Grid, - DropdownMenu, - DropdownMenuItem, - DeleteIcon, useTranslation, SearchBar, Typography, @@ -16,8 +13,9 @@ import { } from '@openmsupply-client/common'; import { CustomerSearchInput } from '@openmsupply-client/system'; -import { useResponse } from '../api'; -import { getApprovalStatusKey } from '../../utils'; +import { useResponse } from '../../api'; +import { getApprovalStatusKey } from '../../../utils'; +import { ToolbarDropDown } from './ToolbarDropDown'; export const Toolbar: FC = () => { const t = useTranslation(); @@ -42,7 +40,6 @@ export const Toolbar: FC = () => { 'period', 'orderType', ]); - const { onDelete } = useResponse.line.delete(); const noLinkedShipments = (shipments?.totalCount ?? 0) === 0; const showInfo = noLinkedShipments && !isDisabled; const { isRemoteAuthorisation } = useResponse.utils.isRemoteAuthorisation(); @@ -132,16 +129,7 @@ export const Toolbar: FC = () => { }} debounceTime={0} /> - - - - {t('button.delete-lines', { ns: 'distribution' })} - - + ); diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx new file mode 100644 index 0000000000..5e96e36328 --- /dev/null +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { + DropdownMenu, + DropdownMenuItem, + DeleteIcon, + useTranslation, +} from '@openmsupply-client/common'; +import { useResponse } from '../../api'; + +interface ToolbarDropDownProps { + isDisabled: boolean; +} + +export const ToolbarDropDown = ({ isDisabled }: ToolbarDropDownProps) => { + const t = useTranslation(); + const onDelete = useResponse.line.delete(); + + return ( + + + {t('button.delete-lines', { ns: 'distribution' })} + + + ); +}; diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/index.ts b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/index.ts new file mode 100644 index 0000000000..7c6430332b --- /dev/null +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/index.ts @@ -0,0 +1 @@ +export * from './Toolbar'; diff --git a/client/packages/requisitions/src/ResponseRequisition/api/api.ts b/client/packages/requisitions/src/ResponseRequisition/api/api.ts index 248a92f66d..c21269276d 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/api.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/api.ts @@ -191,22 +191,20 @@ export const getResponseQueries = (sdk: Sdk, storeId: string) => ({ throw new Error('Unable to update requisition'); }, - deleteLines: async (_: ResponseLineFragment[]) => { - // NOT YET IMPLEMENTED IN SERVER API - - // const ids = responseLines.map(responseParser.toDeleteLine); - // const result = await sdk.deleteRequestLines({ ids, storeId }); - - // if (result.batchRequestRequisition.deleteRequestRequisitionLines) { - // const failedLines = - // result.batchRequestRequisition.deleteRequestRequisitionLines.filter( - // line => - // line.response.__typename === 'DeleteRequestRequisitionLineError' - // ); - // if (failedLines.length === 0) { - // return result.batchRequestRequisition.deleteRequestRequisitionLines; - // } - // } + deleteLines: async (responseLines: ResponseLineFragment[]) => { + const ids = responseLines.map(responseParser.toDeleteLine); + const result = await sdk.deleteResponseLines({ ids, storeId }); + + if (result.batchResponseRequisition.deleteResponseRequisitionLines) { + const failedLines = + result.batchResponseRequisition.deleteResponseRequisitionLines.filter( + line => + line.response.__typename === 'DeleteResponseRequisitionLineError' + ); + if (failedLines.length === 0) { + return result.batchResponseRequisition.deleteResponseRequisitionLines; + } + } throw new Error('Could not delete requisition lines!'); }, diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLines.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLines.ts index 4b8325675b..b1897589ca 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLines.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLines.ts @@ -1,9 +1,9 @@ import { useQueryClient, useMutation, - useNotification, useTranslation, useTableStore, + useDeleteConfirmation, } from '@openmsupply-client/common'; import { useResponse } from '..'; import { useResponseNumber } from '../document/useResponse'; @@ -11,13 +11,12 @@ import { useResponseApi } from '../utils/useResponseApi'; import { useResponseLines } from './useResponseLines'; export const useDeleteResponseLines = () => { - const { success, info } = useNotification(); const { lines } = useResponseLines(); const api = useResponseApi(); const requestNumber = useResponseNumber(); const isDisabled = useResponse.utils.isDisabled(); const queryClient = useQueryClient(); - const { mutate } = useMutation(api.deleteLines, { + const { mutateAsync } = useMutation(api.deleteLines, { onSettled: () => queryClient.invalidateQueries(api.keys.detail(requestNumber)), }); @@ -28,21 +27,25 @@ export const useDeleteResponseLines = () => { ); const onDelete = async () => { - if (isDisabled) { - info(t('label.cant-delete-disabled-requisition'))(); - return; - } - info('Deleting response lines not yet implemented in API')(); - return; - const number = selectedRows?.length; - if (selectedRows && number) { - mutate(selectedRows, { - onSuccess: success(t('messages.deleted-lines', { count: number })), - }); - } else { - info(t('messages.select-rows-to-delete-them'))(); - } + mutateAsync(selectedRows).catch(err => { + throw err; + }); }; - return { onDelete }; + const confirmAndDelete = useDeleteConfirmation({ + selectedRows, + deleteAction: onDelete, + canDelete: !isDisabled, + messages: { + confirmMessage: t('messages.confirm-delete-requisition-lines', { + count: selectedRows.length, + }), + deleteSuccess: t('messages.deleted-lines', { + count: selectedRows.length, + }), + cantDelete: t('label.cant-delete-disabled-requisition'), + }, + }); + + return confirmAndDelete; }; diff --git a/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts b/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts index 6898f3e759..86bf19b1fa 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts @@ -51,6 +51,14 @@ export type UpdateResponseLineMutationVariables = Types.Exact<{ export type UpdateResponseLineMutation = { __typename: 'Mutations', updateResponseRequisitionLine: { __typename: 'RequisitionLineNode', id: string } | { __typename: 'UpdateResponseRequisitionLineError', error: { __typename: 'CannotEditRequisition', description: string } | { __typename: 'ForeignKeyError', description: string, key: Types.ForeignKey } | { __typename: 'RecordNotFound', description: string } } }; +export type DeleteResponseLinesMutationVariables = Types.Exact<{ + ids?: Types.InputMaybe | Types.DeleteResponseRequisitionLineInput>; + storeId: Types.Scalars['String']['input']; +}>; + + +export type DeleteResponseLinesMutation = { __typename: 'Mutations', batchResponseRequisition: { __typename: 'BatchResponseRequisitionResponse', deleteResponseRequisitionLines?: Array<{ __typename: 'DeleteResponseRequisitionLineResponseWithId', id: string, response: { __typename: 'DeleteResponse', id: string } | { __typename: 'DeleteResponseRequisitionLineError', error: { __typename: 'CannotEditRequisition', description: string } | { __typename: 'ForeignKeyError', description: string } | { __typename: 'RecordNotFound', description: string } } }> | null } }; + export type CreateOutboundFromResponseMutationVariables = Types.Exact<{ responseId: Types.Scalars['String']['input']; storeId: Types.Scalars['String']['input']; @@ -295,6 +303,37 @@ export const UpdateResponseLineDocument = gql` } } `; +export const DeleteResponseLinesDocument = gql` + mutation deleteResponseLines($ids: [DeleteResponseRequisitionLineInput!], $storeId: String!) { + batchResponseRequisition( + input: {deleteResponseRequisitionLines: $ids} + storeId: $storeId + ) { + deleteResponseRequisitionLines { + id + response { + ... on DeleteResponseRequisitionLineError { + __typename + error { + description + ... on RecordNotFound { + __typename + description + } + ... on CannotEditRequisition { + __typename + description + } + } + } + ... on DeleteResponse { + id + } + } + } + } +} + `; export const CreateOutboundFromResponseDocument = gql` mutation createOutboundFromResponse($responseId: String!, $storeId: String!) { createRequisitionShipment( @@ -414,6 +453,9 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = updateResponseLine(variables: UpdateResponseLineMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { return withWrapper((wrappedRequestHeaders) => client.request(UpdateResponseLineDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'updateResponseLine', 'mutation', variables); }, + deleteResponseLines(variables: DeleteResponseLinesMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { + return withWrapper((wrappedRequestHeaders) => client.request(DeleteResponseLinesDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'deleteResponseLines', 'mutation', variables); + }, createOutboundFromResponse(variables: CreateOutboundFromResponseMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { return withWrapper((wrappedRequestHeaders) => client.request(CreateOutboundFromResponseDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'createOutboundFromResponse', 'mutation', variables); }, diff --git a/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql b/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql index abc26f640b..70372cd8f5 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql +++ b/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql @@ -230,6 +230,39 @@ mutation updateResponseLine( } } +mutation deleteResponseLines( + $ids: [DeleteResponseRequisitionLineInput!] + $storeId: String! +) { + batchResponseRequisition( + input: { deleteResponseRequisitionLines: $ids } + storeId: $storeId + ) { + deleteResponseRequisitionLines { + id + response { + ... on DeleteResponseRequisitionLineError { + __typename + error { + description + ... on RecordNotFound { + __typename + description + } + ... on CannotEditRequisition { + __typename + description + } + } + } + ... on DeleteResponse { + id + } + } + } + } +} + mutation createOutboundFromResponse($responseId: String!, $storeId: String!) { createRequisitionShipment( input: { responseRequisitionId: $responseId } From f743641fc286227894ef899ce754262c07416506 Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 09:06:32 +1300 Subject: [PATCH 07/23] Add batch mutations service layer --- server/service/src/requisition/mod.rs | 11 ++ .../requisition/response_requisition/batch.rs | 119 ++++++++++++++++++ .../requisition/response_requisition/mod.rs | 3 + 3 files changed, 133 insertions(+) create mode 100644 server/service/src/requisition/response_requisition/batch.rs diff --git a/server/service/src/requisition/mod.rs b/server/service/src/requisition/mod.rs index c35da6f965..084e7d2084 100644 --- a/server/service/src/requisition/mod.rs +++ b/server/service/src/requisition/mod.rs @@ -30,6 +30,9 @@ use repository::{ requisition_row::RequisitionType, Invoice, PaginationOption, RepositoryError, Requisition, RequisitionFilter, RequisitionLine, RequisitionSort, }; +use response_requisition::{ + batch_response_requisition, BatchResponseRequisition, BatchResponseRequisitionResult, +}; pub mod common; pub mod program_settings; @@ -173,6 +176,14 @@ pub trait RequisitionServiceTrait: Sync + Send { batch_request_requisition(ctx, input) } + fn batch_response_requisition( + &self, + ctx: &ServiceContext, + input: BatchResponseRequisition, + ) -> Result { + batch_response_requisition(ctx, input) + } + fn get_supplier_program_requisition_settings( &self, ctx: &ServiceContext, diff --git a/server/service/src/requisition/response_requisition/batch.rs b/server/service/src/requisition/response_requisition/batch.rs new file mode 100644 index 0000000000..00bf2e4d4c --- /dev/null +++ b/server/service/src/requisition/response_requisition/batch.rs @@ -0,0 +1,119 @@ +use repository::RepositoryError; + +use crate::{ + requisition_line::response_requisition_line::*, service_provider::ServiceContext, + BatchMutationsProcessor, InputWithResult, WithDBError, +}; + +#[derive(Clone)] +pub struct BatchResponseRequisition { + pub delete_line: Option>, + pub continue_on_error: Option, +} + +pub type DeleteRequisitionLinesResult = Vec< + InputWithResult< + DeleteResponseRequisitionLine, + Result, + >, +>; + +#[derive(Debug, Default)] +pub struct BatchResponseRequisitionResult { + pub delete_line: DeleteRequisitionLinesResult, +} + +pub fn batch_response_requisition( + ctx: &ServiceContext, + input: BatchResponseRequisition, +) -> Result { + let result = ctx + .connection + .transaction_sync(|_| { + let continue_on_error = input.continue_on_error.unwrap_or(false); + let mut results = BatchResponseRequisitionResult::default(); + + let mutations_processor = BatchMutationsProcessor::new(ctx); + + let (has_errors, result) = mutations_processor + .do_mutations(input.delete_line, delete_response_requisition_line); + results.delete_line = result; + if has_errors && !continue_on_error { + return Err(WithDBError::err(results)); + } + + Ok(results) + as Result< + BatchResponseRequisitionResult, + WithDBError, + > + }) + .map_err(|error| error.to_inner_error()) + .or_else(|error| match error { + WithDBError::DatabaseError(repository_error) => Err(repository_error), + WithDBError::Error(batch_response) => Ok(batch_response), + })?; + + Ok(result) +} + +#[cfg(test)] +mod test { + use repository::{ + mock::{ + mock_full_draft_response_requisition_for_update_test, mock_store_a, MockDataInserts, + }, + test_db::setup_all, + RequisitionLineRowRepository, + }; + use util::inline_init; + + use crate::{ + requisition::response_requisition::BatchResponseRequisition, + requisition_line::response_requisition_line::DeleteResponseRequisitionLine, + service_provider::ServiceProvider, + }; + + #[actix_rt::test] + async fn batch_response_requisition_service() { + let (_, connection, connection_manager, _) = + setup_all("batch_response_requisition_service", MockDataInserts::all()).await; + + let service_provider = ServiceProvider::new(connection_manager, "app_data"); + let context = service_provider + .context(mock_store_a().id, "".to_string()) + .unwrap(); + let service = service_provider.requisition_service; + + let line_id = mock_full_draft_response_requisition_for_update_test().lines[0] + .id + .clone(); + + let delete_requisition_lines_input = BatchResponseRequisition { + delete_line: Some(vec![inline_init( + |input: &mut DeleteResponseRequisitionLine| input.id = line_id.clone(), + )]), + continue_on_error: None, + }; + + assert_eq!( + RequisitionLineRowRepository::new(&connection) + .find_one_by_id(&line_id) + .unwrap(), + Some(mock_full_draft_response_requisition_for_update_test().lines[0].clone()) + ); + + // Test delete + + service + .batch_response_requisition(&context, delete_requisition_lines_input) + .unwrap(); + + assert_eq!( + RequisitionLineRowRepository::new(&connection) + .find_one_by_id(&line_id) + .unwrap(), + None + ); + } +} diff --git a/server/service/src/requisition/response_requisition/mod.rs b/server/service/src/requisition/response_requisition/mod.rs index 3d9eaa2989..2e90d41a63 100644 --- a/server/service/src/requisition/response_requisition/mod.rs +++ b/server/service/src/requisition/response_requisition/mod.rs @@ -12,3 +12,6 @@ pub use create_requisition_shipment::*; mod insert_program; pub use insert_program::*; + +mod batch; +pub use self::batch::*; From 5772374a849013e13578da78429d3fa9f01e22ae Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 09:06:45 +1300 Subject: [PATCH 08/23] Add batch mutations graphql layer minus graphql tests --- .../src/batch_response_requisition.rs | 290 ++++++++++++++++++ server/graphql/batch_mutations/src/lib.rs | 10 + .../response_requisition_line/mod.rs | 2 +- 3 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 server/graphql/batch_mutations/src/batch_response_requisition.rs diff --git a/server/graphql/batch_mutations/src/batch_response_requisition.rs b/server/graphql/batch_mutations/src/batch_response_requisition.rs new file mode 100644 index 0000000000..d31c6f2c25 --- /dev/null +++ b/server/graphql/batch_mutations/src/batch_response_requisition.rs @@ -0,0 +1,290 @@ +use async_graphql::*; +use graphql_core::{standard_graphql_error::validate_auth, ContextExt}; +use graphql_requisition_line::mutations::response_requisition_line; +use service::{ + auth::{Resource, ResourceAccessRequest}, + requisition::response_requisition::*, +}; + +use crate::{to_standard_error, VecOrNone}; + +type ServiceResult = BatchResponseRequisitionResult; +type ServiceInput = BatchResponseRequisition; + +#[derive(SimpleObject)] +#[graphql(concrete( + name = "DeleteResponseRequisitionLineResponseWithId", + params(response_requisition_line::delete::DeleteResponse) +))] + +pub struct MutationWithId { + pub id: String, + pub response: T, +} + +type DeleteRequisitionLinesResponse = + Option>>; + +#[derive(SimpleObject)] +#[graphql(name = "BatchResponseRequisitionResponse")] +pub struct BatchResponse { + delete_response_requisition_lines: DeleteRequisitionLinesResponse, +} + +#[derive(InputObject)] +#[graphql(name = "BatchResponseRequisitionInput")] +pub struct BatchInput { + pub delete_response_requisition_lines: + Option>, + pub continue_on_error: Option, +} + +pub fn batch(ctx: &Context<'_>, store_id: &str, input: BatchInput) -> Result { + let user = validate_auth( + ctx, + &ResourceAccessRequest { + resource: Resource::MutateRequisition, + store_id: Some(store_id.to_string()), + }, + )?; + + let service_provider = ctx.service_provider(); + let service_context = service_provider.context(store_id.to_string(), user.user_id)?; + + let response = service_provider + .requisition_service + .batch_response_requisition(&service_context, input.to_domain())?; + + BatchResponse::from_domain(response) +} + +impl BatchInput { + fn to_domain(self) -> ServiceInput { + let BatchInput { + delete_response_requisition_lines, + continue_on_error, + } = self; + + ServiceInput { + delete_line: delete_response_requisition_lines + .map(|inputs| inputs.into_iter().map(|input| input.to_domain()).collect()), + continue_on_error, + } + } +} + +impl BatchResponse { + fn from_domain(ServiceResult { delete_line }: ServiceResult) -> Result { + let result = BatchResponse { + delete_response_requisition_lines: map_delete_lines(delete_line)?, + }; + + Ok(result) + } +} + +fn map_delete_lines( + responses: DeleteRequisitionLinesResult, +) -> Result { + let mut result = Vec::new(); + for response in responses { + let mapped_response = match response_requisition_line::delete::map_response(response.result) + { + Ok(response) => response, + Err(standard_error) => return Err(to_standard_error(response.input, standard_error)), + }; + + result.push(MutationWithId { + id: response.input.id.clone(), + response: mapped_response, + }); + } + + Ok(result.vec_or_none()) +} + +// #[cfg(test)] +// mod test { +// use async_graphql::EmptyMutation; +// use graphql_core::{ +// assert_graphql_query, assert_standard_graphql_error, test_helpers::setup_graphql_test, +// }; +// use repository::{mock::MockDataInserts, RepositoryError, StorageConnectionManager}; +// use serde_json::json; +// use service::{ +// requisition::{ +// response_requisition::{BatchResponseRequisition, BatchResponseRequisitionResult}, +// RequisitionServiceTrait, +// }, +// requisition_line::response_requisition_line::{ +// DeleteResponseRequisitionLine, DeleteResponseRequisitionLineError, +// }, +// service_provider::{ServiceContext, ServiceProvider}, +// InputWithResult, +// }; +// use util::inline_init; + +// use crate::BatchMutations; + +// type ServiceInput = BatchResponseRequisition; +// type ServiceResult = BatchResponseRequisitionResult; + +// type Method = dyn Fn(ServiceInput) -> Result + Sync + Send; + +// pub struct TestService(pub Box); + +// impl RequisitionServiceTrait for TestService { +// fn batch_response_requisition( +// &self, +// _: &ServiceContext, +// input: ServiceInput, +// ) -> Result { +// self.0(input) +// } +// } + +// fn service_provider( +// test_service: TestService, +// connection_manager: &StorageConnectionManager, +// ) -> ServiceProvider { +// let mut service_provider = ServiceProvider::new(connection_manager.clone(), "app_data"); +// service_provider.requisition_service = Box::new(test_service); +// service_provider +// } + +// #[actix_rt::test] +// async fn test_graphql_batch_request_requisition() { +// let (_, _, connection_manager, settings) = setup_graphql_test( +// EmptyMutation, +// BatchMutations, +// "test_graphql_batch_request_requisition", +// MockDataInserts::all(), +// ) +// .await; + +// let mutation = r#" +// mutation mut($input: BatchResponseRequisitionInput!, $storeId: String!) { +// batchResponseRequisition(input: $input, storeId: $storeId) { +// deleteResponseRequisitionLines { +// response { +// ... on DeleteResponseRequisitionLineError { +// error { +// __typename +// } +// } +// } +// id +// } +// } +// } + +// "#; + +// let expected = json!({ +// "batchResponseRequisition": { +// "deleteResponseRequisitionLines": [ +// { +// "id": "id4", +// "response": { +// "error": { +// "__typename": "RecordNotFound" +// } +// } +// } +// ] +// } +// }); + +// let variables = Some(json!({ +// "storeId": "n/a", +// "input": {} +// } +// )); + +// // Structured Errors +// let test_service = TestService(Box::new(|_| { +// Ok(ServiceResult { +// delete_line: vec![InputWithResult { +// input: inline_init(|input: &mut DeleteResponseRequisitionLine| { +// input.id = "id4".to_string() +// }), +// result: Err(DeleteResponseRequisitionLineError::RequisitionLineDoesNotExist {}), +// }], +// }) +// })); + +// assert_graphql_query!( +// &settings, +// mutation, +// &variables, +// &expected, +// Some(service_provider(test_service, &connection_manager)) +// ); + +// // Standard Error +// let test_service = TestService(Box::new(|_| { +// Ok(ServiceResult { +// delete_line: vec![InputWithResult { +// input: { +// DeleteResponseRequisitionLine { +// id: "id2".to_string(), +// } +// }, +// result: Err(DeleteResponseRequisitionLineError::RequisitionDoesNotExist {}), +// }], +// }) +// })); + +// let expected_message = "Bad user input"; +// let expected_extensions = json!({ +// "input": +// format!( +// "{:#?}", +// inline_init(|input: &mut DeleteResponseRequisitionLine| { +// input.id = "id6".to_string() +// }) +// ) +// }); + +// // assert_standard_graphql_error!( +// // &settings, +// // &mutation, +// // &variables, +// // &expected_message, +// // Some(expected_extensions), +// // Some(service_provider(test_service, &connection_manager)) +// // ); + +// // Success + +// let expected = json!({ +// "batchRequestRequisition": { +// "deleteRequestRequisitionLines": [ +// { +// "id": "id3", +// } +// ], +// } +// } +// ); + +// let test_service = TestService(Box::new(|_| { +// Ok(ServiceResult { +// delete_line: vec![InputWithResult { +// input: inline_init(|input: &mut DeleteResponseRequisitionLine| { +// input.id = "id3".to_string() +// }), +// result: Ok("id3".to_string()), +// }], +// }) +// })); + +// assert_graphql_query!( +// &settings, +// mutation, +// &variables, +// &expected, +// Some(service_provider(test_service, &connection_manager)) +// ); +// } +// } diff --git a/server/graphql/batch_mutations/src/lib.rs b/server/graphql/batch_mutations/src/lib.rs index 833caa9cf1..6a5032cdf4 100644 --- a/server/graphql/batch_mutations/src/lib.rs +++ b/server/graphql/batch_mutations/src/lib.rs @@ -2,6 +2,7 @@ mod batch_inbound_shipment; mod batch_outbound_shipment; mod batch_prescription; mod batch_request_requisition; +mod batch_response_requisition; mod batch_stocktake; use async_graphql::*; @@ -37,6 +38,15 @@ impl BatchMutations { batch_request_requisition::batch(ctx, &store_id, input) } + async fn batch_response_requisition( + &self, + ctx: &Context<'_>, + store_id: String, + input: batch_response_requisition::BatchInput, + ) -> Result { + batch_response_requisition::batch(ctx, &store_id, input) + } + async fn batch_stocktake( &self, ctx: &Context<'_>, diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs index c62270eb32..a4969ea32c 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs @@ -1,5 +1,5 @@ mod update; pub use update::*; -mod delete; +pub mod delete; pub use delete::*; From ccb8f4bbf03a3cb93a8ecc5e761b1d9741eb7bfe Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 09:10:26 +1300 Subject: [PATCH 09/23] Add individual line delete (using batch mutation on back end) --- .../src/ResponseRequisition/api/api.ts | 17 +++++++++++++++++ .../src/ResponseRequisition/api/hooks/index.ts | 2 +- .../ResponseRequisition/api/hooks/line/index.ts | 4 +++- .../api/hooks/line/useDeleteResponseLine.ts | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts diff --git a/client/packages/requisitions/src/ResponseRequisition/api/api.ts b/client/packages/requisitions/src/ResponseRequisition/api/api.ts index c21269276d..dcb4144d82 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/api.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/api.ts @@ -191,6 +191,23 @@ export const getResponseQueries = (sdk: Sdk, storeId: string) => ({ throw new Error('Unable to update requisition'); }, + deleteLine: async (responseLineId: string) => { + const ids = [{ id: responseLineId }]; + const result = await sdk.deleteResponseLines({ ids, storeId }); + + if (result.batchResponseRequisition.deleteResponseRequisitionLines) { + const failedLines = + result.batchResponseRequisition.deleteResponseRequisitionLines.filter( + line => + line.response.__typename === 'DeleteResponseRequisitionLineError' + ); + if (failedLines.length === 0) { + return result.batchResponseRequisition.deleteResponseRequisitionLines; + } + } + + throw new Error('Could not delete requisition lines!'); + }, deleteLines: async (responseLines: ResponseLineFragment[]) => { const ids = responseLines.map(responseParser.toDeleteLine); const result = await sdk.deleteResponseLines({ ids, storeId }); diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts index 9246c0914e..07ebb81e15 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts @@ -16,7 +16,7 @@ export const useResponse = { line: { list: Lines.useResponseLines, stats: Lines.useResponseLineStatsData, - + deleteLine: Lines.useDeleteResponseLine, delete: Lines.useDeleteResponseLines, save: Lines.useSaveResponseLines, }, diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts index 17ad455c35..56f248eb39 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts @@ -2,10 +2,12 @@ import { useDeleteResponseLines } from './useDeleteResponseLines'; import { useResponseLines } from './useResponseLines'; import { useResponseLineStatsData } from './useResponseLineStatsData'; import { useSaveResponseLines } from './useSaveResponseLines'; +import { useDeleteResponseLine } from './useDeleteResponseLine'; export const Lines = { + useDeleteResponseLine, useDeleteResponseLines, useResponseLines, useSaveResponseLines, - useResponseLineStatsData + useResponseLineStatsData, }; diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts new file mode 100644 index 0000000000..2c0146d50a --- /dev/null +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts @@ -0,0 +1,15 @@ +import { useQueryClient, useMutation } from '@openmsupply-client/common'; +import { useResponseApi } from '../utils/useResponseApi'; +import { useResponseNumber } from '../document/useResponse'; + +export const useDeleteResponseLine = () => { + const api = useResponseApi(); + const responseNumber = useResponseNumber(); + + const queryClient = useQueryClient(); + const { mutate } = useMutation(api.deleteLine, { + onSettled: () => + queryClient.invalidateQueries(api.keys.detail(responseNumber)), + }); + return mutate; +}; From e6ec2a2af2982cd0edd4a482785b7bbba2fe9e06 Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 09:25:15 +1300 Subject: [PATCH 10/23] Add graphql tests Limited to success and not found. Quite limited and unsure of testing comprehensively here --- .../src/batch_response_requisition.rs | 335 ++++++++---------- 1 file changed, 150 insertions(+), 185 deletions(-) diff --git a/server/graphql/batch_mutations/src/batch_response_requisition.rs b/server/graphql/batch_mutations/src/batch_response_requisition.rs index d31c6f2c25..fb0c9f9cab 100644 --- a/server/graphql/batch_mutations/src/batch_response_requisition.rs +++ b/server/graphql/batch_mutations/src/batch_response_requisition.rs @@ -103,188 +103,153 @@ fn map_delete_lines( Ok(result.vec_or_none()) } -// #[cfg(test)] -// mod test { -// use async_graphql::EmptyMutation; -// use graphql_core::{ -// assert_graphql_query, assert_standard_graphql_error, test_helpers::setup_graphql_test, -// }; -// use repository::{mock::MockDataInserts, RepositoryError, StorageConnectionManager}; -// use serde_json::json; -// use service::{ -// requisition::{ -// response_requisition::{BatchResponseRequisition, BatchResponseRequisitionResult}, -// RequisitionServiceTrait, -// }, -// requisition_line::response_requisition_line::{ -// DeleteResponseRequisitionLine, DeleteResponseRequisitionLineError, -// }, -// service_provider::{ServiceContext, ServiceProvider}, -// InputWithResult, -// }; -// use util::inline_init; - -// use crate::BatchMutations; - -// type ServiceInput = BatchResponseRequisition; -// type ServiceResult = BatchResponseRequisitionResult; - -// type Method = dyn Fn(ServiceInput) -> Result + Sync + Send; - -// pub struct TestService(pub Box); - -// impl RequisitionServiceTrait for TestService { -// fn batch_response_requisition( -// &self, -// _: &ServiceContext, -// input: ServiceInput, -// ) -> Result { -// self.0(input) -// } -// } - -// fn service_provider( -// test_service: TestService, -// connection_manager: &StorageConnectionManager, -// ) -> ServiceProvider { -// let mut service_provider = ServiceProvider::new(connection_manager.clone(), "app_data"); -// service_provider.requisition_service = Box::new(test_service); -// service_provider -// } - -// #[actix_rt::test] -// async fn test_graphql_batch_request_requisition() { -// let (_, _, connection_manager, settings) = setup_graphql_test( -// EmptyMutation, -// BatchMutations, -// "test_graphql_batch_request_requisition", -// MockDataInserts::all(), -// ) -// .await; - -// let mutation = r#" -// mutation mut($input: BatchResponseRequisitionInput!, $storeId: String!) { -// batchResponseRequisition(input: $input, storeId: $storeId) { -// deleteResponseRequisitionLines { -// response { -// ... on DeleteResponseRequisitionLineError { -// error { -// __typename -// } -// } -// } -// id -// } -// } -// } - -// "#; - -// let expected = json!({ -// "batchResponseRequisition": { -// "deleteResponseRequisitionLines": [ -// { -// "id": "id4", -// "response": { -// "error": { -// "__typename": "RecordNotFound" -// } -// } -// } -// ] -// } -// }); - -// let variables = Some(json!({ -// "storeId": "n/a", -// "input": {} -// } -// )); - -// // Structured Errors -// let test_service = TestService(Box::new(|_| { -// Ok(ServiceResult { -// delete_line: vec![InputWithResult { -// input: inline_init(|input: &mut DeleteResponseRequisitionLine| { -// input.id = "id4".to_string() -// }), -// result: Err(DeleteResponseRequisitionLineError::RequisitionLineDoesNotExist {}), -// }], -// }) -// })); - -// assert_graphql_query!( -// &settings, -// mutation, -// &variables, -// &expected, -// Some(service_provider(test_service, &connection_manager)) -// ); - -// // Standard Error -// let test_service = TestService(Box::new(|_| { -// Ok(ServiceResult { -// delete_line: vec![InputWithResult { -// input: { -// DeleteResponseRequisitionLine { -// id: "id2".to_string(), -// } -// }, -// result: Err(DeleteResponseRequisitionLineError::RequisitionDoesNotExist {}), -// }], -// }) -// })); - -// let expected_message = "Bad user input"; -// let expected_extensions = json!({ -// "input": -// format!( -// "{:#?}", -// inline_init(|input: &mut DeleteResponseRequisitionLine| { -// input.id = "id6".to_string() -// }) -// ) -// }); - -// // assert_standard_graphql_error!( -// // &settings, -// // &mutation, -// // &variables, -// // &expected_message, -// // Some(expected_extensions), -// // Some(service_provider(test_service, &connection_manager)) -// // ); - -// // Success - -// let expected = json!({ -// "batchRequestRequisition": { -// "deleteRequestRequisitionLines": [ -// { -// "id": "id3", -// } -// ], -// } -// } -// ); - -// let test_service = TestService(Box::new(|_| { -// Ok(ServiceResult { -// delete_line: vec![InputWithResult { -// input: inline_init(|input: &mut DeleteResponseRequisitionLine| { -// input.id = "id3".to_string() -// }), -// result: Ok("id3".to_string()), -// }], -// }) -// })); - -// assert_graphql_query!( -// &settings, -// mutation, -// &variables, -// &expected, -// Some(service_provider(test_service, &connection_manager)) -// ); -// } -// } +#[cfg(test)] +mod test { + use async_graphql::EmptyMutation; + use graphql_core::{assert_graphql_query, test_helpers::setup_graphql_test}; + use repository::{mock::MockDataInserts, RepositoryError, StorageConnectionManager}; + use serde_json::json; + use service::{ + requisition::{ + response_requisition::{BatchResponseRequisition, BatchResponseRequisitionResult}, + RequisitionServiceTrait, + }, + requisition_line::response_requisition_line::{ + DeleteResponseRequisitionLine, DeleteResponseRequisitionLineError, + }, + service_provider::{ServiceContext, ServiceProvider}, + InputWithResult, + }; + use util::inline_init; + + use crate::BatchMutations; + + type ServiceInput = BatchResponseRequisition; + type ServiceResult = BatchResponseRequisitionResult; + + type Method = dyn Fn(ServiceInput) -> Result + Sync + Send; + + pub struct TestService(pub Box); + + impl RequisitionServiceTrait for TestService { + fn batch_response_requisition( + &self, + _: &ServiceContext, + input: ServiceInput, + ) -> Result { + self.0(input) + } + } + + fn service_provider( + test_service: TestService, + connection_manager: &StorageConnectionManager, + ) -> ServiceProvider { + let mut service_provider = ServiceProvider::new(connection_manager.clone(), "app_data"); + service_provider.requisition_service = Box::new(test_service); + service_provider + } + + #[actix_rt::test] + async fn test_graphql_batch_request_requisition() { + let (_, _, connection_manager, settings) = setup_graphql_test( + EmptyMutation, + BatchMutations, + "test_graphql_batch_request_requisition", + MockDataInserts::all(), + ) + .await; + + let mutation = r#" + mutation mut($input: BatchResponseRequisitionInput!, $storeId: String!) { + batchResponseRequisition(input: $input, storeId: $storeId) { + deleteResponseRequisitionLines { + response { + ... on DeleteResponseRequisitionLineError { + error { + __typename + } + } + } + id + } + } + } + + "#; + + let expected = json!({ + "batchResponseRequisition": { + "deleteResponseRequisitionLines": [ + { + "id": "id4", + "response": { + "error": { + "__typename": "RecordNotFound" + } + } + } + ] + } + }); + + let variables = Some(json!({ + "storeId": "n/a", + "input": {} + } + )); + + // Structured Errors + let test_service = TestService(Box::new(|_| { + Ok(ServiceResult { + delete_line: vec![InputWithResult { + input: inline_init(|input: &mut DeleteResponseRequisitionLine| { + input.id = "id4".to_string() + }), + result: Err(DeleteResponseRequisitionLineError::RequisitionLineDoesNotExist {}), + }], + }) + })); + + assert_graphql_query!( + &settings, + mutation, + &variables, + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + + // Success + + let expected = json!({ + "batchResponseRequisition": { + "deleteResponseRequisitionLines": [ + { + "id": "id3", + "response": {} + } + ], + } + } + ); + + let test_service = TestService(Box::new(|_| { + Ok(ServiceResult { + delete_line: vec![InputWithResult { + input: inline_init(|input: &mut DeleteResponseRequisitionLine| { + input.id = "id3".to_string() + }), + result: Ok("id3".to_string()), + }], + }) + })); + + assert_graphql_query!( + &settings, + mutation, + &variables, + &expected, + Some(service_provider(test_service, &connection_manager)) + ); + } +} From e6406a70b3768fd80796dd8c971ceb885d0e94dd Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 10:02:20 +1300 Subject: [PATCH 11/23] Regenerate schema --- client/packages/common/src/types/schema.ts | 1623 ++++++++------------ 1 file changed, 681 insertions(+), 942 deletions(-) diff --git a/client/packages/common/src/types/schema.ts b/client/packages/common/src/types/schema.ts index 293b7df597..3a25954d66 100644 --- a/client/packages/common/src/types/schema.ts +++ b/client/packages/common/src/types/schema.ts @@ -1,38 +1,25 @@ export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; -export type MakeEmpty< - T extends { [key: string]: unknown }, - K extends keyof T, -> = { [_ in K]?: never }; -export type Incremental = - | T - | { - [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never; - }; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string }; - String: { input: string; output: string }; - Boolean: { input: boolean; output: boolean }; - Int: { input: number; output: number }; - Float: { input: number; output: number }; + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } /** * Implement the DateTime scalar * * The input/output is a string in RFC3339 format. */ - DateTime: { input: string; output: string }; + DateTime: { input: string; output: string; } /** A scalar that can represent any JSON value. */ - JSON: { input: any; output: any }; + JSON: { input: any; output: any; } /** * ISO 8601 calendar date without timezone. * Format: %Y-%m-%d @@ -42,7 +29,7 @@ export type Scalars = { * * `1994-11-13` * * `2000-02-24` */ - NaiveDate: { input: string; output: string }; + NaiveDate: { input: string; output: string; } /** * ISO 8601 combined date and time without timezone. * @@ -50,7 +37,7 @@ export type Scalars = { * * * `2015-07-01T08:59:60.123`, */ - NaiveDateTime: { input: string; output: string }; + NaiveDateTime: { input: string; output: string; } }; export type AccountBlocked = AuthTokenErrorInterface & { @@ -149,7 +136,7 @@ export enum ActivityLogNodeType { VaccinationDeleted = 'VACCINATION_DELETED', VaccinationUpdated = 'VACCINATION_UPDATED', VaccineCourseCreated = 'VACCINE_COURSE_CREATED', - VaccineCourseUpdated = 'VACCINE_COURSE_UPDATED', + VaccineCourseUpdated = 'VACCINE_COURSE_UPDATED' } export type ActivityLogResponse = ActivityLogConnector; @@ -158,7 +145,7 @@ export enum ActivityLogSortFieldInput { ActivityLogType = 'activityLogType', Id = 'id', RecordId = 'recordId', - UserId = 'userId', + UserId = 'userId' } export type ActivityLogSortInput = { @@ -185,9 +172,7 @@ export type AddFromMasterListInput = { requestRequisitionId: Scalars['String']['input']; }; -export type AddFromMasterListResponse = - | AddFromMasterListError - | RequisitionLineConnector; +export type AddFromMasterListResponse = AddFromMasterListError | RequisitionLineConnector; export type AddToInboundShipmentFromMasterListError = { __typename: 'AddToInboundShipmentFromMasterListError'; @@ -198,9 +183,7 @@ export type AddToInboundShipmentFromMasterListErrorInterface = { description: Scalars['String']['output']; }; -export type AddToInboundShipmentFromMasterListResponse = - | AddToInboundShipmentFromMasterListError - | InvoiceLineConnector; +export type AddToInboundShipmentFromMasterListResponse = AddToInboundShipmentFromMasterListError | InvoiceLineConnector; export type AddToOutboundShipmentFromMasterListError = { __typename: 'AddToOutboundShipmentFromMasterListError'; @@ -211,30 +194,26 @@ export type AddToOutboundShipmentFromMasterListErrorInterface = { description: Scalars['String']['output']; }; -export type AddToOutboundShipmentFromMasterListResponse = - | AddToOutboundShipmentFromMasterListError - | InvoiceLineConnector; +export type AddToOutboundShipmentFromMasterListResponse = AddToOutboundShipmentFromMasterListError | InvoiceLineConnector; export type AddToShipmentFromMasterListInput = { masterListId: Scalars['String']['input']; shipmentId: Scalars['String']['input']; }; -export type AdjustmentReasonNotProvided = InsertStocktakeLineErrorInterface & - UpdateStocktakeLineErrorInterface & { - __typename: 'AdjustmentReasonNotProvided'; - description: Scalars['String']['output']; - }; +export type AdjustmentReasonNotProvided = InsertStocktakeLineErrorInterface & UpdateStocktakeLineErrorInterface & { + __typename: 'AdjustmentReasonNotProvided'; + description: Scalars['String']['output']; +}; -export type AdjustmentReasonNotValid = InsertStocktakeLineErrorInterface & - UpdateStocktakeLineErrorInterface & { - __typename: 'AdjustmentReasonNotValid'; - description: Scalars['String']['output']; - }; +export type AdjustmentReasonNotValid = InsertStocktakeLineErrorInterface & UpdateStocktakeLineErrorInterface & { + __typename: 'AdjustmentReasonNotValid'; + description: Scalars['String']['output']; +}; export enum AdjustmentTypeInput { Addition = 'ADDITION', - Reduction = 'REDUCTION', + Reduction = 'REDUCTION' } export type AllocateOutboundShipmentUnallocatedLineError = { @@ -256,9 +235,7 @@ export type AllocateOutboundShipmentUnallocatedLineNode = { updates: InvoiceLineConnector; }; -export type AllocateOutboundShipmentUnallocatedLineResponse = - | AllocateOutboundShipmentUnallocatedLineError - | AllocateOutboundShipmentUnallocatedLineNode; +export type AllocateOutboundShipmentUnallocatedLineResponse = AllocateOutboundShipmentUnallocatedLineError | AllocateOutboundShipmentUnallocatedLineNode; export type AllocateOutboundShipmentUnallocatedLineResponseWithId = { __typename: 'AllocateOutboundShipmentUnallocatedLineResponseWithId'; @@ -315,7 +292,7 @@ export enum AssetCatalogueItemSortFieldInput { Catalogue = 'catalogue', Code = 'code', Manufacturer = 'manufacturer', - Model = 'model', + Model = 'model' } export type AssetCatalogueItemSortInput = { @@ -331,10 +308,12 @@ export type AssetCatalogueMutations = { insertAssetCatalogueItem: InsertAssetCatalogueItemResponse; }; + export type AssetCatalogueMutationsDeleteAssetCatalogueItemArgs = { assetCatalogueItemId: Scalars['String']['input']; }; + export type AssetCatalogueMutationsInsertAssetCatalogueItemArgs = { input: InsertAssetCatalogueItemInput; storeId: Scalars['String']['input']; @@ -364,7 +343,7 @@ export type AssetCategoryNode = { export type AssetCategoryResponse = AssetCategoryNode | NodeError; export enum AssetCategorySortFieldInput { - Name = 'name', + Name = 'name' } export type AssetCategorySortInput = { @@ -392,7 +371,7 @@ export type AssetClassNode = { export type AssetClassResponse = AssetClassNode | NodeError; export enum AssetClassSortFieldInput { - Name = 'name', + Name = 'name' } export type AssetClassSortInput = { @@ -470,10 +449,12 @@ export type AssetLogReasonMutations = { insertAssetLogReason: InsertAssetLogReasonResponse; }; + export type AssetLogReasonMutationsDeleteLogReasonArgs = { reasonId: Scalars['String']['input']; }; + export type AssetLogReasonMutationsInsertAssetLogReasonArgs = { input: InsertAssetLogReasonInput; }; @@ -486,7 +467,7 @@ export type AssetLogReasonNode = { }; export enum AssetLogReasonSortFieldInput { - Status = 'status', + Status = 'status' } export type AssetLogReasonSortInput = { @@ -503,7 +484,7 @@ export type AssetLogReasonsResponse = AssetLogReasonConnector; export enum AssetLogSortFieldInput { LogDatetime = 'logDatetime', - Status = 'status', + Status = 'status' } export type AssetLogSortInput = { @@ -522,7 +503,7 @@ export enum AssetLogStatusInput { FunctioningButNeedsAttention = 'FUNCTIONING_BUT_NEEDS_ATTENTION', NotFunctioning = 'NOT_FUNCTIONING', NotInUse = 'NOT_IN_USE', - Unserviceable = 'UNSERVICEABLE', + Unserviceable = 'UNSERVICEABLE' } export type AssetLogsResponse = AssetLogConnector; @@ -558,6 +539,7 @@ export type AssetNode = { warrantyStart?: Maybe; }; + export type AssetNodeDonorArgs = { storeId: Scalars['String']['input']; }; @@ -597,7 +579,7 @@ export enum AssetSortFieldInput { ModifiedDatetime = 'modifiedDatetime', ReplacementDate = 'replacementDate', SerialNumber = 'serialNumber', - Store = 'store', + Store = 'store' } export type AssetSortInput = { @@ -632,7 +614,7 @@ export type AssetTypeNode = { export type AssetTypeResponse = AssetTypeNode | NodeError; export enum AssetTypeSortFieldInput { - Name = 'name', + Name = 'name' } export type AssetTypeSortInput = { @@ -675,131 +657,66 @@ export type BarcodeResponse = BarcodeNode | NodeError; export type BatchInboundShipmentInput = { continueOnError?: InputMaybe; - deleteInboundShipmentLines?: InputMaybe< - Array - >; - deleteInboundShipmentServiceLines?: InputMaybe< - Array - >; + deleteInboundShipmentLines?: InputMaybe>; + deleteInboundShipmentServiceLines?: InputMaybe>; deleteInboundShipments?: InputMaybe>; - insertInboundShipmentLines?: InputMaybe< - Array - >; - insertInboundShipmentServiceLines?: InputMaybe< - Array - >; + insertInboundShipmentLines?: InputMaybe>; + insertInboundShipmentServiceLines?: InputMaybe>; insertInboundShipments?: InputMaybe>; - updateInboundShipmentLines?: InputMaybe< - Array - >; - updateInboundShipmentServiceLines?: InputMaybe< - Array - >; + updateInboundShipmentLines?: InputMaybe>; + updateInboundShipmentServiceLines?: InputMaybe>; updateInboundShipments?: InputMaybe>; }; export type BatchInboundShipmentResponse = { __typename: 'BatchInboundShipmentResponse'; - deleteInboundShipmentLines?: Maybe< - Array - >; - deleteInboundShipmentServiceLines?: Maybe< - Array - >; + deleteInboundShipmentLines?: Maybe>; + deleteInboundShipmentServiceLines?: Maybe>; deleteInboundShipments?: Maybe>; - insertInboundShipmentLines?: Maybe< - Array - >; - insertInboundShipmentServiceLines?: Maybe< - Array - >; + insertInboundShipmentLines?: Maybe>; + insertInboundShipmentServiceLines?: Maybe>; insertInboundShipments?: Maybe>; - updateInboundShipmentLines?: Maybe< - Array - >; - updateInboundShipmentServiceLines?: Maybe< - Array - >; + updateInboundShipmentLines?: Maybe>; + updateInboundShipmentServiceLines?: Maybe>; updateInboundShipments?: Maybe>; }; -export type BatchIsReserved = DeleteInboundShipmentLineErrorInterface & - UpdateInboundShipmentLineErrorInterface & { - __typename: 'BatchIsReserved'; - description: Scalars['String']['output']; - }; +export type BatchIsReserved = DeleteInboundShipmentLineErrorInterface & UpdateInboundShipmentLineErrorInterface & { + __typename: 'BatchIsReserved'; + description: Scalars['String']['output']; +}; export type BatchOutboundShipmentInput = { - allocatedOutboundShipmentUnallocatedLines?: InputMaybe< - Array - >; + allocatedOutboundShipmentUnallocatedLines?: InputMaybe>; continueOnError?: InputMaybe; - deleteOutboundShipmentLines?: InputMaybe< - Array - >; - deleteOutboundShipmentServiceLines?: InputMaybe< - Array - >; - deleteOutboundShipmentUnallocatedLines?: InputMaybe< - Array - >; + deleteOutboundShipmentLines?: InputMaybe>; + deleteOutboundShipmentServiceLines?: InputMaybe>; + deleteOutboundShipmentUnallocatedLines?: InputMaybe>; deleteOutboundShipments?: InputMaybe>; - insertOutboundShipmentLines?: InputMaybe< - Array - >; - insertOutboundShipmentServiceLines?: InputMaybe< - Array - >; - insertOutboundShipmentUnallocatedLines?: InputMaybe< - Array - >; + insertOutboundShipmentLines?: InputMaybe>; + insertOutboundShipmentServiceLines?: InputMaybe>; + insertOutboundShipmentUnallocatedLines?: InputMaybe>; insertOutboundShipments?: InputMaybe>; - updateOutboundShipmentLines?: InputMaybe< - Array - >; - updateOutboundShipmentServiceLines?: InputMaybe< - Array - >; - updateOutboundShipmentUnallocatedLines?: InputMaybe< - Array - >; + updateOutboundShipmentLines?: InputMaybe>; + updateOutboundShipmentServiceLines?: InputMaybe>; + updateOutboundShipmentUnallocatedLines?: InputMaybe>; updateOutboundShipments?: InputMaybe>; }; export type BatchOutboundShipmentResponse = { __typename: 'BatchOutboundShipmentResponse'; - allocateOutboundShipmentUnallocatedLines?: Maybe< - Array - >; - deleteOutboundShipmentLines?: Maybe< - Array - >; - deleteOutboundShipmentServiceLines?: Maybe< - Array - >; - deleteOutboundShipmentUnallocatedLines?: Maybe< - Array - >; + allocateOutboundShipmentUnallocatedLines?: Maybe>; + deleteOutboundShipmentLines?: Maybe>; + deleteOutboundShipmentServiceLines?: Maybe>; + deleteOutboundShipmentUnallocatedLines?: Maybe>; deleteOutboundShipments?: Maybe>; - insertOutboundShipmentLines?: Maybe< - Array - >; - insertOutboundShipmentServiceLines?: Maybe< - Array - >; - insertOutboundShipmentUnallocatedLines?: Maybe< - Array - >; + insertOutboundShipmentLines?: Maybe>; + insertOutboundShipmentServiceLines?: Maybe>; + insertOutboundShipmentUnallocatedLines?: Maybe>; insertOutboundShipments?: Maybe>; - updateOutboundShipmentLines?: Maybe< - Array - >; - updateOutboundShipmentServiceLines?: Maybe< - Array - >; - updateOutboundShipmentUnallocatedLines?: Maybe< - Array - >; + updateOutboundShipmentLines?: Maybe>; + updateOutboundShipmentServiceLines?: Maybe>; + updateOutboundShipmentUnallocatedLines?: Maybe>; updateOutboundShipments?: Maybe>; }; @@ -825,54 +742,32 @@ export type BatchPrescriptionResponse = { export type BatchRequestRequisitionInput = { continueOnError?: InputMaybe; - deleteRequestRequisitionLines?: InputMaybe< - Array - >; + deleteRequestRequisitionLines?: InputMaybe>; deleteRequestRequisitions?: InputMaybe>; - insertRequestRequisitionLines?: InputMaybe< - Array - >; + insertRequestRequisitionLines?: InputMaybe>; insertRequestRequisitions?: InputMaybe>; - updateRequestRequisitionLines?: InputMaybe< - Array - >; + updateRequestRequisitionLines?: InputMaybe>; updateRequestRequisitions?: InputMaybe>; }; export type BatchRequestRequisitionResponse = { __typename: 'BatchRequestRequisitionResponse'; - deleteRequestRequisitionLines?: Maybe< - Array - >; - deleteRequestRequisitions?: Maybe< - Array - >; - insertRequestRequisitionLines?: Maybe< - Array - >; - insertRequestRequisitions?: Maybe< - Array - >; - updateRequestRequisitionLines?: Maybe< - Array - >; - updateRequestRequisitions?: Maybe< - Array - >; + deleteRequestRequisitionLines?: Maybe>; + deleteRequestRequisitions?: Maybe>; + insertRequestRequisitionLines?: Maybe>; + insertRequestRequisitions?: Maybe>; + updateRequestRequisitionLines?: Maybe>; + updateRequestRequisitions?: Maybe>; }; export type BatchResponseRequisitionInput = { continueOnError?: InputMaybe; - deleteResponseRequisitionLines?: InputMaybe< - Array - >; + deleteResponseRequisitionLines?: InputMaybe>; }; export type BatchResponseRequisitionResponse = { __typename: 'BatchResponseRequisitionResponse'; - deleteResponseRequisitionLines?: Maybe< - Array - >; + deleteResponseRequisitionLines?: Maybe>; }; export type BatchStocktakeInput = { @@ -895,130 +790,80 @@ export type BatchStocktakeResponse = { updateStocktakes?: Maybe>; }; -export type CanOnlyChangeToAllocatedWhenNoUnallocatedLines = - UpdateErrorInterface & { - __typename: 'CanOnlyChangeToAllocatedWhenNoUnallocatedLines'; - description: Scalars['String']['output']; - invoiceLines: InvoiceLineConnector; - }; +export type CanOnlyChangeToAllocatedWhenNoUnallocatedLines = UpdateErrorInterface & { + __typename: 'CanOnlyChangeToAllocatedWhenNoUnallocatedLines'; + description: Scalars['String']['output']; + invoiceLines: InvoiceLineConnector; +}; -export type CanOnlyChangeToPickedWhenNoUnallocatedLines = - UpdatePrescriptionErrorInterface & { - __typename: 'CanOnlyChangeToPickedWhenNoUnallocatedLines'; - description: Scalars['String']['output']; - invoiceLines: InvoiceLineConnector; - }; +export type CanOnlyChangeToPickedWhenNoUnallocatedLines = UpdatePrescriptionErrorInterface & { + __typename: 'CanOnlyChangeToPickedWhenNoUnallocatedLines'; + description: Scalars['String']['output']; + invoiceLines: InvoiceLineConnector; +}; export type CannotAddPackSizeOfZero = InsertPackVariantErrorInterface & { __typename: 'CannotAddPackSizeOfZero'; description: Scalars['String']['output']; }; -export type CannotAddWithNoAbbreviationAndName = - InsertPackVariantErrorInterface & - UpdatePackVariantErrorInterface & { - __typename: 'CannotAddWithNoAbbreviationAndName'; - description: Scalars['String']['output']; - }; - -export type CannotChangeStatusOfInvoiceOnHold = UpdateErrorInterface & - UpdateInboundShipmentErrorInterface & { - __typename: 'CannotChangeStatusOfInvoiceOnHold'; - description: Scalars['String']['output']; - }; - -export type CannotDeleteInvoiceWithLines = DeleteCustomerReturnErrorInterface & - DeleteErrorInterface & - DeleteInboundShipmentErrorInterface & - DeletePrescriptionErrorInterface & - DeleteSupplierReturnErrorInterface & { - __typename: 'CannotDeleteInvoiceWithLines'; - description: Scalars['String']['output']; - lines: InvoiceLineConnector; - }; - -export type CannotDeleteRequisitionWithLines = - DeleteRequestRequisitionErrorInterface & { - __typename: 'CannotDeleteRequisitionWithLines'; - description: Scalars['String']['output']; - }; - -export type CannotEditInvoice = - AddToInboundShipmentFromMasterListErrorInterface & - AddToOutboundShipmentFromMasterListErrorInterface & - DeleteCustomerReturnErrorInterface & - DeleteErrorInterface & - DeleteInboundShipmentErrorInterface & - DeleteInboundShipmentLineErrorInterface & - DeleteInboundShipmentServiceLineErrorInterface & - DeleteOutboundShipmentLineErrorInterface & - DeleteOutboundShipmentServiceLineErrorInterface & - DeletePrescriptionErrorInterface & - DeletePrescriptionLineErrorInterface & - DeleteSupplierReturnErrorInterface & - InsertInboundShipmentLineErrorInterface & - InsertInboundShipmentServiceLineErrorInterface & - InsertOutboundShipmentLineErrorInterface & - InsertOutboundShipmentServiceLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateInboundShipmentErrorInterface & - UpdateInboundShipmentLineErrorInterface & - UpdateInboundShipmentServiceLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdateOutboundShipmentServiceLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'CannotEditInvoice'; - description: Scalars['String']['output']; - }; - -export type CannotEditRequisition = AddFromMasterListErrorInterface & - CreateRequisitionShipmentErrorInterface & - DeleteRequestRequisitionErrorInterface & - DeleteRequestRequisitionLineErrorInterface & - DeleteResponseRequisitionLineErrorInterface & - InsertRequestRequisitionLineErrorInterface & - SupplyRequestedQuantityErrorInterface & - UpdateRequestRequisitionErrorInterface & - UpdateRequestRequisitionLineErrorInterface & - UpdateResponseRequisitionErrorInterface & - UpdateResponseRequisitionLineErrorInterface & - UseSuggestedQuantityErrorInterface & { - __typename: 'CannotEditRequisition'; - description: Scalars['String']['output']; - }; - -export type CannotEditStocktake = DeleteStocktakeErrorInterface & - DeleteStocktakeLineErrorInterface & - InsertStocktakeLineErrorInterface & - UpdateStocktakeErrorInterface & - UpdateStocktakeLineErrorInterface & { - __typename: 'CannotEditStocktake'; - description: Scalars['String']['output']; - }; +export type CannotAddWithNoAbbreviationAndName = InsertPackVariantErrorInterface & UpdatePackVariantErrorInterface & { + __typename: 'CannotAddWithNoAbbreviationAndName'; + description: Scalars['String']['output']; +}; + +export type CannotChangeStatusOfInvoiceOnHold = UpdateErrorInterface & UpdateInboundShipmentErrorInterface & { + __typename: 'CannotChangeStatusOfInvoiceOnHold'; + description: Scalars['String']['output']; +}; + +export type CannotDeleteInvoiceWithLines = DeleteCustomerReturnErrorInterface & DeleteErrorInterface & DeleteInboundShipmentErrorInterface & DeletePrescriptionErrorInterface & DeleteSupplierReturnErrorInterface & { + __typename: 'CannotDeleteInvoiceWithLines'; + description: Scalars['String']['output']; + lines: InvoiceLineConnector; +}; + +export type CannotDeleteRequisitionWithLines = DeleteRequestRequisitionErrorInterface & { + __typename: 'CannotDeleteRequisitionWithLines'; + description: Scalars['String']['output']; +}; + +export type CannotEditInvoice = AddToInboundShipmentFromMasterListErrorInterface & AddToOutboundShipmentFromMasterListErrorInterface & DeleteCustomerReturnErrorInterface & DeleteErrorInterface & DeleteInboundShipmentErrorInterface & DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeletePrescriptionErrorInterface & DeletePrescriptionLineErrorInterface & DeleteSupplierReturnErrorInterface & InsertInboundShipmentLineErrorInterface & InsertInboundShipmentServiceLineErrorInterface & InsertOutboundShipmentLineErrorInterface & InsertOutboundShipmentServiceLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateInboundShipmentErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'CannotEditInvoice'; + description: Scalars['String']['output']; +}; + +export type CannotEditRequisition = AddFromMasterListErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & InsertResponseRequisitionLineErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UseSuggestedQuantityErrorInterface & { + __typename: 'CannotEditRequisition'; + description: Scalars['String']['output']; +}; + +export type CannotEditStocktake = DeleteStocktakeErrorInterface & DeleteStocktakeLineErrorInterface & InsertStocktakeLineErrorInterface & UpdateStocktakeErrorInterface & UpdateStocktakeLineErrorInterface & { + __typename: 'CannotEditStocktake'; + description: Scalars['String']['output']; +}; export type CannotHaveFractionalPack = InsertRepackErrorInterface & { __typename: 'CannotHaveFractionalPack'; description: Scalars['String']['output']; }; -export type CannotIssueInForeignCurrency = UpdateErrorInterface & - UpdateInboundShipmentErrorInterface & { - __typename: 'CannotIssueInForeignCurrency'; - description: Scalars['String']['output']; - }; +export type CannotIssueInForeignCurrency = UpdateErrorInterface & UpdateInboundShipmentErrorInterface & { + __typename: 'CannotIssueInForeignCurrency'; + description: Scalars['String']['output']; +}; -export type CannotReverseInvoiceStatus = UpdateErrorInterface & - UpdateInboundShipmentErrorInterface & - UpdatePrescriptionErrorInterface & { - __typename: 'CannotReverseInvoiceStatus'; - description: Scalars['String']['output']; - }; +export type CannotReverseInvoiceStatus = UpdateErrorInterface & UpdateInboundShipmentErrorInterface & UpdatePrescriptionErrorInterface & { + __typename: 'CannotReverseInvoiceStatus'; + description: Scalars['String']['output']; +}; export type CentralGeneralMutations = { __typename: 'CentralGeneralMutations'; configureNameProperties: ConfigureNamePropertiesResponse; }; + export type CentralGeneralMutationsConfigureNamePropertiesArgs = { input: Array; }; @@ -1055,9 +900,7 @@ export type CentralPatientSearchInput = { lastName?: InputMaybe; }; -export type CentralPatientSearchResponse = - | CentralPatientSearchConnector - | CentralPatientSearchError; +export type CentralPatientSearchResponse = CentralPatientSearchConnector | CentralPatientSearchError; export type CentralServerMutationNode = { __typename: 'CentralServerMutationNode'; @@ -1117,7 +960,7 @@ export enum ClinicianSortFieldInput { Initials = 'initials', LastName = 'lastName', Mobile = 'mobile', - Phone = 'phone', + Phone = 'phone' } export type ClinicianSortInput = { @@ -1144,12 +987,10 @@ export type ConfigureNamePropertyInput = { valueType: PropertyNodeValueType; }; -export type ConnectionError = CentralPatientSearchErrorInterface & - LinkPatientPatientToStoreErrorInterface & - UpdateUserErrorInterface & { - __typename: 'ConnectionError'; - description: Scalars['String']['output']; - }; +export type ConnectionError = CentralPatientSearchErrorInterface & LinkPatientPatientToStoreErrorInterface & UpdateUserErrorInterface & { + __typename: 'ConnectionError'; + description: Scalars['String']['output']; +}; export type ConsumptionHistoryConnector = { __typename: 'ConsumptionHistoryConnector'; @@ -1230,7 +1071,7 @@ export enum ContactTraceSortFieldInput { Gender = 'gender', LastName = 'lastName', PatientId = 'patientId', - ProgramId = 'programId', + ProgramId = 'programId' } export type ContactTraceSortInput = { @@ -1255,9 +1096,7 @@ export type CreateInventoryAdjustmentInput = { stockLineId: Scalars['String']['input']; }; -export type CreateInventoryAdjustmentResponse = - | CreateInventoryAdjustmentError - | InvoiceNode; +export type CreateInventoryAdjustmentResponse = CreateInventoryAdjustmentError | InvoiceNode; export type CreateRequisitionShipmentError = { __typename: 'CreateRequisitionShipmentError'; @@ -1272,9 +1111,7 @@ export type CreateRequisitionShipmentInput = { responseRequisitionId: Scalars['String']['input']; }; -export type CreateRequisitionShipmentResponse = - | CreateRequisitionShipmentError - | InvoiceNode; +export type CreateRequisitionShipmentResponse = CreateRequisitionShipmentError | InvoiceNode; export type CurrenciesResponse = CurrencyConnector; @@ -1302,7 +1139,7 @@ export type CurrencyNode = { export enum CurrencySortFieldInput { CurrencyCode = 'currencyCode', Id = 'id', - IsHomeCurrency = 'isHomeCurrency', + IsHomeCurrency = 'isHomeCurrency' } export type CurrencySortInput = { @@ -1363,30 +1200,11 @@ export type CustomerReturnLineNode = { stockLineId?: Maybe; }; -export type DatabaseError = DeleteAssetCatalogueItemErrorInterface & - DeleteAssetErrorInterface & - DeleteAssetLogReasonErrorInterface & - DeleteLocationErrorInterface & - DeleteVaccineCourseErrorInterface & - InsertAssetCatalogueItemErrorInterface & - InsertAssetErrorInterface & - InsertAssetLogErrorInterface & - InsertAssetLogReasonErrorInterface & - InsertDemographicIndicatorErrorInterface & - InsertDemographicProjectionErrorInterface & - InsertLocationErrorInterface & - NodeErrorInterface & - RefreshTokenErrorInterface & - UpdateAssetErrorInterface & - UpdateDemographicIndicatorErrorInterface & - UpdateDemographicProjectionErrorInterface & - UpdateLocationErrorInterface & - UpdateSensorErrorInterface & - UpdateVaccineCourseErrorInterface & { - __typename: 'DatabaseError'; - description: Scalars['String']['output']; - fullError: Scalars['String']['output']; - }; +export type DatabaseError = DeleteAssetCatalogueItemErrorInterface & DeleteAssetErrorInterface & DeleteAssetLogReasonErrorInterface & DeleteLocationErrorInterface & DeleteVaccineCourseErrorInterface & InsertAssetCatalogueItemErrorInterface & InsertAssetErrorInterface & InsertAssetLogErrorInterface & InsertAssetLogReasonErrorInterface & InsertDemographicIndicatorErrorInterface & InsertDemographicProjectionErrorInterface & InsertLocationErrorInterface & NodeErrorInterface & RefreshTokenErrorInterface & UpdateAssetErrorInterface & UpdateDemographicIndicatorErrorInterface & UpdateDemographicProjectionErrorInterface & UpdateLocationErrorInterface & UpdateSensorErrorInterface & UpdateVaccineCourseErrorInterface & { + __typename: 'DatabaseError'; + description: Scalars['String']['output']; + fullError: Scalars['String']['output']; +}; export type DatabaseSettingsNode = { __typename: 'DatabaseSettingsNode'; @@ -1395,7 +1213,7 @@ export type DatabaseSettingsNode = { export enum DatabaseType { Postgres = 'POSTGRES', - SqLite = 'SQ_LITE', + SqLite = 'SQ_LITE' } export type DateFilterInput = { @@ -1419,9 +1237,7 @@ export type DeleteAssetCatalogueItemErrorInterface = { description: Scalars['String']['output']; }; -export type DeleteAssetCatalogueItemResponse = - | DeleteAssetCatalogueItemError - | DeleteResponse; +export type DeleteAssetCatalogueItemResponse = DeleteAssetCatalogueItemError | DeleteResponse; export type DeleteAssetError = { __typename: 'DeleteAssetError'; @@ -1441,9 +1257,7 @@ export type DeleteAssetLogReasonErrorInterface = { description: Scalars['String']['output']; }; -export type DeleteAssetLogReasonResponse = - | DeleteAssetLogReasonError - | DeleteResponse; +export type DeleteAssetLogReasonResponse = DeleteAssetLogReasonError | DeleteResponse; export type DeleteAssetResponse = DeleteAssetError | DeleteResponse; @@ -1456,9 +1270,7 @@ export type DeleteCustomerReturnErrorInterface = { description: Scalars['String']['output']; }; -export type DeleteCustomerReturnResponse = - | DeleteCustomerReturnError - | DeleteResponse; +export type DeleteCustomerReturnResponse = DeleteCustomerReturnError | DeleteResponse; export type DeleteErrorInterface = { description: Scalars['String']['output']; @@ -1490,9 +1302,7 @@ export type DeleteInboundShipmentLineInput = { id: Scalars['String']['input']; }; -export type DeleteInboundShipmentLineResponse = - | DeleteInboundShipmentLineError - | DeleteResponse; +export type DeleteInboundShipmentLineResponse = DeleteInboundShipmentLineError | DeleteResponse; export type DeleteInboundShipmentLineResponseWithId = { __typename: 'DeleteInboundShipmentLineResponseWithId'; @@ -1500,9 +1310,7 @@ export type DeleteInboundShipmentLineResponseWithId = { response: DeleteInboundShipmentLineResponse; }; -export type DeleteInboundShipmentResponse = - | DeleteInboundShipmentError - | DeleteResponse; +export type DeleteInboundShipmentResponse = DeleteInboundShipmentError | DeleteResponse; export type DeleteInboundShipmentResponseWithId = { __typename: 'DeleteInboundShipmentResponseWithId'; @@ -1523,9 +1331,7 @@ export type DeleteInboundShipmentServiceLineInput = { id: Scalars['String']['input']; }; -export type DeleteInboundShipmentServiceLineResponse = - | DeleteInboundShipmentServiceLineError - | DeleteResponse; +export type DeleteInboundShipmentServiceLineResponse = DeleteInboundShipmentServiceLineError | DeleteResponse; export type DeleteInboundShipmentServiceLineResponseWithId = { __typename: 'DeleteInboundShipmentServiceLineResponseWithId'; @@ -1566,9 +1372,7 @@ export type DeleteOutboundShipmentLineInput = { id: Scalars['String']['input']; }; -export type DeleteOutboundShipmentLineResponse = - | DeleteOutboundShipmentLineError - | DeleteResponse; +export type DeleteOutboundShipmentLineResponse = DeleteOutboundShipmentLineError | DeleteResponse; export type DeleteOutboundShipmentLineResponseWithId = { __typename: 'DeleteOutboundShipmentLineResponseWithId'; @@ -1576,9 +1380,7 @@ export type DeleteOutboundShipmentLineResponseWithId = { response: DeleteOutboundShipmentLineResponse; }; -export type DeleteOutboundShipmentResponse = - | DeleteOutboundShipmentError - | DeleteResponse; +export type DeleteOutboundShipmentResponse = DeleteOutboundShipmentError | DeleteResponse; export type DeleteOutboundShipmentResponseWithId = { __typename: 'DeleteOutboundShipmentResponseWithId'; @@ -1599,9 +1401,7 @@ export type DeleteOutboundShipmentServiceLineInput = { id: Scalars['String']['input']; }; -export type DeleteOutboundShipmentServiceLineResponse = - | DeleteOutboundShipmentServiceLineError - | DeleteResponse; +export type DeleteOutboundShipmentServiceLineResponse = DeleteOutboundShipmentServiceLineError | DeleteResponse; export type DeleteOutboundShipmentServiceLineResponseWithId = { __typename: 'DeleteOutboundShipmentServiceLineResponseWithId'; @@ -1622,9 +1422,7 @@ export type DeleteOutboundShipmentUnallocatedLineInput = { id: Scalars['String']['input']; }; -export type DeleteOutboundShipmentUnallocatedLineResponse = - | DeleteOutboundShipmentUnallocatedLineError - | DeleteResponse; +export type DeleteOutboundShipmentUnallocatedLineResponse = DeleteOutboundShipmentUnallocatedLineError | DeleteResponse; export type DeleteOutboundShipmentUnallocatedLineResponseWithId = { __typename: 'DeleteOutboundShipmentUnallocatedLineResponseWithId'; @@ -1660,9 +1458,7 @@ export type DeletePrescriptionLineInput = { id: Scalars['String']['input']; }; -export type DeletePrescriptionLineResponse = - | DeletePrescriptionLineError - | DeleteResponse; +export type DeletePrescriptionLineResponse = DeletePrescriptionLineError | DeleteResponse; export type DeletePrescriptionLineResponseWithId = { __typename: 'DeletePrescriptionLineResponseWithId'; @@ -1670,9 +1466,7 @@ export type DeletePrescriptionLineResponseWithId = { response: DeletePrescriptionLineResponse; }; -export type DeletePrescriptionResponse = - | DeletePrescriptionError - | DeleteResponse; +export type DeletePrescriptionResponse = DeletePrescriptionError | DeleteResponse; export type DeletePrescriptionResponseWithId = { __typename: 'DeletePrescriptionResponseWithId'; @@ -1706,9 +1500,7 @@ export type DeleteRequestRequisitionLineInput = { id: Scalars['String']['input']; }; -export type DeleteRequestRequisitionLineResponse = - | DeleteRequestRequisitionLineError - | DeleteResponse; +export type DeleteRequestRequisitionLineResponse = DeleteRequestRequisitionLineError | DeleteResponse; export type DeleteRequestRequisitionLineResponseWithId = { __typename: 'DeleteRequestRequisitionLineResponseWithId'; @@ -1716,9 +1508,7 @@ export type DeleteRequestRequisitionLineResponseWithId = { response: DeleteRequestRequisitionLineResponse; }; -export type DeleteRequestRequisitionResponse = - | DeleteRequestRequisitionError - | DeleteResponse; +export type DeleteRequestRequisitionResponse = DeleteRequestRequisitionError | DeleteResponse; export type DeleteRequestRequisitionResponseWithId = { __typename: 'DeleteRequestRequisitionResponseWithId'; @@ -1744,9 +1534,7 @@ export type DeleteResponseRequisitionLineInput = { id: Scalars['String']['input']; }; -export type DeleteResponseRequisitionLineResponse = - | DeleteResponse - | DeleteResponseRequisitionLineError; +export type DeleteResponseRequisitionLineResponse = DeleteResponse | DeleteResponseRequisitionLineError; export type DeleteResponseRequisitionLineResponseWithId = { __typename: 'DeleteResponseRequisitionLineResponseWithId'; @@ -1780,9 +1568,7 @@ export type DeleteStocktakeLineInput = { id: Scalars['String']['input']; }; -export type DeleteStocktakeLineResponse = - | DeleteResponse - | DeleteStocktakeLineError; +export type DeleteStocktakeLineResponse = DeleteResponse | DeleteStocktakeLineError; export type DeleteStocktakeLineResponseWithId = { __typename: 'DeleteStocktakeLineResponseWithId'; @@ -1807,9 +1593,7 @@ export type DeleteSupplierReturnErrorInterface = { description: Scalars['String']['output']; }; -export type DeleteSupplierReturnResponse = - | DeleteResponse - | DeleteSupplierReturnError; +export type DeleteSupplierReturnResponse = DeleteResponse | DeleteSupplierReturnError; export type DeleteVaccineCourseError = { __typename: 'DeleteVaccineCourseError'; @@ -1820,9 +1604,7 @@ export type DeleteVaccineCourseErrorInterface = { description: Scalars['String']['output']; }; -export type DeleteVaccineCourseResponse = - | DeleteResponse - | DeleteVaccineCourseError; +export type DeleteVaccineCourseResponse = DeleteResponse | DeleteVaccineCourseError; export type DemographicConnector = { __typename: 'DemographicConnector'; @@ -1863,7 +1645,7 @@ export type DemographicIndicatorNode = { export enum DemographicIndicatorSortFieldInput { Id = 'id', - Name = 'name', + Name = 'name' } export type DemographicIndicatorSortInput = { @@ -1881,18 +1663,22 @@ export type DemographicMutations = { updateDemographicProjection: UpdateDemographicProjectionResponse; }; + export type DemographicMutationsInsertDemographicIndicatorArgs = { input: InsertDemographicIndicatorInput; }; + export type DemographicMutationsInsertDemographicProjectionArgs = { input: InsertDemographicProjectionInput; }; + export type DemographicMutationsUpdateDemographicIndicatorArgs = { input: UpdateDemographicIndicatorInput; }; + export type DemographicMutationsUpdateDemographicProjectionArgs = { input: UpdateDemographicProjectionInput; }; @@ -1925,12 +1711,10 @@ export type DemographicProjectionNode = { year5: Scalars['Float']['output']; }; -export type DemographicProjectionResponse = - | DemographicProjectionNode - | NodeError; +export type DemographicProjectionResponse = DemographicProjectionNode | NodeError; export enum DemographicProjectionSortFieldInput { - Id = 'id', + Id = 'id' } export type DemographicProjectionSortInput = { @@ -1942,7 +1726,7 @@ export type DemographicProjectionsResponse = DemographicProjectionConnector; export enum DemographicSortFieldInput { Id = 'id', - Name = 'name', + Name = 'name' } export type DemographicSortInput = { @@ -2014,7 +1798,7 @@ export enum DocumentRegistryCategoryNode { Custom = 'CUSTOM', Encounter = 'ENCOUNTER', Patient = 'PATIENT', - ProgramEnrolment = 'PROGRAM_ENROLMENT', + ProgramEnrolment = 'PROGRAM_ENROLMENT' } export type DocumentRegistryConnector = { @@ -2047,7 +1831,7 @@ export type DocumentRegistryResponse = DocumentRegistryConnector; export enum DocumentRegistrySortFieldInput { DocumentType = 'documentType', - Type = 'type', + Type = 'type' } export type DocumentRegistrySortInput = { @@ -2067,7 +1851,7 @@ export enum DocumentSortFieldInput { Datetime = 'datetime', Name = 'name', Owner = 'owner', - Type = 'type', + Type = 'type' } export type DocumentSortInput = { @@ -2161,6 +1945,7 @@ export type EncounterNode = { type: Scalars['String']['output']; }; + export type EncounterNodeActiveProgramEventsArgs = { at?: InputMaybe; filter?: InputMaybe; @@ -2168,6 +1953,7 @@ export type EncounterNodeActiveProgramEventsArgs = { sort?: InputMaybe; }; + export type EncounterNodeProgramEventsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -2178,7 +1964,7 @@ export enum EncounterNodeStatus { Cancelled = 'CANCELLED', Deleted = 'DELETED', Pending = 'PENDING', - Visited = 'VISITED', + Visited = 'VISITED' } export type EncounterResponse = EncounterConnector; @@ -2190,7 +1976,7 @@ export enum EncounterSortFieldInput { Program = 'program', StartDatetime = 'startDatetime', Status = 'status', - Type = 'type', + Type = 'type' } export type EncounterSortInput = { @@ -2362,35 +2148,14 @@ export enum ForeignKey { LocationId = 'locationId', OtherPartyId = 'otherPartyId', RequisitionId = 'requisitionId', - StockLineId = 'stockLineId', + StockLineId = 'stockLineId' } -export type ForeignKeyError = DeleteInboundShipmentLineErrorInterface & - DeleteInboundShipmentServiceLineErrorInterface & - DeleteOutboundShipmentLineErrorInterface & - DeleteOutboundShipmentServiceLineErrorInterface & - DeleteOutboundShipmentUnallocatedLineErrorInterface & - DeletePrescriptionLineErrorInterface & - DeleteResponseRequisitionLineErrorInterface & - InsertInboundShipmentLineErrorInterface & - InsertInboundShipmentServiceLineErrorInterface & - InsertOutboundShipmentLineErrorInterface & - InsertOutboundShipmentServiceLineErrorInterface & - InsertOutboundShipmentUnallocatedLineErrorInterface & - InsertPrescriptionLineErrorInterface & - InsertRequestRequisitionLineErrorInterface & - UpdateInboundShipmentLineErrorInterface & - UpdateInboundShipmentServiceLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdateOutboundShipmentServiceLineErrorInterface & - UpdateOutboundShipmentUnallocatedLineErrorInterface & - UpdatePrescriptionLineErrorInterface & - UpdateRequestRequisitionLineErrorInterface & - UpdateResponseRequisitionLineErrorInterface & { - __typename: 'ForeignKeyError'; - description: Scalars['String']['output']; - key: ForeignKey; - }; +export type ForeignKeyError = DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & InsertInboundShipmentLineErrorInterface & InsertInboundShipmentServiceLineErrorInterface & InsertOutboundShipmentLineErrorInterface & InsertOutboundShipmentServiceLineErrorInterface & InsertOutboundShipmentUnallocatedLineErrorInterface & InsertPrescriptionLineErrorInterface & InsertRequestRequisitionLineErrorInterface & InsertResponseRequisitionLineErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionLineErrorInterface & { + __typename: 'ForeignKeyError'; + description: Scalars['String']['output']; + key: ForeignKey; +}; export type FormSchemaConnector = { __typename: 'FormSchemaConnector'; @@ -2414,7 +2179,7 @@ export type FormSchemaNode = { export type FormSchemaResponse = FormSchemaConnector; export enum FormSchemaSortFieldInput { - Id = 'id', + Id = 'id' } export type FormSchemaSortInput = { @@ -2453,7 +2218,7 @@ export enum GenderType { TransgenderMale = 'TRANSGENDER_MALE', TransgenderMaleHormone = 'TRANSGENDER_MALE_HORMONE', TransgenderMaleSurgical = 'TRANSGENDER_MALE_SURGICAL', - Unknown = 'UNKNOWN', + Unknown = 'UNKNOWN' } export type GenerateCustomerReturnLinesInput = { @@ -2462,8 +2227,7 @@ export type GenerateCustomerReturnLinesInput = { outboundShipmentLineIds: Array; }; -export type GenerateCustomerReturnLinesResponse = - GeneratedCustomerReturnLineConnector; +export type GenerateCustomerReturnLinesResponse = GeneratedCustomerReturnLineConnector; /** At least one input is required. */ export type GenerateSupplierReturnLinesInput = { @@ -2501,7 +2265,7 @@ export enum InitialisationStatusType { /** Sync settings were set and sync was attempted at least once */ Initialising = 'INITIALISING', /** Sync settings are not set and sync was not attempted */ - PreInitialisation = 'PRE_INITIALISATION', + PreInitialisation = 'PRE_INITIALISATION' } export type InitialiseSiteResponse = SyncErrorNode | SyncSettingsNode; @@ -2527,9 +2291,7 @@ export type InsertAssetCatalogueItemInput = { typeId: Scalars['String']['input']; }; -export type InsertAssetCatalogueItemResponse = - | AssetCatalogueItemNode - | InsertAssetCatalogueItemError; +export type InsertAssetCatalogueItemResponse = AssetCatalogueItemNode | InsertAssetCatalogueItemError; export type InsertAssetError = { __typename: 'InsertAssetError'; @@ -2592,9 +2354,7 @@ export type InsertAssetLogReasonInput = { reason: Scalars['String']['input']; }; -export type InsertAssetLogReasonResponse = - | AssetLogReasonNode - | InsertAssetLogReasonError; +export type InsertAssetLogReasonResponse = AssetLogReasonNode | InsertAssetLogReasonError; export type InsertAssetLogResponse = AssetLogNode | InsertAssetLogError; @@ -2630,9 +2390,7 @@ export type InsertCustomerReturnErrorInterface = { description: Scalars['String']['output']; }; -export type InsertCustomerReturnResponse = - | InsertCustomerReturnError - | InvoiceNode; +export type InsertCustomerReturnResponse = InsertCustomerReturnError | InvoiceNode; export type InsertDemographicIndicatorError = { __typename: 'InsertDemographicIndicatorError'; @@ -2656,9 +2414,7 @@ export type InsertDemographicIndicatorInput = { year5Projection?: InputMaybe; }; -export type InsertDemographicIndicatorResponse = - | DemographicIndicatorNode - | InsertDemographicIndicatorError; +export type InsertDemographicIndicatorResponse = DemographicIndicatorNode | InsertDemographicIndicatorError; export type InsertDemographicProjectionError = { __typename: 'InsertDemographicProjectionError'; @@ -2679,9 +2435,7 @@ export type InsertDemographicProjectionInput = { year5?: InputMaybe; }; -export type InsertDemographicProjectionResponse = - | DemographicProjectionNode - | InsertDemographicProjectionError; +export type InsertDemographicProjectionResponse = DemographicProjectionNode | InsertDemographicProjectionError; export type InsertDocumentRegistryInput = { category: DocumentRegistryCategoryNode; @@ -2761,9 +2515,7 @@ export type InsertInboundShipmentLineInput = { totalBeforeTax?: InputMaybe; }; -export type InsertInboundShipmentLineResponse = - | InsertInboundShipmentLineError - | InvoiceLineNode; +export type InsertInboundShipmentLineResponse = InsertInboundShipmentLineError | InvoiceLineNode; export type InsertInboundShipmentLineResponseWithId = { __typename: 'InsertInboundShipmentLineResponseWithId'; @@ -2771,9 +2523,7 @@ export type InsertInboundShipmentLineResponseWithId = { response: InsertInboundShipmentLineResponse; }; -export type InsertInboundShipmentResponse = - | InsertInboundShipmentError - | InvoiceNode; +export type InsertInboundShipmentResponse = InsertInboundShipmentError | InvoiceNode; export type InsertInboundShipmentResponseWithId = { __typename: 'InsertInboundShipmentResponseWithId'; @@ -2800,9 +2550,7 @@ export type InsertInboundShipmentServiceLineInput = { totalBeforeTax: Scalars['Float']['input']; }; -export type InsertInboundShipmentServiceLineResponse = - | InsertInboundShipmentServiceLineError - | InvoiceLineNode; +export type InsertInboundShipmentServiceLineResponse = InsertInboundShipmentServiceLineError | InvoiceLineNode; export type InsertInboundShipmentServiceLineResponseWithId = { __typename: 'InsertInboundShipmentServiceLineResponseWithId'; @@ -2866,9 +2614,7 @@ export type InsertOutboundShipmentLineInput = { taxPercentage?: InputMaybe; }; -export type InsertOutboundShipmentLineResponse = - | InsertOutboundShipmentLineError - | InvoiceLineNode; +export type InsertOutboundShipmentLineResponse = InsertOutboundShipmentLineError | InvoiceLineNode; export type InsertOutboundShipmentLineResponseWithId = { __typename: 'InsertOutboundShipmentLineResponseWithId'; @@ -2876,10 +2622,7 @@ export type InsertOutboundShipmentLineResponseWithId = { response: InsertOutboundShipmentLineResponse; }; -export type InsertOutboundShipmentResponse = - | InsertOutboundShipmentError - | InvoiceNode - | NodeError; +export type InsertOutboundShipmentResponse = InsertOutboundShipmentError | InvoiceNode | NodeError; export type InsertOutboundShipmentResponseWithId = { __typename: 'InsertOutboundShipmentResponseWithId'; @@ -2906,9 +2649,7 @@ export type InsertOutboundShipmentServiceLineInput = { totalBeforeTax: Scalars['Float']['input']; }; -export type InsertOutboundShipmentServiceLineResponse = - | InsertOutboundShipmentServiceLineError - | InvoiceLineNode; +export type InsertOutboundShipmentServiceLineResponse = InsertOutboundShipmentServiceLineError | InvoiceLineNode; export type InsertOutboundShipmentServiceLineResponseWithId = { __typename: 'InsertOutboundShipmentServiceLineResponseWithId'; @@ -2932,9 +2673,7 @@ export type InsertOutboundShipmentUnallocatedLineInput = { quantity: Scalars['Int']['input']; }; -export type InsertOutboundShipmentUnallocatedLineResponse = - | InsertOutboundShipmentUnallocatedLineError - | InvoiceLineNode; +export type InsertOutboundShipmentUnallocatedLineResponse = InsertOutboundShipmentUnallocatedLineError | InvoiceLineNode; export type InsertOutboundShipmentUnallocatedLineResponseWithId = { __typename: 'InsertOutboundShipmentUnallocatedLineResponseWithId'; @@ -3009,9 +2748,7 @@ export type InsertPrescriptionLineInput = { stockLineId: Scalars['String']['input']; }; -export type InsertPrescriptionLineResponse = - | InsertPrescriptionLineError - | InvoiceLineNode; +export type InsertPrescriptionLineResponse = InsertPrescriptionLineError | InvoiceLineNode; export type InsertPrescriptionLineResponseWithId = { __typename: 'InsertPrescriptionLineResponseWithId'; @@ -3069,9 +2806,7 @@ export type InsertProgramRequestRequisitionInput = { theirReference?: InputMaybe; }; -export type InsertProgramRequestRequisitionResponse = - | InsertProgramRequestRequisitionError - | RequisitionNode; +export type InsertProgramRequestRequisitionResponse = InsertProgramRequestRequisitionError | RequisitionNode; export type InsertProgramResponseRequisitionError = { __typename: 'InsertProgramResponseRequisitionError'; @@ -3089,9 +2824,7 @@ export type InsertProgramResponseRequisitionInput = { programOrderTypeId: Scalars['String']['input']; }; -export type InsertProgramResponseRequisitionResponse = - | InsertProgramResponseRequisitionError - | RequisitionNode; +export type InsertProgramResponseRequisitionResponse = InsertProgramResponseRequisitionError | RequisitionNode; export type InsertRepackError = { __typename: 'InsertRepackError'; @@ -3149,9 +2882,7 @@ export type InsertRequestRequisitionLineInput = { requisitionId: Scalars['String']['input']; }; -export type InsertRequestRequisitionLineResponse = - | InsertRequestRequisitionLineError - | RequisitionLineNode; +export type InsertRequestRequisitionLineResponse = InsertRequestRequisitionLineError | RequisitionLineNode; export type InsertRequestRequisitionLineResponseWithId = { __typename: 'InsertRequestRequisitionLineResponseWithId'; @@ -3159,9 +2890,7 @@ export type InsertRequestRequisitionLineResponseWithId = { response: InsertRequestRequisitionLineResponse; }; -export type InsertRequestRequisitionResponse = - | InsertRequestRequisitionError - | RequisitionNode; +export type InsertRequestRequisitionResponse = InsertRequestRequisitionError | RequisitionNode; export type InsertRequestRequisitionResponseWithId = { __typename: 'InsertRequestRequisitionResponseWithId'; @@ -3204,13 +2933,9 @@ export type InsertResponseRequisitionLineInput = { theirStockOnHand?: InputMaybe; }; -export type InsertResponseRequisitionLineResponse = - | InsertResponseRequisitionLineError - | RequisitionLineNode; +export type InsertResponseRequisitionLineResponse = InsertResponseRequisitionLineError | RequisitionLineNode; -export type InsertResponseRequisitionResponse = - | InsertResponseRequisitionError - | RequisitionNode; +export type InsertResponseRequisitionResponse = InsertResponseRequisitionError | RequisitionNode; export type InsertRnRFormInput = { id: Scalars['String']['input']; @@ -3277,9 +3002,7 @@ export type InsertStocktakeLineInput = { stocktakeId: Scalars['String']['input']; }; -export type InsertStocktakeLineResponse = - | InsertStocktakeLineError - | StocktakeLineNode; +export type InsertStocktakeLineResponse = InsertStocktakeLineError | StocktakeLineNode; export type InsertStocktakeLineResponseWithId = { __typename: 'InsertStocktakeLineResponseWithId'; @@ -3304,9 +3027,7 @@ export type InsertSupplierReturnErrorInterface = { description: Scalars['String']['output']; }; -export type InsertSupplierReturnResponse = - | InsertSupplierReturnError - | InvoiceNode; +export type InsertSupplierReturnResponse = InsertSupplierReturnError | InvoiceNode; export type InsertVaccinationInput = { clinicianId?: InputMaybe; @@ -3345,33 +3066,18 @@ export type InsertVaccineCourseInput = { wastageRate: Scalars['Float']['input']; }; -export type InsertVaccineCourseResponse = - | InsertVaccineCourseError - | VaccineCourseNode; - -export type InternalError = InsertAssetCatalogueItemErrorInterface & - InsertAssetErrorInterface & - InsertAssetLogErrorInterface & - InsertAssetLogReasonErrorInterface & - InsertDemographicIndicatorErrorInterface & - InsertDemographicProjectionErrorInterface & - InsertLocationErrorInterface & - RefreshTokenErrorInterface & - UpdateAssetErrorInterface & - UpdateDemographicIndicatorErrorInterface & - UpdateDemographicProjectionErrorInterface & - UpdateLocationErrorInterface & - UpdateSensorErrorInterface & { - __typename: 'InternalError'; - description: Scalars['String']['output']; - fullError: Scalars['String']['output']; - }; - -export type InvalidCredentials = AuthTokenErrorInterface & - UpdateUserErrorInterface & { - __typename: 'InvalidCredentials'; - description: Scalars['String']['output']; - }; +export type InsertVaccineCourseResponse = InsertVaccineCourseError | VaccineCourseNode; + +export type InternalError = InsertAssetCatalogueItemErrorInterface & InsertAssetErrorInterface & InsertAssetLogErrorInterface & InsertAssetLogReasonErrorInterface & InsertDemographicIndicatorErrorInterface & InsertDemographicProjectionErrorInterface & InsertLocationErrorInterface & RefreshTokenErrorInterface & UpdateAssetErrorInterface & UpdateDemographicIndicatorErrorInterface & UpdateDemographicProjectionErrorInterface & UpdateLocationErrorInterface & UpdateSensorErrorInterface & { + __typename: 'InternalError'; + description: Scalars['String']['output']; + fullError: Scalars['String']['output']; +}; + +export type InvalidCredentials = AuthTokenErrorInterface & UpdateUserErrorInterface & { + __typename: 'InvalidCredentials'; + description: Scalars['String']['output']; +}; export type InvalidStockSelection = UpdatePrescriptionErrorInterface & { __typename: 'InvalidStockSelection'; @@ -3405,16 +3111,15 @@ export type InventoryAdjustmentReasonNode = { export enum InventoryAdjustmentReasonNodeType { Negative = 'NEGATIVE', - Positive = 'POSITIVE', + Positive = 'POSITIVE' } -export type InventoryAdjustmentReasonResponse = - InventoryAdjustmentReasonConnector; +export type InventoryAdjustmentReasonResponse = InventoryAdjustmentReasonConnector; export enum InventoryAdjustmentReasonSortFieldInput { Id = 'id', InventoryAdjustmentReasonType = 'inventoryAdjustmentReasonType', - Reason = 'reason', + Reason = 'reason' } export type InventoryAdjustmentReasonSortInput = { @@ -3470,13 +3175,10 @@ export type InvoiceFilterInput = { verifiedDatetime?: InputMaybe; }; -export type InvoiceIsNotEditable = UpdateErrorInterface & - UpdateNameErrorInterface & - UpdatePrescriptionErrorInterface & - UpdateReturnOtherPartyErrorInterface & { - __typename: 'InvoiceIsNotEditable'; - description: Scalars['String']['output']; - }; +export type InvoiceIsNotEditable = UpdateErrorInterface & UpdateNameErrorInterface & UpdatePrescriptionErrorInterface & UpdateReturnOtherPartyErrorInterface & { + __typename: 'InvoiceIsNotEditable'; + description: Scalars['String']['output']; +}; export type InvoiceLineConnector = { __typename: 'InvoiceLineConnector'; @@ -3531,7 +3233,7 @@ export enum InvoiceLineNodeType { Service = 'SERVICE', StockIn = 'STOCK_IN', StockOut = 'STOCK_OUT', - UnallocatedStock = 'UNALLOCATED_STOCK', + UnallocatedStock = 'UNALLOCATED_STOCK' } export enum InvoiceLineSortFieldInput { @@ -3544,7 +3246,7 @@ export enum InvoiceLineSortFieldInput { /** Invoice line item stock location name */ LocationName = 'locationName', /** Invoice line pack size */ - PackSize = 'packSize', + PackSize = 'packSize' } export type InvoiceLineSortInput = { @@ -3608,6 +3310,7 @@ export type InvoiceNode = { verifiedDatetime?: Maybe; }; + export type InvoiceNodeOtherPartyArgs = { storeId: Scalars['String']['input']; }; @@ -3655,7 +3358,7 @@ export enum InvoiceNodeStatus { * Outbound Shipment: Status is updated based on corresponding inbound Shipment * Inbound Shipment: Becomes not editable */ - Verified = 'VERIFIED', + Verified = 'VERIFIED' } export enum InvoiceNodeType { @@ -3666,7 +3369,7 @@ export enum InvoiceNodeType { OutboundShipment = 'OUTBOUND_SHIPMENT', Prescription = 'PRESCRIPTION', Repack = 'REPACK', - SupplierReturn = 'SUPPLIER_RETURN', + SupplierReturn = 'SUPPLIER_RETURN' } export type InvoiceResponse = InvoiceNode | NodeError; @@ -3684,7 +3387,7 @@ export enum InvoiceSortFieldInput { TheirReference = 'theirReference', TransportReference = 'transportReference', Type = 'type', - VerifiedDatetime = 'verifiedDatetime', + VerifiedDatetime = 'verifiedDatetime' } export type InvoiceSortInput = { @@ -3767,14 +3470,17 @@ export type ItemNode = { weight: Scalars['Float']['output']; }; + export type ItemNodeAvailableBatchesArgs = { storeId: Scalars['String']['input']; }; + export type ItemNodeAvailableStockOnHandArgs = { storeId: Scalars['String']['input']; }; + export type ItemNodeStatsArgs = { amcLookbackMonths?: InputMaybe; storeId: Scalars['String']['input']; @@ -3783,7 +3489,7 @@ export type ItemNodeStatsArgs = { export enum ItemNodeType { NonStock = 'NON_STOCK', Service = 'SERVICE', - Stock = 'STOCK', + Stock = 'STOCK' } export type ItemPackVariantConnector = { @@ -3817,7 +3523,7 @@ export type ItemPriceResponse = ItemPriceNode; export enum ItemSortFieldInput { Code = 'code', Name = 'name', - Type = 'type', + Type = 'type' } export type ItemSortInput = { @@ -3885,7 +3591,7 @@ export enum LanguageType { Portuguese = 'PORTUGUESE', Russian = 'RUSSIAN', Spanish = 'SPANISH', - Tetum = 'TETUM', + Tetum = 'TETUM' } export type LedgerConnector = { @@ -3920,7 +3626,7 @@ export enum LedgerSortFieldInput { ItemId = 'itemId', Name = 'name', Quantity = 'quantity', - StockLineId = 'stockLineId', + StockLineId = 'stockLineId' } export type LedgerSortInput = { @@ -3942,9 +3648,7 @@ export type LinkPatientPatientToStoreErrorInterface = { description: Scalars['String']['output']; }; -export type LinkPatientToStoreResponse = - | LinkPatientPatientToStoreError - | NameStoreJoinNode; +export type LinkPatientToStoreResponse = LinkPatientPatientToStoreError | NameStoreJoinNode; export type LocationConnector = { __typename: 'LocationConnector'; @@ -3968,13 +3672,10 @@ export type LocationInUse = DeleteLocationErrorInterface & { stockLines: StockLineConnector; }; -export type LocationIsOnHold = InsertOutboundShipmentLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'LocationIsOnHold'; - description: Scalars['String']['output']; - }; +export type LocationIsOnHold = InsertOutboundShipmentLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'LocationIsOnHold'; + description: Scalars['String']['output']; +}; export type LocationNode = { __typename: 'LocationNode'; @@ -3985,17 +3686,14 @@ export type LocationNode = { stock: StockLineConnector; }; -export type LocationNotFound = InsertOutboundShipmentLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'LocationNotFound'; - description: Scalars['String']['output']; - }; +export type LocationNotFound = InsertOutboundShipmentLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'LocationNotFound'; + description: Scalars['String']['output']; +}; export enum LocationSortFieldInput { Code = 'code', - Name = 'name', + Name = 'name' } export type LocationSortInput = { @@ -4015,7 +3713,7 @@ export enum LogLevelEnum { Error = 'ERROR', Info = 'INFO', Trace = 'TRACE', - Warn = 'WARN', + Warn = 'WARN' } export type LogLevelNode = { @@ -4040,7 +3738,7 @@ export type LogoutResponse = Logout; export enum LowStockStatus { BelowHalf = 'BELOW_HALF', BelowQuarter = 'BELOW_QUARTER', - Ok = 'OK', + Ok = 'OK' } export type MasterListConnector = { @@ -4083,7 +3781,7 @@ export type MasterListLineNode = { export enum MasterListLineSortFieldInput { Code = 'code', - Name = 'name', + Name = 'name' } export type MasterListLineSortInput = { @@ -4107,23 +3805,21 @@ export type MasterListNode = { name: Scalars['String']['output']; }; -export type MasterListNotFoundForThisName = - AddToOutboundShipmentFromMasterListErrorInterface & { - __typename: 'MasterListNotFoundForThisName'; - description: Scalars['String']['output']; - }; +export type MasterListNotFoundForThisName = AddToOutboundShipmentFromMasterListErrorInterface & { + __typename: 'MasterListNotFoundForThisName'; + description: Scalars['String']['output']; +}; -export type MasterListNotFoundForThisStore = AddFromMasterListErrorInterface & - AddToInboundShipmentFromMasterListErrorInterface & { - __typename: 'MasterListNotFoundForThisStore'; - description: Scalars['String']['output']; - }; +export type MasterListNotFoundForThisStore = AddFromMasterListErrorInterface & AddToInboundShipmentFromMasterListErrorInterface & { + __typename: 'MasterListNotFoundForThisStore'; + description: Scalars['String']['output']; +}; export enum MasterListSortFieldInput { Code = 'code', Description = 'description', DiscountPercentage = 'discountPercentage', - Name = 'name', + Name = 'name' } export type MasterListSortInput = { @@ -4138,12 +3834,10 @@ export type MasterListSortInput = { export type MasterListsResponse = MasterListConnector; -export type MaxOrdersReachedForPeriod = - InsertProgramRequestRequisitionErrorInterface & - InsertProgramResponseRequisitionErrorInterface & { - __typename: 'MaxOrdersReachedForPeriod'; - description: Scalars['String']['output']; - }; +export type MaxOrdersReachedForPeriod = InsertProgramRequestRequisitionErrorInterface & InsertProgramResponseRequisitionErrorInterface & { + __typename: 'MaxOrdersReachedForPeriod'; + description: Scalars['String']['output']; +}; export type MissingCredentials = UpdateUserErrorInterface & { __typename: 'MissingCredentials'; @@ -4293,545 +3987,655 @@ export type Mutations = { useSuggestedQuantity: UseSuggestedQuantityResponse; }; + export type MutationsAddFromMasterListArgs = { input: AddFromMasterListInput; storeId: Scalars['String']['input']; }; + export type MutationsAddToInboundShipmentFromMasterListArgs = { input: AddToShipmentFromMasterListInput; storeId: Scalars['String']['input']; }; + export type MutationsAddToOutboundShipmentFromMasterListArgs = { input: AddToShipmentFromMasterListInput; storeId: Scalars['String']['input']; }; + export type MutationsAllocateOutboundShipmentUnallocatedLineArgs = { lineId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsAllocateProgramNumberArgs = { input: AllocateProgramNumberInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchInboundShipmentArgs = { input: BatchInboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchOutboundShipmentArgs = { input: BatchOutboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchPrescriptionArgs = { input: BatchPrescriptionInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchRequestRequisitionArgs = { input: BatchRequestRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchResponseRequisitionArgs = { input: BatchResponseRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsBatchStocktakeArgs = { input: BatchStocktakeInput; storeId: Scalars['String']['input']; }; + export type MutationsCreateInventoryAdjustmentArgs = { input: CreateInventoryAdjustmentInput; storeId: Scalars['String']['input']; }; + export type MutationsCreateRequisitionShipmentArgs = { input: CreateRequisitionShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteAssetArgs = { assetId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsDeleteCustomerReturnArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsDeleteInboundShipmentArgs = { input: DeleteInboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteInboundShipmentLineArgs = { input: DeleteInboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteInboundShipmentServiceLineArgs = { input: DeleteInboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteLocationArgs = { input: DeleteLocationInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteOutboundShipmentArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsDeleteOutboundShipmentLineArgs = { input: DeleteOutboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteOutboundShipmentServiceLineArgs = { input: DeleteOutboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteOutboundShipmentUnallocatedLineArgs = { input: DeleteOutboundShipmentUnallocatedLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeletePrescriptionArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsDeletePrescriptionLineArgs = { input: DeletePrescriptionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteRequestRequisitionArgs = { input: DeleteRequestRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteRequestRequisitionLineArgs = { input: DeleteRequestRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteResponseRequisitionLineArgs = { input: DeleteResponseRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteStocktakeArgs = { input: DeleteStocktakeInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteStocktakeLineArgs = { input: DeleteStocktakeLineInput; storeId: Scalars['String']['input']; }; + export type MutationsDeleteSupplierReturnArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsFinaliseRnrFormArgs = { input: FinaliseRnRFormInput; storeId: Scalars['String']['input']; }; + export type MutationsInitialiseSiteArgs = { input: SyncSettingsInput; }; + export type MutationsInsertAssetArgs = { input: InsertAssetInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertAssetLogArgs = { input: InsertAssetLogInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertBarcodeArgs = { input: InsertBarcodeInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertContactTraceArgs = { input: InsertContactTraceInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertCustomerReturnArgs = { input: CustomerReturnInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertDocumentRegistryArgs = { input: InsertDocumentRegistryInput; }; + export type MutationsInsertEncounterArgs = { input: InsertEncounterInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertFormSchemaArgs = { input: InsertFormSchemaInput; }; + export type MutationsInsertInboundShipmentArgs = { input: InsertInboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertInboundShipmentLineArgs = { input: InsertInboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertInboundShipmentServiceLineArgs = { input: InsertInboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertLocationArgs = { input: InsertLocationInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertOutboundShipmentArgs = { input: InsertOutboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertOutboundShipmentLineArgs = { input: InsertOutboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertOutboundShipmentServiceLineArgs = { input: InsertOutboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertOutboundShipmentUnallocatedLineArgs = { input: InsertOutboundShipmentUnallocatedLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertPatientArgs = { input: InsertPatientInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertPluginDataArgs = { input: InsertPluginDataInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertPrescriptionArgs = { input: InsertPrescriptionInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertPrescriptionLineArgs = { input: InsertPrescriptionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertProgramEnrolmentArgs = { input: InsertProgramEnrolmentInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertProgramPatientArgs = { input: InsertProgramPatientInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertProgramRequestRequisitionArgs = { input: InsertProgramRequestRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertProgramResponseRequisitionArgs = { input: InsertProgramResponseRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertRepackArgs = { input: InsertRepackInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertRequestRequisitionArgs = { input: InsertRequestRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertRequestRequisitionLineArgs = { input: InsertRequestRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertResponseRequisitionArgs = { input: InsertResponseRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertResponseRequisitionLineArgs = { input: InsertResponseRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertRnrFormArgs = { input: InsertRnRFormInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertStockLineArgs = { input: InsertStockLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertStocktakeArgs = { input: InsertStocktakeInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertStocktakeLineArgs = { input: InsertStocktakeLineInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertSupplierReturnArgs = { input: SupplierReturnInput; storeId: Scalars['String']['input']; }; + export type MutationsInsertVaccinationArgs = { input: InsertVaccinationInput; storeId: Scalars['String']['input']; }; + export type MutationsLinkPatientToStoreArgs = { nameId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type MutationsSupplyRequestedQuantityArgs = { input: SupplyRequestedQuantityInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateAssetArgs = { input: UpdateAssetInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateContactTraceArgs = { input: UpdateContactTraceInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateCustomerReturnArgs = { input: UpdateCustomerReturnInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateCustomerReturnLinesArgs = { input: UpdateCustomerReturnLinesInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateDisplaySettingsArgs = { input: DisplaySettingsInput; }; + export type MutationsUpdateEncounterArgs = { input: UpdateEncounterInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateInboundShipmentArgs = { input: UpdateInboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateInboundShipmentLineArgs = { input: UpdateInboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateInboundShipmentServiceLineArgs = { input: UpdateInboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateLabelPrinterSettingsArgs = { input: LabelPrinterSettingsInput; }; + export type MutationsUpdateLocationArgs = { input: UpdateLocationInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateLogLevelArgs = { input: UpsertLogLevelInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateNamePropertiesArgs = { input: UpdateNamePropertiesInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateOutboundShipmentArgs = { input: UpdateOutboundShipmentInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateOutboundShipmentLineArgs = { input: UpdateOutboundShipmentLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateOutboundShipmentNameArgs = { input: UpdateOutboundShipmentNameInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateOutboundShipmentServiceLineArgs = { input: UpdateOutboundShipmentServiceLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateOutboundShipmentUnallocatedLineArgs = { input: UpdateOutboundShipmentUnallocatedLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdatePatientArgs = { input: UpdatePatientInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdatePluginDataArgs = { input: UpdatePluginDataInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdatePrescriptionArgs = { input: UpdatePrescriptionInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdatePrescriptionLineArgs = { input: UpdatePrescriptionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateProgramEnrolmentArgs = { input: UpdateProgramEnrolmentInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateProgramPatientArgs = { input: UpdateProgramPatientInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateRequestRequisitionArgs = { input: UpdateRequestRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateRequestRequisitionLineArgs = { input: UpdateRequestRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateResponseRequisitionArgs = { input: UpdateResponseRequisitionInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateResponseRequisitionLineArgs = { input: UpdateResponseRequisitionLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateRnrFormArgs = { input: UpdateRnRFormInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateSensorArgs = { input: UpdateSensorInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateStockLineArgs = { input: UpdateStockLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateStocktakeArgs = { input: UpdateStocktakeInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateStocktakeLineArgs = { input: UpdateStocktakeLineInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateSupplierReturnArgs = { input: UpdateSupplierReturnInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateSupplierReturnLinesArgs = { input: UpdateSupplierReturnLinesInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateSupplierReturnOtherPartyArgs = { input: UpdateSupplierReturnOtherPartyInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateSyncSettingsArgs = { input: SyncSettingsInput; }; + export type MutationsUpdateTemperatureBreachArgs = { input: UpdateTemperatureBreachInput; storeId: Scalars['String']['input']; }; + export type MutationsUpdateVaccinationArgs = { input: UpdateVaccinationInput; storeId: Scalars['String']['input']; }; + export type MutationsUseSuggestedQuantityArgs = { input: UseSuggestedQuantityInput; storeId: Scalars['String']['input']; @@ -4914,7 +4718,7 @@ export enum NameNodeType { Facility = 'FACILITY', Invad = 'INVAD', Repack = 'REPACK', - Store = 'STORE', + Store = 'STORE' } export type NamePropertyConnector = { @@ -4934,7 +4738,7 @@ export type NamePropertyResponse = NamePropertyConnector; export enum NameSortFieldInput { Code = 'code', - Name = 'name', + Name = 'name' } export type NameSortInput = { @@ -4956,14 +4760,10 @@ export type NameStoreJoinNode = { export type NamesResponse = NameConnector; -export type NoPermissionForThisStore = InsertAssetErrorInterface & - InsertDemographicIndicatorErrorInterface & - InsertDemographicProjectionErrorInterface & - UpdateDemographicIndicatorErrorInterface & - UpdateDemographicProjectionErrorInterface & { - __typename: 'NoPermissionForThisStore'; - description: Scalars['String']['output']; - }; +export type NoPermissionForThisStore = InsertAssetErrorInterface & InsertDemographicIndicatorErrorInterface & InsertDemographicProjectionErrorInterface & UpdateDemographicIndicatorErrorInterface & UpdateDemographicProjectionErrorInterface & { + __typename: 'NoPermissionForThisStore'; + description: Scalars['String']['output']; +}; export type NoRefreshTokenProvided = RefreshTokenErrorInterface & { __typename: 'NoRefreshTokenProvided'; @@ -4995,33 +4795,27 @@ export type NotAnInboundShipment = UpdateInboundShipmentLineErrorInterface & { description: Scalars['String']['output']; }; -export type NotAnOutboundShipmentError = UpdateErrorInterface & - UpdateNameErrorInterface & { - __typename: 'NotAnOutboundShipmentError'; - description: Scalars['String']['output']; - }; +export type NotAnOutboundShipmentError = UpdateErrorInterface & UpdateNameErrorInterface & { + __typename: 'NotAnOutboundShipmentError'; + description: Scalars['String']['output']; +}; -export type NotEnoughStockForReduction = - InsertOutboundShipmentLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'NotEnoughStockForReduction'; - batch: StockLineResponse; - description: Scalars['String']['output']; - line?: Maybe; - }; +export type NotEnoughStockForReduction = InsertOutboundShipmentLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'NotEnoughStockForReduction'; + batch: StockLineResponse; + description: Scalars['String']['output']; + line?: Maybe; +}; export type NotMostRecentGivenDose = UpdateVaccinationErrorInterface & { __typename: 'NotMostRecentGivenDose'; description: Scalars['String']['output']; }; -export type NothingRemainingToSupply = - CreateRequisitionShipmentErrorInterface & { - __typename: 'NothingRemainingToSupply'; - description: Scalars['String']['output']; - }; +export type NothingRemainingToSupply = CreateRequisitionShipmentErrorInterface & { + __typename: 'NothingRemainingToSupply'; + description: Scalars['String']['output']; +}; /** * Update a nullable value @@ -5058,39 +4852,20 @@ export type NumberNode = { number: Scalars['Int']['output']; }; -export type OtherPartyNotACustomer = InsertCustomerReturnErrorInterface & - InsertErrorInterface & - InsertResponseRequisitionErrorInterface & - UpdateCustomerReturnErrorInterface & - UpdateNameErrorInterface & { - __typename: 'OtherPartyNotACustomer'; - description: Scalars['String']['output']; - }; - -export type OtherPartyNotASupplier = InsertInboundShipmentErrorInterface & - InsertRequestRequisitionErrorInterface & - InsertSupplierReturnErrorInterface & - UpdateInboundShipmentErrorInterface & - UpdateRequestRequisitionErrorInterface & - UpdateReturnOtherPartyErrorInterface & { - __typename: 'OtherPartyNotASupplier'; - description: Scalars['String']['output']; - }; - -export type OtherPartyNotVisible = InsertCustomerReturnErrorInterface & - InsertErrorInterface & - InsertInboundShipmentErrorInterface & - InsertRequestRequisitionErrorInterface & - InsertResponseRequisitionErrorInterface & - InsertSupplierReturnErrorInterface & - UpdateCustomerReturnErrorInterface & - UpdateInboundShipmentErrorInterface & - UpdateNameErrorInterface & - UpdateRequestRequisitionErrorInterface & - UpdateReturnOtherPartyErrorInterface & { - __typename: 'OtherPartyNotVisible'; - description: Scalars['String']['output']; - }; +export type OtherPartyNotACustomer = InsertCustomerReturnErrorInterface & InsertErrorInterface & InsertResponseRequisitionErrorInterface & UpdateCustomerReturnErrorInterface & UpdateNameErrorInterface & { + __typename: 'OtherPartyNotACustomer'; + description: Scalars['String']['output']; +}; + +export type OtherPartyNotASupplier = InsertInboundShipmentErrorInterface & InsertRequestRequisitionErrorInterface & InsertSupplierReturnErrorInterface & UpdateInboundShipmentErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateReturnOtherPartyErrorInterface & { + __typename: 'OtherPartyNotASupplier'; + description: Scalars['String']['output']; +}; + +export type OtherPartyNotVisible = InsertCustomerReturnErrorInterface & InsertErrorInterface & InsertInboundShipmentErrorInterface & InsertRequestRequisitionErrorInterface & InsertResponseRequisitionErrorInterface & InsertSupplierReturnErrorInterface & UpdateCustomerReturnErrorInterface & UpdateInboundShipmentErrorInterface & UpdateNameErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateReturnOtherPartyErrorInterface & { + __typename: 'OtherPartyNotVisible'; + description: Scalars['String']['output']; +}; export type OutboundInvoiceCounts = { __typename: 'OutboundInvoiceCounts'; @@ -5106,16 +4881,19 @@ export type PackVariantMutations = { updatePackVariant: UpdatePackVariantResponse; }; + export type PackVariantMutationsDeletePackVariantArgs = { input: DeletePackVariantInput; storeId: Scalars['String']['input']; }; + export type PackVariantMutationsInsertPackVariantArgs = { input: InsertPackVariantInput; storeId: Scalars['String']['input']; }; + export type PackVariantMutationsUpdatePackVariantArgs = { input: UpdatePackVariantInput; storeId: Scalars['String']['input']; @@ -5204,12 +4982,14 @@ export type PatientNode = { website?: Maybe; }; + export type PatientNodeContactTracesArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe; }; + export type PatientNodeProgramEnrolmentsArgs = { filter?: InputMaybe; }; @@ -5256,7 +5036,7 @@ export enum PatientSortFieldInput { Gender = 'gender', LastName = 'lastName', Name = 'name', - Phone = 'phone', + Phone = 'phone' } export type PatientSortInput = { @@ -5315,7 +5095,7 @@ export enum PluginDataSortFieldInput { Id = 'id', PluginName = 'pluginName', RelatedRecordId = 'relatedRecordId', - RelatedRecordType = 'relatedRecordType', + RelatedRecordType = 'relatedRecordType' } export type PluginDataSortInput = { @@ -5350,7 +5130,7 @@ export type PricingNode = { export enum PrintFormat { Excel = 'EXCEL', Html = 'HTML', - Pdf = 'PDF', + Pdf = 'PDF' } export type PrintReportError = { @@ -5431,6 +5211,7 @@ export type ProgramEnrolmentNode = { type: Scalars['String']['output']; }; + export type ProgramEnrolmentNodeActiveProgramEventsArgs = { at?: InputMaybe; filter?: InputMaybe; @@ -5438,6 +5219,7 @@ export type ProgramEnrolmentNodeActiveProgramEventsArgs = { sort?: InputMaybe; }; + export type ProgramEnrolmentNodeEncountersArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5451,7 +5233,7 @@ export enum ProgramEnrolmentSortFieldInput { PatientId = 'patientId', ProgramEnrolmentId = 'programEnrolmentId', Status = 'status', - Type = 'type', + Type = 'type' } export type ProgramEnrolmentSortInput = { @@ -5504,7 +5286,7 @@ export enum ProgramEventSortFieldInput { Datetime = 'datetime', DocumentName = 'documentName', DocumentType = 'documentType', - Type = 'type', + Type = 'type' } export type ProgramEventSortInput = { @@ -5541,7 +5323,7 @@ export type ProgramRequisitionOrderTypeNode = { }; export enum ProgramSortFieldInput { - Name = 'name', + Name = 'name' } export type ProgramSortInput = { @@ -5569,7 +5351,7 @@ export enum PropertyNodeValueType { Boolean = 'BOOLEAN', Float = 'FLOAT', Integer = 'INTEGER', - String = 'STRING', + String = 'STRING' } export type Queries = { @@ -5735,6 +5517,7 @@ export type Queries = { vaccineCourses: VaccineCoursesResponse; }; + export type QueriesActiveProgramEventsArgs = { at?: InputMaybe; filter?: InputMaybe; @@ -5743,42 +5526,50 @@ export type QueriesActiveProgramEventsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesActivityLogsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesAssetCatalogueItemArgs = { id: Scalars['String']['input']; }; + export type QueriesAssetCatalogueItemsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesAssetCategoriesArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesAssetCategoryArgs = { id: Scalars['String']['input']; }; + export type QueriesAssetClassArgs = { id: Scalars['String']['input']; }; + export type QueriesAssetClassesArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesAssetLogReasonsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5786,6 +5577,7 @@ export type QueriesAssetLogReasonsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesAssetLogsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5793,20 +5585,24 @@ export type QueriesAssetLogsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesAssetPropertiesArgs = { filter?: InputMaybe; }; + export type QueriesAssetTypeArgs = { id: Scalars['String']['input']; }; + export type QueriesAssetTypesArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesAssetsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5814,21 +5610,25 @@ export type QueriesAssetsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesAuthTokenArgs = { password: Scalars['String']['input']; username: Scalars['String']['input']; }; + export type QueriesBarcodeByGtinArgs = { gtin: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesCentralPatientSearchArgs = { input: CentralPatientSearchInput; storeId: Scalars['String']['input']; }; + export type QueriesCliniciansArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5836,6 +5636,7 @@ export type QueriesCliniciansArgs = { storeId: Scalars['String']['input']; }; + export type QueriesContactTracesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5843,15 +5644,18 @@ export type QueriesContactTracesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesCurrenciesArgs = { filter?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesCustomerProgramRequisitionSettingsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesDemographicIndicatorsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5859,16 +5663,19 @@ export type QueriesDemographicIndicatorsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesDemographicProjectionByBaseYearArgs = { baseYear: Scalars['Int']['input']; }; + export type QueriesDemographicProjectionsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesDemographicsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5876,26 +5683,31 @@ export type QueriesDemographicsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesDisplaySettingsArgs = { input: DisplaySettingsHash; }; + export type QueriesDocumentArgs = { name: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesDocumentHistoryArgs = { name: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesDocumentRegistriesArgs = { filter?: InputMaybe; sort?: InputMaybe>; storeId: Scalars['String']['input']; }; + export type QueriesDocumentsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5903,6 +5715,7 @@ export type QueriesDocumentsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesEncounterFieldsArgs = { filter?: InputMaybe; input: EncounterFieldsInput; @@ -5911,6 +5724,7 @@ export type QueriesEncounterFieldsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesEncountersArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -5918,17 +5732,20 @@ export type QueriesEncountersArgs = { storeId: Scalars['String']['input']; }; + export type QueriesFormSchemasArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesGenerateCustomerReturnLinesArgs = { input: GenerateCustomerReturnLinesInput; storeId: Scalars['String']['input']; }; + export type QueriesGenerateReportArgs = { arguments?: InputMaybe; currentLanguage?: InputMaybe; @@ -5939,6 +5756,7 @@ export type QueriesGenerateReportArgs = { storeId: Scalars['String']['input']; }; + export type QueriesGenerateReportDefinitionArgs = { arguments?: InputMaybe; currentLanguage?: InputMaybe; @@ -5949,44 +5767,52 @@ export type QueriesGenerateReportDefinitionArgs = { storeId: Scalars['String']['input']; }; + export type QueriesGenerateSupplierReturnLinesArgs = { input: GenerateSupplierReturnLinesInput; storeId: Scalars['String']['input']; }; + export type QueriesHistoricalStockLinesArgs = { datetime?: InputMaybe; itemId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesInsertPrescriptionArgs = { input: InsertPrescriptionInput; storeId: Scalars['String']['input']; }; + export type QueriesInventoryAdjustmentReasonsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesInvoiceArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesInvoiceByNumberArgs = { invoiceNumber: Scalars['Int']['input']; storeId: Scalars['String']['input']; type: InvoiceNodeType; }; + export type QueriesInvoiceCountsArgs = { storeId: Scalars['String']['input']; timezoneOffset?: InputMaybe; }; + export type QueriesInvoiceLinesArgs = { filter?: InputMaybe; invoiceId: Scalars['String']['input']; @@ -5996,6 +5822,7 @@ export type QueriesInvoiceLinesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesInvoicesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6003,16 +5830,19 @@ export type QueriesInvoicesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesItemCountsArgs = { lowStockThreshold?: InputMaybe; storeId: Scalars['String']['input']; }; + export type QueriesItemPriceArgs = { input: ItemPriceInput; storeId: Scalars['String']['input']; }; + export type QueriesItemsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6020,12 +5850,14 @@ export type QueriesItemsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesLedgerArgs = { filter?: InputMaybe; sort?: InputMaybe>; storeId: Scalars['String']['input']; }; + export type QueriesLocationsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6033,10 +5865,12 @@ export type QueriesLocationsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesLogContentsArgs = { fileName?: InputMaybe; }; + export type QueriesMasterListLinesArgs = { filter?: InputMaybe; masterListId: Scalars['String']['input']; @@ -6045,6 +5879,7 @@ export type QueriesMasterListLinesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesMasterListsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6052,6 +5887,7 @@ export type QueriesMasterListsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesNamesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6059,20 +5895,24 @@ export type QueriesNamesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesPackVariantsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesPatientArgs = { patientId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesPatientSearchArgs = { input: PatientSearchInput; storeId: Scalars['String']['input']; }; + export type QueriesPatientsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6080,6 +5920,7 @@ export type QueriesPatientsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesPluginDataArgs = { filter?: InputMaybe; sort?: InputMaybe>; @@ -6087,12 +5928,14 @@ export type QueriesPluginDataArgs = { type: RelatedRecordNodeType; }; + export type QueriesProgramEnrolmentsArgs = { filter?: InputMaybe; sort?: InputMaybe; storeId: Scalars['String']['input']; }; + export type QueriesProgramEventsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6100,6 +5943,7 @@ export type QueriesProgramEventsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesProgramsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6107,11 +5951,13 @@ export type QueriesProgramsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesRAndRFormArgs = { rnrFormId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesRAndRFormsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6119,27 +5965,32 @@ export type QueriesRAndRFormsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesReasonOptionsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesRepackArgs = { invoiceId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesRepacksByStockLineArgs = { stockLineId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesReportArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesReportsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6147,21 +5998,25 @@ export type QueriesReportsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesRequisitionArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesRequisitionByNumberArgs = { requisitionNumber: Scalars['Int']['input']; storeId: Scalars['String']['input']; type: RequisitionNodeType; }; + export type QueriesRequisitionCountsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesRequisitionLineChartArgs = { consumptionOptionsInput?: InputMaybe; requestRequisitionLineId: Scalars['String']['input']; @@ -6169,6 +6024,7 @@ export type QueriesRequisitionLineChartArgs = { storeId: Scalars['String']['input']; }; + export type QueriesRequisitionsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6176,22 +6032,26 @@ export type QueriesRequisitionsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesResponseRequisitionStatsArgs = { requisitionLineId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesReturnReasonsArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesSchedulesWithPeriodsByProgramArgs = { programId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesSensorsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6199,12 +6059,14 @@ export type QueriesSensorsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesStockCountsArgs = { daysTillExpired?: InputMaybe; storeId: Scalars['String']['input']; timezoneOffset?: InputMaybe; }; + export type QueriesStockLinesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6212,16 +6074,19 @@ export type QueriesStockLinesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesStocktakeArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesStocktakeByNumberArgs = { stocktakeNumber: Scalars['Int']['input']; storeId: Scalars['String']['input']; }; + export type QueriesStocktakeLinesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6231,6 +6096,7 @@ export type QueriesStocktakeLinesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesStocktakesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6238,24 +6104,29 @@ export type QueriesStocktakesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesStoreArgs = { id: Scalars['String']['input']; }; + export type QueriesStorePreferencesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesStoresArgs = { filter?: InputMaybe; page?: InputMaybe; sort?: InputMaybe>; }; + export type QueriesSupplierProgramRequisitionSettingsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesTemperatureBreachesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6263,6 +6134,7 @@ export type QueriesTemperatureBreachesArgs = { storeId: Scalars['String']['input']; }; + export type QueriesTemperatureLogsArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6270,29 +6142,35 @@ export type QueriesTemperatureLogsArgs = { storeId: Scalars['String']['input']; }; + export type QueriesTemperatureNotificationsArgs = { page?: InputMaybe; storeId: Scalars['String']['input']; }; + export type QueriesVaccinationArgs = { id: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesVaccinationCardArgs = { programEnrolmentId: Scalars['String']['input']; storeId: Scalars['String']['input']; }; + export type QueriesVaccineCourseArgs = { id: Scalars['String']['input']; }; + export type QueriesVaccineCourseDoseArgs = { id: Scalars['String']['input']; }; + export type QueriesVaccineCoursesArgs = { filter?: InputMaybe; page?: InputMaybe; @@ -6323,14 +6201,14 @@ export enum ReasonOptionNodeType { NegativeInventoryAdjustment = 'NEGATIVE_INVENTORY_ADJUSTMENT', PositiveInventoryAdjustment = 'POSITIVE_INVENTORY_ADJUSTMENT', RequisitionLineVariance = 'REQUISITION_LINE_VARIANCE', - ReturnReason = 'RETURN_REASON', + ReturnReason = 'RETURN_REASON' } export type ReasonOptionResponse = ReasonOptionConnector; export enum ReasonOptionSortFieldInput { Reason = 'reason', - ReasonOptionType = 'reasonOptionType', + ReasonOptionType = 'reasonOptionType' } export type ReasonOptionSortInput = { @@ -6343,89 +6221,25 @@ export type ReasonOptionSortInput = { key: ReasonOptionSortFieldInput; }; -export type RecordAlreadyExist = InsertAssetCatalogueItemErrorInterface & - InsertAssetErrorInterface & - InsertAssetLogErrorInterface & - InsertAssetLogReasonErrorInterface & - InsertDemographicIndicatorErrorInterface & - InsertDemographicProjectionErrorInterface & - InsertLocationErrorInterface & - InsertVaccineCourseErrorInterface & - UpdateDemographicIndicatorErrorInterface & - UpdateDemographicProjectionErrorInterface & { - __typename: 'RecordAlreadyExist'; - description: Scalars['String']['output']; - }; - -export type RecordBelongsToAnotherStore = DeleteAssetErrorInterface & - DeleteAssetLogReasonErrorInterface & - DeleteLocationErrorInterface & - UpdateAssetErrorInterface & - UpdateLocationErrorInterface & - UpdateSensorErrorInterface & { - __typename: 'RecordBelongsToAnotherStore'; - description: Scalars['String']['output']; - }; - -export type RecordNotFound = AddFromMasterListErrorInterface & - AddToInboundShipmentFromMasterListErrorInterface & - AddToOutboundShipmentFromMasterListErrorInterface & - AllocateOutboundShipmentUnallocatedLineErrorInterface & - CreateRequisitionShipmentErrorInterface & - DeleteAssetCatalogueItemErrorInterface & - DeleteAssetErrorInterface & - DeleteAssetLogReasonErrorInterface & - DeleteCustomerReturnErrorInterface & - DeleteErrorInterface & - DeleteInboundShipmentErrorInterface & - DeleteInboundShipmentLineErrorInterface & - DeleteInboundShipmentServiceLineErrorInterface & - DeleteLocationErrorInterface & - DeleteOutboundShipmentLineErrorInterface & - DeleteOutboundShipmentServiceLineErrorInterface & - DeleteOutboundShipmentUnallocatedLineErrorInterface & - DeletePrescriptionErrorInterface & - DeletePrescriptionLineErrorInterface & - DeleteRequestRequisitionErrorInterface & - DeleteRequestRequisitionLineErrorInterface & - DeleteResponseRequisitionLineErrorInterface & - DeleteSupplierReturnErrorInterface & - DeleteVaccineCourseErrorInterface & - NodeErrorInterface & - RequisitionLineChartErrorInterface & - RequisitionLineStatsErrorInterface & - SupplyRequestedQuantityErrorInterface & - UpdateAssetErrorInterface & - UpdateErrorInterface & - UpdateInboundShipmentErrorInterface & - UpdateInboundShipmentLineErrorInterface & - UpdateInboundShipmentServiceLineErrorInterface & - UpdateLocationErrorInterface & - UpdateNameErrorInterface & - UpdateNamePropertiesErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdateOutboundShipmentServiceLineErrorInterface & - UpdateOutboundShipmentUnallocatedLineErrorInterface & - UpdatePrescriptionErrorInterface & - UpdatePrescriptionLineErrorInterface & - UpdateRequestRequisitionErrorInterface & - UpdateRequestRequisitionLineErrorInterface & - UpdateResponseRequisitionErrorInterface & - UpdateResponseRequisitionLineErrorInterface & - UpdateReturnOtherPartyErrorInterface & - UpdateSensorErrorInterface & - UpdateStockLineErrorInterface & - UseSuggestedQuantityErrorInterface & { - __typename: 'RecordNotFound'; - description: Scalars['String']['output']; - }; - -export type RecordProgramCombinationAlreadyExists = - InsertVaccineCourseErrorInterface & - UpdateVaccineCourseErrorInterface & { - __typename: 'RecordProgramCombinationAlreadyExists'; - description: Scalars['String']['output']; - }; +export type RecordAlreadyExist = InsertAssetCatalogueItemErrorInterface & InsertAssetErrorInterface & InsertAssetLogErrorInterface & InsertAssetLogReasonErrorInterface & InsertDemographicIndicatorErrorInterface & InsertDemographicProjectionErrorInterface & InsertLocationErrorInterface & InsertVaccineCourseErrorInterface & UpdateDemographicIndicatorErrorInterface & UpdateDemographicProjectionErrorInterface & { + __typename: 'RecordAlreadyExist'; + description: Scalars['String']['output']; +}; + +export type RecordBelongsToAnotherStore = DeleteAssetErrorInterface & DeleteAssetLogReasonErrorInterface & DeleteLocationErrorInterface & UpdateAssetErrorInterface & UpdateLocationErrorInterface & UpdateSensorErrorInterface & { + __typename: 'RecordBelongsToAnotherStore'; + description: Scalars['String']['output']; +}; + +export type RecordNotFound = AddFromMasterListErrorInterface & AddToInboundShipmentFromMasterListErrorInterface & AddToOutboundShipmentFromMasterListErrorInterface & AllocateOutboundShipmentUnallocatedLineErrorInterface & CreateRequisitionShipmentErrorInterface & DeleteAssetCatalogueItemErrorInterface & DeleteAssetErrorInterface & DeleteAssetLogReasonErrorInterface & DeleteCustomerReturnErrorInterface & DeleteErrorInterface & DeleteInboundShipmentErrorInterface & DeleteInboundShipmentLineErrorInterface & DeleteInboundShipmentServiceLineErrorInterface & DeleteLocationErrorInterface & DeleteOutboundShipmentLineErrorInterface & DeleteOutboundShipmentServiceLineErrorInterface & DeleteOutboundShipmentUnallocatedLineErrorInterface & DeletePrescriptionErrorInterface & DeletePrescriptionLineErrorInterface & DeleteRequestRequisitionErrorInterface & DeleteRequestRequisitionLineErrorInterface & DeleteResponseRequisitionLineErrorInterface & DeleteSupplierReturnErrorInterface & DeleteVaccineCourseErrorInterface & NodeErrorInterface & RequisitionLineChartErrorInterface & RequisitionLineStatsErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateAssetErrorInterface & UpdateErrorInterface & UpdateInboundShipmentErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateLocationErrorInterface & UpdateNameErrorInterface & UpdateNamePropertiesErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UpdateReturnOtherPartyErrorInterface & UpdateSensorErrorInterface & UpdateStockLineErrorInterface & UseSuggestedQuantityErrorInterface & { + __typename: 'RecordNotFound'; + description: Scalars['String']['output']; +}; + +export type RecordProgramCombinationAlreadyExists = InsertVaccineCourseErrorInterface & UpdateVaccineCourseErrorInterface & { + __typename: 'RecordProgramCombinationAlreadyExists'; + description: Scalars['String']['output']; +}; export type RefreshToken = { __typename: 'RefreshToken'; @@ -6445,7 +6259,7 @@ export type RefreshTokenErrorInterface = { export type RefreshTokenResponse = RefreshToken | RefreshTokenError; export enum RelatedRecordNodeType { - StockLine = 'STOCK_LINE', + StockLine = 'STOCK_LINE' } export type RepackConnector = { @@ -6493,7 +6307,7 @@ export enum ReportContext { Report = 'REPORT', Requisition = 'REQUISITION', Resource = 'RESOURCE', - Stocktake = 'STOCKTAKE', + Stocktake = 'STOCKTAKE' } export type ReportFilterInput = { @@ -6518,7 +6332,7 @@ export type ReportResponse = ReportNode; export enum ReportSortFieldInput { Id = 'id', - Name = 'name', + Name = 'name' } export type ReportSortInput = { @@ -6586,9 +6400,7 @@ export type RequisitionLineChartErrorInterface = { description: Scalars['String']['output']; }; -export type RequisitionLineChartResponse = - | ItemChartNode - | RequisitionLineChartError; +export type RequisitionLineChartResponse = ItemChartNode | RequisitionLineChartError; export type RequisitionLineConnector = { __typename: 'RequisitionLineConnector'; @@ -6642,6 +6454,7 @@ export type RequisitionLineNode = { supplyQuantity: Scalars['Float']['output']; }; + export type RequisitionLineNodeItemStatsArgs = { amcLookbackMonths?: InputMaybe; }; @@ -6655,16 +6468,12 @@ export type RequisitionLineStatsErrorInterface = { description: Scalars['String']['output']; }; -export type RequisitionLineStatsResponse = - | RequisitionLineStatsError - | ResponseRequisitionStatsNode; +export type RequisitionLineStatsResponse = RequisitionLineStatsError | ResponseRequisitionStatsNode; -export type RequisitionLineWithItemIdExists = - InsertRequestRequisitionLineErrorInterface & - InsertResponseRequisitionLineErrorInterface & { - __typename: 'RequisitionLineWithItemIdExists'; - description: Scalars['String']['output']; - }; +export type RequisitionLineWithItemIdExists = InsertRequestRequisitionLineErrorInterface & InsertResponseRequisitionLineErrorInterface & { + __typename: 'RequisitionLineWithItemIdExists'; + description: Scalars['String']['output']; +}; export type RequisitionNode = { __typename: 'RequisitionNode'; @@ -6716,6 +6525,7 @@ export type RequisitionNode = { user?: Maybe; }; + export type RequisitionNodeOtherPartyArgs = { storeId: Scalars['String']['input']; }; @@ -6728,7 +6538,7 @@ export enum RequisitionNodeApprovalStatus { Denied = 'DENIED', None = 'NONE', /** Pending authorisation, requisition should not be editable */ - Pending = 'PENDING', + Pending = 'PENDING' } export enum RequisitionNodeStatus { @@ -6742,14 +6552,14 @@ export enum RequisitionNodeStatus { /** New requisition when automatically created, only applicable to response requisition when it's duplicated in supplying store from request requisition */ New = 'NEW', /** Request requisition is sent and locked for future editing, only applicable to request requisition */ - Sent = 'SENT', + Sent = 'SENT' } export enum RequisitionNodeType { /** Requisition created by store that is ordering stock */ Request = 'REQUEST', /** Supplying store requisition in response to request requisition */ - Response = 'RESPONSE', + Response = 'RESPONSE' } export type RequisitionResponse = RecordNotFound | RequisitionNode; @@ -6767,7 +6577,7 @@ export enum RequisitionSortFieldInput { SentDatetime = 'sentDatetime', Status = 'status', TheirReference = 'theirReference', - Type = 'type', + Type = 'type' } export type RequisitionSortInput = { @@ -6824,7 +6634,7 @@ export type ReturnReasonResponse = ReturnReasonConnector; export enum ReturnReasonSortFieldInput { Id = 'id', - Reason = 'reason', + Reason = 'reason' } export type ReturnReasonSortInput = { @@ -6897,7 +6707,7 @@ export type RnRFormNode = { export enum RnRFormNodeStatus { Draft = 'DRAFT', - Finalised = 'FINALISED', + Finalised = 'FINALISED' } export type RnRFormResponse = NodeError | RnRFormNode; @@ -6907,7 +6717,7 @@ export enum RnRFormSortFieldInput { Period = 'period', Program = 'program', Status = 'status', - SupplierName = 'supplierName', + SupplierName = 'supplierName' } export type RnRFormSortInput = { @@ -6961,12 +6771,12 @@ export type SensorNode = { export enum SensorNodeType { Berlinger = 'BERLINGER', BlueMaestro = 'BLUE_MAESTRO', - Laird = 'LAIRD', + Laird = 'LAIRD' } export enum SensorSortFieldInput { Name = 'name', - Serial = 'serial', + Serial = 'serial' } export type SensorSortInput = { @@ -6981,19 +6791,17 @@ export type SensorSortInput = { export type SensorsResponse = SensorConnector; -export type SnapshotCountCurrentCountMismatch = - UpdateStocktakeErrorInterface & { - __typename: 'SnapshotCountCurrentCountMismatch'; - description: Scalars['String']['output']; - lines: Array; - }; +export type SnapshotCountCurrentCountMismatch = UpdateStocktakeErrorInterface & { + __typename: 'SnapshotCountCurrentCountMismatch'; + description: Scalars['String']['output']; + lines: Array; +}; -export type SnapshotCountCurrentCountMismatchLine = - UpdateStocktakeLineErrorInterface & { - __typename: 'SnapshotCountCurrentCountMismatchLine'; - description: Scalars['String']['output']; - stocktakeLine: StocktakeLineNode; - }; +export type SnapshotCountCurrentCountMismatchLine = UpdateStocktakeLineErrorInterface & { + __typename: 'SnapshotCountCurrentCountMismatchLine'; + description: Scalars['String']['output']; + stocktakeLine: StocktakeLineNode; +}; export enum StatusType { Decommissioned = 'DECOMMISSIONED', @@ -7001,7 +6809,7 @@ export enum StatusType { FunctioningButNeedsAttention = 'FUNCTIONING_BUT_NEEDS_ATTENTION', NotFunctioning = 'NOT_FUNCTIONING', NotInUse = 'NOT_IN_USE', - Unserviceable = 'UNSERVICEABLE', + Unserviceable = 'UNSERVICEABLE' } export type StockCounts = { @@ -7033,15 +6841,11 @@ export type StockEvolutionOptionsInput = { numberOfProjectedDataPoints?: InputMaybe; }; -export type StockLineAlreadyExistsInInvoice = - InsertOutboundShipmentLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'StockLineAlreadyExistsInInvoice'; - description: Scalars['String']['output']; - line: InvoiceLineNode; - }; +export type StockLineAlreadyExistsInInvoice = InsertOutboundShipmentLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'StockLineAlreadyExistsInInvoice'; + description: Scalars['String']['output']; + line: InvoiceLineNode; +}; export type StockLineConnector = { __typename: 'StockLineConnector'; @@ -7062,13 +6866,10 @@ export type StockLineFilterInput = { storeId?: InputMaybe; }; -export type StockLineIsOnHold = InsertOutboundShipmentLineErrorInterface & - InsertPrescriptionLineErrorInterface & - UpdateOutboundShipmentLineErrorInterface & - UpdatePrescriptionLineErrorInterface & { - __typename: 'StockLineIsOnHold'; - description: Scalars['String']['output']; - }; +export type StockLineIsOnHold = InsertOutboundShipmentLineErrorInterface & InsertPrescriptionLineErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdatePrescriptionLineErrorInterface & { + __typename: 'StockLineIsOnHold'; + description: Scalars['String']['output']; +}; export type StockLineNode = { __typename: 'StockLineNode'; @@ -7094,19 +6895,16 @@ export type StockLineNode = { totalNumberOfPacks: Scalars['Float']['output']; }; + export type StockLineNodeMasterListArgs = { storeId: Scalars['String']['input']; }; -export type StockLineReducedBelowZero = - InsertInventoryAdjustmentErrorInterface & - InsertRepackErrorInterface & - InsertStocktakeLineErrorInterface & - UpdateStocktakeLineErrorInterface & { - __typename: 'StockLineReducedBelowZero'; - description: Scalars['String']['output']; - stockLine: StockLineNode; - }; +export type StockLineReducedBelowZero = InsertInventoryAdjustmentErrorInterface & InsertRepackErrorInterface & InsertStocktakeLineErrorInterface & UpdateStocktakeLineErrorInterface & { + __typename: 'StockLineReducedBelowZero'; + description: Scalars['String']['output']; + stockLine: StockLineNode; +}; export type StockLineResponse = NodeError | StockLineNode; @@ -7118,7 +6916,7 @@ export enum StockLineSortFieldInput { LocationCode = 'locationCode', NumberOfPacks = 'numberOfPacks', PackSize = 'packSize', - SupplierName = 'supplierName', + SupplierName = 'supplierName' } export type StockLineSortInput = { @@ -7208,7 +7006,7 @@ export enum StocktakeLineSortFieldInput { /** Stocktake line item stock location code */ LocationCode = 'locationCode', /** Stocktake line pack size */ - PackSize = 'packSize', + PackSize = 'packSize' } export type StocktakeLineSortInput = { @@ -7243,7 +7041,7 @@ export type StocktakeNode = { export enum StocktakeNodeStatus { Finalised = 'FINALISED', - New = 'NEW', + New = 'NEW' } export type StocktakeResponse = NodeError | StocktakeNode; @@ -7255,7 +7053,7 @@ export enum StocktakeSortFieldInput { FinalisedDatetime = 'finalisedDatetime', Status = 'status', StocktakeDate = 'stocktakeDate', - StocktakeNumber = 'stocktakeNumber', + StocktakeNumber = 'stocktakeNumber' } export type StocktakeSortInput = { @@ -7288,7 +7086,7 @@ export type StoreFilterInput = { export enum StoreModeNodeType { Dispensary = 'DISPENSARY', - Store = 'STORE', + Store = 'STORE' } export type StoreNode = { @@ -7306,6 +7104,7 @@ export type StoreNode = { storeName: Scalars['String']['output']; }; + export type StoreNodeNameArgs = { storeId: Scalars['String']['input']; }; @@ -7332,7 +7131,7 @@ export type StoreResponse = NodeError | StoreNode; export enum StoreSortFieldInput { Code = 'code', Name = 'name', - NameCode = 'nameCode', + NameCode = 'nameCode' } export type StoreSortInput = { @@ -7433,9 +7232,7 @@ export type SupplyRequestedQuantityInput = { responseRequisitionId: Scalars['String']['input']; }; -export type SupplyRequestedQuantityResponse = - | RequisitionLineConnector - | SupplyRequestedQuantityError; +export type SupplyRequestedQuantityResponse = RequisitionLineConnector | SupplyRequestedQuantityError; export type SyncErrorNode = { __typename: 'SyncErrorNode'; @@ -7457,7 +7254,7 @@ export enum SyncErrorVariant { SiteNameNotFound = 'SITE_NAME_NOT_FOUND', SiteUuidIsBeingChanged = 'SITE_UUID_IS_BEING_CHANGED', Unknown = 'UNKNOWN', - V6ApiVersionIncompatible = 'V6_API_VERSION_INCOMPATIBLE', + V6ApiVersionIncompatible = 'V6_API_VERSION_INCOMPATIBLE' } export type SyncFileReferenceConnector = { @@ -7550,12 +7347,12 @@ export enum TemperatureBreachNodeType { ColdConsecutive = 'COLD_CONSECUTIVE', ColdCumulative = 'COLD_CUMULATIVE', HotConsecutive = 'HOT_CONSECUTIVE', - HotCumulative = 'HOT_CUMULATIVE', + HotCumulative = 'HOT_CUMULATIVE' } export enum TemperatureBreachSortFieldInput { EndDatetime = 'endDatetime', - StartDatetime = 'startDatetime', + StartDatetime = 'startDatetime' } export type TemperatureBreachSortInput = { @@ -7613,7 +7410,7 @@ export type TemperatureLogNode = { export enum TemperatureLogSortFieldInput { Datetime = 'datetime', - Temperature = 'temperature', + Temperature = 'temperature' } export type TemperatureLogSortInput = { @@ -7641,52 +7438,38 @@ export type TokenExpired = RefreshTokenErrorInterface & { description: Scalars['String']['output']; }; -export type UnallocatedLineForItemAlreadyExists = - InsertOutboundShipmentUnallocatedLineErrorInterface & { - __typename: 'UnallocatedLineForItemAlreadyExists'; - description: Scalars['String']['output']; - }; +export type UnallocatedLineForItemAlreadyExists = InsertOutboundShipmentUnallocatedLineErrorInterface & { + __typename: 'UnallocatedLineForItemAlreadyExists'; + description: Scalars['String']['output']; +}; -export type UnallocatedLinesOnlyEditableInNewInvoice = - InsertOutboundShipmentUnallocatedLineErrorInterface & { - __typename: 'UnallocatedLinesOnlyEditableInNewInvoice'; - description: Scalars['String']['output']; - }; +export type UnallocatedLinesOnlyEditableInNewInvoice = InsertOutboundShipmentUnallocatedLineErrorInterface & { + __typename: 'UnallocatedLinesOnlyEditableInNewInvoice'; + description: Scalars['String']['output']; +}; export enum UniqueCombinationKey { Manufacturer = 'manufacturer', - Model = 'model', + Model = 'model' } -export type UniqueCombinationViolation = - InsertAssetCatalogueItemErrorInterface & { - __typename: 'UniqueCombinationViolation'; - description: Scalars['String']['output']; - fields: Array; - }; +export type UniqueCombinationViolation = InsertAssetCatalogueItemErrorInterface & { + __typename: 'UniqueCombinationViolation'; + description: Scalars['String']['output']; + fields: Array; +}; export enum UniqueValueKey { Code = 'code', Name = 'name', - Serial = 'serial', + Serial = 'serial' } -export type UniqueValueViolation = InsertAssetCatalogueItemErrorInterface & - InsertAssetErrorInterface & - InsertAssetLogErrorInterface & - InsertAssetLogReasonErrorInterface & - InsertDemographicIndicatorErrorInterface & - InsertDemographicProjectionErrorInterface & - InsertLocationErrorInterface & - UpdateAssetErrorInterface & - UpdateDemographicIndicatorErrorInterface & - UpdateDemographicProjectionErrorInterface & - UpdateLocationErrorInterface & - UpdateSensorErrorInterface & { - __typename: 'UniqueValueViolation'; - description: Scalars['String']['output']; - field: UniqueValueKey; - }; +export type UniqueValueViolation = InsertAssetCatalogueItemErrorInterface & InsertAssetErrorInterface & InsertAssetLogErrorInterface & InsertAssetLogReasonErrorInterface & InsertDemographicIndicatorErrorInterface & InsertDemographicProjectionErrorInterface & InsertLocationErrorInterface & UpdateAssetErrorInterface & UpdateDemographicIndicatorErrorInterface & UpdateDemographicProjectionErrorInterface & UpdateLocationErrorInterface & UpdateSensorErrorInterface & { + __typename: 'UniqueValueViolation'; + description: Scalars['String']['output']; + field: UniqueValueKey; +}; export type UpdateAssetError = { __typename: 'UpdateAssetError'; @@ -7757,13 +7540,11 @@ export type UpdateCustomerReturnLinesInput = { export type UpdateCustomerReturnLinesResponse = InvoiceNode; -export type UpdateCustomerReturnResponse = - | InvoiceNode - | UpdateCustomerReturnError; +export type UpdateCustomerReturnResponse = InvoiceNode | UpdateCustomerReturnError; export enum UpdateCustomerReturnStatusInput { Delivered = 'DELIVERED', - Verified = 'VERIFIED', + Verified = 'VERIFIED' } export type UpdateDemographicIndicatorError = { @@ -7788,9 +7569,7 @@ export type UpdateDemographicIndicatorInput = { year5Projection?: InputMaybe; }; -export type UpdateDemographicIndicatorResponse = - | DemographicIndicatorNode - | UpdateDemographicIndicatorError; +export type UpdateDemographicIndicatorResponse = DemographicIndicatorNode | UpdateDemographicIndicatorError; export type UpdateDemographicProjectionError = { __typename: 'UpdateDemographicProjectionError'; @@ -7811,18 +7590,14 @@ export type UpdateDemographicProjectionInput = { year5?: InputMaybe; }; -export type UpdateDemographicProjectionResponse = - | DemographicProjectionNode - | UpdateDemographicProjectionError; +export type UpdateDemographicProjectionResponse = DemographicProjectionNode | UpdateDemographicProjectionError; export type UpdateDisplaySettingsError = { __typename: 'UpdateDisplaySettingsError'; error: Scalars['String']['output']; }; -export type UpdateDisplaySettingsResponse = - | UpdateDisplaySettingsError - | UpdateResult; +export type UpdateDisplaySettingsResponse = UpdateDisplaySettingsError | UpdateResult; export type UpdateEncounterInput = { /** Encounter document data */ @@ -7886,9 +7661,7 @@ export type UpdateInboundShipmentLineInput = { totalBeforeTax?: InputMaybe; }; -export type UpdateInboundShipmentLineResponse = - | InvoiceLineNode - | UpdateInboundShipmentLineError; +export type UpdateInboundShipmentLineResponse = InvoiceLineNode | UpdateInboundShipmentLineError; export type UpdateInboundShipmentLineResponseWithId = { __typename: 'UpdateInboundShipmentLineResponseWithId'; @@ -7896,9 +7669,7 @@ export type UpdateInboundShipmentLineResponseWithId = { response: UpdateInboundShipmentLineResponse; }; -export type UpdateInboundShipmentResponse = - | InvoiceNode - | UpdateInboundShipmentError; +export type UpdateInboundShipmentResponse = InvoiceNode | UpdateInboundShipmentError; export type UpdateInboundShipmentResponseWithId = { __typename: 'UpdateInboundShipmentResponseWithId'; @@ -7924,9 +7695,7 @@ export type UpdateInboundShipmentServiceLineInput = { totalBeforeTax?: InputMaybe; }; -export type UpdateInboundShipmentServiceLineResponse = - | InvoiceLineNode - | UpdateInboundShipmentServiceLineError; +export type UpdateInboundShipmentServiceLineResponse = InvoiceLineNode | UpdateInboundShipmentServiceLineError; export type UpdateInboundShipmentServiceLineResponseWithId = { __typename: 'UpdateInboundShipmentServiceLineResponseWithId'; @@ -7936,7 +7705,7 @@ export type UpdateInboundShipmentServiceLineResponseWithId = { export enum UpdateInboundShipmentStatusInput { Delivered = 'DELIVERED', - Verified = 'VERIFIED', + Verified = 'VERIFIED' } export type UpdateLabelPrinterSettingsError = { @@ -7944,9 +7713,7 @@ export type UpdateLabelPrinterSettingsError = { error: Scalars['String']['output']; }; -export type UpdateLabelPrinterSettingsResponse = - | LabelPrinterUpdateResult - | UpdateLabelPrinterSettingsError; +export type UpdateLabelPrinterSettingsResponse = LabelPrinterUpdateResult | UpdateLabelPrinterSettingsError; export type UpdateLocationError = { __typename: 'UpdateLocationError'; @@ -8026,9 +7793,7 @@ export type UpdateOutboundShipmentLineInput = { tax?: InputMaybe; }; -export type UpdateOutboundShipmentLineResponse = - | InvoiceLineNode - | UpdateOutboundShipmentLineError; +export type UpdateOutboundShipmentLineResponse = InvoiceLineNode | UpdateOutboundShipmentLineError; export type UpdateOutboundShipmentLineResponseWithId = { __typename: 'UpdateOutboundShipmentLineResponseWithId'; @@ -8046,14 +7811,9 @@ export type UpdateOutboundShipmentNameInput = { otherPartyId?: InputMaybe; }; -export type UpdateOutboundShipmentNameResponse = - | InvoiceNode - | UpdateOutboundShipmentNameError; +export type UpdateOutboundShipmentNameResponse = InvoiceNode | UpdateOutboundShipmentNameError; -export type UpdateOutboundShipmentResponse = - | InvoiceNode - | NodeError - | UpdateOutboundShipmentError; +export type UpdateOutboundShipmentResponse = InvoiceNode | NodeError | UpdateOutboundShipmentError; export type UpdateOutboundShipmentResponseWithId = { __typename: 'UpdateOutboundShipmentResponseWithId'; @@ -8079,9 +7839,7 @@ export type UpdateOutboundShipmentServiceLineInput = { totalBeforeTax?: InputMaybe; }; -export type UpdateOutboundShipmentServiceLineResponse = - | InvoiceLineNode - | UpdateOutboundShipmentServiceLineError; +export type UpdateOutboundShipmentServiceLineResponse = InvoiceLineNode | UpdateOutboundShipmentServiceLineError; export type UpdateOutboundShipmentServiceLineResponseWithId = { __typename: 'UpdateOutboundShipmentServiceLineResponseWithId'; @@ -8092,7 +7850,7 @@ export type UpdateOutboundShipmentServiceLineResponseWithId = { export enum UpdateOutboundShipmentStatusInput { Allocated = 'ALLOCATED', Picked = 'PICKED', - Shipped = 'SHIPPED', + Shipped = 'SHIPPED' } export type UpdateOutboundShipmentUnallocatedLineError = { @@ -8109,9 +7867,7 @@ export type UpdateOutboundShipmentUnallocatedLineInput = { quantity: Scalars['Float']['input']; }; -export type UpdateOutboundShipmentUnallocatedLineResponse = - | InvoiceLineNode - | UpdateOutboundShipmentUnallocatedLineError; +export type UpdateOutboundShipmentUnallocatedLineResponse = InvoiceLineNode | UpdateOutboundShipmentUnallocatedLineError; export type UpdateOutboundShipmentUnallocatedLineResponseWithId = { __typename: 'UpdateOutboundShipmentUnallocatedLineResponseWithId'; @@ -8202,9 +7958,7 @@ export type UpdatePrescriptionLineInput = { stockLineId?: InputMaybe; }; -export type UpdatePrescriptionLineResponse = - | InvoiceLineNode - | UpdatePrescriptionLineError; +export type UpdatePrescriptionLineResponse = InvoiceLineNode | UpdatePrescriptionLineError; export type UpdatePrescriptionLineResponseWithId = { __typename: 'UpdatePrescriptionLineResponseWithId'; @@ -8212,10 +7966,7 @@ export type UpdatePrescriptionLineResponseWithId = { response: UpdatePrescriptionLineResponse; }; -export type UpdatePrescriptionResponse = - | InvoiceNode - | NodeError - | UpdatePrescriptionError; +export type UpdatePrescriptionResponse = InvoiceNode | NodeError | UpdatePrescriptionError; export type UpdatePrescriptionResponseWithId = { __typename: 'UpdatePrescriptionResponseWithId'; @@ -8225,7 +7976,7 @@ export type UpdatePrescriptionResponseWithId = { export enum UpdatePrescriptionStatusInput { Picked = 'PICKED', - Verified = 'VERIFIED', + Verified = 'VERIFIED' } export type UpdateProgramEnrolmentInput = { @@ -8287,9 +8038,7 @@ export type UpdateRequestRequisitionLineInput = { requestedQuantity?: InputMaybe; }; -export type UpdateRequestRequisitionLineResponse = - | RequisitionLineNode - | UpdateRequestRequisitionLineError; +export type UpdateRequestRequisitionLineResponse = RequisitionLineNode | UpdateRequestRequisitionLineError; export type UpdateRequestRequisitionLineResponseWithId = { __typename: 'UpdateRequestRequisitionLineResponseWithId'; @@ -8297,9 +8046,7 @@ export type UpdateRequestRequisitionLineResponseWithId = { response: UpdateRequestRequisitionLineResponse; }; -export type UpdateRequestRequisitionResponse = - | RequisitionNode - | UpdateRequestRequisitionError; +export type UpdateRequestRequisitionResponse = RequisitionNode | UpdateRequestRequisitionError; export type UpdateRequestRequisitionResponseWithId = { __typename: 'UpdateRequestRequisitionResponseWithId'; @@ -8308,7 +8055,7 @@ export type UpdateRequestRequisitionResponseWithId = { }; export enum UpdateRequestRequisitionStatusInput { - Sent = 'SENT', + Sent = 'SENT' } export type UpdateResponseRequisitionError = { @@ -8340,19 +8087,17 @@ export type UpdateResponseRequisitionLineErrorInterface = { export type UpdateResponseRequisitionLineInput = { comment?: InputMaybe; id: Scalars['String']['input']; + requestedQuantity?: InputMaybe; supplyQuantity?: InputMaybe; + theirStockOnHand?: InputMaybe; }; -export type UpdateResponseRequisitionLineResponse = - | RequisitionLineNode - | UpdateResponseRequisitionLineError; +export type UpdateResponseRequisitionLineResponse = RequisitionLineNode | UpdateResponseRequisitionLineError; -export type UpdateResponseRequisitionResponse = - | RequisitionNode - | UpdateResponseRequisitionError; +export type UpdateResponseRequisitionResponse = RequisitionNode | UpdateResponseRequisitionError; export enum UpdateResponseRequisitionStatusInput { - Finalised = 'FINALISED', + Finalised = 'FINALISED' } export type UpdateResult = { @@ -8478,9 +8223,7 @@ export type UpdateStocktakeLineInput = { snapshotNumberOfPacks?: InputMaybe; }; -export type UpdateStocktakeLineResponse = - | StocktakeLineNode - | UpdateStocktakeLineError; +export type UpdateStocktakeLineResponse = StocktakeLineNode | UpdateStocktakeLineError; export type UpdateStocktakeLineResponseWithId = { __typename: 'UpdateStocktakeLineResponseWithId'; @@ -8497,7 +8240,7 @@ export type UpdateStocktakeResponseWithId = { }; export enum UpdateStocktakeStatusInput { - Finalised = 'FINALISED', + Finalised = 'FINALISED' } export type UpdateSupplierReturnInput = { @@ -8527,15 +8270,13 @@ export type UpdateSupplierReturnOtherPartyInput = { otherPartyId?: InputMaybe; }; -export type UpdateSupplierReturnOtherPartyResponse = - | InvoiceNode - | UpdateSupplierReturnOtherPartyError; +export type UpdateSupplierReturnOtherPartyResponse = InvoiceNode | UpdateSupplierReturnOtherPartyError; export type UpdateSupplierReturnResponse = InvoiceNode; export enum UpdateSupplierReturnStatusInput { Picked = 'PICKED', - Shipped = 'SHIPPED', + Shipped = 'SHIPPED' } export type UpdateSyncSettingsResponse = SyncErrorNode | SyncSettingsNode; @@ -8586,9 +8327,7 @@ export type UpdateVaccinationInput = { vaccinationDate?: InputMaybe; }; -export type UpdateVaccinationResponse = - | UpdateVaccinationError - | VaccinationNode; +export type UpdateVaccinationResponse = UpdateVaccinationError | VaccinationNode; export type UpdateVaccineCourseError = { __typename: 'UpdateVaccineCourseError'; @@ -8610,9 +8349,7 @@ export type UpdateVaccineCourseInput = { wastageRate: Scalars['Float']['input']; }; -export type UpdateVaccineCourseResponse = - | UpdateVaccineCourseError - | VaccineCourseNode; +export type UpdateVaccineCourseResponse = UpdateVaccineCourseError | VaccineCourseNode; export type UpsertLogLevelInput = { level: LogLevelEnum; @@ -8650,9 +8387,7 @@ export type UseSuggestedQuantityInput = { requestRequisitionId: Scalars['String']['input']; }; -export type UseSuggestedQuantityResponse = - | RequisitionLineConnector - | UseSuggestedQuantityError; +export type UseSuggestedQuantityResponse = RequisitionLineConnector | UseSuggestedQuantityError; export type UserNode = { __typename: 'UserNode'; @@ -8671,6 +8406,7 @@ export type UserNode = { username: Scalars['String']['output']; }; + export type UserNodePermissionsArgs = { storeId?: InputMaybe; }; @@ -8717,7 +8453,7 @@ export enum UserPermission { SupplierReturnMutate = 'SUPPLIER_RETURN_MUTATE', SupplierReturnQuery = 'SUPPLIER_RETURN_QUERY', TemperatureBreachQuery = 'TEMPERATURE_BREACH_QUERY', - TemperatureLogQuery = 'TEMPERATURE_LOG_QUERY', + TemperatureLogQuery = 'TEMPERATURE_LOG_QUERY' } export type UserResponse = UserNode; @@ -8774,6 +8510,7 @@ export type VaccinationCardItemNode = { vaccineCourseId: Scalars['String']['output']; }; + export type VaccinationCardItemNodeFacilityNameArgs = { storeId: Scalars['String']['input']; }; @@ -8782,7 +8519,7 @@ export enum VaccinationCardItemNodeStatus { Given = 'GIVEN', Late = 'LATE', NotGiven = 'NOT_GIVEN', - Pending = 'PENDING', + Pending = 'PENDING' } export type VaccinationCardNode = { @@ -8853,15 +8590,18 @@ export type VaccineCourseMutations = { updateVaccineCourse: UpdateVaccineCourseResponse; }; + export type VaccineCourseMutationsDeleteVaccineCourseArgs = { vaccineCourseId: Scalars['String']['input']; }; + export type VaccineCourseMutationsInsertVaccineCourseArgs = { input: InsertVaccineCourseInput; storeId: Scalars['String']['input']; }; + export type VaccineCourseMutationsUpdateVaccineCourseArgs = { input: UpdateVaccineCourseInput; storeId: Scalars['String']['input']; @@ -8884,7 +8624,7 @@ export type VaccineCourseNode = { export type VaccineCourseResponse = NodeError | VaccineCourseNode; export enum VaccineCourseSortFieldInput { - Name = 'name', + Name = 'name' } export type VaccineCourseSortInput = { @@ -8904,15 +8644,14 @@ export type VariantNode = { shortName: Scalars['String']['output']; }; -export type VariantWithPackSizeAlreadyExists = - InsertPackVariantErrorInterface & { - __typename: 'VariantWithPackSizeAlreadyExists'; - description: Scalars['String']['output']; - }; +export type VariantWithPackSizeAlreadyExists = InsertPackVariantErrorInterface & { + __typename: 'VariantWithPackSizeAlreadyExists'; + description: Scalars['String']['output']; +}; export enum VenCategoryType { E = 'E', N = 'N', NotAssigned = 'NOT_ASSIGNED', - V = 'V', + V = 'V' } From 322715bc19c9f9bd5711c3a75708f78161e2b33e Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 10:13:09 +1300 Subject: [PATCH 12/23] Fix tests Rename draft response requisition to new Restructure error handling to prioritise not request requisition --- .../repository/src/mock/test_requisition_service.rs | 10 +++++----- .../request_requisition/add_from_master_list.rs | 12 ++++++------ .../src/requisition/request_requisition/batch.rs | 4 ++-- .../src/requisition/request_requisition/delete.rs | 12 ++++++------ .../requisition/request_requisition/update/test.rs | 4 ++-- .../request_requisition/update/validate.rs | 8 ++++---- .../request_requisition/use_suggested_quantity.rs | 12 ++++++------ .../src/requisition/response_requisition/batch.rs | 8 +++----- .../supply_requested_quantity.rs | 4 ++-- .../request_requisition_line/delete.rs | 12 ++++++------ .../request_requisition_line/insert.rs | 12 ++++++------ .../request_requisition_line/update.rs | 12 ++++++------ .../response_requisition_line/delete.rs | 6 +++--- 13 files changed, 57 insertions(+), 59 deletions(-) diff --git a/server/repository/src/mock/test_requisition_service.rs b/server/repository/src/mock/test_requisition_service.rs index cbe9647482..b62e037b01 100644 --- a/server/repository/src/mock/test_requisition_service.rs +++ b/server/repository/src/mock/test_requisition_service.rs @@ -41,7 +41,7 @@ pub fn mock_test_requisition_service() -> MockData { .push(mock_request_draft_requisition_calculation_test()); result .full_requisitions - .push(mock_full_draft_response_requisition_for_update_test()); + .push(mock_full_new_response_requisition_for_update_test()); result .full_requisitions .push(mock_new_response_requisition_test()); @@ -201,10 +201,10 @@ pub fn mock_new_response_requisition_for_update_test_line() -> RequisitionLineRo }) } -pub fn mock_full_draft_response_requisition_for_update_test() -> FullMockRequisition { +pub fn mock_full_new_response_requisition_for_update_test() -> FullMockRequisition { FullMockRequisition { requisition: inline_init(|r: &mut RequisitionRow| { - r.id = "mock_full_draft_response_requisition_for_update_test".to_string(); + r.id = "mock_full_new_response_requisition_for_update_test".to_string(); r.requisition_number = 10; r.name_link_id = "name_a".to_string(); r.store_id = mock_store_a().id; @@ -218,8 +218,8 @@ pub fn mock_full_draft_response_requisition_for_update_test() -> FullMockRequisi r.min_months_of_stock = 0.9; }), lines: vec![inline_init(|r: &mut RequisitionLineRow| { - r.id = "mock_full_draft_response_requisition_for_update_test_line".to_string(); - r.requisition_id = "mock_full_draft_response_requisition_for_update_test".to_string(); + r.id = "mock_full_new_response_requisition_for_update_test_line".to_string(); + r.requisition_id = "mock_full_new_response_requisition_for_update_test".to_string(); r.item_link_id = mock_item_a().id; r.requested_quantity = 10.0; r.suggested_quantity = 5.0; diff --git a/server/service/src/requisition/request_requisition/add_from_master_list.rs b/server/service/src/requisition/request_requisition/add_from_master_list.rs index bb58b12206..a07a238cb9 100644 --- a/server/service/src/requisition/request_requisition/add_from_master_list.rs +++ b/server/service/src/requisition/request_requisition/add_from_master_list.rs @@ -70,14 +70,14 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } + check_master_list_for_store(connection, store_id, &input.master_list_id)? .ok_or(OutError::MasterListNotFoundForThisStore)?; @@ -146,7 +146,7 @@ mod test { mock::{ common::FullMockMasterList, mock_draft_request_requisition_for_update_test, - mock_full_draft_response_requisition_for_update_test, mock_item_a, mock_item_b, + mock_full_new_response_requisition_for_update_test, mock_item_a, mock_item_b, mock_item_c, mock_item_d, mock_name_store_a, mock_request_draft_requisition_calculation_test, mock_sent_request_requisition, mock_store_a, mock_store_b, mock_test_not_store_a_master_list, @@ -206,7 +206,7 @@ mod test { service.add_from_master_list( &context, AddFromMasterList { - request_requisition_id: mock_full_draft_response_requisition_for_update_test() + request_requisition_id: mock_full_new_response_requisition_for_update_test() .requisition .id, master_list_id: "n/a".to_owned() diff --git a/server/service/src/requisition/request_requisition/batch.rs b/server/service/src/requisition/request_requisition/batch.rs index bf1e92994f..7dcce3e9cc 100644 --- a/server/service/src/requisition/request_requisition/batch.rs +++ b/server/service/src/requisition/request_requisition/batch.rs @@ -130,7 +130,7 @@ pub fn batch_request_requisition( mod test { use repository::{ mock::{ - mock_full_draft_response_requisition_for_update_test, mock_item_a, mock_name_store_c, + mock_full_new_response_requisition_for_update_test, mock_item_a, mock_name_store_c, mock_store_a, MockDataInserts, }, test_db::setup_all, @@ -160,7 +160,7 @@ mod test { let service = service_provider.requisition_service; let delete_requisition_input = inline_init(|input: &mut DeleteRequestRequisition| { - input.id = mock_full_draft_response_requisition_for_update_test() + input.id = mock_full_new_response_requisition_for_update_test() .requisition .id; }); diff --git a/server/service/src/requisition/request_requisition/delete.rs b/server/service/src/requisition/request_requisition/delete.rs index 250b5d3c42..e2b7c092b4 100644 --- a/server/service/src/requisition/request_requisition/delete.rs +++ b/server/service/src/requisition/request_requisition/delete.rs @@ -94,13 +94,13 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } // Note that lines are not deleted when an invoice is deleted, due to issues with batch deletes. // TODO: implement delete lines. See https://github.com/openmsupply/remote-server/issues/839 for details. // if !get_lines_for_requisition(connection, &input.id)?.is_empty() { @@ -122,7 +122,7 @@ mod test_delete { use repository::{ mock::{ mock_draft_request_requisition_for_update_test, - mock_full_draft_response_requisition_for_update_test, mock_sent_request_requisition, + mock_full_new_response_requisition_for_update_test, mock_sent_request_requisition, mock_store_a, mock_store_b, MockDataInserts, }, test_db::setup_all, @@ -174,7 +174,7 @@ mod test_delete { service.delete_request_requisition( &context, DeleteRequestRequisition { - id: mock_full_draft_response_requisition_for_update_test() + id: mock_full_new_response_requisition_for_update_test() .requisition .id, }, diff --git a/server/service/src/requisition/request_requisition/update/test.rs b/server/service/src/requisition/request_requisition/update/test.rs index 0a4a599c82..de9c5d66a1 100644 --- a/server/service/src/requisition/request_requisition/update/test.rs +++ b/server/service/src/requisition/request_requisition/update/test.rs @@ -4,7 +4,7 @@ mod test_update { use repository::{ mock::{ mock_draft_request_requisition_for_update_test, - mock_full_draft_response_requisition_for_update_test, mock_name_store_c, + mock_full_new_response_requisition_for_update_test, mock_name_store_c, mock_request_draft_requisition_calculation_test, mock_request_program_requisition, mock_sent_request_requisition, mock_store_a, mock_store_b, MockData, MockDataInserts, }, @@ -89,7 +89,7 @@ mod test_update { service.update_request_requisition( &context, inline_init(|r: &mut UpdateRequestRequisition| { - r.id = mock_full_draft_response_requisition_for_update_test() + r.id = mock_full_new_response_requisition_for_update_test() .requisition .id; }), diff --git a/server/service/src/requisition/request_requisition/update/validate.rs b/server/service/src/requisition/request_requisition/update/validate.rs index 2a867dc0b7..6c1d3cb8b6 100644 --- a/server/service/src/requisition/request_requisition/update/validate.rs +++ b/server/service/src/requisition/request_requisition/update/validate.rs @@ -29,14 +29,14 @@ pub fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } + let other_party_id = match &input.other_party_id { None => return Ok((requisition_row, status_changed)), Some(other_party_id) => other_party_id, diff --git a/server/service/src/requisition/request_requisition/use_suggested_quantity.rs b/server/service/src/requisition/request_requisition/use_suggested_quantity.rs index 69f878db3f..99a312e565 100644 --- a/server/service/src/requisition/request_requisition/use_suggested_quantity.rs +++ b/server/service/src/requisition/request_requisition/use_suggested_quantity.rs @@ -66,13 +66,13 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } Ok(()) } @@ -110,7 +110,7 @@ mod test { use repository::{ mock::{ mock_draft_request_requisition_for_update_test, - mock_full_draft_response_requisition_for_update_test, + mock_full_new_response_requisition_for_update_test, mock_request_draft_requisition_calculation_test, mock_sent_request_requisition, mock_store_a, mock_store_b, MockDataInserts, }, @@ -165,7 +165,7 @@ mod test { service.use_suggested_quantity( &context, UseSuggestedQuantity { - request_requisition_id: mock_full_draft_response_requisition_for_update_test() + request_requisition_id: mock_full_new_response_requisition_for_update_test() .requisition .id, }, diff --git a/server/service/src/requisition/response_requisition/batch.rs b/server/service/src/requisition/response_requisition/batch.rs index 00bf2e4d4c..d3a144f3df 100644 --- a/server/service/src/requisition/response_requisition/batch.rs +++ b/server/service/src/requisition/response_requisition/batch.rs @@ -60,9 +60,7 @@ pub fn batch_response_requisition( #[cfg(test)] mod test { use repository::{ - mock::{ - mock_full_draft_response_requisition_for_update_test, mock_store_a, MockDataInserts, - }, + mock::{mock_full_new_response_requisition_for_update_test, mock_store_a, MockDataInserts}, test_db::setup_all, RequisitionLineRowRepository, }; @@ -85,7 +83,7 @@ mod test { .unwrap(); let service = service_provider.requisition_service; - let line_id = mock_full_draft_response_requisition_for_update_test().lines[0] + let line_id = mock_full_new_response_requisition_for_update_test().lines[0] .id .clone(); @@ -100,7 +98,7 @@ mod test { RequisitionLineRowRepository::new(&connection) .find_one_by_id(&line_id) .unwrap(), - Some(mock_full_draft_response_requisition_for_update_test().lines[0].clone()) + Some(mock_full_new_response_requisition_for_update_test().lines[0].clone()) ); // Test delete diff --git a/server/service/src/requisition/response_requisition/supply_requested_quantity.rs b/server/service/src/requisition/response_requisition/supply_requested_quantity.rs index 6999e29cbd..a2f40f9f73 100644 --- a/server/service/src/requisition/response_requisition/supply_requested_quantity.rs +++ b/server/service/src/requisition/response_requisition/supply_requested_quantity.rs @@ -140,7 +140,7 @@ mod test { use repository::{ mock::{ mock_finalised_response_requisition, - mock_full_draft_response_requisition_for_update_test, + mock_full_new_response_requisition_for_update_test, mock_new_response_requisition_test, mock_sent_request_requisition, mock_store_a, mock_store_b, mock_user_account_b, MockDataInserts, }, @@ -210,7 +210,7 @@ mod test { service.supply_requested_quantity( &context, SupplyRequestedQuantity { - response_requisition_id: mock_full_draft_response_requisition_for_update_test() + response_requisition_id: mock_full_new_response_requisition_for_update_test() .requisition .id, }, diff --git a/server/service/src/requisition_line/request_requisition_line/delete.rs b/server/service/src/requisition_line/request_requisition_line/delete.rs index 8dac55a60a..72531ba13f 100644 --- a/server/service/src/requisition_line/request_requisition_line/delete.rs +++ b/server/service/src/requisition_line/request_requisition_line/delete.rs @@ -58,14 +58,14 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } + Ok(()) } @@ -79,7 +79,7 @@ impl From for DeleteRequestRequisitionLineError { mod test { use repository::{ mock::{ - mock_full_draft_response_requisition_for_update_test, + mock_full_new_response_requisition_for_update_test, mock_request_draft_requisition_calculation_test, mock_sent_request_requisition_line, mock_store_a, mock_store_b, MockDataInserts, }, @@ -135,7 +135,7 @@ mod test { service.delete_request_requisition_line( &context, DeleteRequestRequisitionLine { - id: mock_full_draft_response_requisition_for_update_test().lines[0] + id: mock_full_new_response_requisition_for_update_test().lines[0] .id .clone(), }, diff --git a/server/service/src/requisition_line/request_requisition_line/insert.rs b/server/service/src/requisition_line/request_requisition_line/insert.rs index 5e83547dec..bfa9edd945 100644 --- a/server/service/src/requisition_line/request_requisition_line/insert.rs +++ b/server/service/src/requisition_line/request_requisition_line/insert.rs @@ -85,14 +85,14 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } + if (check_item_exists_in_requisition(connection, &input.requisition_id, &input.item_id)?) .is_some() { @@ -141,7 +141,7 @@ mod test { use repository::{ mock::{ mock_draft_request_requisition_for_update_test, - mock_full_draft_response_requisition_for_update_test, mock_item_c, + mock_full_new_response_requisition_for_update_test, mock_item_c, mock_request_draft_requisition, mock_request_draft_requisition_calculation_test, mock_request_program_requisition, mock_sent_request_requisition, mock_store_a, mock_store_b, test_item_stats, MockDataInserts, @@ -227,7 +227,7 @@ mod test { service.insert_request_requisition_line( &context, inline_init(|r: &mut InsertRequestRequisitionLine| { - r.requisition_id = mock_full_draft_response_requisition_for_update_test() + r.requisition_id = mock_full_new_response_requisition_for_update_test() .requisition .id; }), diff --git a/server/service/src/requisition_line/request_requisition_line/update.rs b/server/service/src/requisition_line/request_requisition_line/update.rs index 45197cdaf4..55bffc70bc 100644 --- a/server/service/src/requisition_line/request_requisition_line/update.rs +++ b/server/service/src/requisition_line/request_requisition_line/update.rs @@ -70,14 +70,14 @@ fn validate( return Err(OutError::NotThisStoreRequisition); } - if requisition_row.status != RequisitionStatus::Draft { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.r#type != RequisitionType::Request { return Err(OutError::NotARequestRequisition); } + if requisition_row.status != RequisitionStatus::Draft { + return Err(OutError::CannotEditRequisition); + } + Ok(requisition_line_row) } @@ -106,7 +106,7 @@ impl From for UpdateRequestRequisitionLineError { mod test { use repository::{ mock::{ - mock_full_draft_response_requisition_for_update_test, + mock_full_new_response_requisition_for_update_test, mock_request_draft_requisition_calculation_test, mock_sent_request_requisition_line, mock_store_a, mock_store_b, MockDataInserts, }, @@ -164,7 +164,7 @@ mod test { &context, inline_init(|r: &mut UpdateRequestRequisitionLine| { r.id.clone_from( - &mock_full_draft_response_requisition_for_update_test().lines[0].id, + &mock_full_new_response_requisition_for_update_test().lines[0].id, ); }), ), diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index 78804a4373..a8b2319a52 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -81,7 +81,7 @@ impl From for DeleteResponseRequisitionLineError { mod test { use repository::{ mock::{ - mock_full_draft_response_requisition_for_update_test, + mock_full_new_response_requisition_for_update_test, mock_request_draft_requisition_calculation_test, mock_store_a, mock_store_b, MockDataInserts, }, @@ -140,7 +140,7 @@ mod test { service.delete_response_requisition_line( &context, DeleteResponseRequisitionLine { - id: mock_full_draft_response_requisition_for_update_test().lines[0] + id: mock_full_new_response_requisition_for_update_test().lines[0] .id .clone(), }, @@ -163,7 +163,7 @@ mod test { .unwrap(); let service = service_provider.requisition_line_service; - let test_line = mock_full_draft_response_requisition_for_update_test().lines[0].clone(); + let test_line = mock_full_new_response_requisition_for_update_test().lines[0].clone(); service .delete_response_requisition_line( From 1d668b02741c1a0a7ad0c912bd58a9cf67194752 Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 10:24:36 +1300 Subject: [PATCH 13/23] Restructure order of errors --- .../requisition_line/response_requisition_line/delete.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index a8b2319a52..0eb455d199 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -56,10 +56,6 @@ fn validate( check_requisition_row_exists(connection, &requisition_line_row.requisition_id)? .ok_or(OutError::RequisitionDoesNotExist)?; - if check_approval_status(&requisition_row) { - return Err(OutError::CannotEditRequisition); - } - if requisition_row.store_id != store_id { return Err(OutError::NotThisStoreRequisition); } @@ -68,6 +64,10 @@ fn validate( return Err(OutError::NotAResponseRequisition); } + if check_approval_status(&requisition_row) { + return Err(OutError::CannotEditRequisition); + } + Ok(()) } From 07df94378e05c024833c7c3d08b0cf28c5b1c848 Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 11:27:46 +1300 Subject: [PATCH 14/23] Remove redundant delete line from api --- .../src/ResponseRequisition/api/api.ts | 17 ----------------- .../src/ResponseRequisition/api/hooks/index.ts | 1 - .../ResponseRequisition/api/hooks/line/index.ts | 2 -- .../api/hooks/line/useDeleteResponseLine.ts | 15 --------------- 4 files changed, 35 deletions(-) delete mode 100644 client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts diff --git a/client/packages/requisitions/src/ResponseRequisition/api/api.ts b/client/packages/requisitions/src/ResponseRequisition/api/api.ts index dcb4144d82..c21269276d 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/api.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/api.ts @@ -191,23 +191,6 @@ export const getResponseQueries = (sdk: Sdk, storeId: string) => ({ throw new Error('Unable to update requisition'); }, - deleteLine: async (responseLineId: string) => { - const ids = [{ id: responseLineId }]; - const result = await sdk.deleteResponseLines({ ids, storeId }); - - if (result.batchResponseRequisition.deleteResponseRequisitionLines) { - const failedLines = - result.batchResponseRequisition.deleteResponseRequisitionLines.filter( - line => - line.response.__typename === 'DeleteResponseRequisitionLineError' - ); - if (failedLines.length === 0) { - return result.batchResponseRequisition.deleteResponseRequisitionLines; - } - } - - throw new Error('Could not delete requisition lines!'); - }, deleteLines: async (responseLines: ResponseLineFragment[]) => { const ids = responseLines.map(responseParser.toDeleteLine); const result = await sdk.deleteResponseLines({ ids, storeId }); diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts index 07ebb81e15..20a26f7249 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/index.ts @@ -16,7 +16,6 @@ export const useResponse = { line: { list: Lines.useResponseLines, stats: Lines.useResponseLineStatsData, - deleteLine: Lines.useDeleteResponseLine, delete: Lines.useDeleteResponseLines, save: Lines.useSaveResponseLines, }, diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts index 56f248eb39..10fb6a3423 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/index.ts @@ -2,10 +2,8 @@ import { useDeleteResponseLines } from './useDeleteResponseLines'; import { useResponseLines } from './useResponseLines'; import { useResponseLineStatsData } from './useResponseLineStatsData'; import { useSaveResponseLines } from './useSaveResponseLines'; -import { useDeleteResponseLine } from './useDeleteResponseLine'; export const Lines = { - useDeleteResponseLine, useDeleteResponseLines, useResponseLines, useSaveResponseLines, diff --git a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts b/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts deleted file mode 100644 index 2c0146d50a..0000000000 --- a/client/packages/requisitions/src/ResponseRequisition/api/hooks/line/useDeleteResponseLine.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { useQueryClient, useMutation } from '@openmsupply-client/common'; -import { useResponseApi } from '../utils/useResponseApi'; -import { useResponseNumber } from '../document/useResponse'; - -export const useDeleteResponseLine = () => { - const api = useResponseApi(); - const responseNumber = useResponseNumber(); - - const queryClient = useQueryClient(); - const { mutate } = useMutation(api.deleteLine, { - onSettled: () => - queryClient.invalidateQueries(api.keys.detail(responseNumber)), - }); - return mutate; -}; From c5f479b12f73e62f4053fab2a92829de87e3c97e Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 16:24:41 +1300 Subject: [PATCH 15/23] Add check for request requisition reference --- .../src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx index 07d222552b..a0f0f51a81 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx @@ -129,7 +129,7 @@ export const Toolbar: FC = () => { }} debounceTime={0} /> - + ); From d933c3b002b01b7c210ebb5063f2d6d21a5c4484 Mon Sep 17 00:00:00 2001 From: Fergus Roache <90807420+fergie-nz@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:41:37 +1300 Subject: [PATCH 16/23] Update server/service/src/requisition_line/response_requisition_line/delete.rs Co-authored-by: roxy-dao --- .../src/requisition_line/response_requisition_line/delete.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index 0eb455d199..6e83e2cbd1 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -64,7 +64,7 @@ fn validate( return Err(OutError::NotAResponseRequisition); } - if check_approval_status(&requisition_row) { + if requisition_row.status == RequisitionStatus::Finalised return Err(OutError::CannotEditRequisition); } From 49c32da9d3c96c7a571242611f6bcbdfad19569f Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Fri, 25 Oct 2024 16:48:41 +1300 Subject: [PATCH 17/23] Add check for transferred requisition --- .../mutations/response_requisition_line/delete.rs | 6 ++++++ .../response_requisition_line/delete.rs | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs index e2449d49fa..c3c2e8a770 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/delete.rs @@ -98,6 +98,12 @@ fn map_error(error: ServiceError) -> Result { CannotEditRequisition {}, )) } + ServiceError::CannotDeleteLineFromTransferredRequisition => { + return Ok(DeleteErrorInterface::CannotEditRequisition( + CannotEditRequisition {}, + )) + } + // Standard Graphql Errors ServiceError::NotThisStoreRequisition => BadUserInput(formatted_error), ServiceError::NotAResponseRequisition => BadUserInput(formatted_error), diff --git a/server/service/src/requisition_line/response_requisition_line/delete.rs b/server/service/src/requisition_line/response_requisition_line/delete.rs index 6e83e2cbd1..5197ae200e 100644 --- a/server/service/src/requisition_line/response_requisition_line/delete.rs +++ b/server/service/src/requisition_line/response_requisition_line/delete.rs @@ -1,12 +1,11 @@ use repository::{ requisition_row::RequisitionType, RepositoryError, RequisitionLineRowRepository, - StorageConnection, + RequisitionStatus, StorageConnection, }; use crate::{ - requisition::common::{check_approval_status, check_requisition_row_exists}, - requisition_line::common::check_requisition_line_exists, - service_provider::ServiceContext, + requisition::common::check_requisition_row_exists, + requisition_line::common::check_requisition_line_exists, service_provider::ServiceContext, }; #[derive(Debug, PartialEq, Clone, Default)] @@ -23,6 +22,7 @@ pub enum DeleteResponseRequisitionLineError { RequisitionDoesNotExist, CannotEditRequisition, DatabaseError(RepositoryError), + CannotDeleteLineFromTransferredRequisition, } type OutError = DeleteResponseRequisitionLineError; @@ -64,10 +64,14 @@ fn validate( return Err(OutError::NotAResponseRequisition); } - if requisition_row.status == RequisitionStatus::Finalised + if requisition_row.status == RequisitionStatus::Finalised { return Err(OutError::CannotEditRequisition); } + if requisition_row.linked_requisition_id != None { + return Err(OutError::CannotDeleteLineFromTransferredRequisition); + } + Ok(()) } From 206d3774ce8a720f22b141819dcc1398dc7d1aee Mon Sep 17 00:00:00 2001 From: roxy-dao Date: Tue, 29 Oct 2024 08:38:15 +1300 Subject: [PATCH 18/23] Don't make map_response public --- .../src/mutations/response_requisition_line/insert.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/insert.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/insert.rs index ab51aa4921..10774f3549 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/insert.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/insert.rs @@ -68,7 +68,7 @@ pub fn insert(ctx: &Context<'_>, store_id: &str, input: InsertInput) -> Result) -> Result { +fn map_response(from: Result) -> Result { let result = match from { Ok(requisition_line) => { InsertResponse::Response(RequisitionLineNode::from_domain(requisition_line)) From 8e8b2bb68c3952db0806fb8a16bdc0c8eb96d1e8 Mon Sep 17 00:00:00 2001 From: roxy-dao Date: Tue, 29 Oct 2024 08:39:55 +1300 Subject: [PATCH 19/23] Passing in wrong type for isResponseDisabled check --- client/packages/requisitions/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/packages/requisitions/src/utils.ts b/client/packages/requisitions/src/utils.ts index 9c003319b5..4d167324a9 100644 --- a/client/packages/requisitions/src/utils.ts +++ b/client/packages/requisitions/src/utils.ts @@ -66,7 +66,7 @@ export const isRequestDisabled = (request: RequestRowFragment): boolean => { return request.status !== RequisitionNodeStatus.Draft; }; -export const isResponseDisabled = (response: RequestRowFragment): boolean => { +export const isResponseDisabled = (response: ResponseRowFragment): boolean => { return ( response.status !== RequisitionNodeStatus.New || response.approvalStatus === RequisitionNodeApprovalStatus.Pending || From be7022a856bc5935c3a1f8fa95fa14f9b8af052a Mon Sep 17 00:00:00 2001 From: roxy-dao Date: Tue, 29 Oct 2024 08:40:32 +1300 Subject: [PATCH 20/23] Expose linkedRequisition node --- .../src/ResponseRequisition/api/operations.generated.ts | 7 +++++-- .../src/ResponseRequisition/api/operations.graphql | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts b/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts index 86bf19b1fa..deb9245532 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts +++ b/client/packages/requisitions/src/ResponseRequisition/api/operations.generated.ts @@ -13,7 +13,7 @@ export type UpdateResponseMutation = { __typename: 'Mutations', updateResponseRe export type ResponseLineFragment = { __typename: 'RequisitionLineNode', id: string, itemId: string, requestedQuantity: number, supplyQuantity: number, remainingQuantityToSupply: number, alreadyIssued: number, comment?: string | null, approvedQuantity: number, approvalComment?: string | null, itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number, availableMonthsOfStockOnHand?: number | null, averageMonthlyConsumption: number }, item: { __typename: 'ItemNode', id: string, name: string, code: string, unitName?: string | null }, linkedRequisitionLine?: { __typename: 'RequisitionLineNode', itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number } } | null }; -export type ResponseFragment = { __typename: 'RequisitionNode', id: string, type: Types.RequisitionNodeType, status: Types.RequisitionNodeStatus, createdDatetime: string, sentDatetime?: string | null, finalisedDatetime?: string | null, requisitionNumber: number, colour?: string | null, theirReference?: string | null, comment?: string | null, otherPartyName: string, otherPartyId: string, maxMonthsOfStock: number, minMonthsOfStock: number, approvalStatus: Types.RequisitionNodeApprovalStatus, programName?: string | null, orderType?: string | null, user?: { __typename: 'UserNode', username: string, email?: string | null } | null, shipments: { __typename: 'InvoiceConnector', totalCount: number, nodes: Array<{ __typename: 'InvoiceNode', id: string, invoiceNumber: number, createdDatetime: string, user?: { __typename: 'UserNode', username: string } | null }> }, linesRemainingToSupply: { __typename: 'RequisitionLineConnector', totalCount: number }, lines: { __typename: 'RequisitionLineConnector', totalCount: number, nodes: Array<{ __typename: 'RequisitionLineNode', id: string, itemId: string, requestedQuantity: number, supplyQuantity: number, remainingQuantityToSupply: number, alreadyIssued: number, comment?: string | null, approvedQuantity: number, approvalComment?: string | null, itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number, availableMonthsOfStockOnHand?: number | null, averageMonthlyConsumption: number }, item: { __typename: 'ItemNode', id: string, name: string, code: string, unitName?: string | null }, linkedRequisitionLine?: { __typename: 'RequisitionLineNode', itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number } } | null }> }, otherParty: { __typename: 'NameNode', id: string, code: string, isCustomer: boolean, isSupplier: boolean, isOnHold: boolean, name: string, store?: { __typename: 'StoreNode', id: string, code: string } | null }, period?: { __typename: 'PeriodNode', name: string, startDate: string, endDate: string } | null }; +export type ResponseFragment = { __typename: 'RequisitionNode', id: string, type: Types.RequisitionNodeType, status: Types.RequisitionNodeStatus, createdDatetime: string, sentDatetime?: string | null, finalisedDatetime?: string | null, requisitionNumber: number, colour?: string | null, theirReference?: string | null, comment?: string | null, otherPartyName: string, otherPartyId: string, maxMonthsOfStock: number, minMonthsOfStock: number, approvalStatus: Types.RequisitionNodeApprovalStatus, programName?: string | null, orderType?: string | null, user?: { __typename: 'UserNode', username: string, email?: string | null } | null, shipments: { __typename: 'InvoiceConnector', totalCount: number, nodes: Array<{ __typename: 'InvoiceNode', id: string, invoiceNumber: number, createdDatetime: string, user?: { __typename: 'UserNode', username: string } | null }> }, linesRemainingToSupply: { __typename: 'RequisitionLineConnector', totalCount: number }, lines: { __typename: 'RequisitionLineConnector', totalCount: number, nodes: Array<{ __typename: 'RequisitionLineNode', id: string, itemId: string, requestedQuantity: number, supplyQuantity: number, remainingQuantityToSupply: number, alreadyIssued: number, comment?: string | null, approvedQuantity: number, approvalComment?: string | null, itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number, availableMonthsOfStockOnHand?: number | null, averageMonthlyConsumption: number }, item: { __typename: 'ItemNode', id: string, name: string, code: string, unitName?: string | null }, linkedRequisitionLine?: { __typename: 'RequisitionLineNode', itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number } } | null }> }, otherParty: { __typename: 'NameNode', id: string, code: string, isCustomer: boolean, isSupplier: boolean, isOnHold: boolean, name: string, store?: { __typename: 'StoreNode', id: string, code: string } | null }, period?: { __typename: 'PeriodNode', name: string, startDate: string, endDate: string } | null, linkedRequisition?: { __typename: 'RequisitionNode', id: string } | null }; export type ResponseByNumberQueryVariables = Types.Exact<{ storeId: Types.Scalars['String']['input']; @@ -21,7 +21,7 @@ export type ResponseByNumberQueryVariables = Types.Exact<{ }>; -export type ResponseByNumberQuery = { __typename: 'Queries', requisitionByNumber: { __typename: 'RecordNotFound' } | { __typename: 'RequisitionNode', id: string, type: Types.RequisitionNodeType, status: Types.RequisitionNodeStatus, createdDatetime: string, sentDatetime?: string | null, finalisedDatetime?: string | null, requisitionNumber: number, colour?: string | null, theirReference?: string | null, comment?: string | null, otherPartyName: string, otherPartyId: string, maxMonthsOfStock: number, minMonthsOfStock: number, approvalStatus: Types.RequisitionNodeApprovalStatus, programName?: string | null, orderType?: string | null, user?: { __typename: 'UserNode', username: string, email?: string | null } | null, shipments: { __typename: 'InvoiceConnector', totalCount: number, nodes: Array<{ __typename: 'InvoiceNode', id: string, invoiceNumber: number, createdDatetime: string, user?: { __typename: 'UserNode', username: string } | null }> }, linesRemainingToSupply: { __typename: 'RequisitionLineConnector', totalCount: number }, lines: { __typename: 'RequisitionLineConnector', totalCount: number, nodes: Array<{ __typename: 'RequisitionLineNode', id: string, itemId: string, requestedQuantity: number, supplyQuantity: number, remainingQuantityToSupply: number, alreadyIssued: number, comment?: string | null, approvedQuantity: number, approvalComment?: string | null, itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number, availableMonthsOfStockOnHand?: number | null, averageMonthlyConsumption: number }, item: { __typename: 'ItemNode', id: string, name: string, code: string, unitName?: string | null }, linkedRequisitionLine?: { __typename: 'RequisitionLineNode', itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number } } | null }> }, otherParty: { __typename: 'NameNode', id: string, code: string, isCustomer: boolean, isSupplier: boolean, isOnHold: boolean, name: string, store?: { __typename: 'StoreNode', id: string, code: string } | null }, period?: { __typename: 'PeriodNode', name: string, startDate: string, endDate: string } | null } }; +export type ResponseByNumberQuery = { __typename: 'Queries', requisitionByNumber: { __typename: 'RecordNotFound' } | { __typename: 'RequisitionNode', id: string, type: Types.RequisitionNodeType, status: Types.RequisitionNodeStatus, createdDatetime: string, sentDatetime?: string | null, finalisedDatetime?: string | null, requisitionNumber: number, colour?: string | null, theirReference?: string | null, comment?: string | null, otherPartyName: string, otherPartyId: string, maxMonthsOfStock: number, minMonthsOfStock: number, approvalStatus: Types.RequisitionNodeApprovalStatus, programName?: string | null, orderType?: string | null, user?: { __typename: 'UserNode', username: string, email?: string | null } | null, shipments: { __typename: 'InvoiceConnector', totalCount: number, nodes: Array<{ __typename: 'InvoiceNode', id: string, invoiceNumber: number, createdDatetime: string, user?: { __typename: 'UserNode', username: string } | null }> }, linesRemainingToSupply: { __typename: 'RequisitionLineConnector', totalCount: number }, lines: { __typename: 'RequisitionLineConnector', totalCount: number, nodes: Array<{ __typename: 'RequisitionLineNode', id: string, itemId: string, requestedQuantity: number, supplyQuantity: number, remainingQuantityToSupply: number, alreadyIssued: number, comment?: string | null, approvedQuantity: number, approvalComment?: string | null, itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number, availableMonthsOfStockOnHand?: number | null, averageMonthlyConsumption: number }, item: { __typename: 'ItemNode', id: string, name: string, code: string, unitName?: string | null }, linkedRequisitionLine?: { __typename: 'RequisitionLineNode', itemStats: { __typename: 'ItemStatsNode', availableStockOnHand: number } } | null }> }, otherParty: { __typename: 'NameNode', id: string, code: string, isCustomer: boolean, isSupplier: boolean, isOnHold: boolean, name: string, store?: { __typename: 'StoreNode', id: string, code: string } | null }, period?: { __typename: 'PeriodNode', name: string, startDate: string, endDate: string } | null, linkedRequisition?: { __typename: 'RequisitionNode', id: string } | null } }; export type ResponseRowFragment = { __typename: 'RequisitionNode', colour?: string | null, comment?: string | null, createdDatetime: string, finalisedDatetime?: string | null, id: string, otherPartyName: string, requisitionNumber: number, sentDatetime?: string | null, status: Types.RequisitionNodeStatus, theirReference?: string | null, type: Types.RequisitionNodeType, otherPartyId: string, approvalStatus: Types.RequisitionNodeApprovalStatus, programName?: string | null, orderType?: string | null, period?: { __typename: 'PeriodNode', name: string, startDate: string, endDate: string } | null, shipments: { __typename: 'InvoiceConnector', totalCount: number } }; @@ -182,6 +182,9 @@ export const ResponseFragmentDoc = gql` startDate endDate } + linkedRequisition { + id + } orderType } ${ResponseLineFragmentDoc}`; diff --git a/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql b/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql index 70372cd8f5..c4fc1e7b8c 100644 --- a/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql +++ b/client/packages/requisitions/src/ResponseRequisition/api/operations.graphql @@ -114,6 +114,9 @@ fragment Response on RequisitionNode { startDate endDate } + linkedRequisition { + id + } orderType } query responseByNumber($storeId: String!, $requisitionNumber: Int!) { From 010e33cb8db8e2e2741d886ddff50caaf87e1b11 Mon Sep 17 00:00:00 2001 From: roxy-dao Date: Tue, 29 Oct 2024 08:41:16 +1300 Subject: [PATCH 21/23] Use linkedRequisition for disabled check --- .../ResponseRequisition/DetailView/Toolbar/Toolbar.tsx | 7 ++++++- .../DetailView/Toolbar/ToolbarDropDown.tsx | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx index a0f0f51a81..e2c94af847 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/Toolbar.tsx @@ -31,6 +31,7 @@ export const Toolbar: FC = () => { programName, period, orderType, + linkedRequisition, } = useResponse.document.fields([ 'approvalStatus', 'otherParty', @@ -39,6 +40,7 @@ export const Toolbar: FC = () => { 'programName', 'period', 'orderType', + 'linkedRequisition', ]); const noLinkedShipments = (shipments?.totalCount ?? 0) === 0; const showInfo = noLinkedShipments && !isDisabled; @@ -129,7 +131,10 @@ export const Toolbar: FC = () => { }} debounceTime={0} /> - + ); diff --git a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx index 5e96e36328..577d9a53c4 100644 --- a/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx +++ b/client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx @@ -9,9 +9,13 @@ import { useResponse } from '../../api'; interface ToolbarDropDownProps { isDisabled: boolean; + hasLinkedRequisition: boolean; } -export const ToolbarDropDown = ({ isDisabled }: ToolbarDropDownProps) => { +export const ToolbarDropDown = ({ + isDisabled, + hasLinkedRequisition, +}: ToolbarDropDownProps) => { const t = useTranslation(); const onDelete = useResponse.line.delete(); @@ -20,9 +24,9 @@ export const ToolbarDropDown = ({ isDisabled }: ToolbarDropDownProps) => { - {t('button.delete-lines', { ns: 'distribution' })} + {t('button.delete-lines')} ); From e1c3e4df79a08883067ae5bf5e75c46c533e410d Mon Sep 17 00:00:00 2001 From: Fergus Roache Date: Tue, 29 Oct 2024 08:44:03 +1300 Subject: [PATCH 22/23] Disambiguiating map_errors --- server/graphql/requisition_line/src/lib.rs | 6 +++--- .../src/mutations/response_requisition_line/mod.rs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/server/graphql/requisition_line/src/lib.rs b/server/graphql/requisition_line/src/lib.rs index b760c99d75..c597a11d66 100644 --- a/server/graphql/requisition_line/src/lib.rs +++ b/server/graphql/requisition_line/src/lib.rs @@ -58,8 +58,8 @@ impl RequisitionLineMutations { &self, ctx: &Context<'_>, store_id: String, - input: response_requisition_line::DeleteInput, - ) -> Result { - response_requisition_line::delete(ctx, &store_id, input) + input: response_requisition_line::delete::DeleteInput, + ) -> Result { + response_requisition_line::delete::delete(ctx, &store_id, input) } } diff --git a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs index f02e61c4d4..2fbb03cf1b 100644 --- a/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs +++ b/server/graphql/requisition_line/src/mutations/response_requisition_line/mod.rs @@ -5,4 +5,3 @@ mod update; pub use update::*; pub mod delete; -pub use delete::*; From 83d98e25f6056edf7120979209145618af0a0bc3 Mon Sep 17 00:00:00 2001 From: roxy-dao Date: Tue, 29 Oct 2024 10:51:43 +1300 Subject: [PATCH 23/23] Fix test --- .../graphql/batch_mutations/src/batch_response_requisition.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/graphql/batch_mutations/src/batch_response_requisition.rs b/server/graphql/batch_mutations/src/batch_response_requisition.rs index fb0c9f9cab..fb87881a23 100644 --- a/server/graphql/batch_mutations/src/batch_response_requisition.rs +++ b/server/graphql/batch_mutations/src/batch_response_requisition.rs @@ -151,11 +151,11 @@ mod test { } #[actix_rt::test] - async fn test_graphql_batch_request_requisition() { + async fn test_graphql_batch_response_requisition() { let (_, _, connection_manager, settings) = setup_graphql_test( EmptyMutation, BatchMutations, - "test_graphql_batch_request_requisition", + "test_graphql_batch_response_requisition", MockDataInserts::all(), ) .await;