forked from HHS/Head-Start-TTADP
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from adhocteam/sj-activity-report
Save an Activity Report
- Loading branch information
Showing
25 changed files
with
1,089 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/openapi/paths/activity-reports/activity-reports-id.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
get: | ||
tags: | ||
- activity-reports | ||
summary: Retrieve an activity report | ||
parameters: | ||
- in: path | ||
name: activityReportId | ||
required: true | ||
schema: | ||
type: number | ||
responses: | ||
200: | ||
description: The activity report with an Id of {activityReportId} | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../index.yaml#/components/schemas/activityReport' | ||
put: | ||
tags: | ||
- activity-reports | ||
summary: Update an activity report | ||
requestBody: | ||
description: A new activity report | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../index.yaml#/components/schemas/activityReport' | ||
parameters: | ||
- in: path | ||
name: activityReportId | ||
required: true | ||
schema: | ||
type: number | ||
responses: | ||
200: | ||
description: The updated activity report | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../index.yaml#/components/schemas/activityReport' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
post: | ||
tags: | ||
- activity-reports | ||
summary: Create a new activity report | ||
requestBody: | ||
description: A new activity report | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../index.yaml#/components/schemas/activityReport' | ||
responses: | ||
200: | ||
description: Successfully created activity report | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../index.yaml#/components/schemas/activityReport' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
get: | ||
tags: | ||
- activity-reports | ||
summary: > | ||
Get possible participants for an activity report | ||
description: > | ||
A participant is either a grant or nonGrantee. | ||
responses: | ||
200: | ||
description: The possible participants | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
grants: | ||
type: array | ||
items: | ||
$ref: '../../index.yaml#/components/schemas/participant' | ||
nonGrantees: | ||
type: array | ||
items: | ||
$ref: '../../index.yaml#/components/schemas/participant' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
queryInterface.createTable('NonGrantees', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
name: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
}); | ||
}, | ||
|
||
down: async (queryInterface) => { | ||
queryInterface.dropTable('NonGrantees'); | ||
}, | ||
}; |
114 changes: 114 additions & 0 deletions
114
src/migrations/20210106160931-create-activity-reports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
queryInterface.createTable('ActivityReports', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
resourcesUsed: { | ||
allowNull: true, | ||
type: Sequelize.STRING, | ||
}, | ||
additionalNotes: { | ||
allowNull: true, | ||
type: Sequelize.STRING, | ||
}, | ||
numberOfParticipants: { | ||
allowNull: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
deliveryMethod: { | ||
allowNull: true, | ||
type: Sequelize.STRING, | ||
}, | ||
duration: { | ||
allowNull: true, | ||
type: Sequelize.DECIMAL(3, 1), | ||
}, | ||
endDate: { | ||
allowNull: true, | ||
type: Sequelize.DATEONLY, | ||
}, | ||
startDate: { | ||
allowNull: true, | ||
type: Sequelize.DATEONLY, | ||
}, | ||
participantType: { | ||
allowNull: true, | ||
type: Sequelize.STRING, | ||
}, | ||
requester: { | ||
allowNull: true, | ||
type: Sequelize.STRING, | ||
}, | ||
status: { | ||
allowNull: false, | ||
type: Sequelize.STRING, | ||
}, | ||
programTypes: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
targetPopulations: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
reason: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
participants: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
topics: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
ttaType: { | ||
allowNull: true, | ||
type: Sequelize.ARRAY(Sequelize.STRING), | ||
}, | ||
pageState: { | ||
allowNull: true, | ||
type: Sequelize.JSON, | ||
}, | ||
userId: { | ||
allowNull: false, | ||
type: Sequelize.INTEGER, | ||
references: { | ||
model: { | ||
tableName: 'Users', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
lastUpdatedById: { | ||
allowNull: false, | ||
type: Sequelize.INTEGER, | ||
references: { | ||
model: { | ||
tableName: 'Users', | ||
}, | ||
key: 'id', | ||
}, | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE, | ||
defaultValue: Sequelize.fn('NOW'), | ||
}, | ||
}); | ||
}, | ||
|
||
down: async (queryInterface) => { | ||
queryInterface.dropTable('ActivityReports'); | ||
}, | ||
}; |
Oops, something went wrong.