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

Added bal schema to address, common toponym and district meta schemas #300

Merged
merged 1 commit into from
Oct 10, 2023
Merged
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
5 changes: 3 additions & 2 deletions lib/api/address/schema.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {object, string, number, boolean, array, date} from 'yup'
import {banID, geometrySchema, labelSchema, cadastreSchema} from '../schema.js'
import {banID, geometrySchema, labelSchema, cadastreSchema, balSchema} from '../schema.js'

const PositionTypes = ['entrance', 'building', 'staircase identifier', 'unit identifier', 'utility service', 'postal delivery', 'parcel', 'segment', 'other']

Expand All @@ -9,7 +9,8 @@ const positionSchema = object({
})

const metaSchema = object({
cadastre: cadastreSchema
cadastre: cadastreSchema,
bal: balSchema,
})

export const banAddressSchema = object({
Expand Down
5 changes: 3 additions & 2 deletions lib/api/common-toponym/schema.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {object, array, date} from 'yup'
import {banID, geometrySchema, labelSchema, cadastreSchema} from '../schema.js'
import {banID, geometrySchema, labelSchema, cadastreSchema, balSchema} from '../schema.js'

const metaSchema = object({
cadastre: cadastreSchema
cadastre: cadastreSchema,
bal: balSchema,
})

export const banCommonToponymSchema = object({
Expand Down
5 changes: 3 additions & 2 deletions lib/api/district/schema.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {object, array, date, bool} from 'yup'
import {banID, labelSchema, inseeSchema} from '../schema.js'
import {banID, labelSchema, inseeSchema, balSchema} from '../schema.js'

const configSchema = object({
useBanId: bool()
})

const metaSchema = object({
insee: inseeSchema
insee: inseeSchema,
bal: balSchema,
})

export const banDistrictSchema = object({
Expand Down
11 changes: 10 additions & 1 deletion lib/api/schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {object, string, number, array} from 'yup'
import {object, string, number, array, date, boolean} from 'yup'

export const banID = string().trim().uuid()

Expand All @@ -19,3 +19,12 @@ export const inseeSchema = object({
export const cadastreSchema = object({
ids: array().of(string().trim())
})

export const balSchema = object({
idRevision: string().trim(),
dateRevision: date(),
codeAncienneCommune: string().trim(),
nomAncienneCommune: string().trim(),
isLieuDit: boolean()
})

Loading