(input: input::ResponseData)
| 9 | |
| 10 | #[shopify_function_target(query_path = "src/run.graphql", schema_path = "schema.graphql")] |
| 11 | fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> { |
| 12 | let operations = input |
| 13 | .fulfillment_groups |
| 14 | .iter() |
| 15 | .map(|group| { |
| 16 | let rankings = group |
| 17 | .inventory_location_handles |
| 18 | .iter() |
| 19 | .map(|location_handle| output::RankedLocation { |
| 20 | location_handle: location_handle.clone(), |
| 21 | rank: 0, |
| 22 | }) |
| 23 | .collect::<Vec<output::RankedLocation>>(); |
| 24 | |
| 25 | output::Operation { |
| 26 | rank: output::FulfillmentGroupRankedLocations { |
| 27 | fulfillment_group_handle: group.handle.clone(), |
| 28 | rankings, |
| 29 | }, |
| 30 | } |
| 31 | }) |
| 32 | .collect(); |
| 33 | |
| 34 | Ok(output::FunctionRunResult { operations }) |
| 35 | } |
| 36 | |
| 37 | #[cfg(test)] |
| 38 | mod tests { |
nothing calls this directly
no outgoing calls
no test coverage detected