Skip to content

[Due for payment 2025-09-19] Create a new OpenDuplicatePolicyPage command #69665

Closed

Description

@mountiny

When the RHP page to duplicate policy page is opened, we need to get the policy categories and tags that might not have been loaded before if the user did not visit those pages. #69146 (comment)

So, let's create a new API command named OpenDuplicatePolicyPage to meet the 1:1:1 philosophy goals. This command will return up-to-date policy data with categories and tags in its own collection.

Then we can call that single API when the user tries to duplicate some policy

Issue OwnerCurrent Issue Owner: @alexpensify

Activity

  1. added
    InternalRequires API changes or must be handled by Expensify staff
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 2, 2025
  2. melvin-bot commented on Sep 2, 2025

    @melvin-bot

    Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. moved this to Second Cohort - CRITICAL in [#whatsnext] #migrateon Sep 2, 2025
  4. stitesExpensify commented on Sep 2, 2025

    @stitesExpensify
    Contributor

    @mountiny @narefyev91 is this what you were expecting from the backend?

    [
        {
            "key": "policy_5C3633A00E07721C",
            "onyxMethod": "merge",
            "value": {
                "achAccount": null,
                "address": {},
                "approvalMode": "ADVANCED",
                "approver": "",
                "areCategoriesEnabled": true,
                "areCompanyCardsEnabled": false,
                "areConnectionsEnabled": false,
                "areDistanceRatesEnabled": true,
                "areExpensifyCardsEnabled": false,
                "areInvoicesEnabled": false,
                "arePerDiemRatesEnabled": false,
                "areReportFieldsEnabled": false,
                "areRulesEnabled": false,
                "areTagsEnabled": true,
                "areWorkflowsEnabled": true,
                "autoReimbursement": {
                    "limit": 0
                },
                "autoReimbursementLimit": 0,
                "autoReporting": false,
                "autoReportingFrequency": "immediate",
                "autoReportingOffset": 1,
                "avatarURL": "",
                "chatReportIDAdmins": 7846172291253249,
                "chatReportIDAnnounce": 0,
                "customUnits": {},
                "defaultBillable": false,
                "defaultReimbursable": false,
                "disabledFields": {},
                "exportLayouts": {},
                "harvesting": {
                    "enabled": false
                },
                "hasMultipleTagLists": false,
                "id": "5C3633A00E07721C",
                "isPolicyExpenseChatEnabled": false,
                "name": "1",
                "outputCurrency": "",
                "ownerAccountID": 6,
                "preventSelfApproval": false,
                "reimbursementChoice": "reimburseManual",
                "requiresCategory": false,
                "requiresTag": false,
                "role": "admin",
                "rules": {},
                "tax": {
                    "trackingEnabled": false
                },
                "technicalContact": "",
                "type": "team"
            }
        },
        {
            "key": "policyCategories_5C3633A00E07721C",
            "onyxMethod": "set",
            "value": {
                "Advertising": {
                    "enabled": true,
                    "name": "Advertising"
                },
                "Benefits": {
                    "enabled": true,
                    "name": "Benefits"
                },
                "Car": {
                    "enabled": true,
                    "name": "Car"
                },
                "Equipment": {
                    "enabled": true,
                    "name": "Equipment"
                },
                "Fees": {
                    "enabled": true,
                    "name": "Fees"
                },
                "Home Office": {
                    "enabled": true,
                    "name": "Home Office"
                },
                "Insurance": {
                    "enabled": true,
                    "name": "Insurance"
                },
                "Interest": {
                    "enabled": true,
                    "name": "Interest"
                },
                "Labor": {
                    "enabled": true,
                    "name": "Labor"
                },
                "Maintenance": {
                    "enabled": true,
                    "name": "Maintenance"
                },
                "Materials": {
                    "enabled": true,
                    "name": "Materials"
                },
                "Meals and Entertainment": {
                    "enabled": true,
                    "name": "Meals and Entertainment"
                },
                "Office Supplies": {
                    "enabled": true,
                    "name": "Office Supplies"
                },
                "Other": {
                    "enabled": true,
                    "name": "Other"
                },
                "Professional Services": {
                    "enabled": true,
                    "name": "Professional Services"
                },
                "Rent": {
                    "enabled": true,
                    "name": "Rent"
                },
                "Taxes": {
                    "enabled": true,
                    "name": "Taxes"
                },
                "Travel": {
                    "enabled": true,
                    "name": "Travel"
                },
                "Utilities": {
                    "enabled": true,
                    "name": "Utilities"
                }
            }
        },
        {
            "key": "policyTags_5C3633A00E07721C",
            "onyxMethod": "set",
            "value": {
                "Tag": {
                    "name": "Tag",
                    "orderWeight": 0,
                    "required": false,
                    "tags": {
                        "Cambodia": {
                            "enabled": true,
                            "name": "Cambodia"
                        },
                        "Indonesia": {
                            "enabled": true,
                            "name": "Indonesia"
                        },
                        "Italy": {
                            "enabled": true,
                            "name": "Italy"
                        },
                        "Spain": {
                            "enabled": true,
                            "name": "Spain"
                        },
                        "Thailand": {
                            "enabled": true,
                            "name": "Thailand"
                        },
                        "Uruguay": {
                            "enabled": true,
                            "name": "Uruguay"
                        },
                        "Vietnam": {
                            "enabled": true,
                            "name": "Vietnam"
                        }
                    }
                }
            }
        }
    ]
    
  5. narefyev91 commented on Sep 3, 2025

    @narefyev91
    Contributor

    @mountiny @narefyev91 is this what you were expecting from the backend?

    [
        {
            "key": "policy_5C3633A00E07721C",
            "onyxMethod": "merge",
            "value": {
                "achAccount": null,
                "address": {},
                "approvalMode": "ADVANCED",
                "approver": "",
                "areCategoriesEnabled": true,
                "areCompanyCardsEnabled": false,
                "areConnectionsEnabled": false,
                "areDistanceRatesEnabled": true,
                "areExpensifyCardsEnabled": false,
                "areInvoicesEnabled": false,
                "arePerDiemRatesEnabled": false,
                "areReportFieldsEnabled": false,
                "areRulesEnabled": false,
                "areTagsEnabled": true,
                "areWorkflowsEnabled": true,
                "autoReimbursement": {
                    "limit": 0
                },
                "autoReimbursementLimit": 0,
                "autoReporting": false,
                "autoReportingFrequency": "immediate",
                "autoReportingOffset": 1,
                "avatarURL": "",
                "chatReportIDAdmins": 7846172291253249,
                "chatReportIDAnnounce": 0,
                "customUnits": {},
                "defaultBillable": false,
                "defaultReimbursable": false,
                "disabledFields": {},
                "exportLayouts": {},
                "harvesting": {
                    "enabled": false
                },
                "hasMultipleTagLists": false,
                "id": "5C3633A00E07721C",
                "isPolicyExpenseChatEnabled": false,
                "name": "1",
                "outputCurrency": "",
                "ownerAccountID": 6,
                "preventSelfApproval": false,
                "reimbursementChoice": "reimburseManual",
                "requiresCategory": false,
                "requiresTag": false,
                "role": "admin",
                "rules": {},
                "tax": {
                    "trackingEnabled": false
                },
                "technicalContact": "",
                "type": "team"
            }
        },
        {
            "key": "policyCategories_5C3633A00E07721C",
            "onyxMethod": "set",
            "value": {
                "Advertising": {
                    "enabled": true,
                    "name": "Advertising"
                },
                "Benefits": {
                    "enabled": true,
                    "name": "Benefits"
                },
                "Car": {
                    "enabled": true,
                    "name": "Car"
                },
                "Equipment": {
                    "enabled": true,
                    "name": "Equipment"
                },
                "Fees": {
                    "enabled": true,
                    "name": "Fees"
                },
                "Home Office": {
                    "enabled": true,
                    "name": "Home Office"
                },
                "Insurance": {
                    "enabled": true,
                    "name": "Insurance"
                },
                "Interest": {
                    "enabled": true,
                    "name": "Interest"
                },
                "Labor": {
                    "enabled": true,
                    "name": "Labor"
                },
                "Maintenance": {
                    "enabled": true,
                    "name": "Maintenance"
                },
                "Materials": {
                    "enabled": true,
                    "name": "Materials"
                },
                "Meals and Entertainment": {
                    "enabled": true,
                    "name": "Meals and Entertainment"
                },
                "Office Supplies": {
                    "enabled": true,
                    "name": "Office Supplies"
                },
                "Other": {
                    "enabled": true,
                    "name": "Other"
                },
                "Professional Services": {
                    "enabled": true,
                    "name": "Professional Services"
                },
                "Rent": {
                    "enabled": true,
                    "name": "Rent"
                },
                "Taxes": {
                    "enabled": true,
                    "name": "Taxes"
                },
                "Travel": {
                    "enabled": true,
                    "name": "Travel"
                },
                "Utilities": {
                    "enabled": true,
                    "name": "Utilities"
                }
            }
        },
        {
            "key": "policyTags_5C3633A00E07721C",
            "onyxMethod": "set",
            "value": {
                "Tag": {
                    "name": "Tag",
                    "orderWeight": 0,
                    "required": false,
                    "tags": {
                        "Cambodia": {
                            "enabled": true,
                            "name": "Cambodia"
                        },
                        "Indonesia": {
                            "enabled": true,
                            "name": "Indonesia"
                        },
                        "Italy": {
                            "enabled": true,
                            "name": "Italy"
                        },
                        "Spain": {
                            "enabled": true,
                            "name": "Spain"
                        },
                        "Thailand": {
                            "enabled": true,
                            "name": "Thailand"
                        },
                        "Uruguay": {
                            "enabled": true,
                            "name": "Uruguay"
                        },
                        "Vietnam": {
                            "enabled": true,
                            "name": "Vietnam"
                        }
                    }
                }
            }
        }
    ]
    

    Yeah 100%

  6. 13 remaining items

  7. strepanier03 commented on Sep 19, 2025

    @strepanier03
    Contributor

    @stitesExpensify - Do we owe @narefyev91 a $250 payment here?

  8. melvin-bot commented on Sep 19, 2025

    @melvin-bot

    Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

  9. removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 20, 2025
  10. removed their assignment
    on Sep 20, 2025
  11. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 20, 2025
  12. melvin-bot commented on Sep 20, 2025

    @melvin-bot

    Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  13. strepanier03 commented on Sep 20, 2025

    @strepanier03
    Contributor

    I'm OoO 9/20-10/1 - Assigning a BZ buddy to handle any payment that is needed.

  14. alexpensify commented on Sep 23, 2025

    @alexpensify
    Contributor

    @stitesExpensify - can you please review Sheena's last question regarding payment? Thanks!

  15. stitesExpensify commented on Sep 23, 2025

    @stitesExpensify
    Contributor

    No @narefyev91 works for callstack

  16. alexpensify commented on Sep 23, 2025

    @alexpensify
    Contributor

    Payment Summary

    Contributor: @narefyev91 N/A part of an agency
    Contributor+: Internal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions