Skip to content

Commit

Permalink
feat(api): Add a new seed into organizations
Browse files Browse the repository at this point in the history
  • Loading branch information
theotime2005 committed Jan 17, 2025
1 parent 33435da commit 374e1a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions api/db/seeds/data/team-acces/build-organizations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export function buildOrganizations(databaseBuilder) {
_buildAccisOrganization(databaseBuilder);
}

function _buildAccisOrganization(databaseBuilder) {
const organization = databaseBuilder.factory.buildOrganization({
type: 'PRO',
name: 'Accis',
});

const tag1 = databaseBuilder.factory.buildTag({ name: 'tag1' });
const tag2 = databaseBuilder.factory.buildTag({ name: 'tag2' });
databaseBuilder.factory.buildDataProtectionOfficer.withOrganizationId({
firstName: 'justin',
lastName: 'instant',
email: '[email protected]',
organizationId: organization.id,
});
databaseBuilder.factory.buildOrganizationTag({
organizationId: organization.id,
tagId: tag1.id,
});
databaseBuilder.factory.buildOrganizationTag({ organizationId: organization.id, tagId: tag2.id });
}
2 changes: 2 additions & 0 deletions api/db/seeds/data/team-acces/data-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { buildBlockedUsers } from './build-blocked-users.js';
import { buildCertificationCenters } from './build-certification-centers.js';
import { buildOidcProviders } from './build-oidc-providers.js';
import { buildOrganizationUsers } from './build-organization-users.js';
import { buildOrganizations } from './build-organizations.js';
import { buildPixAdminRoles } from './build-pix-admin-roles.js';
import { buildResetPasswordUsers } from './build-reset-password-users.js';
import { buildScoOrganizationLearners } from './build-sco-organization-learners.js';
Expand All @@ -20,6 +21,7 @@ async function teamAccesDataBuilder(databaseBuilder) {
buildScoOrganizationLearners(databaseBuilder);
await buildCertificationCenters(databaseBuilder);
await buildOidcProviders(databaseBuilder);
await buildOrganizations(databaseBuilder);
}

export { teamAccesDataBuilder };

0 comments on commit 374e1a1

Please sign in to comment.