Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.42k stars 2.8k forks source link

[HOLD for payment 2024-07-24] [#Wave-Control - Add Sage Intacct] Settings Configuration in NewDot: Export #43534

Closed yuwenmemon closed 2 months ago

yuwenmemon commented 3 months ago

Tracking GH: https://github.com/Expensify/Expensify/issues/388780

Design doc section: https://docs.google.com/document/d/1k3ZFw8KB55yPUSCG6KYZlwpwEtmRt3eUshwxs7bZq5I/edit#heading=h.vn04szhrriv7


You will find in the following issue the pseudocode for the different flows. Use them as a guide in your implementation.

Export flow

Main page

function SageIntacctExportPage({policy}: WithPolicyProps) {
    const {export: exportConfig, pendingFields, errorFields} = policy?.connections?.intacct?.config ?? {};

    const currentSageIntacctOrganizationName = useMemo(() => getCurrentSageIntacctOrganizationName(policy ?? undefined), [policy]);

    const sections = useMemo(
        () => [
            {
                description: translate('workspace.sageIntacct.preferredExporter'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_PREFERRED_EXPORTER.getRoute(policyID)),
                title: exportConfig.exporter || translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.exporter,
                pendingAction: pendingFields?.export.exporter,
            },
            {
                description: translate('workspace.sageIntacct.exportDate'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_EXPORT_DATE.getRoute(policyID)),
                title: translate('workspace.sageIntacct.exportDate'),
                hasError: !!errorFields?.export.exportDate,
                pendingAction: pendingFields?.export.exportDate,
            },
            {
                description: translate('workspace.sageIntacct.exportReimbursableExpensesAs'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_REIMBURSABLE_EXPENSES.getRoute(policyID)),
                title: exportConfig.reimbursable ? translate(`workspace.accounting.reimbursable.${exportConfig.reimbursable}`) : translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.reimbursable,
                pendingAction: pendingFields?.export.reimbursable,
            },
            {
                description: translate('workspace.sageIntacct.exportNonReimbursableExpensesAs'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_NON_REIMBURSABLE_EXPENSES.getRoute(policyID)),
                title: exportConfig.nonReimbursable ? translate(`workspace.accounting.nonReimbursable.${exportConfig.nonReimbursable}`) : translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.nonReimbursable,
                pendingAction: pendingFields?.export.nonReimbursable,
            },
        ],
        [
        //... useMemo() dependencies
        ],
    );

    return (
        <ConnectionLayout
            displayName={SageIntacctExportPage.displayName}
            headerTitle="workspace.accounting.export"
            headerSubtitle={currentSageIntacctOrganizationName}
            accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
            policyID={policyID}
            featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
            contentContainerStyle={styles.pb2}
            titleStyle={styles.ph5}
            connectionName={CONST.POLICY.CONNECTIONS.NAME.SAGE_INTACCT}
        >
                    <Text style={[styles.ph5, styles.pb5]}>{translate('workspace.sageIntacct.exportDescription')}</Text>
            {sections.map((section) => (
                <OfflineWithFeedback key={section.description} pendingAction={section.pendingAction}>
                    <MenuItemWithTopDescription
                        title={section.title}
                        description={section.description}
                        shouldShowRightIcon
                        onPress={section.action}
                        brickRoadIndicator={section.hasError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
                    />
                </OfflineWithFeedback>
            ))}
        </ConnectionLayout>
    );
}

SageIntacctExportPage.displayName = 'PolicySageIntacctExportPage';

export default withPolicy(SageIntacctExportPage);
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017260ab59e4fe16a6
  • Upwork Job ID: 1800760782833912827
  • Last Price Increase: 2024-06-12
  • Automatic offers:
    • hungvu193 | Contributor | 102699116
Issue OwnerCurrent Issue Owner: @puneetlath
melvin-bot[bot] commented 3 months ago

Triggered auto assignment to @puneetlath (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

melvin-bot[bot] commented 3 months ago

:warning: It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time :warning:

melvin-bot[bot] commented 3 months ago

Job added to Upwork: https://www.upwork.com/jobs/~017260ab59e4fe16a6

melvin-bot[bot] commented 3 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External)

melvin-bot[bot] commented 3 months ago

Triggered auto assignment to Design team member for new feature review - @dannymcclain (NewFeature)

melvin-bot[bot] commented 3 months ago

Current assignee @s77rt is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 3 months ago

šŸ“£ @hungvu193 šŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role šŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review šŸ§‘ā€šŸ’» Keep in mind: Code of Conduct | Contributing šŸ“–

SzymczakJ commented 3 months ago

Hey! Iā€™m Jakub Szymczak from Software Mansion, an expert agency, and Iā€™d like to work on this issue! I might find somebody from SWM to help me with that, so in that case we can reassign. But in the meantime feel free to assign me šŸ˜„

SzymczakJ commented 3 months ago

Update: Haven't started working on it. I'll probably find somebody from Software Mansion to work on this.

hungvu193 commented 3 months ago

Cool. Still waiting for the PR...

war-in commented 3 months ago

Hi, I'm Marcin from Software Mansion, an expert agency, and I'd like to work on this issue :)

war-in commented 3 months ago

Small update here :) This is the draft PR I'll continue working on Monday. Currently, there are Preferred exporter and Date pages

hungvu193 commented 3 months ago

We probably need to wait for this one right? https://github.com/Expensify/App/issues/43532

war-in commented 3 months ago

Yes, I copied some stuff to make it work so we should wait šŸ‘

hungvu193 commented 3 months ago

Draft PR is up

war-in commented 3 months ago

I think PR is ready but I'm waiting for backend to test it throughly. @hungvu193 are there any updates on the backend PR for the export page? šŸ‘€

hungvu193 commented 3 months ago

I think @yuwenmemon or @NikkiWines can give you the BE update šŸ‘€

hungvu193 commented 3 months ago

I think PR is ready but I'm waiting for backend to test it throughly. @hungvu193 are there any updates on the backend PR for the export page? šŸ‘€

Did you get the answer via slack?

war-in commented 3 months ago

@hungvu193 Yes! All questions were answered :) tl;dr Backend for export is almost ready (or ready). I'll check that soon

hungvu193 commented 3 months ago

Awesome :)

yuwenmemon commented 3 months ago

Just merged the Export APIs they should be on staging on Monday

hungvu193 commented 3 months ago

PR will be ready for review today.

war-in commented 3 months ago

@hungvu193 I think we should split my export PR because it grows quickly (it's over 1000 lines already). I suggest adding offline and error states in a followup PR (I'll start working on it soon).

Please share your thoughts here šŸ™

hungvu193 commented 3 months ago

@hungvu193 I think we should split my export PR because it grows quickly (it's over 1000 lines already).

I suggest adding offline and error states in a followup PR (I'll start working on it soon).

Please share your thoughts here šŸ™

Yes please go ahead šŸ˜. Totally agree with you

war-in commented 3 months ago

Update:

hungvu193 commented 3 months ago

I'd suggest we should merge https://github.com/Expensify/App/pull/43776 first then test the API and other stuff in a follow PR (https://github.com/Expensify/App/pull/44739)

melvin-bot[bot] commented 2 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.7-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-24. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

hungvu193 commented 2 months ago

No payment needed for me here. Feel free to close this one.

puneetlath commented 2 months ago

Got it, thanks!