Skip to content

Commit

Permalink
Revert "feat: Move advance req get to platform API (#2854)" (#2871)
Browse files Browse the repository at this point in the history
This reverts commit de91efa.
  • Loading branch information
bistaastha committed Apr 18, 2024
1 parent 1809526 commit 648d20e
Show file tree
Hide file tree
Showing 38 changed files with 435 additions and 1,326 deletions.
88 changes: 0 additions & 88 deletions src/app/core/mock-data/advance-platform.data.ts

This file was deleted.

21 changes: 9 additions & 12 deletions src/app/core/mock-data/advance-request-custom-field-values.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,39 @@ import { AdvanceRequestCustomFieldValues } from '../models/advance-request-custo

export const advanceRequestCustomFieldValuesData: AdvanceRequestCustomFieldValues[] = [
{
id: 1302,
name: 'Phase',
value: 'Phase 1',
type: 'SELECT',
},
{
id: 1305,
name: 'BILLABLE',
value: true,
type: 'BOOLEAN',
},
{
id: 1304,
name: 'Arrival Date',
value: '2023-1-2',
value: '2 Jan 2023',
type: 'DATE',
},
{
name: 'Checking',
value: 'option1',
type: 'OPTION',
},
];

export const advanceRequestCustomFieldValuesData2: AdvanceRequestCustomFieldValues[] = [
{
id: 1302,
name: 'Phase',
value: 'Phase 1',
},
{
name: 'BILLABLE',
value: true,
},
{
id: 1304,
name: 'Arrival Date',
value: '2023-1-2',
},
{
name: 'Checking',
value: 'option1',
id: 1305,
name: 'BILLABLE',
value: true,
},
];
9 changes: 0 additions & 9 deletions src/app/core/mock-data/approval.data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ApprovalPublic } from '../models/approval-public.model';
import { Approval } from '../models/approval.model';

export const advanceReqApprovals: Approval[] = [
Expand All @@ -17,11 +16,3 @@ export const advanceReqApprovals: Approval[] = [
comment: null,
},
];

export const advanceReqApprovalsPublic: ApprovalPublic[] = [
{
state: 'APPROVAL_PENDING',
approver_email: '[email protected]',
approver_name: 'John Doe',
},
];
218 changes: 44 additions & 174 deletions src/app/core/mock-data/extended-advance-request.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
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> = {
Expand Down Expand Up @@ -249,40 +247,51 @@ export const withoutDatesAdv = {
us_full_name: 'Abhishek Jain',
};

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'),
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',
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',
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',
};

export const singleErqUnflattened = {
Expand Down Expand Up @@ -552,145 +561,6 @@ 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: [
Expand Down
Loading

0 comments on commit 648d20e

Please sign in to comment.