Create a new Site Endpoint
Based on https://gitlab.hzdr.de/hub-terra/sms/frontend/-/issues/350 a backend Endpoint is needed.
-
make a specification together with Frontend Team @tim.eder -
Implement the Endpoint -
Implement Tests -
merge in Develop
This is the data model I am currently using in the frontend prototype.
geom
is an array of coordinate tuples. We could save it as a string encoded GeoJSON in the db. It is done like this in the BioMe webgis component. It could look like this:
"{\u0022type\u0022:\u0022MultiLineString\u0022,\u0022coordinates\u0022:[[[13.0467449439711,50.8897275252422],[13.0469384939347,50.8896681546136],[13.0472165032372,50.8896228347039],[13.0474117020844,50.8895774604349]]]}"
export interface ILatLng {
lat: number,
lng: number
}
export interface IAddress {
street?: string
streetNumber?: string
city?: string
zipCode?: string
country?: string
building?: string
room?: string
}
export interface ISite {
id: string
label: string
geom: ILatLng[]
description: string
epsgCode: string
address: IAddress
archived: boolean
contacts: IContact[]
createdAt: DateTime | null
updatedAt: DateTime | null
createdBy: IContact | null
updatedBy: IContact | null
permissionGroups: : IPermissionGroup[]
visibility: Visibility
}
The connection between sites and configurations should be handled via the configuration model. Because a configuration can only be part of a single site at a given moment, the configuration model needs to be extended with siteId: string
Edited by Tim Eder