Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export class MetaAllocatorController {

const role = this.roleService.getRole(reviewerAddress);
if (!['GOVERNANCE_TEAM', 'METADATA_ALLOCATOR'].includes(role as string)) {
this.logger.error(`Cannot reject refresh: ${role as string} for address ${reviewerAddress} not authorised`)
this.logger.error(
`Cannot reject refresh: ${role as string} for address ${reviewerAddress} not authorised`,
);
return res.status(403).json(badPermissions());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ApplicationError,
Command,
EventSource,
ICommandHandler,
Expand All @@ -10,6 +11,7 @@ import { inject, injectable } from 'inversify';

import {
ApplicationInstruction,
ApplicationStatus,
DatacapAllocator,
IDatacapAllocatorRepository,
} from '@src/domain/application/application';
Expand Down Expand Up @@ -112,6 +114,22 @@ export class EditApplicationCommandHandler implements ICommandHandler<EditApplic

this.logger.debug('application');
this.logger.debug(application);

// FIXME: This is a band-aid, but it's a necessary one. Something in the 2-way
// logic decides to re-open completed Applications on DB or Airtable updates.
// Do not proceed with editing completed applications
if (
application.applicationStatus == ApplicationStatus.DC_ALLOCATED ||
application.applicationStatus == ApplicationStatus.REJECTED
) {
this.logger.debug(`Cannot edit completed application`, application.guid);

return {
success: false,
error: new ApplicationError(400, '400', 'Cannot edit completed application'),
};
}

const prevApplicationInstructions = application.applicationInstructions;

// FIXME ? the original code ALWAYS forced it to META_ALLOCATOR but I think that was wrong (?)
Expand Down