Skip to content

Commit

Permalink
Merge branch '1.1-RC' into dataset-audit
Browse files Browse the repository at this point in the history
  • Loading branch information
HarishGangula authored Sep 16, 2024
2 parents 2cdc2ba + b90f378 commit aaef037
Showing 1 changed file with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ const allowedTransitions: Record<string, any> = {
Delete: [DatasetStatus.Draft, DatasetStatus.ReadyToPublish],
ReadyToPublish: [DatasetStatus.Draft],
Live: [DatasetStatus.ReadyToPublish],
Retire: [DatasetStatus.Live],
Archive: [DatasetStatus.Retired],
Purge: [DatasetStatus.Archived]
Retire: [DatasetStatus.Live]
}
const liveDatasetActions = ["Retire", "Archive", "Purge"]
const liveDatasetActions = ["Retire"]

const validateRequest = (req: Request, datasetId: any) => {
const isRequestValid: Record<string, any> = schemaValidation(req.body, StatusTransitionSchema)
Expand Down Expand Up @@ -71,12 +69,8 @@ const datasetStatusTransition = async (req: Request, res: Response) => {
case "Retire":
await retireDataset(dataset, userID);
break;
case "Archive":
await archiveDataset(dataset);
break;
case "Purge":
await purgeDataset(dataset);
break;
default:
throw obsrvError(dataset.id, "UNKNOWN_STATUS_TRANSITION", "Unknown status transition requested", "BAD_REQUEST", 400)
}

ResponseHandler.successResponse(req, res, { status: httpStatus.OK, data: { message: `Dataset status transition to ${status} successful`, dataset_id } });
Expand Down Expand Up @@ -249,14 +243,4 @@ export const restartPipeline = async (dataset: Record<string, any>) => {
return executeCommand(dataset.id, "RESTART_PIPELINE")
}

const archiveDataset = async (dataset: Record<string, any>) => {

throw obsrvError(dataset.id, "ARCHIVE_NOT_IMPLEMENTED", "Archive functionality is not implemented", "NOT_IMPLEMENTED", 501)
}

const purgeDataset = async (dataset: Record<string, any>) => {

throw obsrvError(dataset.id, "PURGE_NOT_IMPLEMENTED", "Purge functionality is not implemented", "NOT_IMPLEMENTED", 501)
}

export default datasetStatusTransition;

0 comments on commit aaef037

Please sign in to comment.