Skip to content

Commit

Permalink
Merge branch 'master' into receipt-mandatory-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
OmkarJ13 authored Oct 12, 2023
2 parents 29d8be8 + 4e75133 commit 099b96b
Show file tree
Hide file tree
Showing 72 changed files with 3,756 additions and 588 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ Please install node v14.17.2 or above via nvm.
- ionic serve -c `env_name`

# IMPORTANT
## before making any changes

- go to .git/hooks
- run in the shell - chmod +x pre-commit
- Note: It is to prevent keys from accidentally leaking.


## For setting environment variables

- Ping mobile app team for environment files
- Add them inside the environments folder
- Note: Do not make any changes to the environment.ts file - this is a template folder for creating configurations.
- Note: Do not make any changes to the environment.ts file - this is a template folder for creating configurations. Also, make sure not to put staging envs in this file.
- If you are getting errors like this:
```
Property 'LIVE_UPDATE_APP_VERSION' does not exist on type
'{ production: boolean; NAME: string; CLUSTER_DOMAIN: string; ROOT_URL: string; ROUTER_API_ENDPOINT: string;
ANDROID_CLIENT_ID: string; IP_FIND_KEY: string; GOOGLE_MAPS_API_KEY: string; FRESHCHAT_TOKEN: string;
SENTRY_DSN: string; REFINER_NPS_FORM_ID: string; }'
```
make sure you have the latest `environment.staging.ts` file.

## For creating pull requests

Expand Down
42 changes: 42 additions & 0 deletions src/app/core/mock-data/action-sheet-options.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,45 @@ export const expectedActionSheetButtonRes = [
handler: undefined,
},
];

