Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Add connection types to policy object #36181

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ type DisabledFields = {
reimbursable?: boolean;
};

// These types are for the Integration connections for a policy (eg. Quickbooks, Xero, etc).
// This data is not yet used in the codebase which is why it is given a very generic type, but the data is being put into Onyx for future use.
// Once the data is being used, these types should be defined appropriately.
type ConnectionLastSync = Record<string, unknown>;
type ConnectionData = Record<string, unknown>;
type ConnectionConfig = Record<string, unknown>;
type Connection = {
lastSync?: ConnectionLastSync;
data: ConnectionData;
config: ConnectionConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will end up being quite different from integration to integration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for some context about that! Sounds like leaving it generic for now is a good approach.

};

type AutoReportingOffset = number | ValueOf<typeof CONST.POLICY.AUTO_REPORTING_OFFSET>;

type Policy = {
Expand Down Expand Up @@ -158,6 +170,9 @@ type Policy = {

/** ReportID of the announce room for this workspace */
chatReportIDAnnounce?: number;

/** All the integration connections attached to the policy */
connections?: Record<string, Connection>;
};

export default Policy;
Expand Down
Loading