Skip to content

Commit

Permalink
feat(agences): ajout nom usuel (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
oni-Sk authored Dec 19, 2023
1 parent c17c49e commit 145032c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/domain/milo/conseiller.milo.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export namespace ConseillerMilo {
const agenceACreer: AsSql<AgenceSqlModel> = {
id: structureMilo.code,
nomAgence: structureMilo.nomOfficiel,
nomUsuel: structureMilo.nomUsuel,
nomRegion: structureDansLeDepartementSql.nomRegion ?? 'INCONNU',
codeRegion: structureDansLeDepartementSql.codeRegion,
nomDepartement: structureDansLeDepartementSql.nomDepartement,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use strict"

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn(
"agence",
"nom_usuel",
{
type: Sequelize.STRING,
allowNull: true
}
)
},

async down(queryInterface, Sequelize) {
await queryInterface.removeColumn("agence", "nom_usuel")
}
}
6 changes: 6 additions & 0 deletions src/infrastructure/sequelize/models/agence.sql-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export class AgenceDto extends Model {
})
nomAgence: string

@Column({
field: 'nom_usuel',
type: DataType.STRING
})
nomUsuel: string | null

@Column({
field: 'nom_region',
type: DataType.STRING
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/sql-models/agence.sql-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function uneAgenceMiloDto(
const defaults: AsSql<AgenceDto> = {
id: '1',
nomAgence: 'Mission Locale Aubenas',
nomUsuel: 'Mission Locale Aubenas',
nomDepartement: null,
codeDepartement: '07',
structure: Structure.MILO,
Expand All @@ -26,6 +27,7 @@ export function uneAgenceDto(
const defaults: AsSql<AgenceDto> = {
id: '1',
nomAgence: 'Nice',
nomUsuel: 'Nice',
nomDepartement: null,
codeDepartement: '6',
structure: Structure.POLE_EMPLOI,
Expand Down

0 comments on commit 145032c

Please sign in to comment.