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

Stop generating optional data in company helper #1369

Merged
merged 2 commits into from
Sep 30, 2024
Merged
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
13 changes: 4 additions & 9 deletions test/support/helpers/company.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const { randomInteger } = require('../general.js')
*
* - `name` - Example Trading Ltd
* - `type` - organisation
* - `companyNumber` - [randomly generated - 24296934]
* - `organisationType` - limitedCompany
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
Expand All @@ -42,10 +40,7 @@ function add (data = {}) {
function defaults (data = {}) {
const defaults = {
name: 'Example Trading Ltd',
type: 'organisation',
companyNumber: generateCompanyNumber(),
organisationType: 'limitedCompany',
externalId: generateExternalId()
type: 'organisation'
}

return {
Expand All @@ -64,15 +59,15 @@ function generateCompanyNumber () {
}

/**
* Generate a company extrnal id
* Generate a company external id
*
* This is build from NALD import data using the region code and party id
* This is built from NALD import data using the region code and party id
*
* @returns {string} - A random external id
*/
function generateExternalId () {
const regionCode = randomInteger(1, 9)
const partyId = randomInteger(100, 99998)
const partyId = randomInteger(100, 9999998)

return `${regionCode}:${partyId}`
}
Expand Down
Loading