Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
narefyev91 committed Aug 21, 2024
1 parent ee8ed54 commit 4441dc0
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ const ONYXKEYS = {
// Shared NVPs
/** Collection of objects where each object represents the owner of the workspace that is past due billing AND the user is a member of. */
SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END: 'sharedNVP_private_billingGracePeriodEnd_',
SHARED_NVP_PRIVATE_DOMAIN_MEMBER: 'sharedNVP_private_domain_member_',

/**
* Stores the card list for a given fundID and feed in the format: cards_<fundID>_<bankName>
Expand Down Expand Up @@ -749,6 +750,7 @@ type OnyxCollectionValuesMapping = {
[ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS]: OnyxTypes.PolicyConnectionSyncProgress;
[ONYXKEYS.COLLECTION.SNAPSHOT]: OnyxTypes.SearchResults;
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END]: OnyxTypes.BillingGraceEndPeriod;
[ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER]: OnyxTypes.CompanyCards;
[ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS]: OnyxTypes.ExpensifyCardSettings;
[ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST]: OnyxTypes.WorkspaceCardsList;
[ONYXKEYS.COLLECTION.EXPENSIFY_CARD_CONTINUOUS_RECONCILIATION_CONNECTION]: OnyxTypes.PolicyConnectionName;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/workspace/WorkspaceMoreFeaturesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
const policyID = policy?.id;
const workspaceAccountID = policy?.workspaceAccountID ?? -1;
const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID.toString()}${CONST.EXPENSIFY_CARD.BANK}`);
const [companyCardsList] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID.toString()}`);
const [isOrganizeWarningModalOpen, setIsOrganizeWarningModalOpen] = useState(false);
const [isIntegrateWarningModalOpen, setIsIntegrateWarningModalOpen] = useState(false);
const [isReportFieldsWarningModalOpen, setIsReportFieldsWarningModalOpen] = useState(false);
Expand Down Expand Up @@ -131,7 +132,7 @@ function WorkspaceMoreFeaturesPage({policy, route}: WorkspaceMoreFeaturesPagePro
subtitleTranslationKey: 'workspace.moreFeatures.companyCards.subtitle',
isActive: policy?.areCompanyCardsEnabled ?? false,
pendingAction: policy?.pendingFields?.areCompanyCardsEnabled,
disabled: !isEmptyObject(cardsList),
disabled: !isEmptyObject(companyCardsList),
action: (isEnabled: boolean) => {
if (!policyID) {
return;
Expand Down
41 changes: 41 additions & 0 deletions src/types/onyx/CompanyCards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/** Model of CompanyCard's Shared NVP record */
// TODO update information here during implementation Add Company Card flow
type CompanyCards = {
/** Company cards object */
companyCards: {
/** Company card info key */
cdfbmo: CompanyCardInfo;
};
/** Company cards nicknames */
companyCardNicknames: {
/** Company cards info key */
cdfbmo: string;
};
};
/**
* Model of company card information
*/
type CompanyCardInfo = {
/** Company card pending state */
pending: boolean;

/** Company card asr state */
asrEnabled: boolean;

/** Company card force reimbursable value */
forceReimbursable: string;

/** Company card liability type */
liabilityType: string;

/** Company card preferred policy */
preferredPolicy: string;

/** Company card report title format */
reportTitleFormat: string;

/** Company card statement period */
statementPeriodEndDay: string;
};

export default CompanyCards;
2 changes: 2 additions & 0 deletions src/types/onyx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type BlockedFromConcierge from './BlockedFromConcierge';
import type CancellationDetails from './CancellationDetails';
import type Card from './Card';
import type {CardList, IssueNewCard, WorkspaceCardsList} from './Card';
import type CompanyCards from './CompanyCards';
import type {CapturedLogs, Log} from './Console';
import type Credentials from './Credentials';
import type Currency from './Currency';
Expand Down Expand Up @@ -114,6 +115,7 @@ export type {
Credentials,
Currency,
CurrencyList,
CompanyCards,
CustomStatusDraft,
DismissedReferralBanners,
Download,
Expand Down

0 comments on commit 4441dc0

Please sign in to comment.