gustavo-rossignolli/challenge-global — reverse-engineered prompt
Reverse engineered prompt
Build me a small but solid devices management API in C# and .NET. I want to be able to create, update, partially update, fetch, list, filter, and delete devices with fields for id, name, brand, state, and creation time. The valid states should be available, in use, and inactive. Please enforce the business rules too, creation time can never change, and if a device is in use then its name and brand cannot be edited and it also cannot be deleted.
Use a real relational database with PostgreSQL, expose versioned routes under /api/v1/devices, and include paging plus filters by brand and state. I also want Swagger so I can try it easily, clear error responses for validation, not found, and conflict cases, and basic health endpoints for live and ready checks. Add simple observability like structured request logs, tracing or metrics if practical, a response time header, and a basic benchmark endpoint. Please include unit and integration tests, automatic database migration on startup, and Docker plus docker compose so I can run the API and database together. Look up current docs online if you need to.
Want more depth? Deep Reverse