Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JSDOC's lint seeder descriptions #1284

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
10 changes: 10 additions & 0 deletions db/seeds/01-regions.seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const RegionModel = require('../../app/models/region.model.js')

const ServerConfig = require('../../config/server.config.js')

/**
* Seed the regions reference data
*
* Water.regions does not have a composite key constraint for chargeRegionId and naldRegionId.
*
* We do not want multiple occurrences of the column pair chargeRegionId and naldRegionId.
*
* We manually check if the combination exits already and update / insert accordingly.
*
*/
async function seed () {
for (const region of regions) {
const exists = await _exists(region)
Expand Down
10 changes: 10 additions & 0 deletions db/seeds/02-purposes.seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ const { timestampForPostgres } = require('../../app/lib/general.lib.js')
const { data: purposes } = require('./data/purposes.js')
const PurposeModel = require('../../app/models/purpose.model.js')

/**
* Seeds the purposes reference data using an upsert
*
* The water.purpose_uses.legacy_id column must be unique
*
* Previous table name - water.purposes_uses
*
* Public table name - public.purposes
*
*/
async function seed () {
for (const purpose of purposes) {
await _upsert(purpose)
Expand Down
10 changes: 10 additions & 0 deletions db/seeds/03-primary-purposes.seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ const { timestampForPostgres } = require('../../app/lib/general.lib.js')
const { data: primaryPurposes } = require('./data/primary-purposes.js')
const PrimaryPurposeModel = require('../../app/models/primary-purpose.model.js')

/**
* Seeds the primary purpose reference data using an upsert
*
* The water.primary_purposes.legacy_id column must be unique
*
* Previous table name - water.primary_purposes
*
* Public table name - public.primary_purposes
*
*/
async function seed () {
for (const purpose of primaryPurposes) {
await _upsert(purpose)
Expand Down
10 changes: 10 additions & 0 deletions db/seeds/04-secondary-purposes.seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ const { timestampForPostgres } = require('../../app/lib/general.lib.js')
const { data: secondaryPurposes } = require('./data/secondary-purposes.js')
const SecondaryPurposeModel = require('../../app/models/secondary-purpose.model.js')

/**
* Seeds the secondary purpose reference data using an upsert
*
* The water.purposes_secondary.legacy_id column must be unique
*
* Previous table name - water.purposes_secondary
*
* Public table name - public.secondary_purposes
*
*/
async function seed () {
for (const purpose of secondaryPurposes) {
await _upsert(purpose)
Expand Down
10 changes: 10 additions & 0 deletions db/seeds/05-licence-version-purpose-condition-types.seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ const { timestampForPostgres } = require('../../app/lib/general.lib.js')
const { data: licenceVersionPurposeConditionTypes } = require('./data/licence-version-purpose-condition-types.js')
const LicenceVersionPurposeConditionTypeModel = require('../../app/models/licence-version-purpose-condition-type.model.js')

/**
* Seeds the licence version purpose condition types reference data using an upsert
*
* The water.licence_version_purpose_condition_types has a unique constraint composite key for (code, subcode)
*
* Previous table name - water.licence_version_purpose_condition_types
*
* Public table name - public.licence_version_purpose_condition_types
*
*/
async function seed () {
for (const licenceVersionPurposeConditionType of licenceVersionPurposeConditionTypes) {
await _upsert(licenceVersionPurposeConditionType)
Expand Down
Loading