Skip to content

Commit

Permalink
fix: null behavior of category_ids Platform Projects Migration (#3003)
Browse files Browse the repository at this point in the history
  • Loading branch information
SahilK-027 committed Jun 4, 2024
1 parent 8745d14 commit 74cfbcc
Show file tree
Hide file tree
Showing 23 changed files with 1,001 additions and 393 deletions.
2 changes: 2 additions & 0 deletions src/app/core/mock-data/org-category.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ export const orgCategoryPaginated1: OrgCategory[] = deepFreeze([
},
]);

export const categoryIds: string[] = deepFreeze(['129140']);

export const orgCategoryPaginated2: OrgCategory[] = deepFreeze([
{
code: '51708',
Expand Down
15 changes: 15 additions & 0 deletions src/app/core/mock-data/platform/v1/platform-project-args.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { PlatformProjectArgs } from 'src/app/core/models/platform/v1/platform-project-args.model';
import deepFreeze from 'deep-freeze-strict';
import { apiEouRes } from '../../extended-org-user.data';
import { recentlyUsedRes } from '../../recently-used.data';

export const platformProjectsArgs1: PlatformProjectArgs = deepFreeze({
orgId: apiEouRes.ou.org_id,
isEnabled: true,
sortDirection: 'asc',
sortOrder: 'name',
orgCategoryIds: ['16558', '16559', '16560', '16561', '16562'],
projectIds: recentlyUsedRes.recent_project_ids,
offset: 0,
limit: 10,
});
122 changes: 122 additions & 0 deletions src/app/core/mock-data/platform/v1/platform-project.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import { PlatformApiResponse } from '../../../models/platform/platform-api-response.model';
import { PlatformProject } from '../../../models/platform/platform-project.model';
import deepFreeze from 'deep-freeze-strict';

export const platformProjectSingleRes: PlatformApiResponse<PlatformProject[]> = deepFreeze({
count: 1,
data: [
{
is_enabled: true,
code: '1184',
created_at: new Date('2021-05-12T10:28:40.834844'),
description: 'Sage Intacct Project - Customer Mapped Project, Id - 1184',
id: 257528,
name: 'Customer Mapped Project',
category_ids: [122269, 122270, 122271, null],
org_id: 'orFdTTTNcyye',
updated_at: new Date('2021-07-08T10:28:27.686886'),
display_name: 'Customer Mapped Project',
sub_project: null,
},
],
offset: 0,
});

export const platformAPIResponseMultiple: PlatformApiResponse<PlatformProject[]> = deepFreeze({
count: 2,
data: [
{
is_enabled: true,
code: '1184',
created_at: new Date('2021-05-12T10:28:40.834844'),
description: 'Sage Intacct Project - Customer Mapped Project, Id - 1184',
id: 257528,
display_name: 'Customer Mapped Project',
category_ids: [122269, 122270, 122271, null],
org_id: 'orFdTTTNcyye',
updated_at: new Date('2021-07-08T10:28:27.686886'),
name: 'Customer Mapped Project',
sub_project: null,
},
{
is_enabled: true,
code: '1182',
created_at: new Date('2021-05-12T10:28:40.834844'),
description: 'Sage Intacct Project - Fyle Engineering, Id - 1182',
id: 257529,
display_name: 'Fyle Engineering',
category_ids: [122269, 122270, 122271],
org_id: 'orFdTTTNcyye',
updated_at: new Date('2021-07-08T10:28:27.686886'),
name: 'Fyle Engineering',
sub_project: null,
},
],
offset: 0,
});

export const platformAPIResponseActiveOnly: PlatformApiResponse<PlatformProject[]> = deepFreeze({
count: 4,
data: [
{
id: 257528,
created_at: new Date('2021-05-12T10:28:40.834Z'),
updated_at: new Date('2021-07-08T10:28:27.686Z'),
name: 'Customer Mapped Project',
sub_project: null,
code: '1184',
org_id: 'orFdTTTNcyye',
description: 'Sage Intacct Project - Customer Mapped Project, Id - 1184',
is_enabled: true,
category_ids: [null, 145429, 122269, 122271],
display_name: 'Customer Mapped Project',
},
{
id: 257541,
created_at: new Date('2021-05-12T10:28:40.834Z'),
updated_at: new Date('2021-07-08T10:28:27.686Z'),
name: 'Sage Project 8',
sub_project: null,
code: '1178',
org_id: 'orFdTTTNcyye',
description: 'Sage Intacct Project - Sage Project 8, Id - 1178',
is_enabled: true,
category_ids: [null, 145429, 122269, 122271],
display_name: 'Customer Mapped Project',
},
{
id: 257531,
created_at: new Date('2021-05-12T10:28:40.834Z'),
updated_at: new Date('2021-07-08T10:28:27.686Z'),
name: 'Fyle Team Integrations',
sub_project: null,
code: '1183',
org_id: 'orFdTTTNcyye',
description: 'Sage Intacct Project - Fyle Team Integrations, Id - 1183',
is_enabled: true,
category_ids: null,
display_name: 'Customer Mapped Project',
},
],
offset: 0,
});

export const platformAPIResponseNullCategories: PlatformApiResponse<PlatformProject[]> = deepFreeze({
count: 4,
data: [
{
id: 257528,
created_at: new Date('2021-05-12T10:28:40.834Z'),
updated_at: new Date('2021-07-08T10:28:27.686Z'),
name: 'Customer Mapped Project',
sub_project: null,
code: '1184',
org_id: 'orFdTTTNcyye',
description: 'Sage Intacct Project - Customer Mapped Project, Id - 1184',
is_enabled: true,
category_ids: null,
display_name: 'Customer Mapped Project',
},
],
offset: 0,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PlatformProjectParams } from 'src/app/core/models/platform/v1/platform-project-params.model';
import deepFreeze from 'deep-freeze-strict';

export const ProjectPlatformParams: PlatformProjectParams = deepFreeze({
org_id: 'eq.orNVthTo2Zyo',
order: 'name.asc',
limit: 10,
offset: 0,
is_enabled: 'eq.true',
or: '(category_ids.is.null, category_ids.ov.{122269,122270,122271,122272,122273})',
id: 'in.(3943,305792,148971,247936)',
name: 'ilike.%search%',
});
13 changes: 13 additions & 0 deletions src/app/core/models/platform/platform-project.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export interface PlatformProject {
id: number;
org_id: string;
created_at: Date;
updated_at: Date;
name: string;
sub_project: string;
code: string;
display_name: string;
description: string;
is_enabled: boolean;
category_ids: number[];
}
11 changes: 11 additions & 0 deletions src/app/core/models/platform/v1/platform-project-args.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface PlatformProjectArgs {
orgId?: string;
isEnabled?: boolean;
orgCategoryIds?: string[];
searchNameText?: string;
limit?: number;
offset?: number;
sortOrder?: string;
sortDirection?: string;
projectIds?: number[];
}
14 changes: 14 additions & 0 deletions src/app/core/models/platform/v1/platform-project-params.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface PlatformProjectParams {
limit: number;
offset: number;
order?: string;
sortDirection?: string;
sortOrder?: string;
searchNameText?: string;
is_enabled?: string;
id?: string;
category_ids?: string;
org_id?: string;
name?: string;
or?: string;
}
12 changes: 6 additions & 6 deletions src/app/core/models/v2/project-v2.model.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export interface ProjectV2 {
ap1_email: string;
ap1_full_name: string;
ap2_email: string;
ap2_full_name: string;
ap1_email?: string;
ap1_full_name?: string;
ap2_email?: string;
ap2_full_name?: string;
project_active: boolean;
project_approver1_id: string;
project_approver2_id: string;
project_approver1_id?: string;
project_approver2_id?: string;
project_code: string;
project_created_at: Date;
project_description: string;
Expand Down
Loading

0 comments on commit 74cfbcc

Please sign in to comment.