Skip to content

Commit

Permalink
Expose extra field pref in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
roxy-dao committed Nov 14, 2024
1 parent a364d01 commit 5896854
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Types from '@openmsupply-client/common';
import { GraphQLClient, RequestOptions } from 'graphql-request';
import gql from 'graphql-tag';
type GraphQLClientRequestHeaders = RequestOptions['requestHeaders'];
export type UserStoreNodeFragment = { __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number } };
export type UserStoreNodeFragment = { __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number, extraFieldsInRequisition: boolean } };

export type AuthTokenQueryVariables = Types.Exact<{
username: Types.Scalars['String']['input'];
Expand All @@ -16,7 +16,7 @@ export type AuthTokenQuery = { __typename: 'Queries', authToken: { __typename: '
export type MeQueryVariables = Types.Exact<{ [key: string]: never; }>;


export type MeQuery = { __typename: 'Queries', me: { __typename: 'UserNode', email?: string | null, language: Types.LanguageType, username: string, userId: string, firstName?: string | null, lastName?: string | null, phoneNumber?: string | null, jobTitle?: string | null, defaultStore?: { __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number } } | null, stores: { __typename: 'UserStoreConnector', totalCount: number, nodes: Array<{ __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number } }> } } };
export type MeQuery = { __typename: 'Queries', me: { __typename: 'UserNode', email?: string | null, language: Types.LanguageType, username: string, userId: string, firstName?: string | null, lastName?: string | null, phoneNumber?: string | null, jobTitle?: string | null, defaultStore?: { __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number, extraFieldsInRequisition: boolean } } | null, stores: { __typename: 'UserStoreConnector', totalCount: number, nodes: Array<{ __typename: 'UserStoreNode', code: string, id: string, nameId: string, name: string, storeMode: Types.StoreModeNodeType, createdDate?: string | null, homeCurrencyCode?: string | null, isDisabled: boolean, preferences: { __typename: 'StorePreferenceNode', id: string, responseRequisitionRequiresAuthorisation: boolean, requestRequisitionRequiresAuthorisation: boolean, packToOne: boolean, omProgramModule: boolean, vaccineModule: boolean, issueInForeignCurrency: boolean, monthlyConsumptionLookBackPeriod: number, monthsLeadTime: number, monthsOverstock: number, monthsUnderstock: number, monthsItemsExpire: number, stocktakeFrequency: number, extraFieldsInRequisition: boolean } }> } } };

export type IsCentralServerQueryVariables = Types.Exact<{ [key: string]: never; }>;

