From 42b22e0383afdfa5221f116b197eb2877834c085 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Wed, 13 Mar 2024 10:52:07 +0100
Subject: [PATCH 01/12] Initial config to workspace address page

---
 src/ROUTES.ts                                 |  4 +++
 src/SCREENS.ts                                |  1 +
 src/languages/en.ts                           |  1 +
 src/languages/es.ts                           |  1 +
 .../AppNavigator/ModalStackNavigators.tsx     |  1 +
 .../CENTRAL_PANE_TO_RHP_MAPPING.ts            |  2 +-
 src/libs/Navigation/linkingConfig/config.ts   |  3 ++
 src/libs/Navigation/types.ts                  |  1 +
 .../workspace/WorkspaceProfileAddressPage.tsx | 32 +++++++++++++++++++
 src/pages/workspace/WorkspaceProfilePage.tsx  | 17 ++++++++++
 10 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 src/pages/workspace/WorkspaceProfileAddressPage.tsx

diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index d9f0c6658a2b..2b27179db7a0 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -465,6 +465,10 @@ const ROUTES = {
         route: 'workspace/:policyID/profile',
         getRoute: (policyID: string) => `workspace/${policyID}/profile` as const,
     },
+    WORKSPACE_PROFILE_ADDRESS: {
+        route: 'workspace/:policyID/profile/address',
+        getRoute: (policyID: string) => `workspace/${policyID}/profile/address` as const,
+    },
     WORKSPACE_PROFILE_CURRENCY: {
         route: 'workspace/:policyID/profile/currency',
         getRoute: (policyID: string) => `workspace/${policyID}/profile/currency` as const,
diff --git a/src/SCREENS.ts b/src/SCREENS.ts
index a0e06b98da2b..b5c0040dd9f7 100644
--- a/src/SCREENS.ts
+++ b/src/SCREENS.ts
@@ -219,6 +219,7 @@ const SCREENS = {
         TAGS_SETTINGS: 'Tags_Settings',
         TAGS_EDIT: 'Tags_Edit',
         CURRENCY: 'Workspace_Profile_Currency',
+        ADDRESS: 'Workspace_Profile_Address',
         WORKFLOWS: 'Workspace_Workflows',
         WORKFLOWS_APPROVER: 'Workspace_Workflows_Approver',
         WORKFLOWS_AUTO_REPORTING_FREQUENCY: 'Workspace_Workflows_Auto_Reporting_Frequency',
diff --git a/src/languages/en.ts b/src/languages/en.ts
index ff91a4f6f205..9aeca12dd5d7 100755
--- a/src/languages/en.ts
+++ b/src/languages/en.ts
@@ -1984,6 +1984,7 @@ export default {
             currencyInputLabel: 'Default currency',
             currencyInputHelpText: 'All expenses on this workspace will be converted to this currency.',
             currencyInputDisabledText: "The default currency can't be changed because this workspace is linked to a USD bank account.",
+            addressInputLabel: 'Company address',
             save: 'Save',
             genericFailureMessage: 'An error occurred updating the workspace, please try again.',
             avatarUploadFailureMessage: 'An error occurred uploading the avatar, please try again.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index c21f46ed8853..9580ec8df535 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2009,6 +2009,7 @@ export default {
             currencyInputLabel: 'Moneda por defecto',
             currencyInputHelpText: 'Todas los gastos en este espacio de trabajo serán convertidos a esta moneda.',
             currencyInputDisabledText: 'La moneda predeterminada no se puede cambiar porque este espacio de trabajo está vinculado a una cuenta bancaria en USD.',
+            addressInputLabel: 'Dirección de la empresa',
             save: 'Guardar',
             genericFailureMessage: 'Se produjo un error al guardar el espacio de trabajo. Por favor, inténtalo de nuevo.',
             avatarUploadFailureMessage: 'No se pudo subir el avatar. Por favor, inténtalo de nuevo.',
diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
index d56e38564149..df67de82d635 100644
--- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
+++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx
@@ -249,6 +249,7 @@ const SettingsModalStackNavigator = createModalStackNavigator<SettingsNavigatorP
     [SCREENS.WORKSPACE.DESCRIPTION]: () => require('../../../pages/workspace/WorkspaceProfileDescriptionPage').default as React.ComponentType,
     [SCREENS.WORKSPACE.SHARE]: () => require('../../../pages/workspace/WorkspaceProfileSharePage').default as React.ComponentType,
     [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceProfileCurrencyPage').default as React.ComponentType,
+    [SCREENS.WORKSPACE.ADDRESS]: () => require('../../../pages/workspace/WorkspaceProfileAddressPage').default as React.ComponentType,
     [SCREENS.WORKSPACE.CATEGORY_SETTINGS]: () => require('../../../pages/workspace/categories/CategorySettingsPage').default as React.ComponentType,
     [SCREENS.WORKSPACE.CATEGORIES_SETTINGS]: () => require('../../../pages/workspace/categories/WorkspaceCategoriesSettingsPage').default as React.ComponentType,
     [SCREENS.WORKSPACE.MEMBER_DETAILS]: () => require('../../../pages/workspace/members/WorkspaceMemberDetailsPage').default as React.ComponentType,
diff --git a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts
index 743bf2e0cff1..f6fe75901848 100755
--- a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts
+++ b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts
@@ -2,7 +2,7 @@ import type {CentralPaneName} from '@libs/Navigation/types';
 import SCREENS from '@src/SCREENS';
 
 const CENTRAL_PANE_TO_RHP_MAPPING: Partial<Record<CentralPaneName, string[]>> = {
-    [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY, SCREENS.WORKSPACE.DESCRIPTION, SCREENS.WORKSPACE.SHARE],
+    [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY, SCREENS.WORKSPACE.ADDRESS, SCREENS.WORKSPACE.DESCRIPTION, SCREENS.WORKSPACE.SHARE],
     [SCREENS.WORKSPACE.REIMBURSE]: [SCREENS.WORKSPACE.RATE_AND_UNIT, SCREENS.WORKSPACE.RATE_AND_UNIT_RATE, SCREENS.WORKSPACE.RATE_AND_UNIT_UNIT],
     [SCREENS.WORKSPACE.MEMBERS]: [SCREENS.WORKSPACE.INVITE, SCREENS.WORKSPACE.INVITE_MESSAGE, SCREENS.WORKSPACE.MEMBER_DETAILS, SCREENS.WORKSPACE.MEMBER_DETAILS_ROLE_SELECTION],
     [SCREENS.WORKSPACE.WORKFLOWS]: [SCREENS.WORKSPACE.WORKFLOWS_APPROVER, SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY, SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_MONTHLY_OFFSET],
diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts
index 97d7650a9043..296ccc30ba69 100644
--- a/src/libs/Navigation/linkingConfig/config.ts
+++ b/src/libs/Navigation/linkingConfig/config.ts
@@ -249,6 +249,9 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
                         [SCREENS.WORKSPACE.CURRENCY]: {
                             path: ROUTES.WORKSPACE_PROFILE_CURRENCY.route,
                         },
+                        [SCREENS.WORKSPACE.ADDRESS]: {
+                            path: ROUTES.WORKSPACE_PROFILE_ADDRESS.route,
+                        },
                         [SCREENS.WORKSPACE.DESCRIPTION]: {
                             path: ROUTES.WORKSPACE_PROFILE_DESCRIPTION.route,
                         },
diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts
index 33e79b637cc4..1443a60f4b16 100644
--- a/src/libs/Navigation/types.ts
+++ b/src/libs/Navigation/types.ts
@@ -186,6 +186,7 @@ type SettingsNavigatorParamList = {
     [SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER_DATE]: undefined;
     [SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER_TIME]: undefined;
     [SCREENS.WORKSPACE.CURRENCY]: undefined;
+    [SCREENS.WORKSPACE.ADDRESS]: undefined;
     [SCREENS.WORKSPACE.NAME]: undefined;
     [SCREENS.WORKSPACE.DESCRIPTION]: undefined;
     [SCREENS.WORKSPACE.SHARE]: undefined;
diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
new file mode 100644
index 000000000000..80f9066040be
--- /dev/null
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -0,0 +1,32 @@
+import type {StackScreenProps} from '@react-navigation/stack';
+import React from 'react';
+import {Text, View} from 'react-native';
+import type {OnyxEntry} from 'react-native-onyx';
+import {withOnyx} from 'react-native-onyx';
+import ScreenWrapper from '@components/ScreenWrapper';
+import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
+import ONYXKEYS from '@src/ONYXKEYS';
+import type SCREENS from '@src/SCREENS';
+import type {PrivatePersonalDetails} from '@src/types/onyx';
+
+type WorkspaceProfileAddressPageOnyxProps = {
+    /** User's private personal details */
+    privatePersonalDetails: OnyxEntry<PrivatePersonalDetails>;
+};
+
+type WorkspaceProfileAddressPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.ADDRESS> & WorkspaceProfileAddressPageOnyxProps;
+
+function WorkspaceProfileAddressPage({privatePersonalDetails, route}: WorkspaceProfileAddressPageProps) {
+    return (
+        <ScreenWrapper
+            includeSafeAreaPaddingBottom={false}
+            testID={WorkspaceProfileAddressPage.displayName}
+        >
+            <Text>abc</Text>
+        </ScreenWrapper>
+    );
+}
+
+WorkspaceProfileAddressPage.displayName = 'WorkspaceProfileAddressPage';
+
+export default WorkspaceProfileAddressPage;
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index 9d90557b1d37..154708688fb0 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -50,7 +50,10 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
     const currencySymbol = currencyList?.[outputCurrency]?.symbol ?? '';
     const formattedCurrency = !isEmptyObject(policy) && !isEmptyObject(currencyList) ? `${outputCurrency} - ${currencySymbol}` : '';
 
+    const formattedAddress = 'abc';
+
     const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy?.id ?? '')), [policy?.id]);
+    const onPressAddress = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressName = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_NAME.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressDescription = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_DESCRIPTION.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressShare = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_SHARE.getRoute(policy?.id ?? '')), [policy?.id]);
@@ -186,6 +189,20 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
                                     </Text>
                                 </View>
                             </OfflineWithFeedback>
+                            <OfflineWithFeedback pendingAction={policy?.pendingFields?.generalSettings}>
+                                <View>
+                                    <MenuItemWithTopDescription
+                                        title={formattedAddress}
+                                        description={translate('workspace.editor.addressInputLabel')}
+                                        shouldShowRightIcon={!readOnly}
+                                        disabled={hasVBA ? true : readOnly}
+                                        wrapperStyle={styles.sectionMenuItemTopDescription}
+                                        onPress={onPressAddress}
+                                        shouldGreyOutWhenDisabled={false}
+                                        shouldUseDefaultCursorWhenDisabled
+                                    />
+                                </View>
+                            </OfflineWithFeedback>
                             {!readOnly && (
                                 <View style={[styles.flexRow, styles.mt6, styles.mnw120]}>
                                     <Button

From c001a15fbc39cda9230630fdeaa39bba87348d6a Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Fri, 15 Mar 2024 11:01:45 +0100
Subject: [PATCH 02/12] Create workspace address page and section in workspace
 profile

---
 src/libs/actions/Policy.ts                    |  9 +-
 .../workspace/WorkspaceProfileAddressPage.tsx | 95 ++++++++++++++++---
 src/pages/workspace/WorkspaceProfilePage.tsx  |  5 +-
 src/types/onyx/Policy.ts                      | 15 ++-
 4 files changed, 107 insertions(+), 17 deletions(-)

diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts
index 85572ebe04a7..5dfd342a9ebc 100644
--- a/src/libs/actions/Policy.ts
+++ b/src/libs/actions/Policy.ts
@@ -72,7 +72,7 @@ import type {
 } from '@src/types/onyx';
 import type {Errors, PendingAction} from '@src/types/onyx/OnyxCommon';
 import type {OriginalMessageJoinPolicyChangeLog} from '@src/types/onyx/OriginalMessage';
-import type {Attributes, CustomUnit, Rate, Unit} from '@src/types/onyx/Policy';
+import type {Attributes, CompanyAddress, CustomUnit, Rate, Unit} from '@src/types/onyx/Policy';
 import type {OnyxData} from '@src/types/onyx/Request';
 import type {EmptyObject} from '@src/types/utils/EmptyObject';
 import {isEmptyObject} from '@src/types/utils/EmptyObject';
@@ -1366,6 +1366,12 @@ function hideWorkspaceAlertMessage(policyID: string) {
     Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {alertMessage: ''});
 }
 
+function updateAddress(policyID: string, newAddress: CompanyAddress) {
+    Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {
+        address: newAddress,
+    });
+}
+
 function updateWorkspaceCustomUnitAndRate(policyID: string, currentCustomUnit: CustomUnit, newCustomUnit: NewCustomUnit, lastModified?: string) {
     if (!currentCustomUnit.customUnitID || !newCustomUnit?.customUnitID || !newCustomUnit.rates?.customUnitRateID) {
         return;
@@ -3247,6 +3253,7 @@ export {
     clearCustomUnitErrors,
     hideWorkspaceAlertMessage,
     deleteWorkspace,
+    updateAddress,
     updateWorkspaceCustomUnitAndRate,
     updateLastAccessedWorkspace,
     clearDeleteMemberError,
diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
index 80f9066040be..fb76ecaf9a89 100644
--- a/src/pages/workspace/WorkspaceProfileAddressPage.tsx
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -1,32 +1,101 @@
 import type {StackScreenProps} from '@react-navigation/stack';
-import React from 'react';
-import {Text, View} from 'react-native';
-import type {OnyxEntry} from 'react-native-onyx';
-import {withOnyx} from 'react-native-onyx';
+import React, {useCallback, useMemo, useState} from 'react';
+import AddressForm from '@components/AddressForm';
+import type {FormOnyxValues} from '@components/Form/types';
+import HeaderWithBackButton from '@components/HeaderWithBackButton';
 import ScreenWrapper from '@components/ScreenWrapper';
+import useLocalize from '@hooks/useLocalize';
+import Navigation from '@libs/Navigation/Navigation';
 import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
+import {updateAddress} from '@userActions/Policy';
+import type {Country} from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
 import type SCREENS from '@src/SCREENS';
-import type {PrivatePersonalDetails} from '@src/types/onyx';
+import type {CompanyAddress} from '@src/types/onyx/Policy';
+import type {WithPolicyProps} from './withPolicy';
+import withPolicy from './withPolicy';
 
-type WorkspaceProfileAddressPageOnyxProps = {
-    /** User's private personal details */
-    privatePersonalDetails: OnyxEntry<PrivatePersonalDetails>;
-};
+type WorkspaceProfileAddressPagePolicyProps = WithPolicyProps;
 
-type WorkspaceProfileAddressPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.ADDRESS> & WorkspaceProfileAddressPageOnyxProps;
+type WorkspaceProfileAddressPageProps = StackScreenProps<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.ADDRESS> & WorkspaceProfileAddressPagePolicyProps;
+
+function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps) {
+    const {translate} = useLocalize();
+    const address = useMemo(() => policy?.address, [policy]);
+    const [currentCountry, setCurrentCountry] = useState(address?.country);
+    const [street1, street2] = (address?.street ?? '').split('\n');
+    const [state, setState] = useState(address?.state);
+    const [city, setCity] = useState(address?.city);
+    const [zipcode, setZipcode] = useState(address?.zip);
+
+    const updatePolicyAddress = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.HOME_ADDRESS_FORM>) => {
+        if (!policy) {
+            return;
+        }
+        updateAddress(policy?.id, {
+            street: values.addressLine1?.trim() ?? '',
+            street2: values.addressLine2?.trim() ?? '',
+            city: values.city.trim(),
+            state: values.state.trim(),
+            zip: values?.zipPostCode?.trim().toUpperCase() ?? '',
+            country: values.country,
+        });
+    };
+
+    const handleAddressChange = useCallback((value: unknown, key: unknown) => {
+        const countryValue = value as Country | '';
+        const addressKey = key as keyof CompanyAddress;
+
+        if (addressKey !== 'country' && addressKey !== 'state' && addressKey !== 'city' && addressKey !== 'zip') {
+            return;
+        }
+        if (addressKey === 'country') {
+            setCurrentCountry(countryValue);
+            setState('');
+            setCity('');
+            setZipcode('');
+            return;
+        }
+        if (addressKey === 'state') {
+            setState(countryValue);
+            setCity('');
+            setZipcode('');
+            return;
+        }
+        if (addressKey === 'city') {
+            setCity(countryValue);
+            setZipcode('');
+            return;
+        }
+        setZipcode(countryValue);
+    }, []);
 
-function WorkspaceProfileAddressPage({privatePersonalDetails, route}: WorkspaceProfileAddressPageProps) {
     return (
         <ScreenWrapper
             includeSafeAreaPaddingBottom={false}
             testID={WorkspaceProfileAddressPage.displayName}
         >
-            <Text>abc</Text>
+            <HeaderWithBackButton
+                title={translate('workspace.editor.addressInputLabel')}
+                shouldShowBackButton
+                onBackButtonPress={() => Navigation.goBack()}
+            />
+            <AddressForm
+                formID={ONYXKEYS.FORMS.HOME_ADDRESS_FORM}
+                onSubmit={updatePolicyAddress}
+                submitButtonText={translate('common.save')}
+                city={city}
+                country={currentCountry}
+                onAddressChanged={handleAddressChange}
+                state={state}
+                street1={street1}
+                street2={street2}
+                zip={zipcode}
+            />
         </ScreenWrapper>
     );
 }
 
 WorkspaceProfileAddressPage.displayName = 'WorkspaceProfileAddressPage';
 
-export default WorkspaceProfileAddressPage;
+export default withPolicy(WorkspaceProfileAddressPage);
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index 154708688fb0..cc585e636828 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -50,7 +50,8 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
     const currencySymbol = currencyList?.[outputCurrency]?.symbol ?? '';
     const formattedCurrency = !isEmptyObject(policy) && !isEmptyObject(currencyList) ? `${outputCurrency} - ${currencySymbol}` : '';
 
-    const formattedAddress = 'abc';
+    const formattedAddress =
+        !isEmptyObject(policy) && !isEmptyObject(policy.address) ? `${policy.address.street}, ${policy.address.city}, ${policy.address.state} ${policy.address.zip}` : '';
 
     const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressAddress = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policy?.id ?? '')), [policy?.id]);
