struct OrderMovie: AppIntent {
   static let title: LocalizedStringResource = "Order Movie"
   static let description = IntentDescription("Order a movie from the store.")
   static let supportedModes: IntentModes = .background

   @Dependency var appData: ApplicationData

   @Parameter(title: "Movie")
   var movie: MovieEntity

   @MainActor
   func perform() async throws -> some ProvidesDialog & ShowsSnippetView {
      try await requestConfirmation(
         actionName: .order,
         snippetIntent: OrderIntent(movie: $movie)
      )
      let movieData = appData.listMovies.first(where: { $0.id == movie.id })
      let title = movieData?.title ?? "Undefined"
      let order = movieData?.order ?? 0

      return .result(
         dialog: IntentDialog("Confirmation:"),
         view: ConfirmOrderView(movieTitle: title, orders: order)
      )
   }
}
struct TestIntentsShortcuts: AppShortcutsProvider {
   static var appShortcuts: [AppShortcut] {
      AppShortcut(
         intent: OrderMovie(),
         phrases: [
            "Order a movie in \(.applicationName)",
            "Buy a movie in \(.applicationName)"
         ],
         shortTitle: LocalizedStringResource("Order Movie"),
         systemImageName: "cart"
      )
   }
}