-
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: Move advance req get to platform API (#2854)
- Loading branch information
1 parent
aa5cfa6
commit 246ff2d
Showing
38 changed files
with
1,326 additions
and
435 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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { CustomFieldTypes } from '../enums/platform/v1/custom-fields-type.enum'; | ||
import { AdvancesPlatform } from '../models/platform/advances-platform.model'; | ||
import { PlatformApiResponse } from '../models/platform/platform-api-response.model'; | ||
|
||
export const advancePlatform: PlatformApiResponse<AdvancesPlatform> = { | ||
count: 1, | ||
offset: 0, | ||
data: [ | ||
{ | ||
advance_account_id: 'accmwN4nDBMXM', | ||
advance_request_id: 'areqrttywiidF8', | ||
advance_wallet_id: null, | ||
amount: 5044, | ||
card_number: null, | ||
code: null, | ||
created_at: new Date('2024-03-11T08:32:40.861889+00:00'), | ||
creator_user: { | ||
email: '[email protected]', | ||
full_name: 'Neeraj D', | ||
id: 'us1ymEVgUKqb', | ||
}, | ||
currency: 'INR', | ||
custom_fields: [ | ||
{ | ||
name: '123', | ||
type: CustomFieldTypes.TEXT, | ||
value: null, | ||
}, | ||
{ | ||
name: 'Project Name', | ||
type: CustomFieldTypes.TEXT, | ||
value: null, | ||
}, | ||
], | ||
employee: { | ||
code: '1223', | ||
department: { | ||
code: null, | ||
display_name: 'mileage dept / arun', | ||
id: 'dept62zPkMskdX', | ||
name: 'mileage dept', | ||
sub_department: 'arun', | ||
}, | ||
department_id: 'dept62zPkMskdX', | ||
id: 'ouX8dwsbLCLv', | ||
org_id: 'orNVthTo2Zyo', | ||
user: { | ||
email: '[email protected]', | ||
full_name: 'Abhishek Jain test', | ||
id: 'usvKA4X8Ugcr', | ||
}, | ||
user_id: 'usvKA4X8Ugcr', | ||
}, | ||
employee_id: 'ouX8dwsbLCLv', | ||
foreign_amount: null, | ||
foreign_currency: null, | ||
id: 'advRhdN9D326Y', | ||
is_exported: false, | ||
issued_at: new Date('2024-03-11T08:32:27.449000+00:00'), | ||
last_exported_at: null, | ||
org_id: 'orNVthTo2Zyo', | ||
payment_mode: 'CASH', | ||
project: { | ||
code: null, | ||
display_name: 'AAAO2683 / TE02257 AURI', | ||
id: 317383, | ||
name: 'AAAO2683 / TE02257 AURI', | ||
sub_project: null, | ||
}, | ||
project_id: '317383', | ||
purpose: 'testing', | ||
seq_num: 'A/2024/03/T/1', | ||
settlement_id: null, | ||
source: 'WEBAPP', | ||
updated_at: new Date('2024-03-11T08:32:40.861889+00:00'), | ||
user: { | ||
email: '[email protected]', | ||
full_name: 'Abhishek Jain test', | ||
id: 'usvKA4X8Ugcr', | ||
}, | ||
user_id: 'usvKA4X8Ugcr', | ||
advance_request: { | ||
id: 'areq1234', | ||
last_approved_at: new Date('2024-03-14T08:32:40.861Z'), | ||
}, | ||
}, | ||
], | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { ApprovalPublic } from '../models/approval-public.model'; | ||
import { Approval } from '../models/approval.model'; | ||
|
||
export const advanceReqApprovals: Approval[] = [ | ||
|
@@ -16,3 +17,11 @@ export const advanceReqApprovals: Approval[] = [ | |
comment: null, | ||
}, | ||
]; | ||
|
||
export const advanceReqApprovalsPublic: ApprovalPublic[] = [ | ||
{ | ||
state: 'APPROVAL_PENDING', | ||
approver_email: '[email protected]', | ||
approver_name: 'John Doe', | ||
}, | ||
]; |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import { cloneDeep } from 'lodash'; | ||
import { ApiV2Response } from '../models/api-v2.model'; | ||
import { ExtendedAdvanceRequestPublic } from '../models/extended-advance-request-public.model'; | ||
import { ExtendedAdvanceRequest } from '../models/extended_advance_request.model'; | ||
|
||
export const singleExtendedAdvReqRes: ApiV2Response<ExtendedAdvanceRequest> = { | ||
|
@@ -247,51 +249,40 @@ export const withoutDatesAdv = { | |
us_full_name: 'Abhishek Jain', | ||
}; | ||
|
||
export const singleErqRes: ExtendedAdvanceRequest = { | ||
areq_id: 'areqGzKF1Tne23', | ||
areq_created_at: new Date('2023-02-23T13:16:15.260Z'), | ||
areq_approved_at: null, | ||
areq_purpose: 'some', | ||
areq_notes: null, | ||
areq_state: 'SUBMITTED', | ||
export const singleErqRes: ExtendedAdvanceRequestPublic = { | ||
areq_advance_request_number: 'A/2020/10/T/95', | ||
areq_advance_id: 'advjrgwlk2Q', | ||
areq_amount: 47.99, | ||
areq_approved_at: new Date('2020-06-14T13:14:55.201Z'), | ||
areq_created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
areq_currency: 'USD', | ||
areq_amount: 100, | ||
areq_org_user_id: 'ouX8dwsbLCLv', | ||
areq_advance_id: null, | ||
areq_policy_amount: null, | ||
areq_policy_flag: null, | ||
areq_policy_state: 'SUCCESS', | ||
areq_project_id: null, | ||
areq_custom_field_values: null, | ||
areq_updated_at: new Date('2023-02-23T14:16:52.396Z'), | ||
areq_source: 'MOBILE', | ||
areq_advance_request_number: 'AR/2023/02/R/4', | ||
areq_updated_by: null, | ||
areq_is_sent_back: null, | ||
areq_is_pulled_back: null, | ||
ou_id: 'ouX8dwsbLCLv', | ||
ou_org_id: 'orNVthTo2Zyo', | ||
ou_org_name: 'Staging Loaded', | ||
ou_employee_id: '', | ||
ou_location: 'Mumbai', | ||
ou_level: '123', | ||
ou_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', | ||
ou_department: '0000000', | ||
ou_title: 'director', | ||
ou_mobile: '+12025559975', | ||
ou_sub_department: null, | ||
ou_department_id: 'deptpmQ0SsMO0S', | ||
us_full_name: 'Abhishek Jain', | ||
us_email: '[email protected]', | ||
project_code: null, | ||
project_name: null, | ||
advance_id: null, | ||
us_name: 'Abhishek Jain', | ||
policy_amount: null, | ||
policy_flag: null, | ||
policy_state: 'SUCCESS', | ||
new_state: 'APPROVAL_PENDING', | ||
areq_id: 'areqiwr3Wwirr', | ||
areq_notes: 'onsite client meeting', | ||
areq_org_user_id: 'outGt9ju6qP', | ||
areq_project_id: '1234', | ||
areq_purpose: 'onsite client meeting', | ||
areq_source: 'WEBAPP', | ||
areq_state: 'DRAFT', | ||
areq_updated_at: new Date('2020-06-11T13:14:55.201Z'), | ||
ou_department: 'Tech', | ||
ou_department_id: 'deptCjFrZcE0rH', | ||
ou_id: 'outGt9ju6qP', | ||
ou_org_id: 'orwruogwnngg', | ||
ou_sub_department: 'Tech', | ||
us_email: '[email protected]', | ||
us_full_name: 'John Doe', | ||
areq_is_pulled_back: false, | ||
ou_employee_id: 'outGt9ju6qP', | ||
areq_custom_field_values: [ | ||
{ | ||
name: 'checking', | ||
value: 'true', | ||
type: 'BOOLEAN', | ||
}, | ||
], | ||
areq_is_sent_back: false, | ||
project_name: 'Fast and Furious', | ||
project_code: 'C1234', | ||
}; | ||
|
||
export const singleErqUnflattened = { | ||
|
@@ -561,6 +552,145 @@ export const allAdvanceRequestsRes: ApiV2Response<ExtendedAdvanceRequest> = { | |
url: '/v2/advance_requests', | ||
}; | ||
|
||
export const publicAdvanceRequestRes: ApiV2Response<ExtendedAdvanceRequestPublic> = { | ||
count: 1, | ||
data: [ | ||
{ | ||
areq_advance_request_number: 'A/2020/10/T/95', | ||
areq_advance_id: 'advjrgwlk2Q', | ||
areq_amount: 47.99, | ||
areq_approved_at: new Date('2020-06-14T13:14:55.201Z'), | ||
areq_created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
areq_currency: 'USD', | ||
areq_id: 'areqiwr3Wwirr', | ||
areq_notes: 'onsite client meeting', | ||
areq_org_user_id: 'outGt9ju6qP', | ||
areq_project_id: '1234', | ||
areq_purpose: 'onsite client meeting', | ||
areq_source: 'WEBAPP', | ||
areq_state: 'DRAFT', | ||
areq_updated_at: new Date('2020-06-11T13:14:55.201Z'), | ||
ou_department: 'Tech', | ||
ou_department_id: 'deptCjFrZcE0rH', | ||
ou_id: 'outGt9ju6qP', | ||
ou_org_id: 'orwruogwnngg', | ||
ou_sub_department: 'Tech', | ||
us_email: '[email protected]', | ||
us_full_name: 'John Doe', | ||
areq_is_pulled_back: false, | ||
ou_employee_id: 'outGt9ju6qP', | ||
areq_custom_field_values: [{ name: 'checking', value: 'true', type: 'BOOLEAN' }], | ||
areq_is_sent_back: false, | ||
project_name: 'Fast and Furious', | ||
project_code: 'C1234', | ||
}, | ||
], | ||
offset: 0, | ||
}; | ||
|
||
export const publicAdvanceRequestResSentBack: ApiV2Response<ExtendedAdvanceRequestPublic> = { | ||
count: 1, | ||
data: [ | ||
{ | ||
...cloneDeep(publicAdvanceRequestRes.data[0]), | ||
areq_state: 'INQUIRY', | ||
areq_is_pulled_back: false, | ||
areq_is_sent_back: true, | ||
areq_id: 'areqiwr3Wwirk', | ||
}, | ||
], | ||
offset: 0, | ||
}; | ||
|
||
export const publicAdvanceRequestResPulledBack: ApiV2Response<ExtendedAdvanceRequestPublic> = { | ||
count: 1, | ||
data: [ | ||
{ | ||
...cloneDeep(publicAdvanceRequestRes.data[0]), | ||
areq_state: 'DRAFT', | ||
areq_is_pulled_back: true, | ||
areq_is_sent_back: false, | ||
areq_id: 'areqiwr3Wwirl', | ||
}, | ||
], | ||
offset: 0, | ||
}; | ||
|
||
export const publicAdvanceRequestRes2: ApiV2Response<ExtendedAdvanceRequestPublic> = { | ||
...publicAdvanceRequestRes, | ||
count: 250, | ||
}; | ||
|
||
export const publicAdvanceRequestRes3: ExtendedAdvanceRequestPublic = { | ||
...publicAdvanceRequestRes.data[0], | ||
type: 'request', | ||
currency: 'USD', | ||
amount: 47.99, | ||
created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
purpose: 'onsite client meeting', | ||
state: 'DRAFT', | ||
areq_is_pulled_back: true, | ||
}; | ||
|
||
export const publicAdvanceRequestRes4: ExtendedAdvanceRequestPublic = { | ||
...publicAdvanceRequestRes.data[0], | ||
type: 'request', | ||
currency: 'USD', | ||
amount: 47.99, | ||
created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
purpose: 'onsite client meeting', | ||
state: 'DRAFT', | ||
areq_is_sent_back: true, | ||
}; | ||
|
||
export const publicAdvanceRequestRes5: ApiV2Response<ExtendedAdvanceRequestPublic> = { | ||
count: 1, | ||
data: [ | ||
{ | ||
areq_advance_request_number: 'A/2020/10/T/95', | ||
areq_advance_id: 'advjrgwlk2Q', | ||
areq_amount: 47.99, | ||
areq_approved_at: new Date('2020-06-14T13:14:55.201Z'), | ||
areq_created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
areq_currency: 'USD', | ||
areq_id: 'areqiwr3Wwirr', | ||
areq_notes: 'onsite client meeting', | ||
areq_org_user_id: 'outGt9ju6qP', | ||
areq_project_id: '1234', | ||
areq_purpose: 'onsite client meeting', | ||
areq_source: 'WEBAPP', | ||
areq_state: 'DRAFT', | ||
areq_updated_at: new Date('2020-06-11T13:14:55.201Z'), | ||
ou_department: 'Tech', | ||
ou_department_id: 'deptCjFrZcE0rH', | ||
ou_id: 'outGt9ju6qP', | ||
ou_org_id: 'orwruogwnngg', | ||
ou_sub_department: 'Tech', | ||
us_email: '[email protected]', | ||
us_full_name: 'John Doe', | ||
areq_is_pulled_back: true, | ||
ou_employee_id: 'outGt9ju6qP', | ||
areq_custom_field_values: [{ name: 'checking', value: 'true', type: 'BOOLEAN' }], | ||
areq_is_sent_back: false, | ||
project_name: 'Fast and Furious', | ||
project_code: 'C1234', | ||
}, | ||
], | ||
offset: 0, | ||
}; | ||
|
||
export const publicAdvanceRequestRes6: ExtendedAdvanceRequestPublic = { | ||
...publicAdvanceRequestRes.data[0], | ||
type: 'request', | ||
currency: 'USD', | ||
amount: 47.99, | ||
created_at: new Date('2020-06-01T13:14:54.804Z'), | ||
purpose: 'onsite client meeting', | ||
state: 'DRAFT', | ||
areq_is_sent_back: false, | ||
areq_is_pulled_back: true, | ||
}; | ||
|
||
export const allTeamAdvanceRequestsRes: ApiV2Response<ExtendedAdvanceRequest> = { | ||
count: 43, | ||
data: [ | ||
|
Oops, something went wrong.