Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add branching fixes and other fixes for advance request #2865

Merged
merged 15 commits into from
Apr 16, 2024
4 changes: 4 additions & 0 deletions src/app/core/mock-data/advance-platform.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export const advancePlatform: PlatformApiResponse<AdvancesPlatform> = {
id: 'usvKA4X8Ugcr',
},
user_id: 'usvKA4X8Ugcr',
advance_request: {
id: 'areq1234',
last_approved_at: new Date('2024-03-14T08:32:40.861Z'),
},
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ export const advanceRequestCustomFieldValuesData: AdvanceRequestCustomFieldValue
{
name: 'Phase',
value: 'Phase 1',
type: 'SELECT',
},
{
name: 'BILLABLE',
value: true,
type: 'BOOLEAN',
},
{
name: 'Arrival Date',
value: '2023-1-2',
type: 'DATE',
},
{
name: 'Checking',
value: 'option1',
type: 'OPTION',
},
];

Expand All @@ -28,4 +36,8 @@ export const advanceRequestCustomFieldValuesData2: AdvanceRequestCustomFieldValu
name: 'Arrival Date',
value: '2023-1-2',
},
{
name: 'Checking',
value: 'option1',
},
];
42 changes: 42 additions & 0 deletions src/app/core/mock-data/extended-advance-request.data.ts
Original file line number Diff line number Diff line change
@@ -1,3 +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';
Expand Down Expand Up @@ -587,10 +588,39 @@ export const publicAdvanceRequestRes: ApiV2Response<ExtendedAdvanceRequestPublic
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',
Expand Down Expand Up @@ -649,6 +679,18 @@ export const publicAdvanceRequestRes5: ApiV2Response<ExtendedAdvanceRequestPubli
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
2 changes: 2 additions & 0 deletions src/app/core/mock-data/extended-advance.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const singleExtendedAdvancesData: ApiV2Response<ExtendedAdvance> = {
project_name: 'AAAO2683 / TE02257 AURI',
type: 'advance',
creator_us_full_name: 'Neeraj D',
areq_approved_at: new Date('2024-03-14T08:32:40.861Z'),
},
],
offset: 0,
Expand Down Expand Up @@ -80,6 +81,7 @@ export const singleExtendedAdvancesData2: ApiV2Response<ExtendedAdvance> = {
project_id: null,
project_name: null,
creator_us_full_name: 'Ajain',
areq_approved_at: new Date('2024-03-14T08:32:40.861Z'),
},
],
limit: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { cloneDeep } from 'lodash';
import { CustomFieldTypes } from 'src/app/core/enums/platform/v1/custom-fields-type.enum';
import { AdvanceRequestState } from 'src/app/core/models/advance-request-state.model';
import { AdvanceRequestPlatform } from 'src/app/core/models/platform/advance-request-platform.model';
import { PlatformApiResponse } from 'src/app/core/models/platform/platform-api-response.model';

Expand Down Expand Up @@ -86,3 +88,27 @@ export const advanceRequestPlatform: PlatformApiResponse<AdvanceRequestPlatform>
},
],
};

export const advanceRequestPlatformPulledBack: PlatformApiResponse<AdvanceRequestPlatform> = {
count: 1,
offset: 0,
data: [
{
...cloneDeep(advanceRequestPlatform.data[0]),
state: 'PULLED_BACK',
id: 'areqiwr3Wwirl',
},
],
};

export const advanceRequestPlatformSentBack: PlatformApiResponse<AdvanceRequestPlatform> = {
count: 1,
offset: 0,
data: [
{
...cloneDeep(advanceRequestPlatform.data[0]),
id: 'areqiwr3Wwirk',
state: 'SENT_BACK',
},
],
};
2 changes: 0 additions & 2 deletions src/app/core/mock-data/unflattened-advance-request.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ export const unflattenedAdvanceRequestData: UnflattenedAdvanceRequest = {
project_id: null,
custom_field_values: [
{
id: 159,
name: 'Advance Request Place',
value: 'd',
type: null,
},
{
id: 160,
name: 'Category',
value: 'Fyle is best',
type: null,
Expand Down
1 change: 1 addition & 0 deletions src/app/core/models/extended_advance.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export interface ExtendedAdvance {
orig_currency?: string;
purpose?: string;
creator_us_full_name: string;
areq_approved_at: Date;
}
4 changes: 4 additions & 0 deletions src/app/core/models/platform/advances-platform.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ export interface AdvancesPlatform {
employee_id: string;
employee: PlatformEmployee;
creator_user: User;
advance_request?: {
id: string;
last_approved_at: Date;
};
}
Loading
Loading