Skip to content

Commit 93a55f1

Browse files
Merge pull request #35 from StreetSupport/feature/3013-create-organisation-listing-and-search-interface
3013 - Remove duplicated Has on site manager property
2 parents cf88ebc + eee2de3 commit 93a55f1

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

src/jobs/verificationJob.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export function startVerificationJob() {
2222

2323
// Find all organisations with selected administrators
2424
const organisations = await Organisation.find({
25-
'Administrators.IsSelected': true,
2625
// TODO: remove this after testing
2726
DocumentCreationDate: { $gte: new Date('2025-11-01') }
2827
});
@@ -39,23 +38,24 @@ export function startVerificationJob() {
3938

4039
// Find selected administrator
4140
const selectedAdmin = org.Administrators.find(admin => admin.IsSelected);
41+
const email = selectedAdmin?.Email || org.Email;
4242

43-
if (!selectedAdmin || !selectedAdmin.Email) {
43+
if (!email) {
4444
continue;
4545
}
4646

4747
// Check if exactly 90 days (send reminder)
4848
if (daysSinceUpdate === 90) {
49-
console.log(`Reminder sent for: ${org.Name} (${selectedAdmin.Email})`);
49+
console.log(`Reminder sent for: ${org.Name} (${email})`);
5050
const emailSent = await sendVerificationReminderEmail(
51-
selectedAdmin.Email,
51+
email,
5252
org.Name,
5353
daysSinceUpdate
5454
);
5555

5656
if (emailSent) {
5757
remindersCount++;
58-
console.log(`Reminder sent for: ${org.Name} (${selectedAdmin.Email})`);
58+
console.log(`Reminder sent for: ${org.Name} (${email})`);
5959
} else {
6060
errors.push(`Failed to send reminder for ${org.Name}`);
6161
}
@@ -73,13 +73,13 @@ export function startVerificationJob() {
7373

7474
// Send notification email
7575
const emailSent = await sendVerificationExpiredEmail(
76-
selectedAdmin.Email,
76+
email,
7777
org.Name
7878
);
7979

8080
if (emailSent) {
8181
unverifiedCount++;
82-
console.log(`Organisation unverified: ${org.Name} (${selectedAdmin.Email})`);
82+
console.log(`Organisation unverified: ${org.Name} (${email})`);
8383
console.log(` - Related services updated: ${totalUpdated}`);
8484
} else {
8585
errors.push(`Failed to send expiration email for ${org.Name}`);

src/models/accommodationModel.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,6 @@ const AccommodationSchema = new Schema<IAccommodation>({
244244
}
245245
},
246246
SupportProvidedInfo: {
247-
// I don't know if we need this property because we use another field FeaturesWithDiscretionary.HasOnSiteManager on WEB
248-
HasOnSiteManager: {
249-
type: Number,
250-
required: false,
251-
enum: [DiscretionaryValue.No, DiscretionaryValue.Yes, DiscretionaryValue.DontKnowAsk]
252-
},
253247
SupportOffered: {
254248
type: [String],
255249
required: false

src/schemas/accommodationSchema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ const ResidentCriteriaInfoSchema = z.object({
118118
});
119119

120120
const SupportProvidedInfoSchema = z.object({
121-
HasOnSiteManager: z.preprocess(preprocessNumber, DiscretionaryValueSchema.optional()),
122121
SupportOffered: z.preprocess(preprocessJSON, z.array(z.nativeEnum(SupportOfferedType)).optional()),
123122
SupportInfo: z.preprocess(preprocessNullableString, z.string().optional()),
124123
});

src/types/organisations/IAccommodation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export interface IAccommodation {
9797
AcceptsBenefitsClaimants?: boolean;
9898
};
9999
SupportProvidedInfo: {
100-
HasOnSiteManager?: number;
101100
SupportOffered?: string[];
102101
SupportInfo?: string;
103102
};

0 commit comments

Comments
 (0)