In the Policy type all connections are currently typed as required, when in reality only a subset of them is present in the actual data (only the already set up ones, basically). This creates a risk of runtime errors and forces type assertions across multiple files, mostly in tests. No actual errors have been spotted, but it's easy to introduce some without the TypeScript guardrail.
We should mark the type for Policy.connections as Partial, so that it accurately represents real data.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensify
In the
Policytype all connections are currently typed as required, when in reality only a subset of them is present in the actual data (only the already set up ones, basically). This creates a risk of runtime errors and forces type assertions across multiple files, mostly in tests. No actual errors have been spotted, but it's easy to introduce some without the TypeScript guardrail.We should mark the type for
Policy.connectionsasPartial, so that it accurately represents real data.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mallenexpensify