-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalize programmation workflow (#70)
- Loading branch information
Showing
87 changed files
with
2,619 additions
and
1,907 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Knex } from 'knex'; | ||
exports.up = async (knex: Knex) => { | ||
await knex.schema.alterTable('programming_plans', (table) => { | ||
table.string('status_drom'); | ||
}); | ||
|
||
await knex('programming_plans').update({ | ||
status_drom: knex.raw('status') | ||
}); | ||
|
||
await knex.schema.alterTable('programming_plans', (table) => { | ||
table.string('status').notNullable().alter(); | ||
}); | ||
}; | ||
|
||
exports.down = async (knex: Knex) => { | ||
await knex.schema.alterTable('programming_plans', (table) => { | ||
table.dropColumn('status_drom'); | ||
}); | ||
}; |
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,12 @@ | ||
import { Knex } from 'knex'; | ||
exports.up = async (knex: Knex) => { | ||
await knex.schema.alterTable('prescriptions', (table) => { | ||
table.string('notes'); | ||
}); | ||
}; | ||
|
||
exports.down = async (knex: Knex) => { | ||
await knex.schema.alterTable('prescriptions', (table) => { | ||
table.dropColumn('notes'); | ||
}); | ||
}; |
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 |
---|---|---|
|
@@ -7,37 +7,55 @@ exports.seed = async function () { | |
await Users().insert([ | ||
{ | ||
id: uuidv4(), | ||
email: 'admin@pspc.fr', | ||
email: 'admin@maestro.fr', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['Administrator'], | ||
roles: ['Administrator'] | ||
}, | ||
{ | ||
id: uuidv4(), | ||
email: 'coordinateur.national@pspc.fr', | ||
email: 'coordinateur.national@maestro.fr', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['NationalCoordinator'], | ||
roles: ['NationalCoordinator'] | ||
}, | ||
{ | ||
id: uuidv4(), | ||
email: 'coordinateur.regional@pspc.fr', | ||
email: 'coordinateur.regional@maestro.fr', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['RegionalCoordinator'], | ||
region: '44', | ||
region: '44' | ||
}, | ||
{ | ||
id: uuidv4(), | ||
email: '[email protected]', | ||
email: '[email protected]', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['RegionalCoordinator'], | ||
region: '01' | ||
}, | ||
{ | ||
id: uuidv4(), | ||
email: '[email protected]', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['Sampler'], | ||
region: '44', | ||
region: '44' | ||
}, | ||
{ | ||
id: uuidv4(), | ||
email: '[email protected]', | ||
password: bcrypt.hashSync('Test2024'), | ||
firstName: fakerFR.person.firstName(), | ||
lastName: fakerFR.person.lastName(), | ||
roles: ['Sampler'], | ||
region: '01' | ||
} | ||
]); | ||
}; |
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import { v4 as uuidv4 } from 'uuid'; | ||
import { ProgrammingPlans } from '../../../server/repositories/programmingPlanRepository'; | ||
import userRepository from '../../../server/repositories/userRepository'; | ||
import { genProgrammingPlan } from '../../../shared/test/programmingPlanFixtures'; | ||
|
||
export const validatedProgrammingPlanId = uuidv4(); | ||
|
||
exports.seed = async function () { | ||
const user = await userRepository.findOne('coordinateur.national@pspc.fr'); | ||
const user = await userRepository.findOne('coordinateur.national@maestro.fr'); | ||
|
||
if (!user) { | ||
return; | ||
} | ||
|
||
await ProgrammingPlans().insert([ | ||
{ | ||
await ProgrammingPlans().insert( | ||
genProgrammingPlan({ | ||
id: validatedProgrammingPlanId, | ||
createdAt: new Date(), | ||
createdBy: user.id, | ||
status: 'Validated', | ||
year: new Date().getFullYear(), | ||
}, | ||
]); | ||
statusDrom: 'Validated', | ||
year: new Date().getFullYear() | ||
}) | ||
); | ||
}; |
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 |
---|---|---|
|
@@ -4,22 +4,32 @@ import { genUser } from '../../../shared/test/userFixtures'; | |
|
||
export const Region1Fixture = '44' as Region; | ||
export const Region2Fixture = '52' as Region; | ||
export const RegionDromFixture = '01' as Region; | ||
|
||
export const Sampler1Fixture = genUser({ | ||
roles: ['Sampler'], | ||
id: '11111111-1111-1111-1111-111111111111', | ||
region: Region1Fixture, | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
email: '[email protected]', | ||
email: '[email protected]' | ||
}); | ||
export const Sampler2Fixture = genUser({ | ||
roles: ['Sampler'], | ||
id: '22222222-2222-2222-2222-222222222222', | ||
region: Region2Fixture, | ||
firstName: 'Jane', | ||
lastName: 'Austen', | ||
email: '[email protected]', | ||
email: '[email protected]' | ||
}); | ||
|
||
export const SamplerDromFixture = genUser({ | ||
roles: ['Sampler'], | ||
id: '66666666-6666-6666-6666-666666666666', | ||
region: RegionDromFixture, | ||
firstName: 'Jack', | ||
lastName: 'Sparrow', | ||
email: '[email protected]' | ||
}); | ||
|
||
export const RegionalCoordinator = genUser({ | ||
|
@@ -28,18 +38,29 @@ export const RegionalCoordinator = genUser({ | |
region: Region1Fixture, | ||
firstName: 'Alice', | ||
lastName: 'Wonderland', | ||
email: '[email protected]', | ||
email: '[email protected]' | ||
}); | ||
|
||
export const RegionalDromCoordinator = genUser({ | ||
roles: ['RegionalCoordinator'], | ||
id: '44444444-4444-4444-4444-444444444444', | ||
region: RegionDromFixture, | ||
firstName: 'Bob', | ||
lastName: 'Marley', | ||
email: '[email protected]' | ||
}); | ||
export const NationalCoordinator = genUser({ | ||
roles: ['NationalCoordinator'], | ||
id: '44444444-4444-4444-4444-444444444444', | ||
id: '55555555-5555-5555-5555-555555555555' | ||
}); | ||
|
||
exports.seed = async function () { | ||
await Users().insert([ | ||
Sampler1Fixture, | ||
Sampler2Fixture, | ||
SamplerDromFixture, | ||
RegionalCoordinator, | ||
NationalCoordinator, | ||
RegionalDromCoordinator, | ||
NationalCoordinator | ||
]); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
<link rel="apple-touch-icon" href="/dsfr/favicon/apple-touch-icon.png?v=1.12.1" /> | ||
<link rel="icon" href="/dsfr/favicon/favicon.svg?v=1.12.1" type="image/svg+xml" /> | ||
<link rel="shortcut icon" href="/dsfr/favicon/favicon.ico?v=1.12.1" type="image/x-icon" /> | ||
<link rel="stylesheet" href="/dsfr/utility/icons/icons.min.css?hash=483b6fe2" /> | ||
<link rel="stylesheet" href="/dsfr/utility/icons/icons.min.css?hash=19f0b40b" /> | ||
<link rel="stylesheet" href="/dsfr/dsfr.min.css?v=1.12.1" /> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" /> | ||
|
||
|
Oops, something went wrong.