Skip to content

Commit

Permalink
Merge pull request #28906 from rezkiy37/feature/28759-new-report-consts
Browse files Browse the repository at this point in the history
[NoQA] Add the "auto reporting" and "submitted" state as const to the App
  • Loading branch information
mountiny authored Oct 9, 2023
2 parents 5fb236e + 9a8c446 commit e8c45cf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,21 +478,21 @@ const CONST = {
ACTIONS: {
LIMIT: 50,
TYPE: {
APPROVED: 'APPROVED',
ADDCOMMENT: 'ADDCOMMENT',
APPROVED: 'APPROVED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
CLOSED: 'CLOSED',
CREATED: 'CREATED',
SUBMITTED: 'SUBMITTED',
TASKEDITED: 'TASKEDITED',
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
MODIFIEDEXPENSE: 'MODIFIEDEXPENSE',
REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
REPORTPREVIEW: 'REPORTPREVIEW',
SUBMITTED: 'SUBMITTED',
TASKCANCELLED: 'TASKCANCELLED',
TASKCOMPLETED: 'TASKCOMPLETED',
TASKEDITED: 'TASKEDITED',
TASKREOPENED: 'TASKREOPENED',
REPORTPREVIEW: 'REPORTPREVIEW',
POLICYCHANGELOG: {
ADD_APPROVER_RULE: 'POLICYCHANGELOG_ADD_APPROVER_RULE',
ADD_CATEGORY: 'POLICYCHANGELOG_ADD_CATEGORY',
Expand Down Expand Up @@ -1172,6 +1172,14 @@ const CONST = {
AUDITOR: 'auditor',
USER: 'user',
},
AUTO_REPORTING_FREQUENCIES: {
IMMEDIATE: 'immediate',
WEEKLY: 'weekly',
SEMI_MONTHLY: 'semimonthly',
MONTHLY: 'monthly',
TRIP: 'trip',
MANUAL: 'manual',
},
ROOM_PREFIX: '#',
CUSTOM_UNIT_RATE_BASE_OFFSET: 100,
OWNER_EMAIL_FAKE: '_FAKE_',
Expand Down
5 changes: 5 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ type OriginalMessageAddComment = {
reactions?: Reaction[];
};
};
type OriginalMessageSubmitted = {
actionName: typeof CONST.REPORT.ACTIONS.TYPE.SUBMITTED;
originalMessage: unknown;
};

type OriginalMessageClosed = {
actionName: typeof CONST.REPORT.ACTIONS.TYPE.CLOSED;
Expand Down Expand Up @@ -127,6 +131,7 @@ type OriginalMessagePolicyTask = {
type OriginalMessage =
| OriginalMessageIOU
| OriginalMessageAddComment
| OriginalMessageSubmitted
| OriginalMessageClosed
| OriginalMessageCreated
| OriginalMessageRenamed
Expand Down
6 changes: 6 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ type Policy = {

/** Whether policy expense chats can be created and used on this policy. Enabled manually by CQ/JS snippet. Always true for free policies. */
isPolicyExpenseChatEnabled: boolean;

/** Whether the scheduled submit is enabled */
autoReporting: boolean;

/** The scheduled submit frequency set up on the this policy */
autoReportingFrequency: ValueOf<typeof CONST.POLICY.AUTO_REPORTING_FREQUENCIES>;
};

export default Policy;

0 comments on commit e8c45cf

Please sign in to comment.