Skip to content

Commit de32ad1

Browse files
Merge pull request #91 from NSWC-Crane/CHRIS_DEV
Reference pull request for full details.
2 parents 4bd53c0 + 05dbf30 commit de32ad1

File tree

68 files changed

+11211
-10077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+11211
-10077
lines changed

api/Controllers/AAPackage.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
!#######################################################################
3+
! C-PATTM SOFTWARE
4+
! CRANE C-PATTM plan of action and milestones software. Use is governed by the Open Source Academic Research License Agreement contained in the file
5+
! crane_C_PAT.1_license.txt, which is part of this software package. BY
6+
! USING OR MODIFYING THIS SOFTWARE, YOU ARE AGREEING TO THE TERMS AND
7+
! CONDITIONS OF THE LICENSE.
8+
!########################################################################
9+
*/
10+
11+
const aaPackageService = require('../Services/aaPackageService');
12+
13+
module.exports.getAAPackages = async function getAAPackages(req, res, next) {
14+
try {
15+
const aaPackages = await aaPackageService.getAAPackages(req, res, next);
16+
res.status(200).json(aaPackages);
17+
} catch (error) {
18+
if (error.status === 400) {
19+
res.status(400).json({ error: 'Validation Error', detail: error.errors });
20+
} else {
21+
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
22+
}
23+
}
24+
};
25+
26+
module.exports.getAAPackage = async function getAAPackage(req, res, next) {
27+
try {
28+
const aaPackage = await aaPackageService.getAAPackage(req, res, next);
29+
res.status(200).json(aaPackage);
30+
} catch (error) {
31+
if (error.status === 400) {
32+
res.status(400).json({ error: 'Validation Error', detail: error.errors });
33+
} else {
34+
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
35+
}
36+
}
37+
};
38+
39+
module.exports.postAAPackage = async function postAAPackage(req, res, next) {
40+
try {
41+
const aaPackage = await aaPackageService.postAAPackage(req, res, next);
42+
res.status(201).json(aaPackage);
43+
} catch (error) {
44+
if (error.status === 400) {
45+
res.status(400).json({ error: 'Validation Error', detail: error.errors });
46+
} else {
47+
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
48+
}
49+
}
50+
};
51+
52+
module.exports.putAAPackage = async function putAAPackage(req, res, next) {
53+
try {
54+
const aaPackage = await aaPackageService.putAAPackage(req, res, next);
55+
res.status(200).json(aaPackage);
56+
} catch (error) {
57+
if (error.status === 400) {
58+
res.status(400).json({ error: 'Validation Error', detail: error.errors });
59+
} else {
60+
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
61+
}
62+
}
63+
};
64+
65+
module.exports.deleteAAPackage = async function deleteAAPackage(req, res, next) {
66+
try {
67+
await aaPackageService.deleteAAPackage(req, res, next);
68+
res.status(204).send();
69+
} catch (error) {
70+
if (error.status === 400) {
71+
res.status(400).json({ error: 'Validation Error', detail: error.errors });
72+
} else {
73+
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
74+
}
75+
}
76+
};

api/Controllers/Asset.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@
1010

1111
const assetService = require('../Services/assetService')
1212

