Skip to content

Commit fef4c17

Browse files
committed
feat: add "project.groups" field
ref issue #616
1 parent cb0f4f6 commit fef4c17

File tree

7 files changed

+23
-0
lines changed

7 files changed

+23
-0
lines changed

docs/swagger.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4940,6 +4940,10 @@ definitions:
49404940
type: array
49414941
items:
49424942
type: string
4943+
groups:
4944+
type: array
4945+
items:
4946+
type: string
49434947
external:
49444948
type: object
49454949
description: 'READ-ONLY, OPTIONAL. Refernce to external task/issue.'
@@ -5070,6 +5074,10 @@ definitions:
50705074
type: array
50715075
items:
50725076
type: string
5077+
groups:
5078+
type: array
5079+
items:
5080+
type: string
50735081
name:
50745082
type: string
50755083
description: project name
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- UPDATE EXISTING projects table
2+
-- add column `groups`
3+
4+
ALTER TABLE projects ADD COLUMN "groups" character varying(255)[] NOT NULL DEFAULT ARRAY[]::character varying[]::character varying(255)[];

src/events/projects/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ const projectPayloadSchema = Joi.object().keys({
103103
createdAt: Joi.date().required(),
104104
updatedAt: Joi.date().required(),
105105
terms: Joi.array().items(Joi.string()).optional(),
106+
groups: Joi.array().items(Joi.string()).optional(),
106107
name: Joi.string().required(),
107108
description: Joi.string().allow(null).allow('').optional(),
108109
type: Joi.string().max(45).required(),

src/models/project.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ module.exports = function defineProject(sequelize, DataTypes) {
2020
allowNull: false,
2121
defaultValue: [],
2222
},
23+
groups: {
24+
type: DataTypes.ARRAY(DataTypes.STRING),
25+
allowNull: false,
26+
defaultValue: [],
27+
},
2328
type: {
2429
type: DataTypes.STRING,
2530
allowNull: false,

src/routes/projects/create.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const createProjectValidations = {
4646
estimatedPrice: Joi.number().precision(2).positive().optional()
4747
.allow(null),
4848
terms: Joi.array().items(Joi.string()).optional(),
49+
groups: Joi.array().items(Joi.string()).optional(),
4950
external: Joi.object().keys({
5051
id: Joi.string(),
5152
type: Joi.any().valid('github', 'jira', 'asana', 'other'),

src/routes/projects/update.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const updateProjectValdiations = {
4747
estimatedPrice: Joi.number().precision(2).positive().allow(null),
4848
actualPrice: Joi.number().precision(2).positive(),
4949
terms: Joi.array().items(Joi.string()),
50+
groups: Joi.array().items(Joi.string()),
5051
external: Joi.object().keys({
5152
id: Joi.string(),
5253
type: Joi.any().valid('github', 'jira', 'asana', 'other'),

src/utils/es-config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ MAPPINGS[ES_PROJECT_INDEX] = {
322322
terms: {
323323
type: 'string',
324324
},
325+
groups: {
326+
type: 'string',
327+
},
325328
type: {
326329
type: 'string',
327330
index: 'not_analyzed',

0 commit comments

Comments
 (0)