Skip to content

Commit

Permalink
Merge branch 'uat' into p3sprint7
Browse files Browse the repository at this point in the history
  • Loading branch information
ponselvamsakthivel-bc authored Apr 25, 2023
2 parents 83f6b52 + f0fe405 commit 7dfcd4f
Show file tree
Hide file tree
Showing 18 changed files with 97 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ SELECT Assign_Service_To_Org_User_Group('FP_USER','Fleet Portal User','FP_USER',

SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) - add service','CAT_USER','Contract Award Service (CAS) - add to dashboard');
SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) - add service','CAT_USER','Contract Award Service role to create buyer in Jagger');
SELECT Assign_Service_To_Org_User_Group('CAT_USER','Contract Award Service (CAS) - add service','CAT_USER','Contract Award Service role to merge buyer via Jaggaer');

SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional');
-- Following Role no longer required. task-5029-con-3730
-- SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional');
SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing Tile for Buyer User');
SELECT Assign_Service_To_Org_User_Group('JAEGGER_BUYER','eSourcing Service as a buyer','JAEGGER_BUYER','eSourcing buyer role to access Jagger');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'CAS_USER' AND "CcsAccessRoleName" = 'Contract Award Service (CAS) - add to dashboard' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('CAS_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'CAS_USER' AND "CcsAccessRoleName" = 'Contract Award Service role to create buyer in Jagger-LD' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'FP_USER' AND "CcsAccessRoleName" = 'Fleet Portal Tile' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('FP_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@
--SELECT setval('"ServiceRolePermission_Id_seq"', max("Id")) FROM "ServiceRolePermission";
--SELECT AddRole();
--DROP FUNCTION AddRole;

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_BUYER' AND "CcsAccessRoleName" = 'eSourcing Tile for Buyer User' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('JAEGGER_BUYER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_BUYER' AND "CcsAccessRoleName" = 'eSourcing buyer role to access Jagger' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('JAEGGER_BUYER_ES', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Supplier role for CAS for QA Pages Access' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('JAEGGER_SUPPLIER_CAS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Tile for Supplier User' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('JAEGGER_SUPPLIER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('JAEGGER_SUPPLIER_ES', clientServiceId, 0, 0, now(), now(), false);

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'JAEGGER_SUPPLIER' AND "CcsAccessRoleName" = 'eSourcing Supplier role to access Jagger' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


SELECT "Id" into ServicePermissionId From public."ServicePermission" WHERE "ServicePermissionName" = 'JAEGGER_SUPPLIER_ES' AND "CcsServiceId" = clientServiceId LIMIT 1;

INSERT INTO public."CcsAccessRole"(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'DATA_MIGRATION' AND "CcsAccessRoleName" = 'Access Data Migration' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('DATA_MIGRATION_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'DigiTS_USER' AND "CcsAccessRoleName" = 'Access DigiTS' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('DigiTS_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'EL_USER' AND "CcsAccessRoleName" = 'Buyer Supplier Information' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('EL_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'RMI_USER' AND "CcsAccessRoleName" = 'RMI Tile' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('RMI_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'TEST_SAML_CLIENT_USER' AND "CcsAccessRoleName" = 'SAML Client Tile' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('TEST_SAML_CLIENT_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ if (clientServiceId is null) then
return 1;
end if;

IF EXISTS (SELECT "Id" FROM public."CcsAccessRole" WHERE "CcsAccessRoleNameKey" = 'TEST_SSO_CLIENT_USER' AND "CcsAccessRoleName" = 'SSO Client Tile' LIMIT 1) THEN
raise notice 'Role already exists';
return 1;
END IF;


INSERT INTO public."ServicePermission"(
"ServicePermissionName", "CcsServiceId", "CreatedUserId", "LastUpdatedUserId", "CreatedOnUtc","LastUpdatedOnUtc", "IsDeleted")
VALUES ('TEST_SSO_CLIENT_USER_DS', clientServiceId, 0, 0, now(), now(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@ SELECT AddGroupRoleMapping('CAS_USER_GROUP','CAS_USER','Contract Award Service r
--SELECT AddGroupRoleMapping('CAT_USER','CAT_USER','Contract Award Service role to merge buyer via Jaggaer');


-- run the below line the if you are executing all the script at the first time - (Above TEST env)
--SELECT AddGroupRoleMapping('CAS_USER_GROUP','CAT_USER','Contract Award Service role to merge buyer via Jaggaer');

-- run the following in the environment if the script already execuated. (TEST and lower environment.)
--SELECT AddGroupRoleMapping('CAT_USER','CAT_USER','Contract Award Service role to merge buyer via Jaggaer');


SELECT AddGroupRoleMapping('JAEGGER_BUYER_GROUP','JAEGGER_BUYER','eSourcing Service as a buyer');
SELECT AddGroupRoleMapping('JAEGGER_BUYER_GROUP','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional');
-- don't add this role
--SELECT AddGroupRoleMapping('JAEGGER_BUYER_GROUP','JAEGGER_BUYER','eSourcing buyer role for CAS -Optional');
SELECT AddGroupRoleMapping('JAEGGER_BUYER_GROUP','JAEGGER_BUYER','eSourcing Tile for Buyer User');
SELECT AddGroupRoleMapping('JAEGGER_BUYER_GROUP','JAEGGER_BUYER','eSourcing buyer role to access Jagger');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ public async Task<List<OrganisationDetail>> GetOrganisationsAsync()
public async Task<List<OrganisationDetail>> GetOrganisationsForAutoValidationAsync()
{
var organisations = await _dataContext.Organisation.Where(
org => !org.IsDeleted && org.CreatedOnUtc >= TimeZoneInfo.ConvertTimeToUtc(startDate) && org.CreatedOnUtc <= TimeZoneInfo.ConvertTimeToUtc(endDate)
org => org.RightToBuy == false
&& !org.IsDeleted && org.CreatedOnUtc >= TimeZoneInfo.ConvertTimeToUtc(startDate) && org.CreatedOnUtc <= TimeZoneInfo.ConvertTimeToUtc(endDate)
&& !_dataContext.OrganisationAudit.Any(orgAudit => orgAudit.OrganisationId == org.Id))
.Select(o => new OrganisationDetail()
{
Expand Down

0 comments on commit 7dfcd4f

Please sign in to comment.