Skip to content

Commit 12760e4

Browse files
Merge pull request #59 from StreetSupport/fix/remove_todos
Remove TODOs
2 parents 3e66dce + b61cf5c commit 12760e4

File tree

4 files changed

+1
-79
lines changed

4 files changed

+1
-79
lines changed

src/constants/roles.ts

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,6 @@ export function isOrgSpecificRole(role: string): boolean {
8080
return role.startsWith(ROLE_PREFIXES.ADMIN_FOR);
8181
}
8282

83-
// TODO: remove it if we don't need it
84-
/**
85-
* Extract the location/org slug from a specific role
86-
* @example extractRoleSlug('CityAdminFor:birmingham') => 'birmingham'
87-
*/
88-
// export function extractRoleSlug(role: string): string | null {
89-
// if (isLocationSpecificRole(role)) {
90-
// if (role.startsWith(ROLE_PREFIXES.CITY_ADMIN_FOR)) {
91-
// return role.substring(ROLE_PREFIXES.CITY_ADMIN_FOR.length);
92-
// }
93-
// if (role.startsWith(ROLE_PREFIXES.SWEP_ADMIN_FOR)) {
94-
// return role.substring(ROLE_PREFIXES.SWEP_ADMIN_FOR.length);
95-
// }
96-
// }
97-
// if (isOrgSpecificRole(role)) {
98-
// return role.substring(ROLE_PREFIXES.ADMIN_FOR.length);
99-
// }
100-
// return null;
101-
// }
102-
10383
/**
10484
* Create a location-specific city admin role
10585
* @example createCityAdminRole('birmingham') => 'CityAdminFor:birmingham'
@@ -116,15 +96,6 @@ export function createSwepAdminRole(locationSlug: string): string {
11696
return `${ROLE_PREFIXES.SWEP_ADMIN_FOR}${locationSlug}`;
11797
}
11898

119-
// TODO: remove it if we don't need it
120-
/**
121-
* Create an org-specific admin role
122-
* @example createOrgAdminRole('org-slug') => 'AdminFor:org-slug'
123-
*/
124-
// export function createOrgAdminRole(orgSlug: string): string {
125-
// return `${ROLE_PREFIXES.ADMIN_FOR}${orgSlug}`;
126-
// }
127-
12899
/**
129100
* Validate if a role string matches the expected format
130101
*/
@@ -144,30 +115,6 @@ export function isValidRole(role: string): boolean {
144115
return rolePatterns.some(pattern => pattern.test(role));
145116
}
146117

147-
// TODO: remove it if we don't need it
148-
/**
149-
* Get all roles from a user's auth claims (base roles only)
150-
*/
151-
// export function getBaseRoles(authClaims: string[]): BaseRole[] {
152-
// return authClaims.filter(isBaseRole);
153-
// }
154-
155-
// TODO: remove it if we don't need it
156-
/**
157-
* Get all location-specific roles from auth claims
158-
*/
159-
export function getLocationSpecificRoles(authClaims: string[]): string[] {
160-
return authClaims.filter(isLocationSpecificRole);
161-
}
162-
163-
// TODO: remove it if we don't need it
164-
/**
165-
* Get all org-specific roles from auth claims
166-
*/
167-
// export function getOrgSpecificRoles(authClaims: string[]): string[] {
168-
// return authClaims.filter(isOrgSpecificRole);
169-
// }
170-
171118
/**
172119
* Check if user has a specific base role
173120
*/
@@ -203,27 +150,6 @@ export function hasLocationAccess(authClaims: string[], locationSlug: string): b
203150
return authClaims.includes(cityAdminRole) || authClaims.includes(swepAdminRole);
204151
}
205152

206-
207-
// TODO: remove it if we don't need it
208-
/**
209-
* Check if user has access to a specific organisation
210-
*/
211-
// export function hasOrgAccess(authClaims: string[], orgSlug: string): boolean {
212-
// // SuperAdmin has access to all organisations
213-
// if (isSuperAdmin(authClaims)) {
214-
// return true;
215-
// }
216-
217-
// // Check for general OrgAdmin role
218-
// if (hasRole(authClaims, ROLES.ORG_ADMIN)) {
219-
// return true;
220-
// }
221-
222-
// // Check for org-specific role
223-
// const orgAdminRole = createOrgAdminRole(orgSlug);
224-
// return authClaims.includes(orgAdminRole);
225-
// }
226-
227153
// ============================================================================
228154
// VALIDATION REGEX
229155
// ============================================================================

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dotenv.config();
1010
connectDB();
1111

1212
// Start background jobs
13-
// TODO: think how to restrict this job to run only on production
1413
startVerificationJob();
1514
startDisablingJob();
1615
startSwepActivationJob();

src/jobs/verificationOrganisationJob.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export function startVerificationJob() {
2222

2323
// Find all organisations with selected administrators
2424
const organisations = await Organisation.find({
25-
'Administrators.IsSelected': true,
26-
// TODO: remove this after testing
27-
DocumentCreationDate: { $gte: new Date('2025-01-01') }
25+
'Administrators.IsSelected': true
2826
});
2927

3028
for (const org of organisations) {

src/models/bannerModel.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export const BannerSchema = new Schema({
107107
});
108108

109109
// Indexes for performance
110-
// TODO: We will handle synching later for all collections
111110
BannerSchema.index({ IsActive: 1, Priority: -1, 'DocumentCreationDate': -1 });
112111
BannerSchema.index({ LocationSlug: 1, IsActive: 1 });
113112
BannerSchema.index({ TemplateType: 1, IsActive: 1 });

0 commit comments

Comments
 (0)