13-
module.exports.getAssets = async function getAssets(req, res, next) {
14-
try {
15-
const assets = await assetService.getAssets(req, res, next);
16-
res.status(200).json(assets);
17-
} catch (error) {
18-
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
19-
}
20-
}
21-
2213
module.exports.getAsset = async function getAsset(req, res, next) {
2314
try {
2415
const asset = await assetService.getAsset(req, res, next);

api/Controllers/Import.js

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@
1010

1111
const importService = require('../Services/importService');
1212

13-
module.exports.putPoamAssetsWithStigManagerData = async function putPoamAssetsWithStigManagerData(req, res, next) {
14-
try {
15-
const poamAsset = await importService.putPoamAssetsWithStigManagerData(req, res, next);
16-
res.status(200).json(poamAsset);
17-
} catch (error) {
18-
if (error.status === 400) {
19-
res.status(400).json({ error: 'Validation Error', detail: error.errors });
20-
} else {
21-
res.status(500).json({ error: 'Internal Server Error', detail: error.message });
22-
}
23-
}
24-
}
2513

2614
module.exports.uploadPoamFile = async (req, res, next) => {
2715
const file = req.files[0];
@@ -71,24 +59,4 @@ module.exports.importVRAMExcel = async (req, res, next) => {
7159
}
7260
}
7361
});
74-
};
75-
76-
module.exports.postStigManagerAssets = async function postStigManagerAssets(req, res) {
77-
try {
78-
const { assets } = req.body;
79-
const importedAssets = await importService.postStigManagerAssets(assets);
80-
res.status(201).json({ message: 'Assets Imported Successfully', assets: importedAssets });
81-
} catch (error) {
82-
res.status(500).json({ message: 'Internal Server Error' });
83-
}
84-
};
85-
86-
module.exports.postStigManagerCollection = async function postStigManagerCollection(req, res) {
87-
try {
88-
const { collection, assets } = req.body;
89-
await importService.postStigManagerCollection(collection, assets);
90-
res.status(201).json({ message: 'Collection, Assets, and Labels Imported Successfully' });
91-
} catch (error) {
92-
res.status(500).json({ message: 'Internal Server Error' });
93-
}
94-
}
62+
};

api/Controllers/PoamExtensionMilestones.js

Lines changed: 0 additions & 67 deletions
This file was deleted.

api/Models/poam.model.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ module.exports = (sequelize, DataTypes) => {
3838
defaultValue: ''
3939
},
4040
description: {
41-
type: DataTypes.STRING(255),
42-
defaultValue: ''
41+
type: DataTypes.TEXT
4342
},
4443
rawSeverity: {
4544
type: DataTypes.STRING(10),
@@ -67,9 +66,6 @@ module.exports = (sequelize, DataTypes) => {
6766
residualRisk: {
6867
type: DataTypes.TEXT
6968
},
70-
notes: {
71-
type: DataTypes.TEXT
72-
},
7369
status: {
7470
type: DataTypes.STRING(10),
7571
allowNull: false,
@@ -106,12 +102,10 @@ module.exports = (sequelize, DataTypes) => {
106102
},
107103
severity: {
108104
type: DataTypes.STRING(15),
109-
allowNull: false,
110105
defaultValue: ''
111106
},
112107
relevanceOfThreat: {
113108
type: DataTypes.STRING(15),
114-
allowNull: false,
115109
defaultValue: ''
116110
},
117111
threatDescription: {
Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = (sequelize, DataTypes) => {
2-
const poamMilestone = sequelize.define("poammilestones", {
2+
const poamMilestones = sequelize.define("poammilestones", {
33
milestoneId: {
44
type: DataTypes.INTEGER,
55
allowNull: false,
@@ -12,22 +12,37 @@ module.exports = (sequelize, DataTypes) => {
1212
},
1313
milestoneDate: {
1414
type: DataTypes.DATEONLY,
15-
allowNull: true,
15+
allowNull: true
1616
},
1717
milestoneComments: {
1818
type: DataTypes.STRING(2000),
1919
allowNull: true,
20-
defaultValue: ''
20+
defaultValue: null
2121
},
2222
milestoneStatus: {
2323
type: DataTypes.STRING(10),
2424
allowNull: true,
2525
defaultValue: 'Pending'
2626
},
27+
milestoneChangeComments: {
28+
type: DataTypes.STRING(2000),
29+
allowNull: true,
30+
defaultValue: null
31+
},
32+
milestoneChangeDate: {
33+
type: DataTypes.DATEONLY,
34+
allowNull: true
35+
},
36+
milestoneTeam: {
37+
type: DataTypes.STRING(45),
38+
allowNull: true,
39+
defaultValue: null
40+
}
2741
}, {
42+
tableName: 'poammilestones',
2843
freezeTableName: true,
29-
timestamps: false,
44+
timestamps: false
3045
});
3146

32-
return poamMilestone;
47+
return poamMilestones;
3348
};

0 commit comments

Comments
 (0)