Skip to content

Commit

Permalink
fix: migrated add-edit-expense.page to platform [2] (#2755)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshal141 authored Apr 15, 2024
1 parent bcf6604 commit 3a10e2a
Show file tree
Hide file tree
Showing 37 changed files with 460 additions and 606 deletions.
3 changes: 2 additions & 1 deletion src/app/core/mock-data/modal-controller.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { DateFilters } from 'src/app/shared/components/fy-filters/date-filters.e
import { FyAddToReportModalComponent } from 'src/app/shared/components/fy-add-to-report/fy-add-to-report-modal/fy-add-to-report-modal.component';
import { reportOptionsData } from './report-options.data';
import { expectedErpt } from './report-unflattened.data';
import { expectedReportsPaginated } from './platform-report.data';
import { FyInputPopoverComponent } from 'src/app/shared/components/fy-input-popover/fy-input-popover.component';
import { CaptureReceiptComponent } from 'src/app/shared/components/capture-receipt/capture-receipt.component';
import { FyViewAttachmentComponent } from 'src/app/shared/components/fy-view-attachment/fy-view-attachment.component';
Expand Down Expand Up @@ -353,7 +354,7 @@ export const addToReportModalControllerParams = {
component: FyAddToReportModalComponent,
componentProps: {
options: reportOptionsData,
currentSelection: expectedErpt[0],
currentSelection: expectedReportsPaginated[0],
selectionElement: undefined,
showNullOption: true,
cacheName: '',
Expand Down
216 changes: 114 additions & 102 deletions src/app/core/mock-data/option.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,120 +4,132 @@ export const optionData1: Option[] = [
{
label: 'report 1',
value: {
rp: {
id: 'rp5eUkeNm9wB',
org_user_id: 'ouCI4UQ2G0K1',
created_at: new Date('2023-01-21T07:45:18.869Z'),
purpose: '#7: Jan 2023',
currency: 'USD',
amount: 1348.09332,
tax: 1277.14,
state: 'APPROVER_PENDING',
source: 'MOBILE',
num_transactions: 1,
settlement_id: null,
approved_at: null,
reimbursed_at: null,
submitted_at: new Date('2023-01-21T07:45:23.282Z'),
verification_state: null,
trip_request_id: null,
physical_bill: false,
physical_bill_at: null,
exported: null,
manual_flag: false,
policy_flag: false,
claim_number: 'C/2023/01/R/42',
from_dt: null,
to_dt: null,
location1: null,
location2: null,
location3: null,
location4: null,
location5: null,
type: 'EXPENSE',
locations: [],
risk_state_expense_count: null,
risk_state: null,
amount: 1348.09332,
approvals: [],
created_at: new Date('2023-07-11T06:19:28.260142+00:00'),
currency: 'USD',
employee: {
ach_account: {
added: true,
verified: null,
},
business_unit:
'A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed',
code: null,
department: {
code: null,
display_name: '0000000 / arun',
id: 'dept7HJ9C4wvtX',
name: '0000000',
sub_department: 'arun',
},
department_id: 'dept7HJ9C4wvtX',
id: 'ouX8dwsbLCLv',
location: 'Mumbai',
org_id: 'orNVthTo2Zyo',
title: 'director',
user: {
email: '[email protected]',
full_name: 'Abhishek Jain',
id: 'usvKA4X8Ugcr',
},
user_id: 'usvKA4X8Ugcr',
},
ou: {
id: 'ouCI4UQ2G0K1',
org_id: 'orrjqbDbeP9p',
location: 'bangalore',
business_unit: null,
department: 'Primary Sales',
sub_department: 'Primary Sales',
mobile: null,
title: 'lion',
employee_id: 'A',
level: 123,
status: 'ACTIVE',
org_name: 'Fyle Staging',
department_id: 'deptSdAUA5Urej',
},
us: {
full_name: 'Abhishek Jain',
employee_id: 'ouX8dwsbLCLv',
id: 'rpMvN0P10l6F',
is_exported: false,
is_manually_flagged: false,
is_physical_bill_submitted: false,
is_policy_flagged: false,
is_verified: false,
last_approved_at: null,
last_paid_at: null,
last_resubmitted_at: null,
last_submitted_at: null,
next_approver_user_ids: null,
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: 'report 1',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
state: 'DRAFT',
state_display_name: 'Draft',
tax: 1277.14,
updated_at: new Date('2023-08-09T13:02:35.097839+00:00'),
user: {
email: '[email protected]',
full_name: 'Abhishek Jain',
id: 'usvKA4X8Ugcr',
},
user_id: 'usvKA4X8Ugcr',
},
selected: true,
},
{
label: 'report 2',
value: {
rp: {
id: 'rp72SaHM7Fbz',
org_user_id: 'ouCI4UQ2G0K1',
created_at: new Date('2023-01-21T07:45:18.858Z'),
purpose: '#7: Jan 2023',
currency: 'USD',
amount: 0,
tax: 0,
state: 'APPROVER_PENDING',
source: 'MOBILE',
num_transactions: 0,
settlement_id: null,
approved_at: null,
reimbursed_at: null,
submitted_at: new Date('2023-01-21T07:45:21.515Z'),
verification_state: null,
trip_request_id: null,
physical_bill: true,
physical_bill_at: new Date('2023-01-21T07:45:21.173Z'),
exported: null,
manual_flag: false,
policy_flag: false,
claim_number: 'C/2023/01/R/41',
from_dt: null,
to_dt: null,
location1: null,
location2: null,
location3: null,
location4: null,
location5: null,
type: 'EXPENSE',
locations: [],
risk_state_expense_count: null,
risk_state: null,
amount: 100,
approvals: [],
created_at: new Date('2023-07-11T06:19:28.260142+00:00'),
currency: 'USD',
employee: {
ach_account: {
added: true,
verified: null,
},
business_unit:
'A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed',
code: null,
department: {
code: null,
display_name: '0000000 / arun',
id: 'dept7HJ9C4wvtX',
name: '0000000',
sub_department: 'arun',
},
department_id: 'dept7HJ9C4wvtX',
id: 'ouX8dwsbLCLv',
location: 'Mumbai',
org_id: 'orNVthTo2Zyo',
title: 'director',
user: {
email: '[email protected]',
full_name: 'Abhishek Jain',
id: 'usvKA4X8Ugcr',
},
user_id: 'usvKA4X8Ugcr',
},
ou: {
id: 'ouCI4UQ2G0K1',
org_id: 'orrjqbDbeP9p',
location: 'bangalore',
business_unit: null,
department: 'Primary Sales',
sub_department: 'Primary Sales',
mobile: null,
title: 'lion',
employee_id: 'A',
level: 123,
status: 'ACTIVE',
org_name: 'Fyle Staging',
department_id: 'deptSdAUA5Urej',
},
us: {
full_name: 'Abhishek Jain',
employee_id: 'ouX8dwsbLCLv',
id: 'rpMvN0P10l6F',
is_exported: false,
is_manually_flagged: false,
is_physical_bill_submitted: false,
is_policy_flagged: false,
is_verified: false,
last_approved_at: null,
last_paid_at: null,
last_resubmitted_at: null,
last_submitted_at: null,
next_approver_user_ids: null,
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: 'report 2',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
state: 'DRAFT',
state_display_name: 'Draft',
tax: null,
updated_at: new Date('2023-08-09T13:02:35.097839+00:00'),
user: {
email: '[email protected]',
full_name: 'Abhishek Jain',
id: 'usvKA4X8Ugcr',
},
user_id: 'usvKA4X8Ugcr',
},
},
];
6 changes: 3 additions & 3 deletions src/app/core/mock-data/per-diem-form-value.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { currencyObjData6 } from './currency-obj.data';
import { projects } from './extended-projects.data';
import { orgCategoryData1 } from './org-category.data';
import { perDiemRatesData1 } from './per-diem-rates.data';
import { draftReportPerDiemData, expectedAddedApproverERpts } from './report-unflattened.data';
import { expectedReportsPaginated } from './platform-report.data';

export const perDiemFormValuesData1: Partial<PerDiemFormValue> = {
paymentMode: multiplePaymentModesData[0],
Expand Down Expand Up @@ -47,12 +47,12 @@ export const perDiemFormValuesData3: Partial<PerDiemFormValue> = {

export const perDiemFormValuesData4: Partial<PerDiemFormValue> = {
...perDiemFormValuesData1,
report: expectedAddedApproverERpts[0],
report: expectedReportsPaginated[0],
};

export const perDiemFormValuesData5: Partial<PerDiemFormValue> = {
...perDiemFormValuesData1,
report: draftReportPerDiemData[0],
report: expectedReportsPaginated[0],
};

export const perDiemFormValuesData6: Partial<PerDiemFormValue> = {
Expand Down
13 changes: 0 additions & 13 deletions src/app/core/mock-data/per-diem-reports.data.ts

This file was deleted.

28 changes: 15 additions & 13 deletions src/app/core/mock-data/platform-report.data.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { PlatformReport } from '../models/platform/platform-report.model';
import { Report } from '../models/platform/v1/report.model';
import { ReportsQueryParams } from '../models/platform/v1/reports-query-params.model';
import { PlatformApiResponse } from '../models/platform/platform-api-response.model';

export const mockQueryParams: ReportsQueryParams = {
state: 'in.(DRAFT,APPROVER_PENDING,APPROVER_INQUIRY)',
};

export const platformReportData: PlatformReport = {
export const platformReportData: Report = {
amount: 0,
approvals: [],
created_at: new Date('2023-07-11T06:19:28.260142+00:00'),
Expand Down Expand Up @@ -69,13 +69,13 @@ export const platformReportData: PlatformReport = {
user_id: 'usvKA4X8Ugcr',
};

export const platformReportCountData: PlatformApiResponse<PlatformReport> = {
export const platformReportCountData: PlatformApiResponse<Report> = {
count: 4,
data: [platformReportData],
offset: 0,
};

export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
export const allReportsPaginated1: PlatformApiResponse<Report> = {
count: 4,
data: [
{
Expand Down Expand Up @@ -111,7 +111,7 @@ export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
user_id: 'usvKA4X8Ugcr',
},
employee_id: 'ouX8dwsbLCLv',
id: 'rpMvN0P10l6F',
id: 'rprAfNrce73O',
is_exported: false,
is_manually_flagged: false,
is_physical_bill_submitted: false,
Expand All @@ -125,7 +125,7 @@ export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: '#3: Jul 2023 - Office expense',
purpose: '#8: Jan 2023',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
Expand Down Expand Up @@ -173,7 +173,7 @@ export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
user_id: 'usvKA4X8Ugcr',
},
employee_id: 'ouX8dwsbLCLv',
id: 'rpMvN0P10l6F',
id: 'rpLMyvYSXgJy',
is_exported: false,
is_manually_flagged: false,
is_physical_bill_submitted: false,
Expand All @@ -187,7 +187,7 @@ export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: '#3: Jul 2023 - Office expense',
purpose: '#7: Jan 2023',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
Expand All @@ -206,7 +206,7 @@ export const allReportsPaginated1: PlatformApiResponse<PlatformReport> = {
offset: 0,
};

export const allReportsPaginated2: PlatformApiResponse<PlatformReport> = {
export const allReportsPaginated2: PlatformApiResponse<Report> = {
count: 4,
data: [
{
Expand Down Expand Up @@ -256,7 +256,7 @@ export const allReportsPaginated2: PlatformApiResponse<PlatformReport> = {
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: '#3: Jul 2023 - Office expense',
purpose: '#6: Jan 2023',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
Expand Down Expand Up @@ -318,7 +318,7 @@ export const allReportsPaginated2: PlatformApiResponse<PlatformReport> = {
num_expenses: 0,
org_id: 'orNVthTo2Zyo',
physical_bill_submitted_at: null,
purpose: '#3: Jul 2023 - Office expense',
purpose: '#4: Jan 2023',
seq_num: 'C/2023/07/R/17',
settlement_id: null,
source: 'WEBAPP',
Expand All @@ -337,6 +337,8 @@ export const allReportsPaginated2: PlatformApiResponse<PlatformReport> = {
offset: 2,
};

export const expectedReportsSinglePage: PlatformReport[] = [...allReportsPaginated1.data];
export const expectedSingleReport: Report[] = [allReportsPaginated1.data[0]];

export const expectedReportsSinglePage: Report[] = [...allReportsPaginated1.data];

export const expectedReportsPaginated: PlatformReport[] = [...allReportsPaginated1.data, ...allReportsPaginated2.data];
export const expectedReportsPaginated: Report[] = [...allReportsPaginated1.data, ...allReportsPaginated2.data];
Loading

0 comments on commit 3a10e2a

Please sign in to comment.