-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: This is the base branch for commute details related changes (#2806
) * feat: fy-select-commute-details modal as shared component (#2795) * feat: fy-select-commute-details modal as shared component * minor * minor * feat: fy-select-commute-details business logic (#2799) * feat: fy-select-commute-details business logic * minor * minor * minor * feat: refractoring in my-profile page (#2800) * feat: refractoring in my-profile page * minor * feat: tasks added for showing Add Commute Details (#2801) * feat: tasks added for showing Add Commute Details * minor * minor * pr comment * fixing flaky test * feat: add-edit-mileage changes for commute-details (#2807) * feat: fy-select-commute-details modal as shared component * minor * minor * feat: fy-select-commute-details business logic * minor * minor * minor * feat: refractoring in my-profile page * minor * feat: tasks added for showing Add Commute Details * minor * minor * fix: minor * major changes * this commit has switchMap changes * remove consoles * some refractoring and declarations * pr comments part 1 * expenseId as getter * gap removed * feat: popover confirmation once commute is updated from form (#2820) * feat: popover confirmation once commute is updated from form * fix: mandatory as per txnFields (#2823) * fix: mandatory as per txnFields * for round trip disabling * fix: distance can be zero and fix for commute deduction mandatory message (#2826) * fix: distance can be zero and fix for commute deduction mandatory message * minor * minor * feat: commute deduction in view mileage (#2828) * removed false from my-profile to make commute visible * adjusted height for some devices * fix: disable manual entry in fy-select-commute-details and show toast message if error occurs (#2830) * fix: disable manual entry in fy-select-commute-details * fix: scan failed fix * test: test for ionViewWillEnter method in mileage page (#2831) * test: fixing failing tests in mileage page - Part 2 (#2832) * test: test for ionViewWillEnter method in mileage page * test: fixing failing tests in mileage page * removed foucs * test: fixing route-selector component tests - Part 3 (#2833) * test: fixing route-selector component tests * removed foucs * test: added test for newly added methods (#2834) * minor * pr comments * fix: QA fixes for commute deduction (#2835) * fix: header fix for commute details * minor * QA fixes * minor * tests added * minor correction in modal opening logic * feat: added trackers for commute deduction (#2836) * feat: added trackers for commute deduction * minor * removed console log * minor fixes * fixing coverage
- Loading branch information
1 parent
ea4ce2e
commit bdac83e
Showing
51 changed files
with
1,607 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum CommuteDeduction { | ||
ONE_WAY = 'ONE_WAY', | ||
ROUND_TRIP = 'ROUND_TRIP', | ||
NO_DEDUCTION = 'NO_DEDUCTION', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { CommuteDeductionOptions } from '../models/commute-deduction-options.model'; | ||
|
||
export const commuteDeductionOptionsData1: CommuteDeductionOptions[] = [ | ||
{ | ||
label: 'One Way Distance', | ||
value: 'ONE_WAY', | ||
distance: 100, | ||
}, | ||
{ | ||
label: 'Round Trip Distance', | ||
value: 'ROUND_TRIP', | ||
distance: 200, | ||
}, | ||
{ | ||
label: 'No Deduction', | ||
value: 'NO_DEDUCTION', | ||
distance: 0, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { CommuteDetailsResponse } from '../models/platform/commute-details-response.model'; | ||
import { PlatformApiResponse } from '../models/platform/platform-api-response.model'; | ||
|
||
export const commuteDetailsResponseData: PlatformApiResponse<CommuteDetailsResponse> = { | ||
count: 1, | ||
offset: 0, | ||
data: [ | ||
{ | ||
user_id: 'uswr93Wqcfjv', | ||
full_name: 'John Doe', | ||
email: 'ajain@fyle.in', | ||
commute_details: { | ||
distance: 10, | ||
distance_unit: 'KM', | ||
home_location: { | ||
formatted_address: 'Home', | ||
latitude: 12.9715987, | ||
longitude: 77.5945667, | ||
country: 'India', | ||
state: 'Karnataka', | ||
city: 'Bangalore', | ||
}, | ||
work_location: { | ||
formatted_address: 'Work', | ||
latitude: 12.9715987, | ||
longitude: 77.5945667, | ||
country: 'India', | ||
state: 'Karnataka', | ||
city: 'Bangalore', | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { CommuteDetails } from '../models/platform/v1/commute-details.model'; | ||
|
||
export const commuteDetailsData: CommuteDetails = { | ||
distance: 10, | ||
distance_unit: 'KM', | ||
id: 12345, | ||
home_location: { | ||
formatted_address: 'Home', | ||
latitude: 12.9715987, | ||
longitude: 77.5945667, | ||
country: 'India', | ||
state: 'Karnataka', | ||
city: 'Bangalore', | ||
}, | ||
work_location: { | ||
formatted_address: 'Work', | ||
latitude: 12.9715987, | ||
longitude: 77.5945667, | ||
country: 'India', | ||
state: 'Karnataka', | ||
city: 'Bangalore', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface CommuteDeductionOptions { | ||
label: string; | ||
value: string; | ||
distance: number; | ||
selected?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CustomInput } from './custom-input.model'; | ||
import { ExtendedAccount } from './extended-account.model'; | ||
import { Location } from './location.model'; | ||
import { PlatformMileageRates } from './platform/platform-mileage-rates.model'; | ||
import { UnflattenedReport } from './report-unflattened.model'; | ||
import { TxnCustomProperties } from './txn-custom-properties.model'; | ||
import { CostCenter } from './v1/cost-center.model'; | ||
import { OrgCategory } from './v1/org-category.model'; | ||
import { ExtendedProject } from './v2/extended-project.model'; | ||
|
||
export interface MileageFormValue { | ||
route: { | ||
roundTrip: boolean; | ||
mileageLocations?: Location[]; | ||
distance?: number; | ||
}; | ||
category: OrgCategory; | ||
sub_category: OrgCategory; | ||
report: UnflattenedReport; | ||
paymentMode: ExtendedAccount; | ||
custom_inputs: CustomInput[]; | ||
mileage_rate_name: PlatformMileageRates; | ||
vehicle_type: string; | ||
dateOfSpend: Date; | ||
project: ExtendedProject; | ||
costCenter: CostCenter; | ||
billable: boolean; | ||
purpose: string; | ||
project_dependent_fields: TxnCustomProperties[]; | ||
cost_center_dependent_fields: TxnCustomProperties[]; | ||
commuteDeduction: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/app/core/services/platform/v1/spender/employees.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { EmployeesService } from './employees.service'; | ||
|
||
xdescribe('EmployeesService', () => { | ||
let service: EmployeesService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(EmployeesService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
30 changes: 30 additions & 0 deletions
30
src/app/core/services/platform/v1/spender/employees.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { SpenderService } from './spender.service'; | ||
import { Observable } from 'rxjs'; | ||
import { CommuteDetails } from 'src/app/core/models/platform/v1/commute-details.model'; | ||
import { CommuteDetailsResponse } from 'src/app/core/models/platform/commute-details-response.model'; | ||
import { PlatformApiResponse } from 'src/app/core/models/platform/platform-api-response.model'; | ||
import { ExtendedOrgUser } from 'src/app/core/models/extended-org-user.model'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class EmployeesService { | ||
constructor(private spenderService: SpenderService) {} | ||
|
||
getCommuteDetails(eou: ExtendedOrgUser): Observable<PlatformApiResponse<CommuteDetailsResponse>> { | ||
return this.spenderService.get('/employees', { | ||
params: { | ||
user_id: `eq.${eou.us.id}`, | ||
}, | ||
}); | ||
} | ||
|
||
postCommuteDetails(commuteDetails: CommuteDetails): Observable<{ data: CommuteDetailsResponse }> { | ||
return this.spenderService.post('/employees/commute_details', { | ||
data: { | ||
commute_details: commuteDetails, | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.