# SandwichShop Solution

## Project Goal

Manage the operations of a sandwich shop.

## Setup Steps

- This should be configured as an Aspire solution using PlotStax in the initial generation of components and communication.

- This document provides all the information for using the PlotStax API: https://plotcourse.com/llms.txt

- Initially there should be one .NET Core Web API project called "SandwichShop.Main" and it should be enlisted in orchestration.

## Configure these things using only the PlotStax API in the Generator project.

- Add some records and enums for tracking customers and orders, managing employees, and managing inventory of ingredients in a sandwich shop.

- An EF repository manager component called "Storage" that runs in SandwichShop.Main.

- Configure storage with a service called "Repo" that's configured to generate CRUD methods for all data types.

- A non-EF C# component component called "OrderProcessing" that runs in SandwichShop.Main and references "Storage" and has a set of services each of which is configured to generate CRUD methods for one type of record per service.

- A UI component called "OrderUi" with a model for each service in OrderProcessing that should reference the proxy for that service.

- Additionally "OrderUi" should define a page, a script, and a custom element for each model as well as an index page with an index script and a custom element called "Home" for accessing the other pages.  The name of each page should match the name of the script it references as well as the main model.  The elements should also match except that the element names are all prefixed with "Shop".  The index page and index script should not be nested in a sub-folder.  The others should be in folders that group them by feature, for example, sub-components (page/script/model/element) related to creating a sandwich order should all be in one folder, and the sub-components related to employee management should be in a separate folder.

## Important Notes
- This page explains how to set up a new solution that uses the PlotStax API: https://plotcourse.com/ps/apidocs/getting-started
- This repository is an example application definition using the PlotStax API: https://github.com/PlotCourse/Sample-Semicolon
- This is the page where NuGet provides the PlotStax NuGet package: https://www.nuget.org/packages/PlotStax.Gen.Client
- This page has the entire list of URLs for the PlotStax API documentation: https://plotcourse.com/sitemap.txt
- If the user does not express a preference, the user should typically be asked whether they want to include a PlotStax initializer project or not.  If the Initializer project is included, then it should be built and run prior to adding any code to the Generator project.  If the Initializer is not included then, code in the Generator should be directly created following the pattern shown in the example application.
- The terms "attributed interface" and "expressive syntax" are used interchangeably within the context of PlotStax and refer to an interface-driven approach to defining builders.
- The PlotStax API documentation pertaining to attributed interfaces with the API are the items listed in https://plotcourse.com/sitemap.txt that begin with this path: https://plotcourse.com/ps/apidocs/client-api-types/attributes/
- If the user does not express a preference, the user should typically be asked whether they prefer component/sub-component builders to be defined with solution/component builder method calls or with the attributed interface approach.  Records should typically always be defined with the attributed interface approach.  Enums should typically always be defined with the attributed enum approach.
- When writing code for interfaces in the generator project using expressive syntax, never begin the name with an "I" for "interface" because it does not become an interface in the final application.  Instead, the name should indicate the name the builder should use, for example, for the name of a component or service.  The name can start with "I" if that is part of the actual name, for example a component called, "Indigo" or "Inspiration" but an additional "I" should not be used to represent "Interface".
- Note that typically the word "PlotStax" should not be part of the solution name since that is just an API being used for code generation.  If a specific name is not specified in a prompt, the default name used should be something related to the description of what the application does.
- In a solution that uses PlotStax, never directly edit files ending with an extension that indicates they're generated, that is any of these extensions: .g.ts, .generated.ts, .g.cs, or .generated.cs, because these files are managed by the PlotStax component.
- The solution file for a solution that uses PlotStax should use the modern "slnx" format not the older "sln" format.
- By default, target framework should be net10.0.
- By default, use version 13.4.6 for Aspire.AppHost.Sdk as well as any related packages (those with names starting with "Aspire.Hosting.")
- Any time a new .NET Core Web API is added to the solution, the Initializer will need to be re-run if the plan is to use that API for a new component defined with PlotStax.  If not using an Initializer project, then the enum representing the available .NET Core Web API projects should be directly updated to include the newly added project.
- Use the attributed interface approach to define the builders unless otherwise requested or needed.
- Just configure all components in one file under the PlotStax Generator project called "Components.cs" unless otherwise specified.
- Just configure all records and enums in one file under the PlotStax Generator project called "DataTypes.cs" unless otherwise specified.
- Unless otherwise specified, the solution file (the file ending in slnx) should use the folder structure suggested in the PlotStax "Getting Started" documentation and all the suggested folders should be created even if they will initially be empty.  Note that this does not refer to folders on disk, only defined in the slnx for organizing the solution view.
- ALWAYS check https://plotcourse.com for the authoritative API surface before writing any `PlotStax.Gen.Client` usage code
- NEVER hardcode API keys or secrets — use environment variables or `dotnet user-secrets`