@@ -195,7 +196,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
                                         title={formattedAddress}
                                         description={translate('workspace.editor.addressInputLabel')}
                                         shouldShowRightIcon={!readOnly}
-                                        disabled={hasVBA ? true : readOnly}
+                                        disabled={readOnly}
                                         wrapperStyle={styles.sectionMenuItemTopDescription}
                                         onPress={onPressAddress}
                                         shouldGreyOutWhenDisabled={false}
diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts
index cf959194be5f..56b0e92cad9f 100644
--- a/src/types/onyx/Policy.ts
+++ b/src/types/onyx/Policy.ts
@@ -1,5 +1,6 @@
 import type {ValueOf} from 'type-fest';
 import type CONST from '@src/CONST';
+import type {Country} from '@src/CONST';
 import type * as OnyxCommon from './OnyxCommon';
 
 type Unit = 'mi' | 'km';
@@ -27,6 +28,15 @@ type CustomUnit = OnyxCommon.OnyxValueWithOfflineFeedback<{
     errors?: OnyxCommon.Errors;
 }>;
 
+type CompanyAddress = {
+    street: string;
+    street2?: string;
+    city: string;
+    state: string;
+    zip: string;
+    country: Country | '';
+};
+
 type DisabledFields = {
     defaultBillable?: boolean;
     reimbursable?: boolean;
@@ -208,6 +218,9 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback<
         /** The output currency for the policy */
         outputCurrency: string;
 
+        /** The address of the company */
+        address?: CompanyAddress;
+
         /** The URL for the policy avatar */
         avatar?: string;
 
@@ -353,4 +366,4 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback<
 
 export default Policy;
 
-export type {Unit, CustomUnit, Attributes, Rate, TaxRate, TaxRates, TaxRatesWithDefault, PendingJoinRequestPolicy};
+export type {Unit, CustomUnit, Attributes, Rate, TaxRate, TaxRates, TaxRatesWithDefault, PendingJoinRequestPolicy, CompanyAddress};

From 90bdc7eaefc08de2d0b7a097be4c6900424dea56 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Thu, 28 Mar 2024 08:35:01 +0100
Subject: [PATCH 03/12] Change workspace address page route & add beta
 visibility

---
 src/CONST.ts                                 |  1 +
 src/ROUTES.ts                                |  2 +-
 src/libs/Permissions.ts                      |  5 +++
 src/pages/workspace/WorkspaceProfilePage.tsx | 32 +++++++++++---------
 4 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/CONST.ts b/src/CONST.ts
index 47caa5e64a90..147c617802e0 100755
--- a/src/CONST.ts
+++ b/src/CONST.ts
@@ -335,6 +335,7 @@ const CONST = {
         TRACK_EXPENSE: 'trackExpense',
         P2P_DISTANCE_REQUESTS: 'p2pDistanceRequests',
         WORKFLOWS_DELAYED_SUBMISSION: 'workflowsDelayedSubmission',
+        SPOTNANA_TRAVEL: 'spotnanaTravel',
         ACCOUNTING_ON_NEW_EXPENSIFY: 'accountingOnNewExpensify',
     },
     BUTTON_STATES: {
diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index 367bbf1426d0..ed63cc2a1489 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -453,7 +453,7 @@ const ROUTES = {
         getRoute: (policyID: string) => `settings/workspaces/${policyID}/profile` as const,
     },
     WORKSPACE_PROFILE_ADDRESS: {
-        route: 'workspace/:policyID/profile/address',
+        route: 'settings/workspaces/:policyID/profile/address',
         getRoute: (policyID: string) => `workspace/${policyID}/profile/address` as const,
     },
     WORKSPACE_PROFILE_CURRENCY: {
diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts
index effec73f10a9..20672fad0b6c 100644
--- a/src/libs/Permissions.ts
+++ b/src/libs/Permissions.ts
@@ -38,6 +38,10 @@ function canUseWorkflowsDelayedSubmission(betas: OnyxEntry<Beta[]>): boolean {
     return !!betas?.includes(CONST.BETAS.WORKFLOWS_DELAYED_SUBMISSION) || canUseAllBetas(betas);
 }
 
+function canUseSpotnanaTravel(betas: OnyxEntry<Beta[]>): boolean {
+    return !!betas?.includes(CONST.BETAS.SPOTNANA_TRAVEL) || canUseAllBetas(betas);
+}
+
 function canUseAccountingIntegrations(betas: OnyxEntry<Beta[]>): boolean {
     return !!betas?.includes(CONST.BETAS.ACCOUNTING_ON_NEW_EXPENSIFY) || canUseAllBetas(betas);
 }
@@ -59,5 +63,6 @@ export default {
     canUseReportFields,
     canUseP2PDistanceRequests,
     canUseWorkflowsDelayedSubmission,
+    canUseSpotnanaTravel,
     canUseAccountingIntegrations,
 };
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index ae99b41ef53c..f329323d2583 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -16,6 +16,7 @@ import Section from '@components/Section';
 import Text from '@components/Text';
 import useActiveWorkspace from '@hooks/useActiveWorkspace';
 import useLocalize from '@hooks/useLocalize';
+import usePermissions from '@hooks/usePermissions';
 import useThemeIllustrations from '@hooks/useThemeIllustrations';
 import useThemeStyles from '@hooks/useThemeStyles';
 import useWindowDimensions from '@hooks/useWindowDimensions';
@@ -50,6 +51,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
     const {isSmallScreenWidth} = useWindowDimensions();
     const illustrations = useThemeIllustrations();
     const {activeWorkspaceID, setActiveWorkspaceID} = useActiveWorkspace();
+    const {canUseSpotnanaTravel} = usePermissions();
 
     const outputCurrency = policy?.outputCurrency ?? '';
     const currencySymbol = currencyList?.[outputCurrency]?.symbol ?? '';
@@ -216,20 +218,22 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
                                 </Text>
                             </View>
                         </OfflineWithFeedback>
-                        <OfflineWithFeedback pendingAction={policy?.pendingFields?.generalSettings}>
-                            <View>
-                                <MenuItemWithTopDescription
-                                    title={formattedAddress}
-                                    description={translate('workspace.editor.addressInputLabel')}
-                                    shouldShowRightIcon={!readOnly}
-                                    disabled={readOnly}
-                                    wrapperStyle={styles.sectionMenuItemTopDescription}
-                                    onPress={onPressAddress}
-                                    shouldGreyOutWhenDisabled={false}
-                                    shouldUseDefaultCursorWhenDisabled
-                                />
-                            </View>
-                        </OfflineWithFeedback>
+                        {canUseSpotnanaTravel ?? (
+                            <OfflineWithFeedback pendingAction={policy?.pendingFields?.generalSettings}>
+                                <View>
+                                    <MenuItemWithTopDescription
+                                        title={formattedAddress}
+                                        description={translate('workspace.editor.addressInputLabel')}
+                                        shouldShowRightIcon={!readOnly}
+                                        disabled={readOnly}
+                                        wrapperStyle={styles.sectionMenuItemTopDescription}
+                                        onPress={onPressAddress}
+                                        shouldGreyOutWhenDisabled={false}
+                                        shouldUseDefaultCursorWhenDisabled
+                                    />
+                                </View>
+                            </OfflineWithFeedback>
+                        )}
                         {!readOnly && (
                             <View style={[styles.flexRow, styles.mt6, styles.mnw120]}>
                                 <Button

From 28c66fc561b4e6f60d69d144ea044f68106327fa Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Thu, 28 Mar 2024 14:30:38 +0100
Subject: [PATCH 04/12] Fix workspace address page routing

---
 src/ROUTES.ts                                                   | 2 +-
 src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index ed63cc2a1489..204dfb3cdb64 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -454,7 +454,7 @@ const ROUTES = {
     },
     WORKSPACE_PROFILE_ADDRESS: {
         route: 'settings/workspaces/:policyID/profile/address',
-        getRoute: (policyID: string) => `workspace/${policyID}/profile/address` as const,
+        getRoute: (policyID: string) => `settings/workspace/${policyID}/profile/address` as const,
     },
     WORKSPACE_PROFILE_CURRENCY: {
         route: 'settings/workspaces/:policyID/profile/currency',
diff --git a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts
index 1247933701a8..d67b82ab4941 100755
--- a/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts
+++ b/src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts
@@ -2,7 +2,7 @@ import type {FullScreenName} from '@libs/Navigation/types';
 import SCREENS from '@src/SCREENS';
 
 const FULL_SCREEN_TO_RHP_MAPPING: Partial<Record<FullScreenName, string[]>> = {
-    [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY, SCREENS.WORKSPACE.DESCRIPTION, SCREENS.WORKSPACE.SHARE],
+    [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.ADDRESS, SCREENS.WORKSPACE.CURRENCY, SCREENS.WORKSPACE.DESCRIPTION, SCREENS.WORKSPACE.SHARE],
     [SCREENS.WORKSPACE.REIMBURSE]: [SCREENS.WORKSPACE.RATE_AND_UNIT, SCREENS.WORKSPACE.RATE_AND_UNIT_RATE, SCREENS.WORKSPACE.RATE_AND_UNIT_UNIT],
     [SCREENS.WORKSPACE.MEMBERS]: [
         SCREENS.WORKSPACE.INVITE,

From 4fdbaba6bbcfd46b38e9cbb3bf11a7f0f425211b Mon Sep 17 00:00:00 2001
From: Wojciech Boman <wojciechboman@gmail.com>
Date: Thu, 28 Mar 2024 16:35:33 +0100
Subject: [PATCH 05/12] Fix diff in routes to address page and checking beta

---
 src/ROUTES.ts                                | 2 +-
 src/pages/workspace/WorkspaceProfilePage.tsx | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index 204dfb3cdb64..429fa92b690f 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -454,7 +454,7 @@ const ROUTES = {
     },
     WORKSPACE_PROFILE_ADDRESS: {
         route: 'settings/workspaces/:policyID/profile/address',
-        getRoute: (policyID: string) => `settings/workspace/${policyID}/profile/address` as const,
+        getRoute: (policyID: string) => `settings/workspaces/${policyID}/profile/address` as const,
     },
     WORKSPACE_PROFILE_CURRENCY: {
         route: 'settings/workspaces/:policyID/profile/currency',
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index f329323d2583..8d1ee6d4d4d1 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -218,7 +218,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
                                 </Text>
                             </View>
                         </OfflineWithFeedback>
-                        {canUseSpotnanaTravel ?? (
+                        {canUseSpotnanaTravel && (
                             <OfflineWithFeedback pendingAction={policy?.pendingFields?.generalSettings}>
                                 <View>
                                     <MenuItemWithTopDescription

From 352478c6eb477b7ba6c84fc3bd8c1e143d89a99d Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Tue, 16 Apr 2024 15:28:00 +0200
Subject: [PATCH 06/12] Go back after submitting address form

---
 src/pages/workspace/WorkspaceProfileAddressPage.tsx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
index fb76ecaf9a89..0baa21908266 100644
--- a/src/pages/workspace/WorkspaceProfileAddressPage.tsx
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -40,6 +40,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
             zip: values?.zipPostCode?.trim().toUpperCase() ?? '',
             country: values.country,
         });
+        Navigation.goBack();
     };
 
     const handleAddressChange = useCallback((value: unknown, key: unknown) => {

From 7d25e4d29b8f1bd149606de7e55a0be1cad66619 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Tue, 23 Apr 2024 15:45:06 +0200
Subject: [PATCH 07/12] Change translations

---
 src/languages/en.ts                                 | 1 -
 src/languages/es.ts                                 | 1 -
 src/pages/workspace/WorkspaceProfileAddressPage.tsx | 2 +-
 src/pages/workspace/WorkspaceProfilePage.tsx        | 2 +-
 4 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/languages/en.ts b/src/languages/en.ts
index b39953d1f5e5..fcb683472215 100755
--- a/src/languages/en.ts
+++ b/src/languages/en.ts
@@ -2255,7 +2255,6 @@ export default {
             currencyInputLabel: 'Default currency',
             currencyInputHelpText: 'All expenses on this workspace will be converted to this currency.',
             currencyInputDisabledText: "The default currency can't be changed because this workspace is linked to a USD bank account.",
-            addressInputLabel: 'Company address',
             save: 'Save',
             genericFailureMessage: 'An error occurred updating the workspace, please try again.',
             avatarUploadFailureMessage: 'An error occurred uploading the avatar, please try again.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index ab8cb2353d09..57de4057e775 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2283,7 +2283,6 @@ export default {
             currencyInputLabel: 'Moneda por defecto',
             currencyInputHelpText: 'Todas los gastos en este espacio de trabajo serán convertidos a esta moneda.',
             currencyInputDisabledText: 'La moneda predeterminada no se puede cambiar porque este espacio de trabajo está vinculado a una cuenta bancaria en USD.',
-            addressInputLabel: 'Dirección de la empresa',
             save: 'Guardar',
             genericFailureMessage: 'Se produjo un error al guardar el espacio de trabajo. Por favor, inténtalo de nuevo.',
             avatarUploadFailureMessage: 'No se pudo subir el avatar. Por favor, inténtalo de nuevo.',
diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
index 0baa21908266..3dc6e2b4cb98 100644
--- a/src/pages/workspace/WorkspaceProfileAddressPage.tsx
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -77,7 +77,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
             testID={WorkspaceProfileAddressPage.displayName}
         >
             <HeaderWithBackButton
-                title={translate('workspace.editor.addressInputLabel')}
+                title={translate('common.companyAddress')}
                 shouldShowBackButton
                 onBackButtonPress={() => Navigation.goBack()}
             />
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index b07fa130f454..feb81b161ed3 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -222,7 +222,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
                                 <View>
                                     <MenuItemWithTopDescription
                                         title={formattedAddress}
-                                        description={translate('workspace.editor.addressInputLabel')}
+                                        description={translate('common.companyAddress')}
                                         shouldShowRightIcon={!readOnly}
                                         disabled={readOnly}
                                         wrapperStyle={styles.sectionMenuItemTopDescription}

From 2bbf2d50b8495155a7632feeb4b03929856ab111 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Thu, 25 Apr 2024 14:14:56 +0200
Subject: [PATCH 08/12] First tries to call API

---
 .../parameters/UpdatePolicyAddressParams.ts   | 14 +++++++++
 src/libs/API/types.ts                         |  1 +
 src/libs/actions/Policy.ts                    | 29 +++++++++++++++++--
 3 files changed, 42 insertions(+), 2 deletions(-)
 create mode 100644 src/libs/API/parameters/UpdatePolicyAddressParams.ts

diff --git a/src/libs/API/parameters/UpdatePolicyAddressParams.ts b/src/libs/API/parameters/UpdatePolicyAddressParams.ts
new file mode 100644
index 000000000000..b4304bb707d7
--- /dev/null
+++ b/src/libs/API/parameters/UpdatePolicyAddressParams.ts
@@ -0,0 +1,14 @@
+type AddressData = {
+    addressStreet: string;
+    city: string;
+    country: string;
+    state: string;
+    zipCode: string;
+};
+
+type UpdatePolicyAddressParams = {
+    policyID: string;
+    data: AddressData[];
+};
+
+export type {UpdatePolicyAddressParams, AddressData};
diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts
index 7a40400b3826..ad9775400d2f 100644
--- a/src/libs/API/types.ts
+++ b/src/libs/API/types.ts
@@ -42,6 +42,7 @@ const WRITE_COMMANDS = {
     UPDATE_LEGAL_NAME: 'UpdateLegalName',
     UPDATE_DATE_OF_BIRTH: 'UpdateDateOfBirth',
     UPDATE_HOME_ADDRESS: 'UpdateHomeAddress',
+    UPDATE_POLICY_ADDRESS: 'SetPolicyAddress',
     UPDATE_AUTOMATIC_TIMEZONE: 'UpdateAutomaticTimezone',
     UPDATE_SELECTED_TIMEZONE: 'UpdateSelectedTimezone',
     UPDATE_USER_AVATAR: 'UpdateUserAvatar',
diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts
index c6621b926143..d8a553a81073 100644
--- a/src/libs/actions/Policy.ts
+++ b/src/libs/actions/Policy.ts
@@ -54,6 +54,7 @@ import type {
     UpdateWorkspaceGeneralSettingsParams,
     UpdateWorkspaceMembersRoleParams,
 } from '@libs/API/parameters';
+import type {AddressData, UpdatePolicyAddressParams} from '@libs/API/parameters/UpdatePolicyAddressParams';
 import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
 import DateUtils from '@libs/DateUtils';
 import * as ErrorUtils from '@libs/ErrorUtils';
@@ -1821,8 +1822,32 @@ function hideWorkspaceAlertMessage(policyID: string) {
 }
 
 function updateAddress(policyID: string, newAddress: CompanyAddress) {
-    Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {
-        address: newAddress,
+    const {street, street2, city, state, zip, country} = newAddress;
+
+    const data: AddressData = {
+        addressStreet: `${street}\n${street2}`,
+        city,
+        country,
+        state,
+        zipCode: zip,
+    };
+
+    const parameters: UpdatePolicyAddressParams = {
+        policyID,
+        data: [data],
+    };
+
+    const optimisticData: OnyxUpdate[] = [
+        {
+            onyxMethod: Onyx.METHOD.MERGE,
+            key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
+            value: {
+                address: newAddress,
+            },
+        },
+    ];
+    API.write(WRITE_COMMANDS.UPDATE_POLICY_ADDRESS, parameters, {
+        optimisticData,
     });
 }
 

From 63eefbc7dbe8ca0edd5ac95d3a758296f3b2a16d Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Fri, 26 Apr 2024 11:00:00 +0200
Subject: [PATCH 09/12] Comunicate frontend with backend

---
 .../parameters/UpdatePolicyAddressParams.ts   | 18 ++++++-------
 src/libs/actions/Policy.ts                    | 25 ++++++++++---------
 .../workspace/WorkspaceProfileAddressPage.tsx |  5 ++--
 src/pages/workspace/WorkspaceProfilePage.tsx  |  3 ++-
 4 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/src/libs/API/parameters/UpdatePolicyAddressParams.ts b/src/libs/API/parameters/UpdatePolicyAddressParams.ts
index b4304bb707d7..f362fbbed790 100644
--- a/src/libs/API/parameters/UpdatePolicyAddressParams.ts
+++ b/src/libs/API/parameters/UpdatePolicyAddressParams.ts
@@ -1,14 +1,12 @@
-type AddressData = {
-    addressStreet: string;
-    city: string;
-    country: string;
-    state: string;
-    zipCode: string;
-};
-
+// TODO: Change API endpoint parameters format to make it possible to follow naming-convention
+/* eslint-disable @typescript-eslint/naming-convention */
 type UpdatePolicyAddressParams = {
     policyID: string;
-    data: AddressData[];
+    'data[addressStreet]': string;
+    'data[city]': string;
+    'data[country]': string;
+    'data[state]': string;
+    'data[zipCode]': string;
 };
 
-export type {UpdatePolicyAddressParams, AddressData};
+export default UpdatePolicyAddressParams;
diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts
index d8a553a81073..ab75526f239c 100644
--- a/src/libs/actions/Policy.ts
+++ b/src/libs/actions/Policy.ts
@@ -54,7 +54,7 @@ import type {
     UpdateWorkspaceGeneralSettingsParams,
     UpdateWorkspaceMembersRoleParams,
 } from '@libs/API/parameters';
-import type {AddressData, UpdatePolicyAddressParams} from '@libs/API/parameters/UpdatePolicyAddressParams';
+import type UpdatePolicyAddressParams from '@libs/API/parameters/UpdatePolicyAddressParams';
 import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types';
 import DateUtils from '@libs/DateUtils';
 import * as ErrorUtils from '@libs/ErrorUtils';
@@ -1822,19 +1822,19 @@ function hideWorkspaceAlertMessage(policyID: string) {
 }
 
 function updateAddress(policyID: string, newAddress: CompanyAddress) {
-    const {street, street2, city, state, zip, country} = newAddress;
-
-    const data: AddressData = {
-        addressStreet: `${street}\n${street2}`,
-        city,
-        country,
-        state,
-        zipCode: zip,
-    };
-
+    // TODO: Change API endpoint parameters format to make it possible to follow naming-convention
     const parameters: UpdatePolicyAddressParams = {
         policyID,
-        data: [data],
+        // eslint-disable-next-line @typescript-eslint/naming-convention
+        'data[addressStreet]': newAddress.addressStreet,
+        // eslint-disable-next-line @typescript-eslint/naming-convention
+        'data[city]': newAddress.city,
+        // eslint-disable-next-line @typescript-eslint/naming-convention
+        'data[country]': newAddress.country,
+        // eslint-disable-next-line @typescript-eslint/naming-convention
+        'data[state]': newAddress.state,
+        // eslint-disable-next-line @typescript-eslint/naming-convention
+        'data[zipCode]': newAddress.zip,
     };
 
     const optimisticData: OnyxUpdate[] = [
@@ -1846,6 +1846,7 @@ function updateAddress(policyID: string, newAddress: CompanyAddress) {
             },
         },
     ];
+
     API.write(WRITE_COMMANDS.UPDATE_POLICY_ADDRESS, parameters, {
         optimisticData,
     });
diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
index 3dc6e2b4cb98..f34df76fc875 100644
--- a/src/pages/workspace/WorkspaceProfileAddressPage.tsx
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -23,7 +23,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
     const {translate} = useLocalize();
     const address = useMemo(() => policy?.address, [policy]);
     const [currentCountry, setCurrentCountry] = useState(address?.country);
-    const [street1, street2] = (address?.street ?? '').split('\n');
+    const [street1, street2] = (address?.addressStreet ?? '').split('\n');
     const [state, setState] = useState(address?.state);
     const [city, setCity] = useState(address?.city);
     const [zipcode, setZipcode] = useState(address?.zip);
@@ -33,8 +33,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
             return;
         }
         updateAddress(policy?.id, {
-            street: values.addressLine1?.trim() ?? '',
-            street2: values.addressLine2?.trim() ?? '',
+            addressStreet: `${values.addressLine1?.trim() ?? ''}\n${values.addressLine2?.trim() ?? ''}`,
             city: values.city.trim(),
             state: values.state.trim(),
             zip: values?.zipPostCode?.trim().toUpperCase() ?? '',
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index feb81b161ed3..19547ad5f94e 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -57,8 +57,9 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
     const currencySymbol = currencyList?.[outputCurrency]?.symbol ?? '';
     const formattedCurrency = !isEmptyObject(policy) && !isEmptyObject(currencyList) ? `${outputCurrency} - ${currencySymbol}` : '';
 
+    const [street1, street2] = (policy?.address?.addressStreet ?? '').split('\n');
     const formattedAddress =
-        !isEmptyObject(policy) && !isEmptyObject(policy.address) ? `${policy.address.street}, ${policy.address.city}, ${policy.address.state} ${policy.address.zip}` : '';
+        !isEmptyObject(policy) && !isEmptyObject(policy.address) ? `${street1.trim()}, ${street2.trim()}, ${policy.address.city}, ${policy.address.state} ${policy.address.zip}` : '';
 
     const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressAddress = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policy?.id ?? '')), [policy?.id]);

From d9ed6fc7f3c4e80a30d76dd6a71e3081e5a52687 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Fri, 26 Apr 2024 11:04:14 +0200
Subject: [PATCH 10/12] Street address line fix

---
 src/types/onyx/Policy.ts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts
index f218cc7bb8af..ede540544f7e 100644
--- a/src/types/onyx/Policy.ts
+++ b/src/types/onyx/Policy.ts
@@ -32,8 +32,7 @@ type CustomUnit = OnyxCommon.OnyxValueWithOfflineFeedback<{
 }>;
 
 type CompanyAddress = {
-    street: string;
-    street2?: string;
+    addressStreet: string;
     city: string;
     state: string;
     zip: string;

From 8d2fd832dab6aa91b3fd736ed108dec186d3b0c6 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Fri, 26 Apr 2024 12:02:43 +0200
Subject: [PATCH 11/12] Fix typecheck errors

---
 src/libs/API/parameters/index.ts | 1 +
 src/libs/API/types.ts            | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts
index d7af1fadee2d..8fcc26754294 100644
--- a/src/libs/API/parameters/index.ts
+++ b/src/libs/API/parameters/index.ts
@@ -64,6 +64,7 @@ export type {default as UpdateFrequentlyUsedEmojisParams} from './UpdateFrequent
 export type {default as UpdateGroupChatNameParams} from './UpdateGroupChatNameParams';
 export type {default as UpdateGroupChatMemberRolesParams} from './UpdateGroupChatMemberRolesParams';
 export type {default as UpdateHomeAddressParams} from './UpdateHomeAddressParams';
+export type {default as UpdatePolicyAddressParams} from './UpdatePolicyAddressParams';
 export type {default as UpdateLegalNameParams} from './UpdateLegalNameParams';
 export type {default as UpdateNewsletterSubscriptionParams} from './UpdateNewsletterSubscriptionParams';
 export type {default as UpdatePersonalInformationForBankAccountParams} from './UpdatePersonalInformationForBankAccountParams';
diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts
index 4cf1f1fafd63..5bb19208e2b5 100644
--- a/src/libs/API/types.ts
+++ b/src/libs/API/types.ts
@@ -243,6 +243,7 @@ type WriteCommandParameters = {
     [WRITE_COMMANDS.UPDATE_DISPLAY_NAME]: Parameters.UpdateDisplayNameParams;
     [WRITE_COMMANDS.UPDATE_LEGAL_NAME]: Parameters.UpdateLegalNameParams;
     [WRITE_COMMANDS.UPDATE_DATE_OF_BIRTH]: Parameters.UpdateDateOfBirthParams;
+    [WRITE_COMMANDS.UPDATE_POLICY_ADDRESS]: Parameters.UpdatePolicyAddressParams;
     [WRITE_COMMANDS.UPDATE_HOME_ADDRESS]: Parameters.UpdateHomeAddressParams;
     [WRITE_COMMANDS.UPDATE_AUTOMATIC_TIMEZONE]: Parameters.UpdateAutomaticTimezoneParams;
     [WRITE_COMMANDS.UPDATE_SELECTED_TIMEZONE]: Parameters.UpdateSelectedTimezoneParams;

From f7da8c4ca35e19642a9b6e7f95850679dfa027d1 Mon Sep 17 00:00:00 2001
From: smelaa <aleksandra.smela@gmail.com>
Date: Mon, 29 Apr 2024 13:09:32 +0200
Subject: [PATCH 12/12] Fix small bugs & address review comments

---
 src/libs/actions/Policy.ts                    |  2 +-
 .../workspace/WorkspaceProfileAddressPage.tsx | 21 ++++++++++++++-----
 src/pages/workspace/WorkspaceProfilePage.tsx  |  4 +++-
 src/types/onyx/Policy.ts                      |  2 +-
 4 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts
index 692685756e0d..118904e3ba0a 100644
--- a/src/libs/actions/Policy.ts
+++ b/src/libs/actions/Policy.ts
@@ -1833,7 +1833,7 @@ function updateAddress(policyID: string, newAddress: CompanyAddress) {
         // eslint-disable-next-line @typescript-eslint/naming-convention
         'data[state]': newAddress.state,
         // eslint-disable-next-line @typescript-eslint/naming-convention
-        'data[zipCode]': newAddress.zip,
+        'data[zipCode]': newAddress.zipCode,
     };
 
     const optimisticData: OnyxUpdate[] = [
diff --git a/src/pages/workspace/WorkspaceProfileAddressPage.tsx b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
index f34df76fc875..175a3611ef57 100644
--- a/src/pages/workspace/WorkspaceProfileAddressPage.tsx
+++ b/src/pages/workspace/WorkspaceProfileAddressPage.tsx
@@ -1,5 +1,5 @@
 import type {StackScreenProps} from '@react-navigation/stack';
-import React, {useCallback, useMemo, useState} from 'react';
+import React, {useCallback, useEffect, useMemo, useState} from 'react';
 import AddressForm from '@components/AddressForm';
 import type {FormOnyxValues} from '@components/Form/types';
 import HeaderWithBackButton from '@components/HeaderWithBackButton';
@@ -23,10 +23,10 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
     const {translate} = useLocalize();
     const address = useMemo(() => policy?.address, [policy]);
     const [currentCountry, setCurrentCountry] = useState(address?.country);
-    const [street1, street2] = (address?.addressStreet ?? '').split('\n');
+    const [[street1, street2], setStreets] = useState((address?.addressStreet ?? '').split('\n'));
     const [state, setState] = useState(address?.state);
     const [city, setCity] = useState(address?.city);
-    const [zipcode, setZipcode] = useState(address?.zip);
+    const [zipcode, setZipcode] = useState(address?.zipCode);
 
     const updatePolicyAddress = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.HOME_ADDRESS_FORM>) => {
         if (!policy) {
@@ -36,7 +36,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
             addressStreet: `${values.addressLine1?.trim() ?? ''}\n${values.addressLine2?.trim() ?? ''}`,
             city: values.city.trim(),
             state: values.state.trim(),
-            zip: values?.zipPostCode?.trim().toUpperCase() ?? '',
+            zipCode: values?.zipPostCode?.trim().toUpperCase() ?? '',
             country: values.country,
         });
         Navigation.goBack();
@@ -46,7 +46,7 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
         const countryValue = value as Country | '';
         const addressKey = key as keyof CompanyAddress;
 
-        if (addressKey !== 'country' && addressKey !== 'state' && addressKey !== 'city' && addressKey !== 'zip') {
+        if (addressKey !== 'country' && addressKey !== 'state' && addressKey !== 'city' && addressKey !== 'zipCode') {
             return;
         }
         if (addressKey === 'country') {
@@ -70,6 +70,17 @@ function WorkspaceProfileAddressPage({policy}: WorkspaceProfileAddressPageProps)
         setZipcode(countryValue);
     }, []);
 
+    useEffect(() => {
+        if (!address) {
+            return;
+        }
+        setStreets((address?.addressStreet ?? '').split('\n'));
+        setState(address.state);
+        setCurrentCountry(address.country);
+        setCity(address.city);
+        setZipcode(address.zipCode);
+    }, [address]);
+
     return (
         <ScreenWrapper
             includeSafeAreaPaddingBottom={false}
diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx
index 19547ad5f94e..223d7ea19402 100644
--- a/src/pages/workspace/WorkspaceProfilePage.tsx
+++ b/src/pages/workspace/WorkspaceProfilePage.tsx
@@ -59,7 +59,9 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
 
     const [street1, street2] = (policy?.address?.addressStreet ?? '').split('\n');
     const formattedAddress =
-        !isEmptyObject(policy) && !isEmptyObject(policy.address) ? `${street1.trim()}, ${street2.trim()}, ${policy.address.city}, ${policy.address.state} ${policy.address.zip}` : '';
+        !isEmptyObject(policy) && !isEmptyObject(policy.address)
+            ? `${street1?.trim()}, ${street2 ? `${street2.trim()}, ` : ''}${policy.address.city}, ${policy.address.state} ${policy.address.zipCode ?? ''}`
+            : '';
 
     const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy?.id ?? '')), [policy?.id]);
     const onPressAddress = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policy?.id ?? '')), [policy?.id]);
diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts
index f5c0cd3392c4..5aeb875f4bdc 100644
--- a/src/types/onyx/Policy.ts
+++ b/src/types/onyx/Policy.ts
@@ -35,7 +35,7 @@ type CompanyAddress = {
     addressStreet: string;
     city: string;
     state: string;
-    zip: string;
+    zipCode: string;
     country: Country | '';
 };
 
