1- //TODO: Why is the request data here wrapped within a object and isn't a direct parameter
2-
31import axios from "axios" ;
42import {
53 Description , DisplayIcon ,
@@ -14,14 +12,13 @@ import {
1412} from "@code0-tech/hercules" ;
1513import { getAuthToken } from "../helpers.js" ;
1614import {
17- EndOfDayRequestData ,
1815 EndOfDayResponseData ,
1916 EndOfDayResponseDataSchema ,
2017} from "../data_types/glsEndOfDay.js" ;
2118
2219@Identifier ( "getEndOfDayReport" )
2320@DisplayIcon ( "codezero:gls" )
24- @Signature ( "(data: GLS_END_OF_DAY_REQUEST_DATA ): GLS_END_OF_DAY_RESPONSE_DATA" )
21+ @Signature ( "(date: string ): GLS_END_OF_DAY_RESPONSE_DATA" )
2522@Name ( { code : "en-US" , content : "Get end of day report" } )
2623@DisplayMessage ( { code : "en-US" , content : "Get end of day report" } )
2724@Documentation ( {
@@ -33,17 +30,17 @@ import {
3330 content : "Retrieves all shipments dispatched on a given date. Useful for reconciliation and end-of-day processing." ,
3431} )
3532@Parameter ( {
36- runtimeName : "data " ,
37- name : [ { code : "en-US" , content : "Data " } ] ,
38- description : [ { code : "en-US" , content : "The end of day report request data ." } ] ,
33+ runtimeName : "date " ,
34+ name : [ { code : "en-US" , content : "Date " } ] ,
35+ description : [ { code : "en-US" , content : "The dispatch date to retrieve shipments for, in ISO format (YYYY-MM-DD) ." } ] ,
3936} )
4037export class GetEndOfDayReportFunction {
41- async run ( context : FunctionContext , data : EndOfDayRequestData ) : Promise < EndOfDayResponseData > {
38+ async run ( context : FunctionContext , date : string ) : Promise < EndOfDayResponseData > {
4239 const url = context . matchedConfig . findConfig ( "ship_it_api_url" ) as string ;
4340
4441 try {
4542 const result = await axios . post (
46- `${ url } /rs/shipments/endofday?date=${ data . date } ` ,
43+ `${ url } /rs/shipments/endofday?date=${ date } ` ,
4744 { } ,
4845 {
4946 headers : {
0 commit comments