Skip to content

Commit

Permalink
Support Stock Expectations (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen authored May 7, 2023
1 parent 0e5042e commit 52d67b6
Show file tree
Hide file tree
Showing 7 changed files with 435 additions and 166 deletions.
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function App() {
);
}
} catch (error) {
console.log(error);
console.error(error);
}
};

Expand Down
19 changes: 19 additions & 0 deletions apollo/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ export const ITEM_GROUP_FRAGMENT = gql`
}
`;

export const STOCK_EXPECTATION_FRAGMENT = gql`
fragment StockExpectation on StockExpectation {
id
importantThreshold
warningThreshold
item {
id
}
}
`;

export const EVENT_CONFIGURATION_FRAGMENT = gql`
${ITEM_FRAGMENT}
${ITEM_GROUP_FRAGMENT}
Expand All @@ -79,13 +90,21 @@ export const EVENT_CONFIGURATION_FRAGMENT = gql`

export const LOGISTIC_EVENT_CONFIGURATION_FRAGMENT = gql`
${EVENT_CONFIGURATION_FRAGMENT}
${STOCK_EXPECTATION_FRAGMENT}
fragment LogisticEventConfiguration on Event {
...EventConfiguration
id
locations(first: 1000) {
edges {
node {
...Location
stockExpectations(first: 1000) {
edges {
node {
...StockExpectation
}
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions components/LogisticNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export default function LogisticNavigation({
<StockItemDetails
event={event}
stockEntry={props.route.params.stock}
refetch={refetch}
/>
)}
</OverviewStack.Screen>
Expand Down
12 changes: 4 additions & 8 deletions components/native/NativeNumberOnlyInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import fonts from '../../constants/fonts';
export default function NativeNumberOnlyInput(
props: Omit<
React.ComponentProps<typeof NumericInput>,
| 'textColor'
| 'inputStyle'
| 'containerStyle'
| 'type'
Expand All @@ -21,10 +20,11 @@ export default function NativeNumberOnlyInput(
| 'rightButtonBackgroundColor'
>
) {
const textColor = props.textColor ?? colors.primary;
return (
<>
<NumericInput
textColor={colors.primary}
textColor={textColor}
inputStyle={{ fontFamily: fonts.defaultFontFamilyBold } as ViewStyle}
containerStyle={{ flexShrink: 0, width: 150 }}
{...props}
Expand All @@ -33,14 +33,10 @@ export default function NativeNumberOnlyInput(
totalWidth={150}
totalHeight={70}
customDecIcon={
<Ionicons
size={44}
name={'ios-remove-circle'}
color={colors.primary}
/>
<Ionicons size={44} name={'ios-remove-circle'} color={textColor} />
}
customIncIcon={
<Ionicons size={44} name={'ios-add-circle'} color={colors.primary} />
<Ionicons size={44} name={'ios-add-circle'} color={textColor} />
}
leftButtonBackgroundColor={'transparent'}
rightButtonBackgroundColor={'transparent'}
Expand Down
44 changes: 34 additions & 10 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
"error.destinationLocationRequired.description": {
"defaultMessage": "Ausgehenden Standort auswählen."
},
"error.itemRequired.description": {
"defaultMessage": "Artikel auswählen."
"error.eventNotFound.description": {
"defaultMessage": "Der Anlass konnte nicht gefunden werden."
},
"error.locationNotFound.description": {
"defaultMessage": "Der Standort konnte nicht gefunden werden."
},
"error.sourceAndDestinationEqual.description": {
"defaultMessage": "Quell- & Zielstandort können nicht gleich sein."
Expand Down Expand Up @@ -56,9 +59,6 @@
"model.item.unit": {
"defaultMessage": "Einheit"
},
"model.itemGroup": {
"defaultMessage": "Artikelgruppe"
},
"model.location": {
"defaultMessage": "Standort"
},
Expand All @@ -68,11 +68,8 @@
"model.stockEntry.missingCount": {
"defaultMessage": "Fehlende Artikel"
},
"model.stockEntry.movementIn": {
"defaultMessage": "Eingehende Verschiebungen"
},
"model.stockEntry.movementOut": {
"defaultMessage": "Ausgehende Verschiebungen"
"model.stockEntry.movements": {
"defaultMessage": "TBD: Movements"
},
"model.stockEntry.stock": {
"defaultMessage": "Bestand"
Expand Down Expand Up @@ -101,6 +98,9 @@
"refreshing": {
"defaultMessage": "Wird geladen..."
},
"retry": {
"defaultMessage": "Erneut versuchen"
},
"save": {
"defaultMessage": "Speichern"
},
Expand Down Expand Up @@ -130,5 +130,29 @@
},
"screen.scanner": {
"defaultMessage": "Scanner"
},
"screen.stockItemDetails.baseData": {
"defaultMessage": "Basis Daten"
},
"screen.stockItemDetails.stock": {
"defaultMessage": "Bestand"
},
"screen.stockItemDetails.stockExpectation": {
"defaultMessage": "Bestandserwartungen"
},
"stockExpectation.success.save": {
"defaultMessage": "Bestandserwartungen erfolgreich gespeichert."
},
"error.itemRequired.description": {
"defaultMessage": "Artikel auswählen."
},
"model.itemGroup": {
"defaultMessage": "Artikelgruppe"
},
"model.stockEntry.movementIn": {
"defaultMessage": "Eingehende Verschiebungen"
},
"model.stockEntry.movementOut": {
"defaultMessage": "Ausgehende Verschiebungen"
}
}
32 changes: 22 additions & 10 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
"error.destinationLocationRequired.description": {
"defaultMessage": "Please select destination location"
},
"error.itemRequired.description": {
"defaultMessage": "Please select an item"
"error.eventNotFound.description": {
"defaultMessage": "The event could not be found."
},
"error.locationNotFound.description": {
"defaultMessage": "The location could not be found."
},
"error.sourceAndDestinationEqual.description": {
"defaultMessage": "Source and destination cannot be the same"
Expand Down Expand Up @@ -56,9 +59,6 @@
"model.item.unit": {
"defaultMessage": "Unit"
},
"model.itemGroup": {
"defaultMessage": "Item Group"
},
"model.location": {
"defaultMessage": "Location"
},
Expand All @@ -68,11 +68,8 @@
"model.stockEntry.missingCount": {
"defaultMessage": "Missing"
},
"model.stockEntry.movementIn": {
"defaultMessage": "Movement In"
},
"model.stockEntry.movementOut": {
"defaultMessage": "Movement Out"
"model.stockEntry.movements": {
"defaultMessage": "Movements"
},
"model.stockEntry.stock": {
"defaultMessage": "Stock"
Expand Down Expand Up @@ -101,6 +98,9 @@
"refreshing": {
"defaultMessage": "Refreshing..."
},
"retry": {
"defaultMessage": "Retry"
},
"save": {
"defaultMessage": "Save"
},
Expand Down Expand Up @@ -130,5 +130,17 @@
},
"screen.scanner": {
"defaultMessage": "Scanner"
},
"screen.stockItemDetails.baseData": {
"defaultMessage": "Base Data"
},
"screen.stockItemDetails.stock": {
"defaultMessage": "Stock"
},
"screen.stockItemDetails.stockExpectation": {
"defaultMessage": "Stock Expectation"
},
"stockExpectation.success.save": {
"defaultMessage": "Successfuly saved stock expectation."
}
}
Loading

0 comments on commit 52d67b6

Please sign in to comment.