Skip to content

Instantly share code, notes, and snippets.

View pazteddy's full-sized avatar
🏠
Working from home

Teddy Paz Muñoz pazteddy

🏠
Working from home
View GitHub Profile
@pazteddy
pazteddy / dependencias_para_pruebas.md
Created December 9, 2025 15:37
Agregar todas las dependencias necesarias

Ingresamos al proyecto y ejecutamos en la terminal las instalaciones necesarias:

cd DevTallesShop.Api.Tests

dotnet add package Microsoft.NET.Test.Sdk
dotnet add package xunit
dotnet add package xunit.runner.visualstudio
dotnet add package FluentAssertions
dotnet add package Moq
dotnet add package Castle.Core
@pazteddy
pazteddy / generacion_documentacion.json
Created December 8, 2025 17:03
Instrucciones para generar documentación del proyecto
{
"role": "user",
"goal": "Generar un README.md atractivo y completo para el proyecto DevTallesShop.Api, una Minimal API en .NET.",
"context": {
"projectName": "DevTallesShop.Api",
"projectType": "Minimal API en .NET",
"solutionStructure": [
"DevTallesShop/",
" DevTallesShop.Api/",
" Data/",
@pazteddy
pazteddy / DiscountService.cs
Last active November 25, 2025 21:07
Tarea desarrollar la clase y método, para obtener el descuento según la edad del cliente y años como cliente
/*
=============
🏆 Ejercicio
=============
*/
// 1. Crear una clase llamada DiscountService.
//
// 2. Incluir el siguiente método público:
//
// - GetDiscountPercentage
@pazteddy
pazteddy / Instalaciones-arquitectura-limpia.md
Created November 20, 2025 15:12
Instalaciones recomendadas - .NET: Pruebas completas para minimal API

Instalaciones recomendadas - .NET: Pruebas completas para minimal API

.NET Logo xUnit Logo

@pazteddy
pazteddy / deploy-aws-eb-guide.md
Last active October 28, 2025 21:22
Pasos para desplegar nuestra aplicación en AWS Elastic Beanstalk

Guía de despliegue en AWS Elastic Beanstalk

Esta guía documenta el proceso completo para desplegar la aplicación TechNotes en AWS Elastic Beanstalk, basada en el despliegue exitoso realizado.

Requisitos previos

  • Shell zsh
  • .NET SDK 8 instalado (dotnet --version)
  • EB CLI instalado (eb --version)
@pazteddy
pazteddy / NoteOverview.razor
Created October 22, 2025 17:25
Estilos para la última columna de acciones en el componente NoteOverview
<TemplateColumn Title="Acciones" Class="border-2 px-6 py-4 text-center">
<div class="flex items-center justify-center space-x-2">
<button @onclick="() => EditNote(context.Id)"
class="p-2 text-indigo-600 hover:text-indigo-900 rounded-full hover:bg-indigo-50">
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 16 16">
<path
d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z" />
</svg>
</button>
<button @onclick="() => TogglePublishNote(context.Id)"
@pazteddy
pazteddy / NoteOverview.razor
Last active October 22, 2025 16:57
Estilos para el componente NoteOverview
@page "/note-overview"
@using TechNotes.Application.Notes
@rendermode @(new InteractiveWebAssemblyRenderMode(false))
@inject HttpClient Http
@inject NavigationManager NavigationManager
<PageTitle>Mis notas</PageTitle>
<h2 class="text-5xl font-bold text-center mb-3">Mis notas</h2>
@if (notes == null)
@pazteddy
pazteddy / RemoveRoleFromUser.cs
Last active October 17, 2025 21:36
Instrucciones para la tarea de eliminar un rol
/*
=============
🏆 Ejercicio
=============
*/
// 1. Agregar el siguiente método a la interfaz IUserService:
//
// - RemoveRoleFromUserAsync
// → Recibe un userId y un roleName,
// y elimina el rol del usuario indicado de forma asíncrona.
@pazteddy
pazteddy / UserRolesModal.razor
Last active October 17, 2025 15:39
Modal para la gestión de roles
@if (ShowModal)
{
<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div class="relative w-full max-w-lg sm:max-w-xl bg-white rounded-xl shadow-xl p-4 sm:p-5">
<!-- Boton de cerrar esquina superior derecha -->
<button @onclick="CloseModal"
class="absolute top-3 right-3 inline-flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
@pazteddy
pazteddy / UserOverview.razor
Created October 16, 2025 20:10
Estilos para el botón para manejo de roles y línea de comando para Tailwind
<TemplateColumn Title="Administrar" Class="border-2 px-4 py-3 text-center">
<div class="flex justify-center">
<button
class="rounded-md inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all duration-200 shadow-sm hover:shadow-md"
@onclick="() => OpenModal(context.Id, context.UserName)">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756