Skip to content

Commit

Permalink
Merge branch 'main' of github.com:QuantozTechnology/qbs-white-label-a…
Browse files Browse the repository at this point in the history
…pp into delete-customer
  • Loading branch information
nagarwal4 committed Apr 19, 2024
2 parents d5e634c + 142fdcb commit 8b5807e
Show file tree
Hide file tree
Showing 53 changed files with 4,841 additions and 21,231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,18 @@ public async Task CreateAsync(Customer customer, string? ip = null, Cancellation
throw new CustomErrorsException(NexusErrorCodes.ExistingProperty.ToString(), customer.CustomerCode, Constants.NexusErrorMessages.ExistingCode);
}

var encodedEmail = Uri.EscapeDataString(customer.Email.ToLower().Trim());

var query = new Dictionary<string, string>
{
{ "Email", customer.Email.ToLower().Trim() }
{ "Email", encodedEmail }
};

var existingCustomersWithEmail = await _tokenServer.Customers.Get(query);

if (existingCustomersWithEmail != null && existingCustomersWithEmail.Records.Any(existingCustomer => existingCustomer.Status != CustomerStatus.DELETED.ToString()))
if (existingCustomersWithEmail != null
&& existingCustomersWithEmail.Records.Any()
&& existingCustomersWithEmail.Records.Any(existingCustomer => existingCustomer.Status != CustomerStatus.DELETED.ToString()))
{
throw new CustomErrorsException(NexusErrorCodes.ExistingProperty.ToString(), customer.Email, Constants.NexusErrorMessages.ExistingEmail);
}
Expand Down
62 changes: 36 additions & 26 deletions mobile/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,28 @@ import { appNavigationState } from "./src/config/config";
import FullScreenLoadingSpinner from "./src/components/FullScreenLoadingSpinner";
import { CustomerProvider } from "./src/context/CustomerContext";
import { Feather } from "@expo/vector-icons";
import * as Sentry from "sentry-expo";
import Constants from "expo-constants";
import { ToastProvider } from "./src/context/NotificationContext";
import { AppStateProvider } from './src/context/AppStateContext';
import { removeStoredData } from "./src/utils/functions";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { QPA_TOKEN_KEY } from "./src/auth/authStorageService";
import { SECURE_STORE_KEYS } from "./src/auth/types";

const prefix = Linking.createURL("/");
const queryClient = new QueryClient();

Sentry.init({
dsn: Constants.expoConfig?.extra?.SENTRY_DSN,
enableInExpoDevelopment:
Constants.expoConfig?.extra?.APP_ENV !== "development",
debug: Constants.expoConfig?.extra?.APP_ENV !== "development",
});
const APP_INSTALLED_KEY = 'APP_INSTALLED';

async function checkAppInstalled() {
const appInstalled = await AsyncStorage.getItem(APP_INSTALLED_KEY);
if (!appInstalled) {
await AsyncStorage.setItem(APP_INSTALLED_KEY, 'true');
// remove oid
await removeStoredData([SECURE_STORE_KEYS.OID, QPA_TOKEN_KEY.QPA_ACCESS_TOKEN, QPA_TOKEN_KEY.QPA_ID_TOKEN, QPA_TOKEN_KEY.QPA_REFRESH_TOKEN]);
}

return true;
}
export default function App() {
const [appReady, setAppReady] = useState(false);

Expand All @@ -43,23 +51,23 @@ export default function App() {
config: appNavigationState,
};

const loadFontsAsync = async() => {
await Font.loadAsync({
"Lato-Light": require("./assets/fonts/Lato-Light.ttf"),
"Lato-Regular": require("./assets/fonts/Lato-Regular.ttf"),
"Lato-Bold": require("./assets/fonts/Lato-Bold.ttf"),
});
await Font.loadAsync(FontAwesome5.font);
await Font.loadAsync(Ionicons.font);
await Font.loadAsync(Feather.font);
await checkAppInstalled();
setAppReady(true);
}
useEffect(() => {
async function loadFontsAsync() {
await Font.loadAsync({
"Lato-Light": require("./assets/fonts/Lato-Light.ttf"),
"Lato-Regular": require("./assets/fonts/Lato-Regular.ttf"),
"Lato-Bold": require("./assets/fonts/Lato-Bold.ttf"),
});
await Font.loadAsync(FontAwesome5.font);
await Font.loadAsync(Ionicons.font);
await Font.loadAsync(Feather.font);

setAppReady(true);
}

loadFontsAsync();
}, []);


if (!appReady) {
return null;
}
Expand All @@ -75,11 +83,13 @@ export default function App() {
>
<QueryClientProvider client={queryClient}>
<CustomerProvider>
<ToastProvider>
<ErrorBoundary>
<WelcomeStackNavigator />
</ErrorBoundary>
</ToastProvider>
<ToastProvider>
<ErrorBoundary>
<AppStateProvider>
<WelcomeStackNavigator />
</AppStateProvider>
</ErrorBoundary>
</ToastProvider>
</CustomerProvider>
</QueryClientProvider>
</NavigationContainer>
Expand Down
Loading

0 comments on commit 8b5807e

Please sign in to comment.