export const expectedActionSheetButtonsWithMileage = [
{
text: 'Capture Receipt',
icon: 'assets/svg/fy-camera.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
{
text: 'Add Manually',
icon: 'assets/svg/fy-expense.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
{
text: 'Add Mileage',
icon: 'assets/svg/fy-mileage.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
];

export const expectedActionSheetButtonsWithPerDiem = [
{
text: 'Capture Receipt',
icon: 'assets/svg/fy-camera.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
{
text: 'Add Manually',
icon: 'assets/svg/fy-expense.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
{
text: 'Add Per Diem',
icon: 'assets/svg/fy-calendar.svg',
cssClass: 'capture-receipt',
handler: undefined,
},
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AddEditAdvanceRequestFormValue } from '../models/add-edit-advance-request-form-value.model';
import { recentlyUsedProjectRes } from './recently-used.data';

export const addEditAdvanceRequestFormValueData: AddEditAdvanceRequestFormValue = {
currencyObj: {
Expand All @@ -20,3 +21,8 @@ export const addEditAdvanceRequestFormValueData2: AddEditAdvanceRequestFormValue
project: null,
customFieldValues: [],
};

export const addEditAdvanceRequestFormValueData3: AddEditAdvanceRequestFormValue = {
...addEditAdvanceRequestFormValueData,
project: recentlyUsedProjectRes[0],
};
40 changes: 40 additions & 0 deletions src/app/core/mock-data/advance-request-custom-field-values.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { AdvanceRequestCustomFieldValues } from '../models/advance-request-custom-field-values.model';

export const advanceRequestCustomFieldValuesData: AdvanceRequestCustomFieldValues[] = [
{
id: 1302,
name: 'Phase',
value: 'Phase 1',
type: 'SELECT',
},
{
id: 1305,
name: 'BILLABLE',
value: true,
type: 'BOOLEAN',
},
{
id: 1304,
name: 'Arrival Date',
value: '2 Jan 2023',
type: 'DATE',
},
];

export const advanceRequestCustomFieldValuesData2: AdvanceRequestCustomFieldValues[] = [
{
id: 1302,
name: 'Phase',
value: 'Phase 1',
},
{
id: 1304,
name: 'Arrival Date',
value: '2023-1-2',
},
{
id: 1305,
name: 'BILLABLE',
value: true,
},
];
45 changes: 45 additions & 0 deletions src/app/core/mock-data/advance-requests-custom-fields.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,48 @@ export const advanceRequestCustomFieldData: AdvanceRequestsCustomFields[] = [
placeholder: '123',
},
];

export const advanceRequestCustomFieldData2: AdvanceRequestsCustomFields[] = [
{
id: 150,
org_id: 'orNVthTo2Zyo',
created_at: new Date('2022-10-30T23:07:03.385Z'),
updated_at: new Date('2022-10-30T23:07:03.385Z'),
type: 'BOOLEAN',
name: 'checking',
options: ['option1', 'option2'],
mandatory: false,
active: true,
added_by: 'ouX8dwsbLCLv',
last_updated_by: 'ouX8dwsbLCLv',
placeholder: null,
},
{
id: 142,
org_id: 'orNVthTo2Zyo',
created_at: new Date('2022-11-04T02:14:37.292Z'),
updated_at: new Date('2022-11-04T02:14:37.292Z'),
type: 'BOOLEAN',
name: 'Okay?',
options: null,
mandatory: false,
active: true,
added_by: 'ouX8dwsbLCLv',
last_updated_by: 'ouX8dwsbLCLv',
placeholder: null,
},
{
id: 144,
org_id: 'orNVthTo2Zyo',
created_at: new Date('2022-11-04T02:14:37.292Z'),
updated_at: new Date('2022-11-04T02:14:37.292Z'),
type: 'BOOLEAN',
name: 'Okay?',
options: null,
mandatory: false,
active: true,
added_by: 'ouX8dwsbLCLv',
last_updated_by: 'ouX8dwsbLCLv',
placeholder: null,
},
];
18 changes: 18 additions & 0 deletions src/app/core/mock-data/advance-requests.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,21 @@ export const checkPolicyAdvReqParam: AdvanceRequests = {
is_sent_back: null,
is_pulled_back: true,
};

export const advanceRequests2: Partial<AdvanceRequests> = {
...advanceRequests,
currency: 'USD',
amount: 130,
purpose: 'Test purpose',
project_id: 168826,
notes: 'Test notes',
source: 'MOBILE',
custom_field_values: null,
};

export const advanceRequests3: Partial<AdvanceRequests> = {
org_user_id: 'ouX8dwsbLCLv',
currency: 'GNF',
source: 'MOBILE',
created_at: new Date(),
};
4 changes: 4 additions & 0 deletions src/app/core/mock-data/allowed-expense-types.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const allowedExpenseTypes: Record<string, boolean> = {
mileage: true,
perDiem: true,
};
12 changes: 12 additions & 0 deletions src/app/core/mock-data/corporate-card-expense-unflattened.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ export const eCCCData2: CCCExpUnflattened = {
vendor: null,
},
};

export const eCCCData3: CCCExpUnflattened = {
...expectedECccResponse[0],
balance: {
transfer_settlement_id: 'setxPixUhOPVL',
},
flow: 'newCCCFlow',
ccce: {
...expectedECccResponse[0].ccce,
corporate_credit_card_account_number: '123456789',
},
};
31 changes: 31 additions & 0 deletions src/app/core/mock-data/expense-filters.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,34 @@ export const expenseFiltersData2: Partial<ExpenseFilters> = {
sortDir: 'asc',
splitExpense: 'YES',
};

export const expenseFiltersData3: Partial<ExpenseFilters> = {
state: 'custom',
date: 'Last Month',
customDateStart: new Date('2023-01-04'),
customDateEnd: new Date('2023-01-10'),
receiptsAttached: 'Yes',
type: ['Mileage'],
cardNumbers: ['1234', '2389'],
splitExpense: 'Yes',
};

export const expenseFiltersData4: Partial<ExpenseFilters> = {
...expenseFiltersData3,
customDateStart: undefined,
customDateEnd: undefined,
};

export const expenseFiltersData5: Partial<ExpenseFilters> = {
receiptsAttached: 'YES',
sortParam: 'tx_amount',
sortDir: 'desc',
splitExpense: 'YES',
};

export const expenseFiltersData6: Partial<ExpenseFilters> = {
receiptsAttached: 'YES',
sortParam: 'tx_txn_dt',
sortDir: 'asc',
splitExpense: 'YES',
};
61 changes: 59 additions & 2 deletions src/app/core/mock-data/file-object.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ export const fileObjectData5: FileObject = {
purpose: '',
};

export const thumbnailUrlMockData: FileObject[] = [
export const fileUrlMockData: FileObject[] = [
{
id: 'fiwJ0nQTBpYH',
purpose: 'THUMBNAILx200x200',
url: 'mock-url-1',
},
];
Expand Down Expand Up @@ -310,3 +309,61 @@ export const expectedFileData1 = [
thumbnail: 'thumbnail',
},
];

export const advanceRequestFileUrlData: FileObject[] = [
{
...fileObjectAdv1,
},
{
...fileObject7[0],
type: 'jpeg',
id: null,
},
];

export const expectedFileData2: FileObject[] = [
{
type: 'pdf',
url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.pdf',
thumbnail: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.pdf',
},
];

export const advanceRequestFileUrlData2: FileObject[] = [
{
...fileObjectAdv1,
id: null,
},
{
...fileObject7[0],
type: 'image',
id: null,
},
];

export const fileObject9: FileObject[] = [
{
id: 'fiV1gXpyCcbU',
org_user_id: 'ouX8dwsbLCLv',
created_at: new Date('2023-03-06T07:51:05.614Z'),
name: '000.jpeg',
s3url: '2023-03-06/orNVthTo2Zyo/receipts/fiV1gXpyCcbU.000.jpeg',
transaction_id: 'tx1vdITUXIzf',
invoice_id: null,
advance_request_id: null,
purpose: 'ORIGINAL',
password: null,
receipt_coordinates: null,
email_meta_data: null,
fyle_sub_url: '/api/files/fiV1gXpyCcbU/download',
},
];

export const fileObject10: FileObject[] = [
{
...fileObjectAdv1,
url: 'mockdownloadurl.png',
type: 'pdf',
thumbnail: 'src/assets/images/pdf-receipt-placeholder.png',
},
];
18 changes: 18 additions & 0 deletions src/app/core/mock-data/file.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ export const fileData2: File[] = [
fyle_sub_url: '/api/files/fiK7c69UDJNb/download',
},
];

export const fileData3: File[] = [
{
id: 'fiV1gXpyCcbU',
org_user_id: 'ouX8dwsbLCLv',
created_at: new Date('2023-03-06T07:51:05.614Z'),
name: '000.jpeg',
s3url: '2023-03-06/orNVthTo2Zyo/receipts/fiV1gXpyCcbU.000.jpeg',
transaction_id: 'tx1vdITUXIzf',
invoice_id: null,
advance_request_id: null,
purpose: 'ORIGINAL',
password: null,
receipt_coordinates: null,
email_meta_data: null,
fyle_sub_url: '/api/files/fiV1gXpyCcbU/download',
},
];
Loading

0 comments on commit 099b96b

Please sign in to comment.