@@ -19,6 +19,10 @@ import { EditElevation, EditElevationRequest } from '@use-cases/plan/EditElevati
1919import { EditDifferentialLeveling , EditDifferentialLevelingRequest } from '@use-cases/plan/EditDifferentialLeveling' ;
2020import { EditTopoBoundary , EditTopoBoundaryRequest } from '@use-cases/plan/EditTopoBoundary' ;
2121import { EditTopoSetting , EditTopoSettingRequest } from '@use-cases/plan/EditTopoSetting' ;
22+ import {
23+ EditLongitudinalProfileParameters ,
24+ EditLongitudinalProfileParametersRequest ,
25+ } from '@use-cases/plan/EditLongitudinalProfileParameters' ;
2226
2327export class PlanController {
2428 constructor (
@@ -36,6 +40,7 @@ export class PlanController {
3640 private readonly editDifferentialLevelingUseCase : EditDifferentialLeveling ,
3741 private readonly editTopoBoundaryUseCase : EditTopoBoundary ,
3842 private readonly editTopoSettingUseCase : EditTopoSetting ,
43+ private readonly editLongitudinalProfileParametersUseCase : EditLongitudinalProfileParameters ,
3944 ) { }
4045
4146 async createPlan (
@@ -297,6 +302,7 @@ export class PlanController {
297302 page_orientation : 1 ,
298303 footers : 1 ,
299304 footer_size : 1 ,
305+ dxf_version : 1 ,
300306 created_at : 1 ,
301307 updated_at : 1 ,
302308 } ,
@@ -434,4 +440,38 @@ export class PlanController {
434440 return handleError ( e ) ;
435441 }
436442 }
443+
444+ async editLongitudinalProfileParameters (
445+ req : HttpRequest <
446+ EditLongitudinalProfileParametersRequest [ 'params' ] ,
447+ { plan_id : string } ,
448+ undefined ,
449+ undefined ,
450+ AuthenticateResponse
451+ > ,
452+ ) : Promise < HttpResponse < Plan | Error > > {
453+ try {
454+ const error = PlanValidator . validateEditLongitudinalProfileParameters ( req . body ) ;
455+ if ( error ) {
456+ return badRequest ( error ) ;
457+ }
458+
459+ const plan = await this . editLongitudinalProfileParametersUseCase . execute ( {
460+ plan_id : req . params ! . plan_id ,
461+ params : req . body ! ,
462+ options : {
463+ filter : { user : req . user ! . id } ,
464+ projection : {
465+ longitudinal_profile_parameters : 1 ,
466+ created_at : 1 ,
467+ updated_at : 1 ,
468+ } ,
469+ } ,
470+ } ) ;
471+
472+ return success ( plan ) ;
473+ } catch ( e ) {
474+ return handleError ( e ) ;
475+ }
476+ }
437477}
0 commit comments