Expand Down Expand Up @@ -75,6 +75,7 @@ export const UserStoreNodeFragmentDoc = gql`
monthsUnderstock
monthsItemsExpire
stocktakeFrequency
extraFieldsInRequisition
}
createdDate
homeCurrencyCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fragment UserStoreNode on UserStoreNode {
monthsUnderstock
monthsItemsExpire
stocktakeFrequency
extraFieldsInRequisition
}
createdDate
homeCurrencyCode
Expand Down
104 changes: 103 additions & 1 deletion client/packages/common/src/types/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2350,6 +2350,45 @@ export type InboundInvoiceCounts = {
notDelivered: Scalars['Int']['output'];
};

export type IndicatorColumnNode = {
__typename: 'IndicatorColumnNode';
columnNumber: Scalars['Int']['output'];
name: Scalars['String']['output'];
value?: Maybe<IndicatorValueNode>;
valueType: IndicatorValueTypeNode;
};


export type IndicatorColumnNodeValueArgs = {
customerNameLinkId: Scalars['String']['input'];
periodId: Scalars['String']['input'];
storeId: Scalars['String']['input'];
};

export type IndicatorLineNode = {
__typename: 'IndicatorLineNode';
columns: Array<IndicatorColumnNode>;
line: IndicatorLineRowNode;
};

export type IndicatorLineRowNode = {
__typename: 'IndicatorLineRowNode';
code: Scalars['String']['output'];
lineNumber: Scalars['Int']['output'];
name: Scalars['String']['output'];
};

export type IndicatorValueNode = {
__typename: 'IndicatorValueNode';
id: Scalars['String']['output'];
value: Scalars['String']['output'];
};

export enum IndicatorValueTypeNode {
Number = 'NUMBER',
String = 'STRING'
}

export type InitialisationStatusNode = {
__typename: 'InitialisationStatusNode';
siteName?: Maybe<Scalars['String']['output']>;
Expand Down Expand Up @@ -4048,6 +4087,7 @@ export type Mutations = {
updateInboundShipment: UpdateInboundShipmentResponse;
updateInboundShipmentLine: UpdateInboundShipmentLineResponse;
updateInboundShipmentServiceLine: UpdateInboundShipmentServiceLineResponse;
updateIndicatorValue: UpdateIndicatorValueResponse;
updateLabelPrinterSettings: UpdateLabelPrinterSettingsResponse;
updateLocation: UpdateLocationResponse;
updateLogLevel: UpsertLogLevelResponse;
Expand Down Expand Up @@ -4566,6 +4606,12 @@ export type MutationsUpdateInboundShipmentServiceLineArgs = {
};


export type MutationsUpdateIndicatorValueArgs = {
input: UpdateIndicatorValueInput;
storeId: Scalars['String']['input'];
};


export type MutationsUpdateLabelPrinterSettingsArgs = {
input: LabelPrinterSettingsInput;
};
Expand Down Expand Up @@ -5400,6 +5446,37 @@ export type ProgramFilterInput = {
name?: InputMaybe<StringFilterInput>;
};

export type ProgramIndicatorConnector = {
__typename: 'ProgramIndicatorConnector';
nodes: Array<ProgramIndicatorNode>;
totalCount: Scalars['Int']['output'];
};

export type ProgramIndicatorFilterInput = {
id?: InputMaybe<EqualFilterStringInput>;
programId?: InputMaybe<EqualFilterStringInput>;
};

export type ProgramIndicatorNode = {
__typename: 'ProgramIndicatorNode';
code?: Maybe<Scalars['String']['output']>;
id: Scalars['String']['output'];
lineAndColumns: Array<IndicatorLineNode>;
program: ProgramNode;
};

export type ProgramIndicatorResponse = ProgramIndicatorConnector;

export enum ProgramIndicatorSortFieldInput {
Code = 'code',
ProgramId = 'programId'
}

export type ProgramIndicatorSortInput = {
desc?: InputMaybe<Scalars['Boolean']['input']>;
key: ProgramIndicatorSortFieldInput;
};

export type ProgramNode = {
__typename: 'ProgramNode';
id: Scalars['String']['output'];
Expand Down Expand Up @@ -5564,6 +5641,7 @@ export type Queries = {
plugins: Array<PluginNode>;
programEnrolments: ProgramEnrolmentResponse;
programEvents: ProgramEventResponse;
programIndicators: ProgramIndicatorResponse;
programs: ProgramsResponse;
rAndRForm: RnRFormResponse;
rAndRForms: RnRFormsResponse;
Expand Down Expand Up @@ -6054,6 +6132,13 @@ export type QueriesProgramEventsArgs = {
};


export type QueriesProgramIndicatorsArgs = {
filter?: InputMaybe<ProgramIndicatorFilterInput>;
sort?: InputMaybe<ProgramIndicatorSortInput>;
storeId: Scalars['String']['input'];
};


export type QueriesProgramsArgs = {
filter?: InputMaybe<ProgramFilterInput>;
page?: InputMaybe<PaginationInput>;
Expand Down Expand Up @@ -6341,7 +6426,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 & DeleteResponseRequisitionErrorInterface & DeleteResponseRequisitionLineErrorInterface & DeleteSupplierReturnErrorInterface & DeleteVaccineCourseErrorInterface & NodeErrorInterface & RequisitionLineChartErrorInterface & RequisitionLineStatsErrorInterface & ScannedDataParseErrorInterface & 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 & DeleteResponseRequisitionErrorInterface & DeleteResponseRequisitionLineErrorInterface & DeleteSupplierReturnErrorInterface & DeleteVaccineCourseErrorInterface & NodeErrorInterface & RequisitionLineChartErrorInterface & RequisitionLineStatsErrorInterface & ScannedDataParseErrorInterface & SupplyRequestedQuantityErrorInterface & UpdateAssetErrorInterface & UpdateErrorInterface & UpdateInboundShipmentErrorInterface & UpdateInboundShipmentLineErrorInterface & UpdateInboundShipmentServiceLineErrorInterface & UpdateIndicatorValueErrorInterface & UpdateLocationErrorInterface & UpdateNameErrorInterface & UpdateNamePropertiesErrorInterface & UpdateOutboundShipmentLineErrorInterface & UpdateOutboundShipmentServiceLineErrorInterface & UpdateOutboundShipmentUnallocatedLineErrorInterface & UpdatePrescriptionErrorInterface & UpdatePrescriptionLineErrorInterface & UpdateRequestRequisitionErrorInterface & UpdateRequestRequisitionLineErrorInterface & UpdateResponseRequisitionErrorInterface & UpdateResponseRequisitionLineErrorInterface & UpdateReturnOtherPartyErrorInterface & UpdateSensorErrorInterface & UpdateStockLineErrorInterface & UseSuggestedQuantityErrorInterface & {
__typename: 'RecordNotFound';
description: Scalars['String']['output'];
};
Expand Down Expand Up @@ -7240,6 +7325,7 @@ export type StoreNodeNameArgs = {

export type StorePreferenceNode = {
__typename: 'StorePreferenceNode';
extraFieldsInRequisition: Scalars['Boolean']['output'];
id: Scalars['String']['output'];
issueInForeignCurrency: Scalars['Boolean']['output'];
monthlyConsumptionLookBackPeriod: Scalars['Float']['output'];
Expand Down Expand Up @@ -7843,6 +7929,22 @@ export enum UpdateInboundShipmentStatusInput {
Verified = 'VERIFIED'
}

export type UpdateIndicatorValueError = {
__typename: 'UpdateIndicatorValueError';
error: UpdateIndicatorValueErrorInterface;
};

export type UpdateIndicatorValueErrorInterface = {
description: Scalars['String']['output'];
};

export type UpdateIndicatorValueInput = {
id: Scalars['String']['input'];
value: Scalars['String']['input'];
};

export type UpdateIndicatorValueResponse = IndicatorValueNode | UpdateIndicatorValueError;

export type UpdateLabelPrinterSettingsError = {
__typename: 'UpdateLabelPrinterSettingsError';
error: Scalars['String']['output'];
Expand Down

0 comments on commit 5896854

Please sign in to comment.