-
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.
fix: Replace public GET calls to display delegatee info (#3172)
* replace delegatee info from eou * minor * switch to delegator changes * fix unit tests * fix employee service unit tests * more fixes * switch to delegator changes * eslint fixes * more fixes * minor * add safety
- Loading branch information
1 parent
cb49e6d
commit 6731a9e
Showing
19 changed files
with
292 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,6 +402,118 @@ export const eouFlattended: EouApiResponse = deepFreeze({ | |
ou_cost_center_ids: [13792, 13793, 13794, 14018, 13795, 13995, 9493, 9494, 13785, 13787, 13788, 13789, 13790, 13791], | ||
}); | ||
|
||
export const eouUnFlattended: ExtendedOrgUser = deepFreeze({ | ||
ou: { | ||
id: 'ouX8dwsbLCLv', | ||
created_at: new Date('2018-02-01T02:32:25.267Z'), | ||
org_id: 'orNVthTo2Zyo', | ||
user_id: 'usvKA4X8Ugcr', | ||
employee_id: '', | ||
location: 'Mumbai', | ||
level: 123, | ||
level_id: 'lvlPtroPaClQy', | ||
band: 'Very Long Level name Very Long Level name Very Long Level name Very Long Level name Very Long Level name Very Long Level name Very Long Level name Very Long Level name', | ||
rank: 1121212121, | ||
business_unit: | ||
'A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed A very long Business Unit indeed', | ||
department_id: 'deptpmQ0SsMO0S', | ||
department: '0000000', | ||
sub_department: null, | ||
roles: ['ADMIN', 'APPROVER', 'FYLER', 'HOP', 'HOD', 'OWNER'], | ||
approver1_id: 'ouy8gYhZRK4E', | ||
approver2_id: null, | ||
approver3_id: null, | ||
delegatee_id: 'ouAIf3H1yhZj', | ||
delegation_start_at: new Date('2023-02-02T03:07:28.879Z'), | ||
delegation_end_at: null, | ||
title: 'director', | ||
status: 'ACTIVE', | ||
branch_ifsc: 'ICIC0002322', | ||
branch_account: '12123412221', | ||
mobile: '+12025559975', | ||
mobile_verified: false, | ||
mobile_verified_at: null, | ||
is_primary: true, | ||
owner: false, | ||
joining_dt: new Date('2017-07-25T00:00:00.000+0000'), | ||
special_email: '[email protected]', | ||
custom_field_values: [ | ||
{ | ||
id: 685, | ||
name: 'Hybrid human', | ||
value: null, | ||
}, | ||
{ | ||
id: 430, | ||
name: 'UNum1', | ||
value: 1, | ||
}, | ||
{ | ||
id: 138, | ||
name: 'Driver salary limit', | ||
value: 1122, | ||
}, | ||
{ | ||
id: 139, | ||
name: 'Fuel limit', | ||
value: 1, | ||
}, | ||
{ | ||
id: 459, | ||
name: 'multi', | ||
value: '', | ||
}, | ||
{ | ||
id: 456, | ||
name: 'Place', | ||
value: null, | ||
}, | ||
{ | ||
id: 458, | ||
name: 'Location', | ||
value: null, | ||
}, | ||
], | ||
org_name: 'Staging Loaded', | ||
settings_id: 'ousS9MgDNQ6NB', | ||
default_cost_center_id: null, | ||
default_cost_center_name: null, | ||
default_cost_center_code: null, | ||
cost_center_ids: [13792, 13793, 13794, 14018, 13795, 13995, 9493, 9494, 13785, 13787, 13788, 13789, 13790, 13791], | ||
}, | ||
org: { | ||
domain: 'fyle.in', | ||
currency: 'INR', | ||
}, | ||
us: { | ||
id: 'usvKA4X8Ugcr', | ||
created_at: new Date('2016-06-13T12:21:16.803Z'), | ||
full_name: 'Abhishek Jain', | ||
email: '[email protected]', | ||
email_verified_at: new Date('2022-09-06T05:26:19.898Z'), | ||
onboarded: true, | ||
}, | ||
ap1: { | ||
full_name: 'Aditya Gupta', | ||
email: '[email protected]', | ||
}, | ||
ap2: { | ||
full_name: null, | ||
email: null, | ||
}, | ||
ap3: { | ||
full_name: null, | ||
email: null, | ||
}, | ||
bb: { | ||
bank_name: 'ICICI BANK LIMITED', | ||
}, | ||
dwolla: { | ||
customer_id: 'dwcJzfwZCgwkdfG', | ||
bank_account_added: true, | ||
}, | ||
}); | ||
|
||
export const eouWithNoAttempts: ExtendedOrgUser = deepFreeze({ | ||
...apiEouRes, | ||
ou: { | ||
|
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,8 @@ | ||
import deepFreeze from 'deep-freeze-strict'; | ||
import { Delegator } from 'src/app/core/models/platform/delegator.model'; | ||
|
||
export const delegatorData: Delegator = deepFreeze({ | ||
user_id: '0x1234', | ||
email: '[email protected]', | ||
full_name: 'Vercetti', | ||
}); |
47 changes: 47 additions & 0 deletions
47
src/app/core/mock-data/platform/v1/platform-employee.data.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,47 @@ | ||
import deepFreeze from 'deep-freeze-strict'; | ||
import { DelegationType } from 'src/app/core/models/platform/delegation-type.enum'; | ||
import { PlatformApiResponse } from 'src/app/core/models/platform/platform-api-response.model'; | ||
import { PlatformEmployee } from 'src/app/core/models/platform/platform-employee.model'; | ||
|
||
export const platformEmployeeData: PlatformEmployee = deepFreeze({ | ||
code: null, | ||
department: { | ||
code: null, | ||
display_name: 'Tech', | ||
id: 'deptCjFrZcE0rH', | ||
name: 'Tech', | ||
sub_department: 'Tech', | ||
}, | ||
department_id: 'deptCjFrZcE0rH', | ||
id: 'ouirDZ7tTLEQ', | ||
org_id: 'orNVthTo2Zyo', | ||
user: { | ||
email: '[email protected]', | ||
full_name: 'Arjun', | ||
id: 'usJZ9bgfNB5n', | ||
}, | ||
user_id: 'usJZ9bgfNB5n', | ||
delegatees: [ | ||
{ | ||
id: 100, | ||
type: DelegationType.PERMANENT, | ||
user_id: '0x1234', | ||
email: '[email protected]', | ||
full_name: 'Vercetti', | ||
start_at: new Date(), | ||
end_at: null, | ||
}, | ||
], | ||
}); | ||
|
||
export const platformEmployeeResponse: PlatformApiResponse<PlatformEmployee> = deepFreeze({ | ||
count: 1, | ||
offset: 10, | ||
data: platformEmployeeData, | ||
}); | ||
|
||
export const platformEmployeeEmptyResponse: PlatformApiResponse<PlatformEmployee> = deepFreeze({ | ||
count: 1, | ||
offset: 10, | ||
data: null, | ||
}); |
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 |
---|---|---|
|
@@ -9,4 +9,5 @@ export interface EmployeeParams { | |
order: string; | ||
limit: number; | ||
us_email?: string; | ||
us_id: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { DelegationType } from './delegation-type.enum'; | ||
|
||
export interface Delegatee { | ||
id: number; | ||
type: DelegationType; | ||
user_id: string; | ||
email: string; | ||
full_name: string; | ||
start_at: Date; | ||
end_at: Date; | ||
} |
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,4 @@ | ||
export enum DelegationType { | ||
SHORT_TERM, | ||
PERMANENT, | ||
} |
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 interface Delegator { | ||
user_id: string; | ||
email: string; | ||
full_name: 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
Oops, something went wrong.