diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts deleted file mode 100644 index 048befa814..0000000000 --- a/src/app/core/core.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -@NgModule({ - declarations: [], - imports: [CommonModule], -}) -export class CoreModule {} diff --git a/src/app/core/mock-data/api-params.data.ts b/src/app/core/mock-data/api-params.data.ts index 07a29a3872..5cde10b266 100644 --- a/src/app/core/mock-data/api-params.data.ts +++ b/src/app/core/mock-data/api-params.data.ts @@ -2,24 +2,6 @@ import deepFreeze from 'deep-freeze-strict'; import { ReportApiParams } from '../models/report-api-params.model'; -export const getMyReportsParam1: ReportApiParams = deepFreeze({ - offset: 0, - limit: 2, - queryParams: { - rp_state: 'in.(DRAFT,APPROVER_PENDING,APPROVER_INQUIRY)', - }, - order: undefined, -}); - -export const getMyReportsParam2: ReportApiParams = deepFreeze({ - offset: 2, - limit: 2, - queryParams: { - rp_state: 'in.(DRAFT,APPROVER_PENDING,APPROVER_INQUIRY)', - }, - order: undefined, -}); - export const getTeamReportsParams1: ReportApiParams = deepFreeze({ offset: 0, limit: 10, diff --git a/src/app/core/mock-data/corporate-card-expense-flattened.data.ts b/src/app/core/mock-data/corporate-card-expense-flattened.data.ts deleted file mode 100644 index 95a1932065..0000000000 --- a/src/app/core/mock-data/corporate-card-expense-flattened.data.ts +++ /dev/null @@ -1,36 +0,0 @@ -import deepFreeze from 'deep-freeze-strict'; - -import { CCCExpFlattened } from '../models/corporate-card-expense-flattened.model'; - -export const eCCCApiResponse: CCCExpFlattened[] = deepFreeze([ - { - ccce_id: 'ccceYIJhT8Aj6U', - ccce_created_at: new Date('2021-03-26T09:29:14.586Z'), - ccce_updated_at: new Date('2022-01-07T11:53:53.588Z'), - ccce_txn_dt: new Date('2018-06-26T10:00:00.000Z'), - ccce_creator_id: null, - ccce_orig_currency: null, - ccce_orig_amount: null, - ccce_currency: 'USD', - ccce_amount: 30.98, - ccce_description: 'AMAZON.COM, SEATTLE, WA', - ccce_vendor: 'AMAZON.COM', - ccce_payment_id: 'pay4KzfYhLEvS', - ccce_state: 'IN_PROGRESS', - personal: false, - matched_by: 'ouX8dwsbLCLv', - matched_at: new Date('2022-01-07T11:53:52.588Z'), - tx_split_group_id: 'tx1FQMblw3XF', - tx_split_group_user_amount: null, - ccce_group_id: 'ccceYIJhT8Aj6U', - reversed: false, - bank_txn_id: 'btxnMy43OZokde', - ccce_card_or_account_number: '869', - ou_id: 'ouX8dwsbLCLv', - ou_org_id: 'orNVthTo2Zyo', - us_full_name: 'Abhishek Jain', - us_email: 'ajain@fyle.in', - ou_department_id: 'deptpmQ0SsMO0S', - tx_project_id: null, - }, -]); diff --git a/src/app/core/mock-data/etxn-params.data.ts b/src/app/core/mock-data/etxn-params.data.ts deleted file mode 100644 index 696ed4bb41..0000000000 --- a/src/app/core/mock-data/etxn-params.data.ts +++ /dev/null @@ -1,10 +0,0 @@ -import deepFreeze from 'deep-freeze-strict'; - -import { EtxnParams } from '../models/etxn-params.model'; - -export const etxnParamsData1: EtxnParams = deepFreeze({ - tx_org_user_id: 'eq.out3t2X258rd', - tx_state: 'in.(COMPLETE)', - or: '(tx_policy_amount.is.null,tx_policy_amount.gt.0.0001)', - tx_report_id: 'is.null', -}); diff --git a/src/app/core/mock-data/formatted-policy-violation.data.ts b/src/app/core/mock-data/formatted-policy-violation.data.ts deleted file mode 100644 index aea5561bbc..0000000000 --- a/src/app/core/mock-data/formatted-policy-violation.data.ts +++ /dev/null @@ -1,113 +0,0 @@ -import deepFreeze from 'deep-freeze-strict'; - -import { FormattedPolicyViolation } from '../models/formatted-policy-violation.model'; - -export const formattedPolicyViolation1: FormattedPolicyViolation = deepFreeze({ - rules: [ - 'The expense will be flagged, employee will be alerted, expense will be made unreportable and expense amount will be capped to the amount limit when expense amount in category 1 / chumma returns/1 / sd/1 / sub 123/aniruddha test / aniruddha sub/Food/Food / Travelling - Inland/Snacks/Stuff/te knklw/TEst Cateogory / 12 exceeds: INR 1000 and are fyled from Paid by Employee payment mode(s). ', - ], - action: { - final_desired_state: { - add_approver_user_ids: [], - amount: 0, - flag: true, - is_receipt_mandatory: false, - remove_employee_approver1: false, - run_status: 'SUCCESS', - run_summary: [ - 'expense will be flagged for verification and approval', - 'expense could not be added to a report or submitted', - ], - }, - individual_desired_states: [ - { - add_approver_user_ids: [], - amount: 0, - expense_policy_rule: { - action_show_warning: true, - description: - 'The expense will be flagged, employee will be alerted, expense will be made unreportable and expense amount will be capped to the amount limit when expense amount in category 1 / chumma returns/1 / sd/1 / sub 123/aniruddha test / aniruddha sub/Food/Food / Travelling - Inland/Snacks/Stuff/te knklw/TEst Cateogory / 12 exceeds: INR 1000 and are fyled from Paid by Employee payment mode(s). ', - id: 'tprNEIc03yOXB', - }, - expense_policy_rule_id: 'tprNEIc03yOXB', - run_result: [ - 'expense will be flagged for verification and approval', - 'expense could not be added to a report or submitted', - ], - run_status: 'VIOLATED_ACTION_SUCCESS', - }, - ], - }, - type: 'category', - name: '1 / chumma returns', - currency: 'INR', - amount: 240000, - isCriticalPolicyViolation: true, - isExpanded: false, -}); - -export const formattedPolicyViolation2: FormattedPolicyViolation = deepFreeze({ - rules: [ - 'The expense will be flagged, employee will be alerted, expense will be made unreportable and expense amount will be capped to the amount limit when expense amount in category 1 / chumma returns/1 / sd/1 / sub 123/aniruddha test / aniruddha sub/Food/Food / Travelling - Inland/Snacks/Stuff/te knklw/TEst Cateogory / 12 exceeds: INR 1000 and are fyled from Paid by Employee payment mode(s). ', - ], - action: { - final_desired_state: { - add_approver_user_ids: [], - amount: 0, - flag: true, - is_receipt_mandatory: true, - remove_employee_approver1: false, - run_status: 'SUCCESS', - run_summary: [ - 'expense will be flagged for verification and approval', - 'expense could not be added to a report or submitted', - ], - }, - individual_desired_states: [ - { - add_approver_user_ids: [], - amount: 0, - expense_policy_rule: { - action_show_warning: true, - description: - 'The expense will be flagged, employee will be alerted, expense will be made unreportable and expense amount will be capped to the amount limit when expense amount in category 1 / chumma returns/1 / sd/1 / sub 123/aniruddha test / aniruddha sub/Food/Food / Travelling - Inland/Snacks/Stuff/te knklw/TEst Cateogory / 12 exceeds: INR 1000 and are fyled from Paid by Employee payment mode(s). ', - id: 'tprNEIc03yOXB', - }, - expense_policy_rule_id: 'tprNEIc03yOXB', - run_result: [ - 'expense will be flagged for verification and approval', - 'expense could not be added to a report or submitted', - ], - run_status: 'VIOLATED_ACTION_SUCCESS', - }, - { - add_approver_user_ids: [], - amount: null, - expense_policy_rule: { - action_show_warning: true, - description: 'Receipt needed for expenses above INR 123', - id: 'tprZyt959EMyK', - }, - expense_policy_rule_id: 'tprZyt959EMyK', - run_result: ['expense will be flagged for verification and approval'], - run_status: 'VIOLATED_ACTION_SUCCESS', - }, - ], - }, - type: 'category', - name: '1 / sd', - currency: 'INR', - amount: 160000, - isCriticalPolicyViolation: true, - isExpanded: false, -}); - -export const formattedTxnViolations = deepFreeze({ - txc2KIogxUAy: formattedPolicyViolation1, - txgfkvuYteta: formattedPolicyViolation2, -}); - -export const formattedTxnViolations2 = deepFreeze({ - txc2KIogxUAy: { ...formattedPolicyViolation1, isCriticalPolicyViolation: false }, - txgfkvuYteta: { ...formattedPolicyViolation2, isCriticalPolicyViolation: false }, -}); diff --git a/src/app/core/mock-data/get-expenses-query-params-with-filters.data.ts b/src/app/core/mock-data/get-expenses-query-params-with-filters.data.ts index 873efc6470..43fe1a21f2 100644 --- a/src/app/core/mock-data/get-expenses-query-params-with-filters.data.ts +++ b/src/app/core/mock-data/get-expenses-query-params-with-filters.data.ts @@ -1,17 +1,6 @@ import deepFreeze from 'deep-freeze-strict'; - -import { GetExpensesQueryParamsWithFilters } from '../models/get-expenses-query-params-with-filters.model'; import { GetExpenseQueryParam } from '../models/platform/v1/get-expenses-query.model'; -export const expectedCurrentParams: Partial = deepFreeze({ - sortDir: 'asc', - queryParams: { - corporate_credit_card_account_number: 'in.(789)', - and: '(tx_txn_dt.gte.March,tx_txn_dt.lt.April)', - or: ['(tx_is_split_expense.eq.true)'], - }, -}); - export const expectedCurrentParamsWoFilterState: Partial = deepFreeze({ sortDir: 'asc', queryParams: { diff --git a/src/app/core/mock-data/policy-violation.data.ts b/src/app/core/mock-data/policy-violation.data.ts index a17d78e82d..1f46824a0c 100644 --- a/src/app/core/mock-data/policy-violation.data.ts +++ b/src/app/core/mock-data/policy-violation.data.ts @@ -1,7 +1,6 @@ import deepFreeze from 'deep-freeze-strict'; import { PolicyViolation } from '../models/policy-violation.model'; -import { PolicyViolationTxn } from '../models/policy-violation-txn.model'; export const policyViolation1: PolicyViolation = deepFreeze({ data: { final_desired_state: { @@ -55,11 +54,6 @@ export const splitPolicyExp3: PolicyViolation = deepFreeze({ type: 'category', }); -export const policyVoilationData2: PolicyViolationTxn = deepFreeze({ - txVHydZVrGYC: splitPolicyExp2, - tx4QhcvNHpuh: splitPolicyExp3, -}); - export const splitPolicyExp4: PolicyViolation = deepFreeze({ data: { final_desired_state: { @@ -150,16 +144,6 @@ export const splitPolicyExp5: PolicyViolation = deepFreeze({ type: 'category', }); -export const policyViolationData3: PolicyViolationTxn = deepFreeze({ - txc2KIogxUAy: splitPolicyExp4, - txgfkvuYteta: splitPolicyExp5, -}); - -export const policyViolationData4: PolicyViolationTxn = deepFreeze({ - txSEM4DtjyKR: splitPolicyExp4, - txNyI8ot5CuJ: splitPolicyExp5, -}); - export const policyViolationData5: PolicyViolation = deepFreeze({ amount: 122, currency: 'INR', diff --git a/src/app/core/mock-data/report-v1.data.ts b/src/app/core/mock-data/report-v1.data.ts deleted file mode 100644 index 0657ede8bf..0000000000 --- a/src/app/core/mock-data/report-v1.data.ts +++ /dev/null @@ -1,183 +0,0 @@ -import deepFreeze from 'deep-freeze-strict'; - -import { ReportV1 } from '../models/report-v1.model'; - -export const reportUnflattenedData: ReportV1 = deepFreeze({ - created_at: new Date('2023-01-19T16:25:46.804Z'), - updated_at: new Date('2023-01-19T16:25:46.804Z'), - last_updated_by: { - user_id: 'usvKA4X8Ugcr', - org_user_id: 'ouCI4UQ2G0K1', - org_id: 'orrjqbDbeP9p', - roles: ['APPROVER', 'ADMIN', 'FYLER', 'HOP', 'FINANCE', 'PAYMENT_PROCESSOR', 'VERIFIER', 'AUDITOR', 'OWNER'], - scopes: [], - allowed_cidrs: [], - cluster_domain: '"https://staging.fyle.tech"', - proxy_org_user_id: null, - tpa_id: null, - tpa_name: null, - name: 'ouCI4UQ2G0K1', - }, - id: 'rp6LK3ghVatB', - org_user_id: 'ouCI4UQ2G0K1', - purpose: '#6: Jan 2023', - currency: 'USD', - creator_id: 'ouCI4UQ2G0K1', - amount: 0, - tax: null, - status_id: null, - num_transactions: 0, - tally_export_id: null, - state: 'DRAFT', - source: 'MOBILE', - reimbursement_id: null, - approved_at: null, - reimbursed_at: null, - submitted_at: null, - verification_state: null, - trip_request_id: null, - exported: null, - manual_flag: null, - policy_flag: null, - claim_number: 'C/2023/01/R/35', - from_dt: null, - to_dt: null, - location1: null, - location2: null, - location3: null, - location4: null, - location5: null, - type: 'EXPENSE', -}); - -export const reportUnflattenedData2: ReportV1 = deepFreeze({ - created_at: new Date('2023-01-21T07:45:18.869Z'), - updated_at: new Date('2023-01-21T07:45:18.869Z'), - last_updated_by: { - user_id: 'usvKA4X8Ugcr', - org_user_id: 'ouCI4UQ2G0K1', - org_id: 'orrjqbDbeP9p', - roles: ['APPROVER', 'ADMIN', 'FYLER', 'HOP', 'FINANCE', 'PAYMENT_PROCESSOR', 'VERIFIER', 'AUDITOR', 'OWNER'], - scopes: [], - allowed_cidrs: [], - cluster_domain: '"https://staging.fyle.tech"', - proxy_org_user_id: null, - tpa_id: null, - tpa_name: null, - name: 'ouCI4UQ2G0K1', - }, - id: 'rp5eUkeNm9wB', - org_user_id: 'ouCI4UQ2G0K1', - purpose: '#7: Jan 2023', - currency: 'USD', - creator_id: 'ouCI4UQ2G0K1', - amount: 0, - tax: null, - status_id: null, - num_transactions: 0, - tally_export_id: null, - state: 'DRAFT', - source: 'MOBILE', - reimbursement_id: null, - approved_at: null, - reimbursed_at: null, - submitted_at: null, - verification_state: null, - trip_request_id: null, - exported: null, - manual_flag: null, - policy_flag: null, - 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', -}); - -export const apiEmptyReportRes: ReportV1 = deepFreeze({ - created_at: null, - updated_at: null, - last_updated_by: null, - id: null, - org_user_id: null, - purpose: ' #7: Jan 2023', - currency: null, - creator_id: null, - amount: null, - tax: null, - status_id: null, - num_transactions: null, - tally_export_id: null, - state: null, - source: null, - reimbursement_id: null, - approved_at: null, - reimbursed_at: null, - submitted_at: null, - verification_state: null, - trip_request_id: null, - exported: null, - manual_flag: null, - policy_flag: null, - claim_number: null, - from_dt: null, - to_dt: null, - location1: null, - location2: null, - location3: null, - location4: null, - location5: null, - type: null, -}); - -export const apiReportUpdatedDetails: ReportV1 = deepFreeze({ - created_at: new Date('2022-10-31T13:54:46.317Z'), - updated_at: new Date('2023-01-23T10:53:52.220Z'), - last_updated_by: { - user_id: 'usvKA4X8Ugcr', - org_user_id: 'ouX8dwsbLCLv', - org_id: 'orNVthTo2Zyo', - roles: ['ADMIN', 'APPROVER', 'FYLER', 'HOP', 'HOD', 'OWNER'], - scopes: [], - allowed_cidrs: [], - cluster_domain: '"https://staging.fyle.tech"', - proxy_org_user_id: null, - tpa_id: null, - tpa_name: null, - name: 'ouX8dwsbLCLv', - }, - id: 'rptkwzhsieIY', - org_user_id: 'ouX8dwsbLCLv', - purpose: 'My Testing Report', - currency: 'USD', - creator_id: 'ouX8dwsbLCLv', - amount: 46040, - tax: 101.29, - status_id: null, - num_transactions: 4, - tally_export_id: null, - state: 'DRAFT', - source: 'MOBILE', - reimbursement_id: null, - approved_at: null, - reimbursed_at: null, - submitted_at: null, - verification_state: null, - trip_request_id: null, - exported: false, - manual_flag: false, - policy_flag: false, - claim_number: 'C/2022/10/R/37', - from_dt: null, - to_dt: null, - location1: null, - location2: null, - location3: null, - location4: null, - location5: null, - type: 'EXPENSE', -}); diff --git a/src/app/core/models/split-expense-missing-fields.data.ts b/src/app/core/mock-data/split-expense-missing-fields.data.ts similarity index 54% rename from src/app/core/models/split-expense-missing-fields.data.ts rename to src/app/core/mock-data/split-expense-missing-fields.data.ts index 3d5517f9a0..afca2bc10c 100644 --- a/src/app/core/models/split-expense-missing-fields.data.ts +++ b/src/app/core/mock-data/split-expense-missing-fields.data.ts @@ -1,6 +1,7 @@ -import { SplitExpenseMissingFields } from './platform/v1/split-expense-missing-fields.model'; +import deepFreezeStrict from 'deep-freeze-strict'; +import { SplitExpenseMissingFields } from '../models/platform/v1/split-expense-missing-fields.model'; -export const SplitExpenseMissingFieldsData: SplitExpenseMissingFields = { +export const SplitExpenseMissingFieldsData: SplitExpenseMissingFields = deepFreezeStrict({ data: [ { missing_amount: false, @@ -9,4 +10,4 @@ export const SplitExpenseMissingFieldsData: SplitExpenseMissingFields = { missing_expense_field_ids: [], }, ], -}; +}); diff --git a/src/app/core/models/corporate-card-expense-flattened.model.ts b/src/app/core/models/corporate-card-expense-flattened.model.ts deleted file mode 100644 index 3ea06c556b..0000000000 --- a/src/app/core/models/corporate-card-expense-flattened.model.ts +++ /dev/null @@ -1,30 +0,0 @@ -export interface CCCExpFlattened { - ccce_id: string; - ccce_created_at: Date; - ccce_updated_at: Date; - ccce_txn_dt: Date; - ccce_creator_id: string; - ccce_orig_currency: string; - ccce_orig_amount: number; - ccce_currency: string; - ccce_amount: number; - ccce_description: string; - ccce_vendor: string; - ccce_payment_id: string; - ccce_state: string; - personal: boolean; - matched_by: string; - matched_at: Date; - tx_split_group_id: string; - tx_split_group_user_amount: number; - ccce_group_id: string; - reversed: boolean; - bank_txn_id: string; - ccce_card_or_account_number: string; - ou_id: string; - ou_org_id: string; - us_full_name: string; - us_email: string; - ou_department_id: string; - tx_project_id: string; -} diff --git a/src/app/core/models/etxn-params.model.ts b/src/app/core/models/etxn-params.model.ts deleted file mode 100644 index 12361bbd31..0000000000 --- a/src/app/core/models/etxn-params.model.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface EtxnParams { - tx_split_group_id?: string; - tx_org_user_id?: string; - tx_state?: string; - or?: string | string[]; - tx_report_id?: string; - order?: string; - scalar?: boolean; - tx_id?: string; -} diff --git a/src/app/core/models/formatted-policy-violation.model.ts b/src/app/core/models/formatted-policy-violation.model.ts deleted file mode 100644 index 620464672d..0000000000 --- a/src/app/core/models/formatted-policy-violation.model.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { FinalExpensePolicyState } from './platform/platform-final-expense-policy-state.model'; -import { IndividualExpensePolicyState } from './platform/platform-individual-expense-policy-state.model'; - -export interface FormattedPolicyViolation { - rules: string[]; - action: { - individual_desired_states: IndividualExpensePolicyState[]; - final_desired_state: FinalExpensePolicyState; - }; - type: string; - name: string; - currency: string; - amount: number; - isCriticalPolicyViolation: boolean; - isExpanded: boolean; -} diff --git a/src/app/core/models/get-expenses-query-params-with-filters.model.ts b/src/app/core/models/get-expenses-query-params-with-filters.model.ts deleted file mode 100644 index 83188b23ad..0000000000 --- a/src/app/core/models/get-expenses-query-params-with-filters.model.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FilterQueryParams } from './filter-query-params.model'; - -export type GetExpensesQueryParamsWithFilters = { - pageNumber: number; - queryParams: FilterQueryParams; - sortParam: string; - sortDir: string; - searchString: string; -}; diff --git a/src/app/core/models/platform/personal-cards-date-params.model.ts b/src/app/core/models/platform/personal-cards-date-params.model.ts deleted file mode 100644 index 794453098f..0000000000 --- a/src/app/core/models/platform/personal-cards-date-params.model.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface PersonalCardsDateParams { - pageNumber: number; - queryParams: { - ba_id?: string; - btxn_status?: string; - or?: string; - }; - sortParam: string; - sortDir: string; - searchString: string; -} diff --git a/src/app/core/models/policy-violation-txn.model.ts b/src/app/core/models/policy-violation-txn.model.ts deleted file mode 100644 index 70aa145379..0000000000 --- a/src/app/core/models/policy-violation-txn.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { PolicyViolation } from './policy-violation.model'; - -export interface PolicyViolationTxn { - [transactionID: string]: PolicyViolation; -} diff --git a/src/app/core/models/push-notification-data.model.ts b/src/app/core/models/push-notification-data.model.ts deleted file mode 100644 index 2da93d8ad3..0000000000 --- a/src/app/core/models/push-notification-data.model.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface PushNotificationData { - cta_url?: string; - notification_id?: number; -} diff --git a/src/app/core/models/report-api-params.model.ts b/src/app/core/models/report-api-params.model.ts index 1c0fc9d638..15c04a8daa 100644 --- a/src/app/core/models/report-api-params.model.ts +++ b/src/app/core/models/report-api-params.model.ts @@ -1,9 +1,3 @@ -export interface ReportQueryParams { - rp_state?: string; - or?: string | string[]; - rp_id?: string; -} - export interface ReportApiParams { offset?: number; limit?: number; diff --git a/src/app/core/models/report-params.model.ts b/src/app/core/models/report-params.model.ts deleted file mode 100644 index fa0548b1a3..0000000000 --- a/src/app/core/models/report-params.model.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface ReportParams { - state?: string[]; - or?: string; - order_by?: string; - dateRange?: { - from: string; - to: string; - }; -} diff --git a/src/app/core/models/report-stats-response.model.ts b/src/app/core/models/report-stats-response.model.ts deleted file mode 100644 index 85468057f6..0000000000 --- a/src/app/core/models/report-stats-response.model.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface ReportStatsResponse { - aggregates: { - function_name: string; - function_value: number; - }[]; -} diff --git a/src/app/core/models/report-v1.model.ts b/src/app/core/models/report-v1.model.ts deleted file mode 100644 index b681f9153c..0000000000 --- a/src/app/core/models/report-v1.model.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { UserDetails } from './v1/user-details.model'; - -export interface ReportV1 { - created_at: Date; - updated_at: Date; - last_updated_by?: UserDetails; - id: string; - org_user_id?: string; - purpose: string; - currency: string; - creator_id: string; - amount: number; - tax?: number; - status_id?: string; - num_transactions: number; - tally_export_id?: string; - state: string; - source: string; - reimbursement_id?: string; - approved_at?: Date; - reimbursed_at?: Date; - submitted_at?: Date; - verification_state?: string; - trip_request_id?: string; - exported: boolean; - policy_flag: boolean; - claim_number: string; - from_dt: Date; - to_dt: Date; - location1: string; - location2: string; - location3: string; - location4: string; - location5: string; - type: string; -} diff --git a/src/app/core/models/stats-one-dimension.model.ts b/src/app/core/models/stats-one-dimension.model.ts deleted file mode 100644 index c36da70c2e..0000000000 --- a/src/app/core/models/stats-one-dimension.model.ts +++ /dev/null @@ -1,46 +0,0 @@ -export class StatsOneDResponse { - dimensions: string[]; - - name: string; - - value: [ - { - aggregates?: [ - { - function_name?: string; - function_value?: any; - } - ]; - key?: [ - { - column_name?: string; - column_value?: any; - } - ]; - } - ]; - - constructor(statObj: any) { - this.dimensions = statObj.dimensions; - this.name = statObj.name; - this.value = statObj.value; - } - - getStatAggregatesByIdx(index: number): Array<{ value: T; key: string }> { - return this.value.map((stat) => ({ - value: stat.aggregates.length && stat.aggregates[index].function_value, - key: stat.key.length && stat.key[index].column_value, - })); - } - - getStatsTotalCount(index = 0): number { - const stats = this.getStatAggregatesByIdx(index); - return stats.reduce((acc, statValue) => acc + statValue.value, 0); - } - - public getStatsCountBySource(source: string, index = 0) { - const stats = this.getStatAggregatesByIdx(index); - const filteresStatsRes = stats.filter((stat) => stat.key.toLowerCase().indexOf(source.toLowerCase()) > -1); - return filteresStatsRes.reduce((acc, statValue) => acc + statValue.value, 0); - } -} diff --git a/src/app/core/models/text-search-params.model.ts b/src/app/core/models/text-search-params.model.ts deleted file mode 100644 index 000cb56ce5..0000000000 --- a/src/app/core/models/text-search-params.model.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface TextSearchQueryParams { - [key: string]: T; -} diff --git a/src/app/core/models/text-search-query.model.ts b/src/app/core/models/text-search-query.model.ts deleted file mode 100644 index 717fac999f..0000000000 --- a/src/app/core/models/text-search-query.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface TextSearchQuery { - _search_document?: string; - btxn_status?: string; - ba_id?: string; -} diff --git a/src/app/core/models/v2/bank-accounts-assigned.model.ts b/src/app/core/models/v2/bank-accounts-assigned.model.ts deleted file mode 100644 index 8bcc2a6125..0000000000 --- a/src/app/core/models/v2/bank-accounts-assigned.model.ts +++ /dev/null @@ -1,24 +0,0 @@ -export interface BankAccountsAssigned { - assigned_by_ou_id: string; - assigned_to_ou_id: string; - assignee_email: string; - assignee_full_name: string; - ba_account_number: string; - ba_bank_name: string; - ba_created_at: Date; - ba_currency: string; - ba_id: string; - ba_last_synced_at: Date; - ba_mask: string; - ba_nickname: string; - ba_sync_type: string; - ba_updated_at: Date; - total_unclassified_amount: number; - total_unclassified_count: number; - unclassified_credit_amount: number; - unclassified_credit_count: number; - unclassified_debit_amount: number; - unclassified_debit_count: number; - total_classified_count: number; - total_classified_amount: number; -} diff --git a/src/app/core/services/corporate-credit-card-expense.service.spec.ts b/src/app/core/services/corporate-credit-card-expense.service.spec.ts index c9e6fcf65a..c72279fdca 100644 --- a/src/app/core/services/corporate-credit-card-expense.service.spec.ts +++ b/src/app/core/services/corporate-credit-card-expense.service.spec.ts @@ -7,7 +7,6 @@ import { AuthService } from './auth.service'; import { CorporateCreditCardExpenseService } from './corporate-credit-card-expense.service'; import { DataTransformService } from './data-transform.service'; import { apiCardV2Transactions } from '../mock-data/ccc-api-response.data'; -import { expectedECccResponse } from '../mock-data/corporate-card-expense-unflattened.data'; import { uniqueCardsParam } from '../mock-data/unique-cards.data'; import { cardAggregateStatParam } from '../mock-data/card-aggregate-stats.data'; import { DateService } from './date.service'; @@ -15,7 +14,6 @@ import { expectedUniqueCardStats } from '../mock-data/unique-cards-stats.data'; import { apiAssignedCardDetailsRes } from '../mock-data/stats-response.data'; import { expectedAssignedCCCStats, mastercardCCCStats } from '../mock-data/ccc-expense.details.data'; import { apiEouRes } from '../mock-data/extended-org-user.data'; -import { eCCCApiResponse } from '../mock-data/corporate-card-expense-flattened.data'; import { mastercardRTFCard, statementUploadedCard } from '../mock-data/platform-corporate-card.data'; import { StatsResponse } from '../models/v2/stats-response.model'; import { bankFeedSourcesData } from '../mock-data/bank-feed-sources.data'; diff --git a/src/app/core/services/file-response.model.ts b/src/app/core/services/file-response.model.ts deleted file mode 100644 index 4b78d63718..0000000000 --- a/src/app/core/services/file-response.model.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface FileResponse { - type?: string; - thumbnail?: string; -} diff --git a/src/app/core/services/merge-expenses.service.spec.ts b/src/app/core/services/merge-expenses.service.spec.ts index ceb5432d42..bd250f78fb 100644 --- a/src/app/core/services/merge-expenses.service.spec.ts +++ b/src/app/core/services/merge-expenses.service.spec.ts @@ -87,8 +87,7 @@ import { optionsData8, optionsData9, } from '../mock-data/merge-expenses-options-data.data'; -import { fileObject11, fileObject5 } from '../mock-data/file-object.data'; -import { mergeExpenesesCustomInputsData } from '../mock-data/merge-expenses-custom-inputs.data'; +import { fileObject11 } from '../mock-data/file-object.data'; import * as lodash from 'lodash'; import { projectsV1Data } from '../test-data/projects.spec.data'; import { corporateCardExpenseData } from '../mock-data/corporate-card-expense.data'; diff --git a/src/app/core/services/platform/v1/spender/expenses.service.spec.ts b/src/app/core/services/platform/v1/spender/expenses.service.spec.ts index ecfd88822b..aeac61f1f6 100644 --- a/src/app/core/services/platform/v1/spender/expenses.service.spec.ts +++ b/src/app/core/services/platform/v1/spender/expenses.service.spec.ts @@ -21,7 +21,7 @@ import { } from 'src/app/core/mock-data/platform/v1/attach-receipt-payload.data'; import { splitPayloadData1 } from 'src/app/core/mock-data/split-payload.data'; import { splitPolicyExp1 } from 'src/app/core/mock-data/split-expense-policy.data'; -import { SplitExpenseMissingFieldsData } from 'src/app/core/models/split-expense-missing-fields.data'; +import { SplitExpenseMissingFieldsData } from 'src/app/core/mock-data/split-expense-missing-fields.data'; import { CorporateCreditCardExpenseService } from '../../../corporate-credit-card-expense.service'; import { ccTransactionResponseData, diff --git a/src/app/core/services/report.service.spec.ts b/src/app/core/services/report.service.spec.ts index ae96e831d2..0cd40d219a 100644 --- a/src/app/core/services/report.service.spec.ts +++ b/src/app/core/services/report.service.spec.ts @@ -4,96 +4,26 @@ import { DatePipe } from '@angular/common'; import { of } from 'rxjs'; import { PAGINATION_SIZE } from 'src/app/constants'; import { reportAllowedActionsResponse } from '../mock-data/allowed-actions.data'; -import { - approversData1, - apiAllApproverRes1, - apiAllApproverRes2, - apiApproverRes, - expectedApprovers, - approversData2, - approversData3, -} from '../mock-data/approver.data'; -import { apiEouRes } from '../mock-data/extended-org-user.data'; import { orgSettingsRes } from '../mock-data/org-settings.data'; import { apiReportAutoSubmissionDetails } from '../mock-data/report-auto-submission-details.data'; -import { addApproverERpts, expectedAddedApproverERpts } from '../mock-data/report-unflattened.data'; -import { - reportUnflattenedData, - reportUnflattenedData2, - apiEmptyReportRes, - apiReportUpdatedDetails, -} from '../mock-data/report-v1.data'; -import { - apiExtendedReportRes, - expectedAllReports, - expectedReportSingleResponse, - reportParam, - expectedPaginatedReports, - reportData1, -} from '../mock-data/report.data'; -import { getMyReportsParam1, getMyReportsParam2 } from '../mock-data/api-params.data'; -import { expectedReportRawStats } from '../mock-data/stats-dimension-response.data'; -import { StatsResponse } from '../models/v2/stats-response.model'; -import { ApiV2Service } from './api-v2.service'; -import { ApiService } from './api.service'; -import { AuthService } from './auth.service'; -import { DataTransformService } from './data-transform.service'; -import { DateService } from './date.service'; import { LaunchDarklyService } from './launch-darkly.service'; -import { NetworkService } from './network.service'; import { PermissionsService } from './permissions.service'; import { ReportService } from './report.service'; -import { StorageService } from './storage.service'; import { TransactionService } from './transaction.service'; import { UserEventService } from './user-event.service'; -import { dataErtpTransformed, apiErptReporDataParam } from '../mock-data/data-transform.data'; -import { expectedReportsSinglePage, platformReportData } from '../mock-data/platform-report.data'; +import { platformReportData } from '../mock-data/platform-report.data'; import { ApproverPlatformApiService } from './approver-platform-api.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { cloneDeep } from 'lodash'; -import { SpenderReportsService } from './platform/v1/spender/reports.service'; describe('ReportService', () => { let reportService: ReportService; - let dataTransformService: jasmine.SpyObj; - let dateService: DateService; - let apiService: jasmine.SpyObj; - let apiv2Service: jasmine.SpyObj; - let authService: jasmine.SpyObj; - let storageService: jasmine.SpyObj; - let userEventService: jasmine.SpyObj; let spenderPlatformV1ApiService: jasmine.SpyObj; let approverPlatformApiService: jasmine.SpyObj; let permissionsService: jasmine.SpyObj; let transactionService: jasmine.SpyObj; - let networkService: jasmine.SpyObj; - let spenderReportsService: jasmine.SpyObj; - let launchDarklyService: LaunchDarklyService; - - const apiReportStatParams: Partial = { - scalar: false, - dimension_1_1: 'rp_state', - aggregates: 'sum(rp_amount),count(rp_id)', - }; - - const apiReportStatsRawParam: Partial = { - approved_by: 'cs.{ouCI4UQ2G0K1}', - rp_approval_state: ['in.(APPROVAL_PENDING)'], - rp_state: ['in.(APPROVER_PENDING)'], - sequential_approval_turn: ['in.(true)'], - aggregates: 'count(rp_id),sum(rp_amount)', - scalar: true, - }; - - const apiApproversParam = ['rpDyD26O3qpV', 'rpqzKD4bPXpW']; beforeEach(() => { - const apiServiceSpy = jasmine.createSpyObj('ApiService', ['get', 'post', 'delete']); - const apiv2ServiceSpy = jasmine.createSpyObj('ApiV2Service', ['get', 'post', 'getStats']); - const authServiceSpy = jasmine.createSpyObj('AuthService', ['getEou', 'getRoles']); - const dataTransformServiceSpy = jasmine.createSpyObj('DataTransformService', ['unflatten']); - const networkServiceSpy = jasmine.createSpyObj('NetworkSpy', ['isOnline']); - const storageServiceSpy = jasmine.createSpyObj('StorageService', ['set', 'get']); const transactionServiceSpy = jasmine.createSpyObj('TransactionService', ['clearCache']); const userEventServiceSpy = jasmine.createSpyObj('UserEventServive', ['clearTaskCache', 'onLogout']); const spenderPlatformV1ApiServiceSpy = jasmine.createSpyObj('SpenderPlatformService', ['post']); @@ -106,30 +36,6 @@ describe('ReportService', () => { ReportService, DatePipe, LaunchDarklyService, - { - provide: ApiService, - useValue: apiServiceSpy, - }, - { - provide: DataTransformService, - useValue: dataTransformServiceSpy, - }, - { - provide: ApiV2Service, - useValue: apiv2ServiceSpy, - }, - { - provide: AuthService, - useValue: authServiceSpy, - }, - { - provide: NetworkService, - useValue: networkServiceSpy, - }, - { - provide: StorageService, - useValue: storageServiceSpy, - }, { provide: TransactionService, useValue: transactionServiceSpy, @@ -158,15 +64,7 @@ describe('ReportService', () => { }); reportService = TestBed.inject(ReportService); - dateService = TestBed.inject(DateService); - apiService = TestBed.inject(ApiService) as jasmine.SpyObj; - apiv2Service = TestBed.inject(ApiV2Service) as jasmine.SpyObj; - authService = TestBed.inject(AuthService) as jasmine.SpyObj; - dataTransformService = TestBed.inject(DataTransformService) as jasmine.SpyObj; - networkService = TestBed.inject(NetworkService) as jasmine.SpyObj; - storageService = TestBed.inject(StorageService) as jasmine.SpyObj; transactionService = TestBed.inject(TransactionService) as jasmine.SpyObj; - userEventService = TestBed.inject(UserEventService) as jasmine.SpyObj; spenderPlatformV1ApiService = TestBed.inject( SpenderPlatformV1ApiService ) as jasmine.SpyObj; @@ -174,8 +72,6 @@ describe('ReportService', () => { ApproverPlatformApiService ) as jasmine.SpyObj; permissionsService = TestBed.inject(PermissionsService) as jasmine.SpyObj; - launchDarklyService = TestBed.inject(LaunchDarklyService) as jasmine.SpyObj; - spenderReportsService = TestBed.inject(SpenderReportsService) as jasmine.SpyObj; }); it('should be created', () => { diff --git a/src/app/core/services/report.service.ts b/src/app/core/services/report.service.ts index 2e0db77e93..87c7a1aee6 100644 --- a/src/app/core/services/report.service.ts +++ b/src/app/core/services/report.service.ts @@ -1,27 +1,17 @@ import { DatePipe } from '@angular/common'; -import { Inject, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { Observable, Subject, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import { PAGINATION_SIZE } from 'src/app/constants'; import { CacheBuster, Cacheable } from 'ts-cacheable'; import { OrgSettings } from '../models/org-settings.model'; import { Report } from '../models/platform/v1/report.model'; import { ReportAutoSubmissionDetails } from '../models/report-auto-submission-details.model'; import { ReportPermission } from '../models/report-permission.model'; import { ApproverPlatformApiService } from './approver-platform-api.service'; -import { ApiV2Service } from './api-v2.service'; -import { ApiService } from './api.service'; -import { AuthService } from './auth.service'; -import { DataTransformService } from './data-transform.service'; -import { DateService } from './date.service'; -import { LaunchDarklyService } from './launch-darkly.service'; -import { NetworkService } from './network.service'; import { PermissionsService } from './permissions.service'; import { SpenderPlatformV1ApiService } from './spender-platform-v1-api.service'; -import { StorageService } from './storage.service'; import { TransactionService } from './transaction.service'; import { UserEventService } from './user-event.service'; -import { SpenderReportsService } from './platform/v1/spender/reports.service'; const reportsCacheBuster$ = new Subject(); @@ -30,22 +20,12 @@ const reportsCacheBuster$ = new Subject(); }) export class ReportService { constructor( - @Inject(PAGINATION_SIZE) private paginationSize: number, - private networkService: NetworkService, - private storageService: StorageService, - private apiService: ApiService, - private authService: AuthService, - private apiv2Service: ApiV2Service, - private dateService: DateService, - private dataTransformService: DataTransformService, private transactionService: TransactionService, private userEventService: UserEventService, private spenderPlatformV1ApiService: SpenderPlatformV1ApiService, private approverPlatformApiService: ApproverPlatformApiService, private datePipe: DatePipe, - private launchDarklyService: LaunchDarklyService, - private permissionsService: PermissionsService, - private spenderReportsService: SpenderReportsService + private permissionsService: PermissionsService ) { reportsCacheBuster$.subscribe(() => { this.userEventService.clearTaskCache(); diff --git a/src/app/core/services/split-expense.service.spec.ts b/src/app/core/services/split-expense.service.spec.ts index c76427202c..5083ed120c 100644 --- a/src/app/core/services/split-expense.service.spec.ts +++ b/src/app/core/services/split-expense.service.spec.ts @@ -1,10 +1,7 @@ import { TestBed } from '@angular/core/testing'; import { SplitExpenseService } from './split-expense.service'; -import { TransactionService } from './transaction.service'; import { ExpensesService } from './platform/v1/spender/expenses.service'; import { PolicyService } from './policy.service'; -import { DataTransformService } from './data-transform.service'; -import { FileService } from './file.service'; import { StatusService } from './status.service'; import { CategoriesService } from './categories.service'; import { transformedOrgCategories, unspecifiedCategory } from '../mock-data/org-category.data'; @@ -12,12 +9,8 @@ import { splitPurposeTxn, splitTxn, sourceSplitTxn, - sourceTxn2, - splitTxns, createSourceTxn, splitTxn2, - txnParam1, - txnParam2, createSourceTxn2, txnData2, txnList, @@ -34,33 +27,13 @@ import { txnData10, txnData11, txnData12, - upsertTxnParam, txnDataPayload, } from '../mock-data/transaction.data'; import { of } from 'rxjs'; -import { splitExpFileObj, splitExpFile2, splitExpFile3, fileObject4 } from '../mock-data/file-object.data'; -import { fileTxns } from '../mock-data/file-txn.data'; -import { splitExpensePolicyExp } from '../mock-data/platform-policy-expense.data'; -import { splitExpPolicyData } from '../mock-data/expense-policy.data'; -import { splitPolicyExp } from '../mock-data/public-policy-expense.data'; -import { - policyViolation1, - policyViolationData3, - policyViolationData4, - policyVoilationData2, - splitPolicyExp4, -} from '../mock-data/policy-violation.data'; -import { splitExpData, splitExpData2, splitExpTransformedData } from '../mock-data/expense.data'; -import { formattedTxnViolations, formattedTxnViolations2 } from '../mock-data/formatted-policy-violation.data'; -import { txnStatusData, txnStatusData1, txnStatusData2 } from '../mock-data/transaction-status.data'; -import { - violationComment1, - violationComment2, - violationComment3, - violationComment4, - violationComment5, -} from '../mock-data/policy-violcation-comment.data'; -import { unflattenExp1, unflattenExp2 } from '../mock-data/unflattened-expense.data'; +import { fileObject4 } from '../mock-data/file-object.data'; +import { splitPolicyExp4 } from '../mock-data/policy-violation.data'; +import { txnStatusData } from '../mock-data/transaction-status.data'; +import { violationComment1, violationComment4, violationComment5 } from '../mock-data/policy-violcation-comment.data'; import { criticalPolicyViolation1, criticalPolicyViolation2 } from '../mock-data/crtical-policy-violations.data'; import { UtilityService } from './utility.service'; import { cloneDeep, split } from 'lodash'; @@ -68,41 +41,25 @@ import { expenseFieldResponse } from '../mock-data/expense-field.data'; import { splitPayloadData1, splitPayloadData2, splitPayloadData3 } from '../mock-data/split-payload.data'; import { splitPolicyExp1 } from '../mock-data/split-expense-policy.data'; import { splitData2, splitsData1 } from '../mock-data/splits.data'; -import { SplitExpenseMissingFieldsData } from '../models/split-expense-missing-fields.data'; -import { - transformedSplitExpenseMissingFieldsData, - transformedSplitExpenseMissingFieldsData2, -} from '../mock-data/transformed-split-expense-missing-fields.data'; +import { SplitExpenseMissingFieldsData } from '../mock-data/split-expense-missing-fields.data'; +import { transformedSplitExpenseMissingFieldsData2 } from '../mock-data/transformed-split-expense-missing-fields.data'; import { filteredSplitPolicyViolationsData2 } from '../mock-data/filtered-split-policy-violations.data'; -import { - filteredMissingFieldsViolationsData, - filteredMissingFieldsViolationsData2, -} from '../mock-data/filtered-missing-fields-violations.data'; +import { filteredMissingFieldsViolationsData2 } from '../mock-data/filtered-missing-fields-violations.data'; describe('SplitExpenseService', () => { let splitExpenseService: SplitExpenseService; - let transactionService: jasmine.SpyObj; let expensesService: jasmine.SpyObj; let policyService: jasmine.SpyObj; - let dataTransformService: jasmine.SpyObj; - let fileService: jasmine.SpyObj; let statusService: jasmine.SpyObj; let categoriesService: jasmine.SpyObj; let utilityService: jasmine.SpyObj; beforeEach(() => { - const transactionServiceSpy = jasmine.createSpyObj('TransactionService', [ - 'checkPolicy', - 'upsert', - 'transformRawExpense', - ]); const policyServiceSpy = jasmine.createSpyObj('PolicyService', [ 'transformTo', 'getPolicyRules', 'getCriticalPolicyRules', ]); - const dataTransformServiceSpy = jasmine.createSpyObj('DataTransformService', ['unflatten']); - const fileServiceSpy = jasmine.createSpyObj('FileService', ['base64Download']); const statusServiceSpy = jasmine.createSpyObj('StatusService', ['post']); const categoriesServiceSpy = jasmine.createSpyObj('CategoriesService', ['filterByOrgCategoryId']); const utilityServiceSpy = jasmine.createSpyObj('UtiltyService', ['generateRandomString']); @@ -116,10 +73,6 @@ describe('SplitExpenseService', () => { TestBed.configureTestingModule({ providers: [ SplitExpenseService, - { - provide: TransactionService, - useValue: transactionServiceSpy, - }, { provide: ExpensesService, useValue: expensesServiceSpy, @@ -132,18 +85,10 @@ describe('SplitExpenseService', () => { provide: StatusService, useValue: statusServiceSpy, }, - { - provide: FileService, - useValue: fileServiceSpy, - }, { provide: CategoriesService, useValue: categoriesServiceSpy, }, - { - provide: DataTransformService, - useValue: dataTransformServiceSpy, - }, { provide: UtilityService, useValue: utilityServiceSpy, @@ -156,13 +101,10 @@ describe('SplitExpenseService', () => { }); splitExpenseService = TestBed.inject(SplitExpenseService); - transactionService = TestBed.inject(TransactionService) as jasmine.SpyObj; expensesService = TestBed.inject(ExpensesService) as jasmine.SpyObj; policyService = TestBed.inject(PolicyService) as jasmine.SpyObj; - fileService = TestBed.inject(FileService) as jasmine.SpyObj; statusService = TestBed.inject(StatusService) as jasmine.SpyObj; categoriesService = TestBed.inject(CategoriesService) as jasmine.SpyObj; - dataTransformService = TestBed.inject(DataTransformService) as jasmine.SpyObj; utilityService = TestBed.inject(UtilityService) as jasmine.SpyObj; expensesService = TestBed.inject(ExpensesService) as jasmine.SpyObj; }); diff --git a/src/app/core/services/split-expense.service.ts b/src/app/core/services/split-expense.service.ts index 737b95115b..806044b0f1 100644 --- a/src/app/core/services/split-expense.service.ts +++ b/src/app/core/services/split-expense.service.ts @@ -8,11 +8,8 @@ import { TransactionStatus } from '../models/transaction-status.model'; import { OrgCategory } from '../models/v1/org-category.model'; import { Transaction } from '../models/v1/transaction.model'; import { CategoriesService } from './categories.service'; -import { DataTransformService } from './data-transform.service'; -import { FileService } from './file.service'; import { PolicyService } from './policy.service'; import { StatusService } from './status.service'; -import { TransactionService } from './transaction.service'; import { UtilityService } from './utility.service'; import { ExpensesService } from './platform/v1/spender/expenses.service'; import { ExpenseField } from '../models/v1/expense-field.model'; @@ -34,12 +31,9 @@ export class SplitExpenseService { prependPolicyViolationMessage = 'Policy violation explanation: '; constructor( - private transactionService: TransactionService, - private fileService: FileService, private policyService: PolicyService, private statusService: StatusService, private categoriesService: CategoriesService, - private dataTransformService: DataTransformService, private utilityService: UtilityService, private expensesService: ExpensesService ) {} diff --git a/src/app/fyle/merge-expense/merge-expense-3.page.spec.ts b/src/app/fyle/merge-expense/merge-expense-3.page.spec.ts index b412cf5d9d..2b5f2ce5f2 100644 --- a/src/app/fyle/merge-expense/merge-expense-3.page.spec.ts +++ b/src/app/fyle/merge-expense/merge-expense-3.page.spec.ts @@ -16,56 +16,25 @@ import { cloneDeep } from 'lodash'; import { apiExpenseRes, expenseList2 } from 'src/app/core/mock-data/expense.data'; import { BehaviorSubject, Observable, Subscription, of, skip, take } from 'rxjs'; import { - optionsData10, - optionsData11, - optionsData12, - optionsData13, - optionsData14, optionsData15, optionsData16, optionsData17, optionsData18, optionsData19, - optionsData2, optionsData20, optionsData21, - optionsData3, optionsData32, optionsData33, - optionsData6, - optionsData7, - optionsData8, - optionsData9, optionsDataMergeExpenses, } from 'src/app/core/mock-data/merge-expenses-options-data.data'; -import { - combinedOptionsData1, - combinedOptionsData2, - combinedOptionsData3, -} from 'src/app/core/mock-data/combined-options.data'; -import { fileObject7 } from 'src/app/core/mock-data/file-object.data'; +import { combinedOptionsData2, combinedOptionsData3 } from 'src/app/core/mock-data/combined-options.data'; import { projectDependentFieldsMappingData1 } from 'src/app/core/mock-data/project-dependent-fields-mapping.data'; import { CostCenterDependentFieldsMappingData1 } from 'src/app/core/mock-data/cost-center-dependent-fields-mapping.data'; -import { - generatedFormPropertiesData1, - generatedFormPropertiesData2, - generatedFormPropertiesData3, - generatedFormPropertiesData4, -} from 'src/app/core/mock-data/generated-form-properties.data'; -import { ToastMessageComponent } from 'src/app/shared/components/toast-message/toast-message.component'; -import { snackbarPropertiesRes5 } from 'src/app/core/mock-data/snackbar-properties.data'; -import { - mergeExpenseFormData1, - mergeExpenseFormData2, - mergeExpenseFormData3, - mergeExpenseFormData4, - mergeExpenseFormData5, -} from 'src/app/core/mock-data/merge-expense-form-data.data'; +import { mergeExpenseFormData1 } from 'src/app/core/mock-data/merge-expense-form-data.data'; import { dependentCustomFields } from 'src/app/core/mock-data/expense-field.data'; import { expectedTxnCustomProperties, txnCustomPropertiesData, - txnCustomPropertiesData2, } from 'src/app/core/mock-data/txn-custom-properties.data'; import { filterTestData } from 'src/app/core/test-data/custom-inputs.spec.data'; import { responseAfterAppliedFilter } from 'src/app/core/test-data/custom-inputs.spec.data'; diff --git a/src/app/fyle/my-expenses/my-expenses.page.spec.ts b/src/app/fyle/my-expenses/my-expenses.page.spec.ts index 4f7ce7f288..0db5d00a94 100644 --- a/src/app/fyle/my-expenses/my-expenses.page.spec.ts +++ b/src/app/fyle/my-expenses/my-expenses.page.spec.ts @@ -18,22 +18,14 @@ import { } from 'src/app/core/mock-data/action-sheet-options.data'; import { allowedExpenseTypes } from 'src/app/core/mock-data/allowed-expense-types.data'; import { apiAuthRes } from 'src/app/core/mock-data/auth-reponse.data'; -import { cardAggregateStatParam } from 'src/app/core/mock-data/card-aggregate-stats.data'; import { expectedAssignedCCCStats } from 'src/app/core/mock-data/ccc-expense.details.data'; import { - expectedCriticalPolicyViolationPopoverParams, - expectedCriticalPolicyViolationPopoverParams2, - expectedCriticalPolicyViolationPopoverParams3, -} from 'src/app/core/mock-data/critical-policy-violation-popover.data'; -import { - expenseFiltersData1, expenseFiltersData2, expenseWithPotentialDuplicateFilterData, } from 'src/app/core/mock-data/expense-filters.data'; import { apiExpenseRes, expectedFormattedTransaction, - expenseData1, expenseData2, expenseList4, expenseListwithoutID, @@ -77,13 +69,10 @@ import { import { orgUserSettingsData } from 'src/app/core/mock-data/org-user-settings.data'; import { apiExpenses1, - apiExpenses2, expenseData, mileageExpenseWithDistance, perDiemExpenseWithSingleNumDays, } from 'src/app/core/mock-data/platform/v1/expense.data'; -import { reportUnflattenedData } from 'src/app/core/mock-data/report-v1.data'; -import { expectedReportSingleResponse } from 'src/app/core/mock-data/report.data'; import { selectedFilters1, selectedFilters2 } from 'src/app/core/mock-data/selected-filters.data'; import { snackbarPropertiesRes, @@ -92,13 +81,10 @@ import { snackbarPropertiesRes4, } from 'src/app/core/mock-data/snackbar-properties.data'; import { txnList } from 'src/app/core/mock-data/transaction.data'; -import { unflattenedTxnData } from 'src/app/core/mock-data/unflattened-txn.data'; import { unformattedTxnData } from 'src/app/core/mock-data/unformatted-transaction.data'; -import { expectedUniqueCardStats } from 'src/app/core/mock-data/unique-cards-stats.data'; import { uniqueCardsData } from 'src/app/core/mock-data/unique-cards.data'; import { AdvancesStates } from 'src/app/core/models/advances-states.model'; import { BackButtonActionPriority } from 'src/app/core/models/back-button-action-priority.enum'; -import { Expense } from 'src/app/core/models/expense.model'; import { ExtendedReport } from 'src/app/core/models/report.model'; import { ApiV2Service } from 'src/app/core/services/api-v2.service'; import { CategoriesService } from 'src/app/core/services/categories.service'; diff --git a/src/app/fyle/my-view-report/my-view-report.page.spec.ts b/src/app/fyle/my-view-report/my-view-report.page.spec.ts index d22ef505dd..d9f0277865 100644 --- a/src/app/fyle/my-view-report/my-view-report.page.spec.ts +++ b/src/app/fyle/my-view-report/my-view-report.page.spec.ts @@ -11,11 +11,9 @@ import { cloneDeep } from 'lodash'; import { Subscription, of } from 'rxjs'; import { click, getElementBySelector } from 'src/app/core/dom-helpers'; import { ReportPageSegment } from 'src/app/core/enums/report-page-segment.enum'; -import { approversData1 } from 'src/app/core/mock-data/approver.data'; import { apiEouRes } from 'src/app/core/mock-data/extended-org-user.data'; import { fyModalProperties, shareReportModalProperties } from 'src/app/core/mock-data/model-properties.data'; import { apiReportPermissions } from 'src/app/core/mock-data/report-permissions.data'; -import { expectedAllReports } from 'src/app/core/mock-data/report.data'; import { ExpenseView } from 'src/app/core/models/expense-view.enum'; import { AuthService } from 'src/app/core/services/auth.service'; import { LoaderService } from 'src/app/core/services/loader.service'; @@ -27,9 +25,7 @@ import { SnackbarPropertiesService } from 'src/app/core/services/snackbar-proper import { StatusService } from 'src/app/core/services/status.service'; import { orgSettingsData } from 'src/app/core/test-data/accounts.service.spec.data'; import { - expectedNewStatusData, newEstatusData1, - systemComments1, systemCommentsWithSt, systemExtendedComments, userComments, @@ -42,13 +38,11 @@ import { ReportState } from 'src/app/shared/pipes/report-state.pipe'; import { SnakeCaseToSpaceCase } from 'src/app/shared/pipes/snake-case-to-space-case.pipe'; import { NetworkService } from '../../core/services/network.service'; import { TrackingService } from '../../core/services/tracking.service'; -import { txnStatusData } from 'src/app/core/mock-data/transaction-status.data'; import { allReportsPaginated1, expectedReportsSinglePage, paidReportData, platformReportData, - reportExportResponse, sentBackReportData, } from 'src/app/core/mock-data/platform-report.data'; import { @@ -57,7 +51,6 @@ import { mileageExpense, perDiemExpense, } from 'src/app/core/mock-data/platform/v1/expense.data'; -import { ExpenseState } from 'src/app/core/models/expense-state.enum'; import { ExpensesService } from 'src/app/core/services/platform/v1/spender/expenses.service'; import { FyViewReportInfoComponent } from 'src/app/shared/components/fy-view-report-info/fy-view-report-info.component'; import { MyViewReportPage } from './my-view-report.page'; diff --git a/src/app/fyle/split-expense/split-expense.page.spec.ts b/src/app/fyle/split-expense/split-expense.page.spec.ts index 8302139df2..42c6b4cb1b 100644 --- a/src/app/fyle/split-expense/split-expense.page.spec.ts +++ b/src/app/fyle/split-expense/split-expense.page.spec.ts @@ -2,11 +2,9 @@ import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angul import { IonicModule } from '@ionic/angular'; import { CategoriesService } from 'src/app/core/services/categories.service'; import { DateService } from 'src/app/core/services/date.service'; -import { FileService } from 'src/app/core/services/file.service'; -import { TransactionService } from 'src/app/core/services/transaction.service'; import { SplitExpenseService } from 'src/app/core/services/split-expense.service'; import { TransactionsOutboxService } from 'src/app/core/services/transactions-outbox.service'; -import { MatSnackBar, MatSnackBarRef } from '@angular/material/snack-bar'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { SnackbarPropertiesService } from 'src/app/core/services/snackbar-properties.service'; import { TrackingService } from 'src/app/core/services/tracking.service'; import { PolicyService } from 'src/app/core/services/policy.service'; @@ -18,7 +16,6 @@ import { DependentFieldsService } from 'src/app/core/services/dependent-fields.s import { SplitExpensePage } from './split-expense.page'; import { ExpensesService } from 'src/app/core/services/platform/v1/spender/expenses.service'; import { - AbstractControlOptions, FormArray, FormBuilder, FormControl, @@ -41,7 +38,6 @@ import { expectedFilterOrgCategory, expectedOrgCategoriesPaginated, filterOrgCategoryParam, - orgCategoryData, transformedOrgCategories, unspecifiedCategory, } from 'src/app/core/mock-data/org-category.data'; @@ -49,54 +45,29 @@ import { MatIconTestingModule } from '@angular/material/icon/testing'; import { FyAlertInfoComponent } from 'src/app/shared/components/fy-alert-info/fy-alert-info.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { - amtTxn3, modifiedTxnData4, modifiedTxnData5, modifiedTxnData6, modifiedTxnData7, sourceTxn2, - splitExpenseTxn1, - splitExpenseTxn1_1, - splitExpenseTxn2, - splitExpenseTxn2_2, - splitExpenseTxn2_3, - splitExpenseTxn3, - splitPurposeTxn, - splitTxn2, splitTxns, - txnAmount1, - txnAmount2, txnData, txnData4, txnData6, txnList, } from 'src/app/core/mock-data/transaction.data'; -import { splitTransactionData1 } from 'src/app/core/mock-data/public-policy-expense.data'; -import { ExpenseFieldsObj } from 'src/app/core/models/v1/expense-fields-obj.model'; import { expenseFieldObjData, txnFieldData } from 'src/app/core/mock-data/expense-field-obj.data'; import { fileObjectData5, fileObject6, - fileObject7, fileObject8, fileObjectAdv, fileObjectAdv1, fileObjectData4, - splitExpFile2, - splitExpFile3, - splitExpFileObj, fileUrlMockData, fileObjectData1, } from 'src/app/core/mock-data/file-object.data'; -import { - fileTxns, - fileTxns2, - fileTxns3, - fileTxns4, - fileTxns5, - fileTxns6, - fileTxns7, -} from 'src/app/core/mock-data/file-txn.data'; + import { splitExpense1, splitExpense2, @@ -113,7 +84,7 @@ import { import { LaunchDarklyService } from 'src/app/core/services/launch-darkly.service'; import { ProjectsService } from 'src/app/core/services/projects.service'; import { orgUserSettingsData } from 'src/app/core/mock-data/org-user-settings.data'; -import { dependentFieldValues, txnCustomProperties } from 'src/app/core/test-data/dependent-fields.service.spec.data'; +import { dependentFieldValues } from 'src/app/core/test-data/dependent-fields.service.spec.data'; import { allowedActiveCategories, allowedActiveCategoriesListOptions, @@ -122,21 +93,12 @@ import { testActiveCategoryListOptions, testProjectV2, } from 'src/app/core/test-data/projects.spec.data'; -import { fileData2 } from 'src/app/core/mock-data/file.data'; import { ToastMessageComponent } from 'src/app/shared/components/toast-message/toast-message.component'; -import { formattedTxnViolations } from 'src/app/core/mock-data/formatted-policy-violation.data'; import { SplitExpensePolicyViolationComponent } from 'src/app/shared/components/split-expense-policy-violation/split-expense-policy-violation.component'; -import { - policyViolation1, - policyViolationData3, - policyViolationData5, - policyVoilationData2, -} from 'src/app/core/mock-data/policy-violation.data'; +import { policyViolation1, policyViolationData5 } from 'src/app/core/mock-data/policy-violation.data'; import { orgData1 } from 'src/app/core/mock-data/org.data'; -import { unflattenedAccount2Data, unflattenedAccount3Data } from 'src/app/core/test-data/accounts.service.spec.data'; +import { unflattenedAccount3Data } from 'src/app/core/test-data/accounts.service.spec.data'; import { categorieListRes } from 'src/app/core/mock-data/org-category-list-item.data'; -import * as dayjs from 'dayjs'; -import { expenseList2 } from 'src/app/core/mock-data/expense.data'; import { cloneDeep } from 'lodash'; import { splitExpenseFormData1, @@ -146,7 +108,6 @@ import { splitExpenseFormData6, splitExpenseFormData7, } from 'src/app/core/mock-data/split-expense-form.data'; -import { customInputData1 } from 'src/app/core/mock-data/custom-input.data'; import { costCentersData3, expectedCCdata } from 'src/app/core/mock-data/cost-centers.data'; import { currencyObjData1, @@ -154,12 +115,10 @@ import { currencyObjData3, currencyObjData4, } from 'src/app/core/mock-data/currency-obj.data'; -import { matchedCCCTransactionData1 } from 'src/app/core/mock-data/matchedCCCTransaction.data'; import { ToastType } from 'src/app/core/enums/toast-type.enum'; import { costCenterExpenseField, expenseFieldResponse } from 'src/app/core/mock-data/expense-field.data'; import { TimezoneService } from 'src/app/core/services/timezone.service'; import { txnCustomPropertiesData } from 'src/app/core/mock-data/txn-custom-properties.data'; -import { expectedProjects4 } from 'src/app/core/mock-data/extended-projects.data'; import { filteredSplitPolicyViolationsData } from 'src/app/core/mock-data/filtered-split-policy-violations.data'; import { filteredMissingFieldsViolationsData } from 'src/app/core/mock-data/filtered-missing-fields-violations.data'; import { @@ -167,9 +126,9 @@ import { transformedSplitExpenseMissingFieldsData2, } from 'src/app/core/mock-data/transformed-split-expense-missing-fields.data'; import { splitPolicyExp1 } from 'src/app/core/mock-data/split-expense-policy.data'; -import { SplitExpenseMissingFieldsData } from 'src/app/core/models/split-expense-missing-fields.data'; +import { SplitExpenseMissingFieldsData } from 'src/app/core/mock-data/split-expense-missing-fields.data'; import { splitPayloadData1 } from 'src/app/core/mock-data/split-payload.data'; -import { platformExpenseData, platformExpenseWithExtractedData } from 'src/app/core/mock-data/platform/v1/expense.data'; +import { platformExpenseWithExtractedData } from 'src/app/core/mock-data/platform/v1/expense.data'; import { orgSettingsWithProjectCategoryRestrictions } from 'src/app/core/mock-data/org-settings.data'; describe('SplitExpensePage', () => { @@ -180,8 +139,6 @@ describe('SplitExpensePage', () => { let dateService: jasmine.SpyObj; let splitExpenseService: jasmine.SpyObj; let currencyService: jasmine.SpyObj; - let transactionService: jasmine.SpyObj; - let fileService: jasmine.SpyObj; let expensesService: jasmine.SpyObj; let navController: jasmine.SpyObj; let router: jasmine.SpyObj; @@ -219,9 +176,7 @@ describe('SplitExpensePage', () => { 'transformSplitTo', ]); const currencyServiceSpy = jasmine.createSpyObj('CurrencyService', ['getHomeCurrency']); - const transactionServiceSpy = jasmine.createSpyObj('TransactionService', ['delete', 'matchCCCExpense']); const expensesServiceSpy = jasmine.createSpyObj('ExpensesService', ['getExpenseById']); - const fileServiceSpy = jasmine.createSpyObj('FileService', ['findByTransactionId']); const routerSpy = jasmine.createSpyObj('Router', ['navigate']); const transactionsOutboxServiceSpy = jasmine.createSpyObj('TransactionsOutboxService', ['fileUpload']); const matSnackBarSpy = jasmine.createSpyObj('MatSnackBar', ['openFromComponent']); @@ -275,9 +230,7 @@ describe('SplitExpensePage', () => { }, { provide: SplitExpenseService, useValue: splitExpenseServiceSpy }, { provide: CurrencyService, useValue: currencyServiceSpy }, - { provide: TransactionService, useValue: transactionServiceSpy }, { provide: ExpensesService, useValue: expensesServiceSpy }, - { provide: FileService, useValue: fileServiceSpy }, { provide: Router, useValue: routerSpy }, { provide: TransactionsOutboxService, useValue: transactionsOutboxServiceSpy }, { provide: MatSnackBar, useValue: matSnackBarSpy }, @@ -328,9 +281,7 @@ describe('SplitExpensePage', () => { dateService = TestBed.inject(DateService) as jasmine.SpyObj; splitExpenseService = TestBed.inject(SplitExpenseService) as jasmine.SpyObj; currencyService = TestBed.inject(CurrencyService) as jasmine.SpyObj; - transactionService = TestBed.inject(TransactionService) as jasmine.SpyObj; expensesService = TestBed.inject(ExpensesService) as jasmine.SpyObj; - fileService = TestBed.inject(FileService) as jasmine.SpyObj; router = TestBed.inject(Router) as jasmine.SpyObj; transactionsOutboxService = TestBed.inject(TransactionsOutboxService) as jasmine.SpyObj; matSnackBar = TestBed.inject(MatSnackBar) as jasmine.SpyObj; diff --git a/src/app/fyle/split-expense/split-expense.page.ts b/src/app/fyle/split-expense/split-expense.page.ts index c4a17c6efb..c8f3394134 100644 --- a/src/app/fyle/split-expense/split-expense.page.ts +++ b/src/app/fyle/split-expense/split-expense.page.ts @@ -8,8 +8,6 @@ import { combineLatest, forkJoin, from, iif, Observable, of, throwError } from ' import { catchError, concatMap, finalize, map, switchMap } from 'rxjs/operators'; import { CategoriesService } from 'src/app/core/services/categories.service'; import { DateService } from 'src/app/core/services/date.service'; -import { FileService } from 'src/app/core/services/file.service'; -import { TransactionService } from 'src/app/core/services/transaction.service'; import { SplitExpenseService } from 'src/app/core/services/split-expense.service'; import { TransactionsOutboxService } from 'src/app/core/services/transactions-outbox.service'; import { MatSnackBar } from '@angular/material/snack-bar'; @@ -126,8 +124,6 @@ export class SplitExpensePage { private dateService: DateService, private splitExpenseService: SplitExpenseService, private currencyService: CurrencyService, - private transactionService: TransactionService, - private fileService: FileService, private navController: NavController, private router: Router, private transactionsOutboxService: TransactionsOutboxService, diff --git a/src/app/fyle/team-reports/team-reports-1.page.spec.ts b/src/app/fyle/team-reports/team-reports-1.page.spec.ts index 2d9c82be56..8c77226c9a 100644 --- a/src/app/fyle/team-reports/team-reports-1.page.spec.ts +++ b/src/app/fyle/team-reports/team-reports-1.page.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, discardPeriodicTasks, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; -import { ModalController, RefresherCustomEvent } from '@ionic/angular'; +import { ModalController } from '@ionic/angular'; import { TeamReportsPage } from './team-reports.page'; import { NetworkService } from 'src/app/core/services/network.service'; @@ -14,7 +14,6 @@ import { TasksService } from 'src/app/core/services/tasks.service'; import { OrgSettingsService } from 'src/app/core/services/org-settings.service'; import { HeaderState } from 'src/app/shared/components/fy-header/header-state.enum'; import { BehaviorSubject, of } from 'rxjs'; -import { orgSettingsData } from 'src/app/core/test-data/accounts.service.spec.data'; import { creditTxnFilterPill } from 'src/app/core/mock-data/filter-pills.data'; import { getElementRef } from 'src/app/core/dom-helpers'; import { cloneDeep } from 'lodash'; @@ -23,11 +22,9 @@ import { tasksQueryParamsWithFiltersData, tasksQueryParamsWithFiltersData2, } from 'src/app/core/mock-data/get-tasks-query-params-with-filters.data'; -import { tasksQueryParamsParams } from 'src/app/core/mock-data/get-tasks-query-params.data'; import { getTeamReportsParams1, getTeamReportsParams2 } from 'src/app/core/mock-data/api-params.data'; import { GetTasksQueryParamsWithFilters } from 'src/app/core/models/get-tasks-query-params-with-filters.model'; import { expectedReportsSinglePage } from 'src/app/core/mock-data/platform-report.data'; -import { SpenderReportsService } from 'src/app/core/services/platform/v1/spender/reports.service'; import { ApproverReportsService } from 'src/app/core/services/platform/v1/approver/reports.service'; import { AuthService } from 'src/app/core/services/auth.service'; import { apiEouRes } from 'src/app/core/mock-data/extended-org-user.data'; diff --git a/src/app/fyle/team-reports/team-reports-2.page.spec.ts b/src/app/fyle/team-reports/team-reports-2.page.spec.ts index 5f6be0c83a..b1ad7f48bb 100644 --- a/src/app/fyle/team-reports/team-reports-2.page.spec.ts +++ b/src/app/fyle/team-reports/team-reports-2.page.spec.ts @@ -1,5 +1,5 @@ -import { ComponentFixture, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; -import { ModalController, RefresherCustomEvent } from '@ionic/angular'; +import { ComponentFixture, waitForAsync } from '@angular/core/testing'; +import { ModalController } from '@ionic/angular'; import { TeamReportsPage } from './team-reports.page'; import { NetworkService } from 'src/app/core/services/network.service'; @@ -12,30 +12,20 @@ import { TrackingService } from 'src/app/core/services/tracking.service'; import { ApiV2Service } from 'src/app/core/services/api-v2.service'; import { TasksService } from 'src/app/core/services/tasks.service'; import { OrgSettingsService } from 'src/app/core/services/org-settings.service'; -import { HeaderState } from 'src/app/shared/components/fy-header/header-state.enum'; import { BehaviorSubject, of } from 'rxjs'; -import { orgSettingsData } from 'src/app/core/test-data/accounts.service.spec.data'; -import { reportParam } from 'src/app/core/mock-data/report.data'; -import { creditTxnFilterPill } from 'src/app/core/mock-data/filter-pills.data'; import { getElementRef } from 'src/app/core/dom-helpers'; import { cloneDeep } from 'lodash'; -import { orgSettingsParamsWithSimplifiedReport } from 'src/app/core/mock-data/org-settings.data'; import { tasksQueryParamsWithFiltersData, - tasksQueryParamsWithFiltersData2, tasksQueryParamsWithFiltersData3, } from 'src/app/core/mock-data/get-tasks-query-params-with-filters.data'; import { - tasksQueryParamsParams, teamReportsQueryParams, teamReportsQueryParams2, teamReportsQueryParams3, } from 'src/app/core/mock-data/get-tasks-query-params.data'; -import { getTeamReportsParams1, getTeamReportsParams2 } from 'src/app/core/mock-data/api-params.data'; -import { GetTasksQueryParamsWithFilters } from 'src/app/core/models/get-tasks-query-params-with-filters.model'; import { GetTasksQueryParams } from 'src/app/core/models/get-tasks.query-params.model'; import * as dayjs from 'dayjs'; -import { popupConfigData, popupConfigData2 } from 'src/app/core/mock-data/popup.data'; import { apiEouRes } from 'src/app/core/mock-data/extended-org-user.data'; import { expectedReportsSinglePage } from 'src/app/core/mock-data/platform-report.data'; diff --git a/src/app/fyle/view-mileage/view-mileage.page.spec.ts b/src/app/fyle/view-mileage/view-mileage.page.spec.ts index 13fd14ba86..92fcb8d3df 100644 --- a/src/app/fyle/view-mileage/view-mileage.page.spec.ts +++ b/src/app/fyle/view-mileage/view-mileage.page.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; import { LoaderService } from 'src/app/core/services/loader.service'; -import { TransactionService } from 'src/app/core/services/transaction.service'; import { CustomInputsService } from 'src/app/core/services/custom-inputs.service'; import { PolicyService } from 'src/app/core/services/policy.service'; import { NetworkService } from '../../core/services/network.service'; @@ -17,7 +16,6 @@ import { PopoverController, ModalController } from '@ionic/angular'; import { ExpenseView } from 'src/app/core/models/expense-view.enum'; import { EventEmitter } from '@angular/core'; import { of } from 'rxjs'; -import { expenseData1, expenseData2 } from 'src/app/core/mock-data/expense.data'; import { ViewCommentComponent } from 'src/app/shared/components/comments-history/view-comment/view-comment.component'; import { individualExpPolicyStateData3 } from 'src/app/core/mock-data/individual-expense-policy-state.data'; import { @@ -25,7 +23,6 @@ import { expensePolicyStatesData, } from 'src/app/core/mock-data/platform-policy-expense.data'; import { dependentFieldValues } from 'src/app/core/test-data/dependent-fields.service.spec.data'; -import { FyPopoverComponent } from 'src/app/shared/components/fy-popover/fy-popover.component'; import { FileObject } from 'src/app/core/models/file-obj.model'; import { FyViewAttachmentComponent } from 'src/app/shared/components/fy-view-attachment/fy-view-attachment.component'; import { FileService } from 'src/app/core/services/file.service'; @@ -35,8 +32,7 @@ import { filledCustomProperties } from 'src/app/core/test-data/custom-inputs.spe import { getEstatusApiResponse } from 'src/app/core/test-data/status.service.spec.data'; import { cloneDeep, slice } from 'lodash'; import { isEmpty } from 'rxjs/operators'; -import { txnStatusData } from 'src/app/core/mock-data/transaction-status.data'; -import { mileageExpense, platformExpenseData } from 'src/app/core/mock-data/platform/v1/expense.data'; +import { mileageExpense } from 'src/app/core/mock-data/platform/v1/expense.data'; import { Expense } from 'src/app/core/models/platform/v1/expense.model'; import { ExpenseState } from 'src/app/core/models/expense-state.enum'; import { AccountType } from 'src/app/core/models/platform/v1/account.model'; @@ -46,22 +42,16 @@ import { MileageRatesService } from 'src/app/core/services/mileage-rates.service import { platformMileageRatesSingleData } from 'src/app/core/mock-data/platform-mileage-rate.data'; import { CustomInput } from 'src/app/core/models/custom-input.model'; import { ApproverReportsService } from 'src/app/core/services/platform/v1/approver/reports.service'; -import { - expectedReportsSinglePage, - expectedReportsSinglePageSubmitted, - paidReportData, -} from '../../core/mock-data/platform-report.data'; +import { expectedReportsSinglePageSubmitted, paidReportData } from '../../core/mock-data/platform-report.data'; import { SpenderFileService } from 'src/app/core/services/platform/v1/spender/file.service'; import { ApproverFileService } from 'src/app/core/services/platform/v1/approver/file.service'; import { generateUrlsBulkData1 } from 'src/app/core/mock-data/generate-urls-bulk-response.data'; import { receiptInfoData1 } from 'src/app/core/mock-data/receipt-info.data'; -import { LaunchDarklyService } from 'src/app/core/services/launch-darkly.service'; describe('ViewMileagePage', () => { let component: ViewMileagePage; let fixture: ComponentFixture; let loaderService: jasmine.SpyObj; - let transactionService: jasmine.SpyObj; let customInputsService: jasmine.SpyObj; let policyService: jasmine.SpyObj; let popoverController: jasmine.SpyObj; @@ -82,11 +72,9 @@ describe('ViewMileagePage', () => { let approverReportsService: jasmine.SpyObj; let spenderFileService: jasmine.SpyObj; let approverFileService: jasmine.SpyObj; - let launchDarklyService: jasmine.SpyObj; beforeEach(waitForAsync(() => { const loaderServiceSpy = jasmine.createSpyObj('LoaderService', ['hideLoader', 'showLoader']); - const transactionServiceSpy = jasmine.createSpyObj('TransactionService', ['manualUnflag', 'manualFlag']); const customInputsServiceSpy = jasmine.createSpyObj('CustomInputsService', [ 'getCustomPropertyDisplayValue', 'fillCustomProperties', @@ -133,9 +121,6 @@ describe('ViewMileagePage', () => { ]); const spenderFileServiceSpy = jasmine.createSpyObj('SpenderFileService', ['generateUrls']); const approverFileServiceSpy = jasmine.createSpyObj('ApproverFileService', ['generateUrls']); - const launchDarklyServiceSpy = jasmine.createSpyObj('LaunchDarklyService', [ - 'checkIfManualFlaggingFeatureIsEnabled', - ]); TestBed.configureTestingModule({ declarations: [ViewMileagePage], @@ -145,10 +130,6 @@ describe('ViewMileagePage', () => { useValue: loaderServiceSpy, provide: LoaderService, }, - { - useValue: transactionServiceSpy, - provide: TransactionService, - }, { useValue: customInputsServiceSpy, provide: CustomInputsService, @@ -238,13 +219,11 @@ describe('ViewMileagePage', () => { }, }, }, - { provide: LaunchDarklyService, useValue: launchDarklyServiceSpy }, ], }).compileComponents(); fixture = TestBed.createComponent(ViewMileagePage); component = fixture.componentInstance; loaderService = TestBed.inject(LoaderService) as jasmine.SpyObj; - transactionService = TestBed.inject(TransactionService) as jasmine.SpyObj; customInputsService = TestBed.inject(CustomInputsService) as jasmine.SpyObj; statusService = TestBed.inject(StatusService) as jasmine.SpyObj; modalController = TestBed.inject(ModalController) as jasmine.SpyObj; @@ -264,7 +243,6 @@ describe('ViewMileagePage', () => { approverReportsService = TestBed.inject(ApproverReportsService) as jasmine.SpyObj; spenderFileService = TestBed.inject(SpenderFileService) as jasmine.SpyObj; approverFileService = TestBed.inject(ApproverFileService) as jasmine.SpyObj; - launchDarklyService = TestBed.inject(LaunchDarklyService) as jasmine.SpyObj; activateRouteMock = TestBed.inject(ActivatedRoute); fixture.detectChanges(); diff --git a/src/app/fyle/view-mileage/view-mileage.page.ts b/src/app/fyle/view-mileage/view-mileage.page.ts index 9d475cb0fc..94e857f70f 100644 --- a/src/app/fyle/view-mileage/view-mileage.page.ts +++ b/src/app/fyle/view-mileage/view-mileage.page.ts @@ -3,7 +3,6 @@ import { Observable, from, Subject, concat, noop, of, forkJoin } from 'rxjs'; import { CustomField } from 'src/app/core/models/custom_field.model'; import { ActivatedRoute, Router } from '@angular/router'; import { LoaderService } from 'src/app/core/services/loader.service'; -import { TransactionService } from 'src/app/core/services/transaction.service'; import { CustomInputsService } from 'src/app/core/services/custom-inputs.service'; import { PolicyService } from 'src/app/core/services/policy.service'; import { switchMap, finalize, shareReplay, map, takeUntil, take, filter } from 'rxjs/operators'; @@ -114,7 +113,6 @@ export class ViewMileagePage { constructor( private activatedRoute: ActivatedRoute, private loaderService: LoaderService, - private transactionService: TransactionService, private customInputsService: CustomInputsService, private policyService: PolicyService, private popoverController: PopoverController, diff --git a/src/app/fyle/view-team-report/view-team-report.page.spec.ts b/src/app/fyle/view-team-report/view-team-report.page.spec.ts index b0c1cd44c6..00d39bd323 100644 --- a/src/app/fyle/view-team-report/view-team-report.page.spec.ts +++ b/src/app/fyle/view-team-report/view-team-report.page.spec.ts @@ -1,17 +1,11 @@ import { CurrencyPipe } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core'; -import { ComponentFixture, TestBed, fakeAsync, flushMicrotasks, tick, waitForAsync } from '@angular/core/testing'; +import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { MatSnackBar } from '@angular/material/snack-bar'; import { By } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; -import { - IonicModule, - ModalController, - PopoverController, - SegmentChangeEventDetail, - SegmentCustomEvent, -} from '@ionic/angular'; +import { IonicModule, ModalController, PopoverController } from '@ionic/angular'; import { finalize, of } from 'rxjs'; import { click, getElementBySelector, getTextContent } from 'src/app/core/dom-helpers'; import { apiEouRes } from 'src/app/core/mock-data/extended-org-user.data'; @@ -41,7 +35,6 @@ import { FyCurrencyPipe } from 'src/app/shared/pipes/fy-currency.pipe'; import { HumanizeCurrencyPipe } from 'src/app/shared/pipes/humanize-currency.pipe'; import { NetworkService } from '../../core/services/network.service'; import { TrackingService } from '../../core/services/tracking.service'; -import { ShareReportComponent } from './share-report/share-report.component'; import { ViewTeamReportPage } from './view-team-report.page'; import { pdfExportData1, pdfExportData2 } from 'src/app/core/mock-data/pdf-export.data'; import { EditReportNamePopoverComponent } from '../my-view-report/edit-report-name-popover/edit-report-name-popover.component'; diff --git a/src/app/shared/components/corporate-card/corporate-card.component.spec.ts b/src/app/shared/components/corporate-card/corporate-card.component.spec.ts index 876035a1e7..d388c8ecc3 100644 --- a/src/app/shared/components/corporate-card/corporate-card.component.spec.ts +++ b/src/app/shared/components/corporate-card/corporate-card.component.spec.ts @@ -22,6 +22,7 @@ import { By } from '@angular/platform-browser'; }) class MockCardNumberComponent { @Input() cardNumber: string; + @Input() cardNickname: string; } describe('CorporateCardComponent', () => { diff --git a/src/app/shared/components/split-expense-policy-violation/split-expense-policy-violation.component.spec.ts b/src/app/shared/components/split-expense-policy-violation/split-expense-policy-violation.component.spec.ts index 2bd4459fff..e689fb735c 100644 --- a/src/app/shared/components/split-expense-policy-violation/split-expense-policy-violation.component.spec.ts +++ b/src/app/shared/components/split-expense-policy-violation/split-expense-policy-violation.component.spec.ts @@ -2,12 +2,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule, ModalController } from '@ionic/angular'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { SplitExpensePolicyViolationComponent } from './split-expense-policy-violation.component'; -import { - formattedPolicyViolation1, - formattedPolicyViolation2, -} from 'src/app/core/mock-data/formatted-policy-violation.data'; import { FormArray, FormBuilder, ReactiveFormsModule } from '@angular/forms'; -import { of } from 'rxjs'; import { cloneDeep } from 'lodash'; import { filteredSplitPolicyViolationsData, diff --git a/src/app/shared/components/virtual-card/virtual-card.component.scss b/src/app/shared/components/virtual-card/virtual-card.component.scss index 33417d8b31..e72d9a67bc 100644 --- a/src/app/shared/components/virtual-card/virtual-card.component.scss +++ b/src/app/shared/components/virtual-card/virtual-card.component.scss @@ -97,7 +97,7 @@ height: 16px; display: flex; justify-content: center; - align-items: start; + align-items: flex-start; margin-top: 2px; } &__cvv-copy-icon { diff --git a/tsconfig.app.json b/tsconfig.app.json index 91b32f2fce..cdeddd289b 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -13,6 +13,8 @@ "src/**/*.d.ts" ], "exclude": [ - "src/**/*.spec.ts" + "src/**/*.spec.ts", + "src/app/core/mock-data/*", + "src/app/core/test-data/*" ] }