├── Samples ├── applepiesmall.jpg ├── peachpiesmall.jpg ├── pecanpiesmall.jpg ├── cheesecakesmall.jpg ├── cherrypiesmall.jpg ├── pumpkinpiesmall.jpg ├── rhubarbpiesmall.jpg ├── birthdaypiesmall.jpg ├── cranberrypiesmall.jpg ├── strawberrypiesmall.jpg ├── christmasapplepiesmall.jpg ├── pistachecheesecakesmall.jpg ├── blueberrycheesecakesmall.jpg ├── chocolatecheesecakesmall.jpg ├── strawberrycheesecakesmall.jpg └── caramelpopcorncheesecakesmall.jpg ├── AdminBaker ├── Client │ ├── wwwroot │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ └── scss │ │ │ │ │ ├── helpers │ │ │ │ │ ├── _clearfix.scss │ │ │ │ │ ├── _text-truncation.scss │ │ │ │ │ ├── _visually-hidden.scss │ │ │ │ │ ├── _vr.scss │ │ │ │ │ ├── _stretched-link.scss │ │ │ │ │ ├── _stacks.scss │ │ │ │ │ ├── _colored-links.scss │ │ │ │ │ ├── _ratio.scss │ │ │ │ │ └── _position.scss │ │ │ │ │ ├── mixins │ │ │ │ │ ├── _clearfix.scss │ │ │ │ │ ├── _lists.scss │ │ │ │ │ ├── _color-scheme.scss │ │ │ │ │ ├── _text-truncate.scss │ │ │ │ │ ├── _resize.scss │ │ │ │ │ ├── _container.scss │ │ │ │ │ ├── _alert.scss │ │ │ │ │ ├── _backdrop.scss │ │ │ │ │ ├── _image.scss │ │ │ │ │ ├── _box-shadow.scss │ │ │ │ │ ├── _reset-text.scss │ │ │ │ │ ├── _list-group.scss │ │ │ │ │ ├── _deprecate.scss │ │ │ │ │ ├── _transition.scss │ │ │ │ │ ├── _pagination.scss │ │ │ │ │ ├── _table-variants.scss │ │ │ │ │ ├── _visually-hidden.scss │ │ │ │ │ └── _caret.scss │ │ │ │ │ ├── forms │ │ │ │ │ ├── _form-text.scss │ │ │ │ │ ├── _validation.scss │ │ │ │ │ └── _labels.scss │ │ │ │ │ ├── _forms.scss │ │ │ │ │ ├── _helpers.scss │ │ │ │ │ ├── bootstrap-utilities.scss │ │ │ │ │ ├── bootstrap-reboot.scss │ │ │ │ │ ├── _transitions.scss │ │ │ │ │ ├── _grid.scss │ │ │ │ │ ├── _badge.scss │ │ │ │ │ ├── _breadcrumb.scss │ │ │ │ │ ├── _mixins.scss │ │ │ │ │ ├── _placeholders.scss │ │ │ │ │ ├── _close.scss │ │ │ │ │ ├── bootstrap.scss │ │ │ │ │ ├── _images.scss │ │ │ │ │ ├── _containers.scss │ │ │ │ │ ├── _progress.scss │ │ │ │ │ ├── _toasts.scss │ │ │ │ │ ├── bootstrap-grid.scss │ │ │ │ │ ├── _alert.scss │ │ │ │ │ └── _spinners.scss │ │ │ └── open-iconic │ │ │ │ ├── font │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ │ └── ICON-LICENSE │ │ ├── favicon.png │ │ ├── icon-192.png │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── assets │ │ │ └── images │ │ │ │ ├── logo.jpg │ │ │ │ ├── paypal.png │ │ │ │ ├── contact.jpg │ │ │ │ ├── noimage.png │ │ │ │ └── notfound.jpg │ │ ├── scss │ │ │ ├── _fixed-width.scss │ │ │ ├── _screen-reader.scss │ │ │ ├── _larger.scss │ │ │ ├── _list.scss │ │ │ ├── _core.scss │ │ │ ├── font-awesome.scss │ │ │ ├── _stacked.scss │ │ │ ├── _bordered-pulled.scss │ │ │ ├── _rotated-flipped.scss │ │ │ ├── _path.scss │ │ │ └── _animated.scss │ │ ├── js │ │ │ ├── validationrut.js │ │ │ └── geolocation.js │ │ └── index.html │ ├── Shared │ │ ├── NavMenu.razor.css │ │ ├── LoadingComponent.razor │ │ ├── NotFoundComponent.razor │ │ ├── MainLayout.razor │ │ ├── LoadingComponent.cs │ │ ├── MainLayout.razor.css │ │ ├── LoadingComponent.razor.css │ │ ├── Maestros │ │ │ ├── TipoTortaEdit.razor │ │ │ ├── RecetaEdit.razor │ │ │ ├── UnidadMedidaEdit.razor │ │ │ └── UnidadMedidaList.razor │ │ ├── Tortas │ │ │ ├── ProductoCard.razor │ │ │ └── ProductoCarousel.razor │ │ ├── Auditorias │ │ │ ├── VendedorAuditoria.razor │ │ │ ├── ClienteAuditoria.razor │ │ │ ├── MateriaPrimaAuditoria.razor │ │ │ └── ProductoAuditoria.razor │ │ └── Pedidos │ │ │ └── PedidoAuditoria.razor │ ├── Proxy │ │ ├── IRecetaProxy.cs │ │ ├── ITipoTortaProxy.cs │ │ ├── IUnidadMedidaProxy.cs │ │ ├── IMateriaPrimaProxy.cs │ │ ├── IPayPalProxy.cs │ │ ├── IReporteProxy.cs │ │ ├── Services │ │ │ ├── RecetaProxy.cs │ │ │ ├── TipoTortaProxy.cs │ │ │ ├── UnidadMedidaProxy.cs │ │ │ ├── MateriaPrimaProxy.cs │ │ │ ├── PayPalProxy.cs │ │ │ ├── ReporteProxy.cs │ │ │ ├── ProductoProxy.cs │ │ │ ├── ClienteProxy.cs │ │ │ └── VendedorProxy.cs │ │ ├── ICarritoProxy.cs │ │ ├── IClienteProxy.cs │ │ ├── IVendedorProxy.cs │ │ ├── IProductoProxy.cs │ │ ├── IProxyUser.cs │ │ ├── ICrudRestHelper.cs │ │ └── IPedidoProxy.cs │ ├── Pages │ │ ├── PayPalTransaction │ │ │ └── PayPalCancel.razor │ │ ├── Recetas │ │ │ ├── RecetasCreate.razor │ │ │ ├── RecetasEditPage.razor │ │ │ └── RecetasListPage.razor │ │ ├── Index.razor.css │ │ ├── TiposTorta │ │ │ ├── TiposTortaCreate.razor │ │ │ ├── TipoTortaEditPage.razor │ │ │ └── TiposTortaListPage.razor │ │ ├── UnidadesMedida │ │ │ ├── UnidadesMedidaCreate.razor │ │ │ ├── UnidadesMedidaEditPage.razor │ │ │ └── UnidadesMedidaListPage.razor │ │ ├── Productos │ │ │ ├── ProductosCreate.razor │ │ │ ├── ProductosListPage.razor │ │ │ └── ProductosEditPage.razor │ │ └── MateriasPrima │ │ │ ├── MateriasPrimaCreate.razor │ │ │ ├── MateriasPrimaListPage.razor │ │ │ └── MateriasPrimaEditPage.razor │ ├── Auth │ │ └── SessionStorageExtension.cs │ ├── Properties │ │ └── launchSettings.json │ ├── App.razor │ └── _Imports.razor ├── Shared │ ├── Response │ │ ├── CommonDtoResponse.cs │ │ ├── TipoTortaDto.cs │ │ ├── GeolocationResult.cs │ │ ├── ReporteTipoTortaDto.cs │ │ ├── RecetaDto.cs │ │ ├── PaymentOrderDtoResponse.cs │ │ ├── AuditoriaDto.cs │ │ ├── UnidadMedidaDto.cs │ │ ├── LoginDtoResponse.cs │ │ ├── MateriaPrimaAuditoriaDto.cs │ │ ├── VendedorAuditoriaDto.cs │ │ ├── ReporteCantidadDto.cs │ │ ├── MateriaPrimaDto.cs │ │ ├── PedidoAuditoriaDto.cs │ │ ├── ClienteAuditoriaDto.cs │ │ ├── ProductoAuditoriaDto.cs │ │ ├── BaseResponse.cs │ │ ├── ClienteDto.cs │ │ ├── VendedorDto.cs │ │ ├── ProductoDto.cs │ │ └── PedidoDto.cs │ ├── Request │ │ ├── PaymentOrderDtoRequest.cs │ │ ├── ClienteDtoRequest.cs │ │ ├── GenerateTokenToResetDtoRequest.cs │ │ ├── TarjetaDto.cs │ │ ├── TipoTortaDtoRequest.cs │ │ ├── VendedorDtoRequest.cs │ │ ├── UpdateProfileDtoRequest.cs │ │ ├── LoginDtoRequest.cs │ │ ├── RecetaDtoRequest.cs │ │ ├── ResetPasswordDtoRequest.cs │ │ ├── UnidadMedidaDtoRequest.cs │ │ ├── MateriaPrimaDtoRequest.cs │ │ ├── ChangePasswordDtoRequest.cs │ │ ├── PersonaDtoRequest.cs │ │ ├── ProductoDtoRequest.cs │ │ ├── RegistrarUsuarioDto.cs │ │ └── PedidoDtoRequest.cs │ ├── CarritoDto.cs │ ├── AdminBaker.Shared.csproj │ └── Constantes.cs └── Server │ ├── appsettings.json │ ├── .idea │ └── .idea.Server.dir │ │ └── .idea │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── indexLayout.xml │ │ └── .gitignore │ ├── .config │ └── dotnet-tools.json │ ├── Pages │ ├── Error.cshtml.cs │ └── Error.cshtml │ ├── Properties │ └── launchSettings.json │ ├── Controllers │ ├── PayPalController.cs │ ├── ReportesController.cs │ ├── RecetasController.cs │ ├── ClientesController.cs │ └── TipoTortasController.cs │ ├── appsettings.Development.json │ └── AdminBaker.Server.csproj ├── AdminBaker.DataAccess ├── Scripts │ └── uspAuditorias.sql ├── Configurations │ ├── TipoTortaConfiguration.cs │ ├── RecetaConfiguration.cs │ ├── ClienteConfiguration.cs │ ├── VendedorConfiguration.cs │ ├── MateriaPrimaConfiguration.cs │ ├── PedidoItemConfiguration.cs │ ├── ProductoConfiguration.cs │ ├── PedidoConfiguration.cs │ └── UnidadMedidaConfiguration.cs ├── IdentityUserECommerce.cs ├── Migrations │ ├── 20230709002459_v3.1.0.cs │ ├── 20230705064727_v2.0.0.cs │ └── 20230705214847_v3.0.1.cs └── AdminBaker.DataAccess.csproj ├── AdminBaker.Entities ├── TipoPedido.cs ├── TipoTorta.cs ├── EstadoPedido.cs ├── Receta.cs ├── Vendedor.cs ├── UnidadMedida.cs ├── Info │ ├── ReporteTipoTortaTotalInfo.cs │ ├── BaseAuditoriaInfo.cs │ ├── ReporteCantidadesInfo.cs │ ├── MateriaPrimaAuditoriaInfo.cs │ ├── VendedorAuditoriaInfo.cs │ ├── MateriaPrimaInfo.cs │ ├── ClienteAuditoriaInfo.cs │ ├── ProductoAuditoriaInfo.cs │ ├── PedidoAuditoriaInfo.cs │ ├── ProductoInfo.cs │ └── PedidoInfo.cs ├── Cliente.cs ├── AdminBaker.Entities.csproj ├── EntityBase.cs ├── MateriaPrima.cs ├── Persona.cs ├── Producto.cs ├── PedidoItem.cs ├── Pedido.cs └── Configuration │ └── AppConfig.cs ├── AdminBaker.Services ├── Interfaces │ ├── IEmailService.cs │ ├── IFileUploader.cs │ ├── IPayPalTransactionService.cs │ ├── IClienteService.cs │ ├── IReporteService.cs │ ├── IRecetaService.cs │ ├── ITipoTortaService.cs │ ├── IUnidadMedidaService.cs │ ├── IVendedorService.cs │ ├── IMateriaPrimaService.cs │ ├── IUserService.cs │ ├── IProductoService.cs │ └── IPedidoService.cs ├── Utils.cs ├── AdminBaker.Services.csproj └── Implementations │ └── AzureBlobStorageUploader.cs ├── AdminBaker.Repositories ├── Interfaces │ ├── IRecetaRepository.cs │ ├── ITipoTortaRepository.cs │ ├── IUnidadMedidaRepository.cs │ ├── IMateriaPrimaRepository.cs │ ├── IVendedorRepository.cs │ ├── IClienteRepository.cs │ ├── IProductoRepository.cs │ ├── IPedidoRepository.cs │ └── IRepositoryBase.cs ├── Implementations │ ├── RecetaRepository.cs │ ├── TipoTortaRepository.cs │ ├── UnidadMedidaRepository.cs │ ├── MateriaPrimaRepository.cs │ └── VendedorRepository.cs └── AdminBaker.Repositories.csproj └── .vscode ├── launch.json └── tasks.json /Samples/applepiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/applepiesmall.jpg -------------------------------------------------------------------------------- /Samples/peachpiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/peachpiesmall.jpg -------------------------------------------------------------------------------- /Samples/pecanpiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/pecanpiesmall.jpg -------------------------------------------------------------------------------- /Samples/cheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/cheesecakesmall.jpg -------------------------------------------------------------------------------- /Samples/cherrypiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/cherrypiesmall.jpg -------------------------------------------------------------------------------- /Samples/pumpkinpiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/pumpkinpiesmall.jpg -------------------------------------------------------------------------------- /Samples/rhubarbpiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/rhubarbpiesmall.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_clearfix.scss: -------------------------------------------------------------------------------- 1 | .clearfix { 2 | @include clearfix(); 3 | } 4 | -------------------------------------------------------------------------------- /Samples/birthdaypiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/birthdaypiesmall.jpg -------------------------------------------------------------------------------- /Samples/cranberrypiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/cranberrypiesmall.jpg -------------------------------------------------------------------------------- /Samples/strawberrypiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/strawberrypiesmall.jpg -------------------------------------------------------------------------------- /Samples/christmasapplepiesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/christmasapplepiesmall.jpg -------------------------------------------------------------------------------- /Samples/pistachecheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/pistachecheesecakesmall.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/favicon.png -------------------------------------------------------------------------------- /Samples/blueberrycheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/blueberrycheesecakesmall.jpg -------------------------------------------------------------------------------- /Samples/chocolatecheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/chocolatecheesecakesmall.jpg -------------------------------------------------------------------------------- /Samples/strawberrycheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/strawberrycheesecakesmall.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/icon-192.png -------------------------------------------------------------------------------- /Samples/caramelpopcorncheesecakesmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/Samples/caramelpopcorncheesecakesmall.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .nav-item { 2 | margin-left: 1px; 3 | text-transform: capitalize; 4 | font-size: 0.9em; 5 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Scripts/uspAuditorias.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker.DataAccess/Scripts/uspAuditorias.sql -------------------------------------------------------------------------------- /AdminBaker.Entities/TipoPedido.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public enum TipoPedido 4 | { 5 | PedidoNormal, 6 | PedidoEspecial 7 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/assets/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/assets/images/logo.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/assets/images/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/assets/images/paypal.png -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/assets/images/contact.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/assets/images/contact.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/assets/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/assets/images/noimage.png -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/assets/images/notfound.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/assets/images/notfound.jpg -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/CommonDtoResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class CommonDtoResponse 4 | { 5 | public int Id { get; set; } 6 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_text-truncation.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Text truncation 3 | // 4 | 5 | .text-truncate { 6 | @include text-truncate(); 7 | } 8 | -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/LoadingComponent.razor: -------------------------------------------------------------------------------- 1 | @if (IsLoading) 2 | { 3 |
4 |
5 |
6 |
7 | } -------------------------------------------------------------------------------- /AdminBaker/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/PaymentOrderDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class PaymentOrderDtoRequest 4 | { 5 | public int PedidoId { get; set; } 6 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /AdminBaker.Entities/TipoTorta.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities 2 | { 3 | public class TipoTorta : EntityBase 4 | { 5 | public required string Nombre { get; set; } 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erickorlando/BlazorWeb/HEAD/AdminBaker/Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/TipoTortaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class TipoTortaDto : CommonDtoResponse 4 | { 5 | public string Nombre { get; set; } = default!; 6 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/NotFoundComponent.razor: -------------------------------------------------------------------------------- 1 |

Pagina no encontrada

2 | 3 | No encontrado 4 | 5 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/ClienteDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class ClienteDtoRequest : PersonaDtoRequest 4 | { 5 | public DateTime FechaNacimiento { get; set; } 6 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/EstadoPedido.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public enum EstadoPedido 4 | { 5 | Pendiente, 6 | EnPreparacion, 7 | EnCamino, 8 | Entregado, 9 | Cancelado 10 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Receta.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class Receta : EntityBase 4 | { 5 | public required string Nombre { get; set; } 6 | public required string Detalle { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IEmailService.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Services.Interfaces; 2 | 3 | public interface IEmailService 4 | { 5 | Task SendEmailAsync(string email, string subject, string message); 6 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IFileUploader.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Services.Interfaces; 2 | 3 | public interface IFileUploader 4 | { 5 | Task UploadFileAsync(string? base64String, string? fileName); 6 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/GenerateTokenToResetDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class GenerateTokenToResetDtoRequest 4 | { 5 | public string Email { get; set; } = default!; 6 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IRecetaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | 3 | namespace AdminBaker.Repositories.Interfaces; 4 | 5 | public interface IRecetaRepository : IRepositoryBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Vendedor.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class Vendedor : Persona 4 | { 5 | public required string CodigoTrabajador { get; set; } 6 | public required string Horario { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 5 |
6 |
7 | @Body 8 |
9 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/GeolocationResult.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class GeolocationResult 4 | { 5 | public double Latitude { get; set; } 6 | public double Longitude { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/UnidadMedida.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class UnidadMedida : EntityBase 4 | { 5 | public required string Codigo { get; set; } 6 | public required string Descripcion { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/ITipoTortaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | 3 | namespace AdminBaker.Repositories.Interfaces; 4 | 5 | public interface ITipoTortaRepository : IRepositoryBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_visually-hidden.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Visually hidden 3 | // 4 | 5 | .visually-hidden, 6 | .visually-hidden-focusable:not(:focus):not(:focus-within) { 7 | @include visually-hidden(); 8 | } 9 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_vr.scss: -------------------------------------------------------------------------------- 1 | .vr { 2 | display: inline-block; 3 | align-self: stretch; 4 | width: 1px; 5 | min-height: 1em; 6 | background-color: currentColor; 7 | opacity: $hr-opacity; 8 | } 9 | -------------------------------------------------------------------------------- /AdminBaker/Server/.idea/.idea.Server.dir/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IUnidadMedidaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | 3 | namespace AdminBaker.Repositories.Interfaces; 4 | 5 | public interface IUnidadMedidaRepository : IRepositoryBase 6 | { 7 | 8 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ReporteTipoTortaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ReporteTipoTortaDto 4 | { 5 | public string TipoTorta { get; set; } = default!; 6 | public decimal SumaTotal { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/ReporteTipoTortaTotalInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class ReporteTipoTortaTotalInfo 4 | { 5 | public string TipoTorta { get; set; } = default!; 6 | public decimal SumaTotal { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/LoadingComponent.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | 3 | namespace AdminBaker.Client.Shared; 4 | 5 | public partial class LoadingComponent 6 | { 7 | [Parameter] 8 | public bool IsLoading { get; set; } 9 | } -------------------------------------------------------------------------------- /AdminBaker/Server/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "7.0.9", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/RecetaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class RecetaDto : CommonDtoResponse 4 | { 5 | public string Nombre { get; set; } = default!; 6 | public string Detalle { get; set; } = default!; 7 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Cliente.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class Cliente : Persona 4 | { 5 | public DateTime FechaNacimiento { get; set; } 6 | public string? Latitud { get; set; } 7 | public string? Longitud { get; set; } 8 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/TarjetaDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class TarjetaDto 6 | { 7 | public DateTime FechaRetiro { get; set; } = DateTime.Today.AddDays(14); 8 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IRecetaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IRecetaProxy : ICrudRestHelper 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start clearfix 2 | @mixin clearfix() { 3 | &::after { 4 | display: block; 5 | clear: both; 6 | content: ""; 7 | } 8 | } 9 | // scss-docs-end clearfix 10 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_lists.scss: -------------------------------------------------------------------------------- 1 | // Lists 2 | 3 | // Unstyled keeps list items block level, just removes default browser padding and list-style 4 | @mixin list-unstyled { 5 | padding-left: 0; 6 | list-style: none; 7 | } 8 | -------------------------------------------------------------------------------- /AdminBaker/Server/.idea/.idea.Server.dir/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_color-scheme.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start mixin-color-scheme 2 | @mixin color-scheme($name) { 3 | @media (prefers-color-scheme: #{$name}) { 4 | @content; 5 | } 6 | } 7 | // scss-docs-end mixin-color-scheme 8 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/TipoTortaDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class TipoTortaDtoRequest 6 | { 7 | [Required] 8 | public string Nombre { get; set; } = default!; 9 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Utils.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Services; 2 | 3 | public static class Utils 4 | { 5 | public static string ParseUserName(string email) 6 | { 7 | var userName = email.Split('@')[0]; 8 | return userName; 9 | } 10 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/ITipoTortaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface ITipoTortaProxy : ICrudRestHelper 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_text-truncate.scss: -------------------------------------------------------------------------------- 1 | // Text truncate 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-truncate() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/VendedorDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class VendedorDtoRequest : PersonaDtoRequest 4 | { 5 | public required string CodigoTrabajador { get; set; } 6 | public required string Horario { get; set; } 7 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/BaseAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class BaseAuditoriaInfo 4 | { 5 | public string? Usuario { get; set; } 6 | public string Estado { get; set; } = default!; 7 | public DateTime FechaCambio { get; set; } 8 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IUnidadMedidaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IUnidadMedidaProxy : ICrudRestHelper 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /AdminBaker/Server/.idea/.idea.Server.dir/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 5 | resize: $direction; // Options: horizontal, vertical, both 6 | } 7 | -------------------------------------------------------------------------------- /AdminBaker.Entities/AdminBaker.Entities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/PaymentOrderDtoResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class PaymentOrderDtoResponse 4 | { 5 | public int PedidoId { get; set; } 6 | public string OrderId { get; set; } = default!; 7 | public string ApproveUrl { get; set; } = default!; 8 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/UpdateProfileDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class UpdateProfileDtoRequest : PersonaDtoRequest 4 | { 5 | public DateTime FechaNacimiento { get; set; } 6 | public string? Latitud { get; set; } 7 | public string? Longitud { get; set; } 8 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/AuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class AuditoriaDto 4 | { 5 | public int Id { get; set; } 6 | public string Estado { get; set; } = default!; 7 | public string? Usuario { get; set; } 8 | public DateTime FechaCambio { get; set; } 9 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/EntityBase.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class EntityBase 4 | { 5 | public int Id { get; set; } 6 | public bool Estado { get; set; } 7 | public string? Usuario { get; set; } 8 | protected EntityBase() 9 | { 10 | Estado = true; 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/UnidadMedidaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class UnidadMedidaDto : CommonDtoResponse 4 | { 5 | public string Codigo { get; set; } = default!; 6 | public string Descripcion { get; set; } = default!; 7 | public string Texto => $"{Codigo} - {Descripcion}"; 8 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | main { 2 | flex: 1; 3 | } 4 | 5 | 6 | @media (max-width: 1024px) { 7 | .nav-link { 8 | text-transform: capitalize; 9 | } 10 | } 11 | 12 | @media (max-width: 1440px) { 13 | .nav-link { 14 | text-transform: capitalize; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/LoginDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class LoginDtoRequest 6 | { 7 | [Required] public string UserName { get; set; } = null!; 8 | 9 | [Required] public string Password { get; set; } = null!; 10 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/RecetaDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class RecetaDtoRequest 6 | { 7 | [StringLength(50)] 8 | public string Nombre { get; set; } = default!; 9 | public string Detalle { get; set; } = default!; 10 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/forms/_form-text.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Form text 3 | // 4 | 5 | .form-text { 6 | margin-top: $form-text-margin-top; 7 | @include font-size($form-text-font-size); 8 | font-style: $form-text-font-style; 9 | font-weight: $form-text-font-weight; 10 | color: $form-text-color; 11 | } 12 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/LoginDtoResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class LoginDtoResponse : BaseResponse 4 | { 5 | public string Token { get; set; } = default!; 6 | 7 | public string FullName { get; set; } = default!; 8 | 9 | public List Roles { get; set; } = default!; 10 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch and Debug Standalone Blazor WebAssembly App", 6 | "type": "blazorwasm", 7 | "request": "launch", 8 | "cwd": "${workspaceFolder}/AdminBaker/Server" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/CarritoDto.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Response; 2 | 3 | namespace AdminBaker.Shared; 4 | 5 | public class CarritoDto 6 | { 7 | public ProductoDto ProductoDto { get; set; } = null!; 8 | public int Cantidad { get; set; } 9 | public decimal Precio { get; set; } 10 | public decimal Total { get; set; } 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_forms.scss: -------------------------------------------------------------------------------- 1 | @import "forms/labels"; 2 | @import "forms/form-text"; 3 | @import "forms/form-control"; 4 | @import "forms/form-select"; 5 | @import "forms/form-check"; 6 | @import "forms/form-range"; 7 | @import "forms/floating-labels"; 8 | @import "forms/input-group"; 9 | @import "forms/validation"; 10 | -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IMateriaPrimaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IMateriaPrimaProxy : ICrudRestHelper 7 | { 8 | Task> ListAuditAsync(); 9 | 10 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/ResetPasswordDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class ResetPasswordDtoRequest 4 | { 5 | public string Token { get; set; } = null!; 6 | public string Email { get; set; } = null!; 7 | public string Clave { get; set; } = null!; 8 | public string ConfirmarClave { get; set; } = null!; 9 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/UnidadMedidaDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class UnidadMedidaDtoRequest 6 | { 7 | [Required] 8 | public string Codigo { get; set; } = default!; 9 | 10 | [Required] 11 | public string Descripcion { get; set; } = default!; 12 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_helpers.scss: -------------------------------------------------------------------------------- 1 | @import "helpers/clearfix"; 2 | @import "helpers/colored-links"; 3 | @import "helpers/ratio"; 4 | @import "helpers/position"; 5 | @import "helpers/stacks"; 6 | @import "helpers/visually-hidden"; 7 | @import "helpers/stretched-link"; 8 | @import "helpers/text-truncation"; 9 | @import "helpers/vr"; 10 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_stretched-link.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Stretched link 3 | // 4 | 5 | .stretched-link { 6 | &::#{$stretched-link-pseudo-element} { 7 | position: absolute; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | left: 0; 12 | z-index: $stretched-link-z-index; 13 | content: ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_container.scss: -------------------------------------------------------------------------------- 1 | // Container mixins 2 | 3 | @mixin make-container($gutter: $container-padding-x) { 4 | width: 100%; 5 | padding-right: var(--#{$variable-prefix}gutter-x, #{$gutter}); 6 | padding-left: var(--#{$variable-prefix}gutter-x, #{$gutter}); 7 | margin-right: auto; 8 | margin-left: auto; 9 | } 10 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/MateriaPrimaAuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class MateriaPrimaAuditoriaDto : AuditoriaDto 4 | { 5 | public string Nombre { get; set; } = default!; 6 | public DateTime Caducidad { get; set; } 7 | public decimal Cantidad { get; set; } 8 | public string UnidadMedida { get; set; } = default!; 9 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/AdminBaker.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IPayPalProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IPayPalProxy 7 | { 8 | Task CreateOrderAsync(PaymentOrderDtoRequest request); 9 | 10 | Task CapturePaymentAsync(int pedidoId, string orderId); 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_stacks.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start stacks 2 | .hstack { 3 | display: flex; 4 | flex-direction: row; 5 | align-items: center; 6 | align-self: stretch; 7 | } 8 | 9 | .vstack { 10 | display: flex; 11 | flex: 1 1 auto; 12 | flex-direction: column; 13 | align-self: stretch; 14 | } 15 | // scss-docs-end stacks 16 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_alert.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start alert-variant-mixin 2 | @mixin alert-variant($background, $border, $color) { 3 | color: $color; 4 | @include gradient-bg($background); 5 | border-color: $border; 6 | 7 | .alert-link { 8 | color: shade-color($color, 20%); 9 | } 10 | } 11 | // scss-docs-end alert-variant-mixin 12 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/VendedorAuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class VendedorAuditoriaDto : AuditoriaDto 4 | { 5 | public string NombreCompleto { get; set; } = default!; 6 | public string Rut { get; set; } = default!; 7 | public string Email { get; set; } = default!; 8 | public string Direccion { get; set; } = default!; 9 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/MateriaPrima.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class MateriaPrima : EntityBase 4 | { 5 | public required string Nombre { get; set; } 6 | public decimal Cantidad { get; set; } 7 | public required UnidadMedida UnidadMedida { get; set; } 8 | public int UnidadMedidaId { get; set; } 9 | public DateTime Caducidad { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker/Server/.idea/.idea.Server.dir/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /projectSettingsUpdater.xml 6 | /.idea.Server.iml 7 | /modules.xml 8 | /contentModel.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/ReporteCantidadesInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class ReporteCantidadesInfo 4 | { 5 | public int CantidadProductos { get; set; } 6 | public int CantidadClientes { get; set; } 7 | public int CantidadVentas { get; set; } 8 | public decimal SumaTotalVentas { get; set; } 9 | public decimal VentaPromedio { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IReporteProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Response; 2 | 3 | namespace AdminBaker.Client.Proxy; 4 | 5 | public interface IReporteProxy 6 | { 7 | Task> GetReporteTipoTortaAsync(DateTime fechaInicio, DateTime fechaFin); 8 | 9 | Task GetReporteCantidadesAsync(DateTime fechaInicio, DateTime fechaFin); 10 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ReporteCantidadDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ReporteCantidadDto 4 | { 5 | public int CantidadProductos { get; set; } 6 | public int CantidadClientes { get; set; } 7 | public int CantidadVentas { get; set; } 8 | public decimal SumaTotalVentas { get; set; } 9 | public decimal VentaPromedio { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/RecetaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy.Services; 5 | 6 | public class RecetaProxy : CrudRestHelperBase, IRecetaProxy 7 | { 8 | public RecetaProxy(HttpClient httpClient) : 9 | base("api/Recetas", httpClient) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/MateriaPrimaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class MateriaPrimaDto : CommonDtoResponse 4 | { 5 | public required string Nombre { get; set; } 6 | public decimal Cantidad { get; set; } 7 | public string UnidadMedida { get; set; } = default!; 8 | public int UnidadMedidaId { get; set; } 9 | public DateTime Caducidad { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IMateriaPrimaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Entities.Info; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IMateriaPrimaRepository : IRepositoryBase 7 | { 8 | Task> ListAsync(); 9 | 10 | Task> ListAuditAsync(); 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/ICarritoProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared; 2 | 3 | namespace AdminBaker.Client.Proxy; 4 | 5 | public interface ICarritoProxy 6 | { 7 | event Action? ActualizarVista; 8 | Task AgregarCarrito(CarritoDto modelo); 9 | Task EliminarCarrito(int idProducto); 10 | int CantidadProductos(); 11 | Task> ObtenerCarrito(); 12 | Task LimpiarCarrito(); 13 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/MateriaPrimaAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class MateriaPrimaAuditoriaInfo : BaseAuditoriaInfo 4 | { 5 | public int Id { get; set; } 6 | public string Nombre { get; set; } = default!; 7 | public DateTime Caducidad { get; set; } 8 | public decimal Cantidad { get; set; } 9 | public string UnidadMedida { get; set; } = default!; 10 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Implementations/RecetaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.DataAccess; 2 | using AdminBaker.Entities; 3 | using AdminBaker.Repositories.Interfaces; 4 | 5 | namespace AdminBaker.Repositories.Implementations; 6 | 7 | public class RecetaRepository : RepositoryBase, IRecetaRepository 8 | { 9 | public RecetaRepository(AdminBakerDbContext context) : base(context) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/PedidoAuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class PedidoAuditoriaDto : AuditoriaDto 4 | { 5 | public string NroPedido { get; set; } = default!; 6 | public DateTime Fecha { get; set; } 7 | public string Cliente { get; set; } = default!; 8 | public string EstadoPedido { get; set; } = default!; 9 | public string? Vendedor { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/VendedorAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class VendedorAuditoriaInfo : BaseAuditoriaInfo 4 | { 5 | public int Id { get; set; } 6 | public string NombreCompleto { get; set; } = default!; 7 | public string Rut { get; set; } = default!; 8 | public string Email { get; set; } = default!; 9 | public string Direccion { get; set; } = default!; 10 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Constantes.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared; 2 | 3 | public class Constantes 4 | { 5 | public const string Idioma = "es-CL"; 6 | public const string Formato = "N2"; 7 | public const string FormatoFecha = "yyyy-MM-dd"; 8 | 9 | public const string RolAdministrador = "Admin"; 10 | public const string RolCliente = "Cliente"; 11 | public const string RolVendedor = "Vendedor"; 12 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/MateriaPrimaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class MateriaPrimaInfo 4 | { 5 | public int Id { get; set; } 6 | public string Nombre { get; set; } = default!; 7 | public decimal Cantidad { get; set; } 8 | public string UnidadMedida { get; set; } = default!; 9 | public int UnidadMedidaId { get; set; } 10 | public DateTime Caducidad { get; set; } 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/TipoTortaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy.Services; 5 | 6 | public class TipoTortaProxy : CrudRestHelperBase, ITipoTortaProxy 7 | { 8 | public TipoTortaProxy(HttpClient httpClient) 9 | : base("api/TipoTortas", httpClient) 10 | { 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Implementations/TipoTortaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.DataAccess; 2 | using AdminBaker.Entities; 3 | using AdminBaker.Repositories.Interfaces; 4 | 5 | namespace AdminBaker.Repositories.Implementations; 6 | 7 | public class TipoTortaRepository : RepositoryBase, ITipoTortaRepository 8 | { 9 | public TipoTortaRepository(AdminBakerDbContext context) : base(context) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IPayPalTransactionService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IPayPalTransactionService 7 | { 8 | Task> CreateOrderAsync(PaymentOrderDtoRequest request); 9 | 10 | Task CapturePaymentAsync(int pedidoId, string orderId); 11 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ClienteAuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ClienteAuditoriaDto : AuditoriaDto 4 | { 5 | public string NombreCompleto { get; set; } = default!; 6 | public string Rut { get; set; } = default!; 7 | public string Email { get; set; } = default!; 8 | public string Direccion { get; set; } = default!; 9 | public DateTime FechaNacimiento { get; set; } 10 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IClienteProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IClienteProxy : ICrudRestHelper 7 | { 8 | Task> ListAsync(string? filter); 9 | 10 | Task> ListAuditAsync(); 11 | 12 | Task ReactivateAsync(int id); 13 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/UnidadMedidaProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy.Services; 5 | 6 | public class UnidadMedidaProxy : CrudRestHelperBase, IUnidadMedidaProxy 7 | { 8 | public UnidadMedidaProxy(HttpClient httpClient) 9 | : base("api/UnidadMedida", httpClient) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Implementations/UnidadMedidaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.DataAccess; 2 | using AdminBaker.Entities; 3 | using AdminBaker.Repositories.Interfaces; 4 | 5 | namespace AdminBaker.Repositories.Implementations; 6 | 7 | public class UnidadMedidaRepository : RepositoryBase, IUnidadMedidaRepository 8 | { 9 | public UnidadMedidaRepository(AdminBakerDbContext context) : base(context) 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IVendedorProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IVendedorProxy : ICrudRestHelper 7 | { 8 | Task> ListAsync(string? filter); 9 | 10 | Task> ListAuditAsync(); 11 | 12 | Task ReactivateAsync(int id); 13 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_colored-links.scss: -------------------------------------------------------------------------------- 1 | @each $color, $value in $theme-colors { 2 | .link-#{$color} { 3 | color: $value; 4 | 5 | @if $link-shade-percentage != 0 { 6 | &:hover, 7 | &:focus { 8 | color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage)); 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_backdrop.scss: -------------------------------------------------------------------------------- 1 | // Shared between modals and offcanvases 2 | @mixin overlay-backdrop($zindex, $backdrop-bg, $backdrop-opacity) { 3 | position: fixed; 4 | top: 0; 5 | left: 0; 6 | z-index: $zindex; 7 | width: 100vw; 8 | height: 100vh; 9 | background-color: $backdrop-bg; 10 | 11 | // Fade for backdrop 12 | &.fade { opacity: 0; } 13 | &.show { opacity: $backdrop-opacity; } 14 | } 15 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ProductoAuditoriaDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ProductoAuditoriaDto : AuditoriaDto 4 | { 5 | public string Nombre { get; set; } = default!; 6 | public int Cantidad { get; set; } 7 | public decimal Precio { get; set; } 8 | public string Relleno { get; set; } = default!; 9 | public string TipoTorta { get; set; } = default!; 10 | public double Tamanio { get; set; } 11 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IClienteService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Response; 2 | 3 | namespace AdminBaker.Services.Interfaces; 4 | 5 | public interface IClienteService 6 | { 7 | Task> ListAsync(string? filter); 8 | 9 | Task>> ListAuditAsync(); 10 | 11 | Task DeleteAsync(int id); 12 | 13 | Task ReactivateAsync(int id); 14 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IReporteService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Response; 2 | 3 | namespace AdminBaker.Services.Interfaces; 4 | 5 | public interface IReporteService 6 | { 7 | Task>> GetReporteTipoTortaAsync(DateTime fechaInicio, 8 | DateTime fechaFin); 9 | 10 | Task> GetReporteCantidadesAsync(DateTime fechaInicio, DateTime fechaFin); 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IProductoProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IProductoProxy : ICrudRestHelper 7 | { 8 | Task> ListTopCarouselAsync(); 9 | 10 | Task> ListAsync(string filter); 11 | 12 | Task> ListAuditAsync(); 13 | 14 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/ClienteAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class ClienteAuditoriaInfo : BaseAuditoriaInfo 4 | { 5 | public int Id { get; set; } 6 | public string NombreCompleto { get; set; } = default!; 7 | public string Rut { get; set; } = default!; 8 | public string Email { get; set; } = default!; 9 | public string Direccion { get; set; } = default!; 10 | public DateTime FechaNacimiento { get; set; } 11 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IVendedorRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Entities.Info; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IVendedorRepository : IRepositoryBase 7 | { 8 | Task FindByEmailAsync(string email); 9 | Task> ListAsync(string? filter); 10 | Task> ListAuditAsync(); 11 | Task ReactivarAsync(int id); 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/MateriaPrimaDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class MateriaPrimaDtoRequest 6 | { 7 | [Required] 8 | public string Nombre { get; set; } = default!; 9 | public decimal Cantidad { get; set; } 10 | public int UnidadMedidaId { get; set; } 11 | public DateTime Caducidad { get; set; } = DateTime.Today.AddMonths(6); 12 | public string? Usuario { get; set; } 13 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/ProductoAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class ProductoAuditoriaInfo : BaseAuditoriaInfo 4 | { 5 | public int Id { get; set; } 6 | public string Nombre { get; set; } = default!; 7 | public int Cantidad { get; set; } 8 | public decimal Precio { get; set; } 9 | public string Relleno { get; set; } = default!; 10 | public string TipoTorta { get; set; } = default!; 11 | public double Tamanio { get; set; } 12 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/BaseResponse.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class BaseResponse 4 | { 5 | public bool Success { get; set; } 6 | public string? ErrorMessage { get; set; } 7 | } 8 | 9 | public class BaseResponseGeneric : BaseResponse 10 | { 11 | public T? Data { get; set; } 12 | } 13 | 14 | public class PaginationResponse : BaseResponse 15 | { 16 | public ICollection? Data { get; set; } 17 | public int TotalPages { get; set; } 18 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/TipoTortaConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class TipoTortaConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Nombre) 12 | .HasMaxLength(100); 13 | } 14 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Persona.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Entities; 4 | 5 | public class Persona : EntityBase 6 | { 7 | [StringLength(50)] 8 | public required string Rut { get; set; } 9 | 10 | [StringLength(200)] 11 | public required string NombreCompleto { get; set; } 12 | 13 | [StringLength(500)] 14 | public required string Email { get; set; } 15 | 16 | [StringLength(500)] 17 | public string? Direccion { get; set; } 18 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IClienteRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Entities.Info; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IClienteRepository : IRepositoryBase 7 | { 8 | Task FindByEmailAsync(string email); 9 | Task GetLastNumberAsync(); 10 | Task> ListAsync(string? filter); 11 | Task> ListAuditAsync(); 12 | Task ReactivarAsync(int id); 13 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IProductoRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Entities.Info; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IProductoRepository : IRepositoryBase 7 | { 8 | Task> ListAsync(string? filtro); 9 | 10 | Task> ListTopCarousel(); 11 | 12 | Task GetSpecialAsync(); 13 | 14 | Task> ListAuditAsync(); 15 | 16 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_image.scss: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | 10 | @mixin img-fluid { 11 | // Part 1: Set a maximum relative to the parent 12 | max-width: 100%; 13 | // Part 2: Override the height to auto, otherwise images will be stretched 14 | // when setting a width and height attribute on the img element. 15 | height: auto; 16 | } 17 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/js/validationrut.js: -------------------------------------------------------------------------------- 1 | window.validacionRut = (rutCompleto) => { 2 | if (!/^[0-9]+-[0-9kK]{1}$/.test(rutCompleto)) 3 | return false; 4 | const tmp = rutCompleto.split('-'); 5 | var digv = tmp[1]; 6 | const rut = tmp[0]; 7 | if (digv == 'K') digv = 'k'; 8 | return (dv(rut) == digv); 9 | } 10 | 11 | function dv(t) { 12 | var m = 0, s = 1; 13 | for (; t; t = Math.floor(t / 10)) 14 | s = (s + t % 10 * (9 - m++ % 6)) % 11; 15 | return s ? s - 1 : 'k'; 16 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/PedidoAuditoriaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class PedidoAuditoriaInfo 4 | { 5 | public int Id { get; set; } 6 | public string NroPedido { get; set; } = default!; 7 | public DateTime Fecha { get; set; } 8 | public string Cliente { get; set; } = default!; 9 | public string EstadoPedido { get; set; } = default!; 10 | public string? Vendedor { get; set; } 11 | public string? Usuario { get; set; } 12 | public DateTime FechaCambio { get; set; } 13 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/bootstrap-utilities.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | */ 7 | 8 | // Configuration 9 | @import "functions"; 10 | @import "variables"; 11 | @import "mixins"; 12 | @import "utilities"; 13 | 14 | // Helpers 15 | @import "helpers"; 16 | 17 | // Utilities 18 | @import "utilities/api"; 19 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/bootstrap-reboot.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v5.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | 9 | @import "functions"; 10 | @import "variables"; 11 | @import "mixins"; 12 | @import "root"; 13 | @import "reboot"; 14 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_box-shadow.scss: -------------------------------------------------------------------------------- 1 | @mixin box-shadow($shadow...) { 2 | @if $enable-shadows { 3 | $result: (); 4 | 5 | @each $value in $shadow { 6 | @if $value != null { 7 | $result: append($result, $value, "comma"); 8 | } 9 | @if $value == none and length($shadow) > 1 { 10 | @warn "The keyword 'none' must be used as a single argument."; 11 | } 12 | } 13 | 14 | @if (length($result) > 0) { 15 | box-shadow: $result; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AdminBaker.Entities/Producto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class Producto : EntityBase 4 | { 5 | public required TipoTorta TipoTorta { get; set; } 6 | public int TipoTortaId { get; set; } 7 | public required string Nombre { get; set; } 8 | public int Cantidad { get; set; } 9 | public decimal Precio { get; set; } 10 | public required string Relleno { get; set; } 11 | public double Tamanio { get; set; } 12 | public string? ImagenUrl { get; set; } 13 | public bool Especial { get; set; } 14 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/ChangePasswordDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class ChangePasswordDtoRequest 6 | { 7 | [Required] 8 | public string OldPassword { get; set; } = default!; 9 | 10 | [Compare(nameof(ConfirmNewPassword))] 11 | public string NewPassword { get; set; } = default!; 12 | 13 | [Required] 14 | public string ConfirmNewPassword { get; set; } = default!; 15 | 16 | public string Email { get; set; } = string.Empty; 17 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IRecetaService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IRecetaService 7 | { 8 | 9 | Task> ListAsync(); 10 | 11 | Task> FindByIdAsync(int id); 12 | 13 | Task CreateAsync(RecetaDtoRequest request); 14 | 15 | Task UpdateAsync(int id, RecetaDtoRequest request); 16 | 17 | Task DeleteAsync(int id); 18 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/ITipoTortaService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface ITipoTortaService 7 | { 8 | Task> ListAsync(); 9 | 10 | Task> FindByIdAsync(int id); 11 | 12 | Task CreateAsync(TipoTortaDtoRequest request); 13 | 14 | Task UpdateAsync(int id, TipoTortaDtoRequest request); 15 | 16 | Task DeleteAsync(int id); 17 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ClienteDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ClienteDto : CommonDtoResponse 4 | { 5 | public string Rut { get; set; } = default!; 6 | 7 | public string NombreCompleto { get; set; } = default!; 8 | 9 | public string Email { get; set; } = default!; 10 | 11 | public string? Direccion { get; set; } 12 | public DateTime FechaNacimiento { get; set; } 13 | public string Estado { get; set; } = default!; 14 | public string? Latitud { get; set; } 15 | public string? Longitud { get; set; } 16 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/VendedorDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class VendedorDto : CommonDtoResponse 4 | { 5 | public string CodigoTrabajador { get; set; } = default!; 6 | 7 | public string Horario { get; set; } = default!; 8 | 9 | public string Rut { get; set; } = default!; 10 | 11 | public string NombreCompleto { get; set; } = default!; 12 | 13 | public string Email { get; set; } = default!; 14 | 15 | public string? Direccion { get; set; } 16 | 17 | public string Estado { get; set; } = default!; 18 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/ProductoInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class ProductoInfo 4 | { 5 | public int Id { get; set; } 6 | public required string TipoTorta { get; set; } 7 | public int TipoTortaId { get; set; } 8 | public required string Nombre { get; set; } 9 | public int Cantidad { get; set; } 10 | public decimal Precio { get; set; } 11 | public required string Relleno { get; set; } 12 | public double Tamanio { get; set; } 13 | public string? ImagenUrl { get; set; } 14 | public bool Especial { get; set; } 15 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IUnidadMedidaService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IUnidadMedidaService 7 | { 8 | Task> ListAsync(); 9 | 10 | Task> FindByIdAsync(int id); 11 | 12 | Task CreateAsync(UnidadMedidaDtoRequest request); 13 | 14 | Task UpdateAsync(int id, UnidadMedidaDtoRequest request); 15 | 16 | Task DeleteAsync(int id); 17 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/forms/_validation.scss: -------------------------------------------------------------------------------- 1 | // Form validation 2 | // 3 | // Provide feedback to users when form field values are valid or invalid. Works 4 | // primarily for client-side validation via scoped `:invalid` and `:valid` 5 | // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for 6 | // server-side validation. 7 | 8 | // scss-docs-start form-validation-states-loop 9 | @each $state, $data in $form-validation-states { 10 | @include form-validation-state($state, $data...); 11 | } 12 | // scss-docs-end form-validation-states-loop 13 | -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/ProductoDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class ProductoDto 4 | { 5 | public int Id { get; set; } 6 | public string Nombre { get; set; } = string.Empty; 7 | public int Cantidad { get; set; } 8 | public decimal Precio { get; set; } 9 | public int TipoTortaId { get; set; } 10 | public required string TipoTorta { get; set; } 11 | public required string Relleno { get; set; } 12 | public double Tamanio { get; set; } 13 | public string? ImagenUrl { get; set; } 14 | public bool Especial { get; set; } 15 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/RecetaConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class RecetaConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Nombre) 12 | .HasMaxLength(100); 13 | 14 | builder.Property(p => p.Detalle) 15 | .HasMaxLength(10000); 16 | } 17 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_ratio.scss: -------------------------------------------------------------------------------- 1 | // Credit: Nicolas Gallagher and SUIT CSS. 2 | 3 | .ratio { 4 | position: relative; 5 | width: 100%; 6 | 7 | &::before { 8 | display: block; 9 | padding-top: var(--#{$variable-prefix}aspect-ratio); 10 | content: ""; 11 | } 12 | 13 | > * { 14 | position: absolute; 15 | top: 0; 16 | left: 0; 17 | width: 100%; 18 | height: 100%; 19 | } 20 | } 21 | 22 | @each $key, $ratio in $aspect-ratios { 23 | .ratio-#{$key} { 24 | --#{$variable-prefix}aspect-ratio: #{$ratio}; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_transitions.scss: -------------------------------------------------------------------------------- 1 | .fade { 2 | @include transition($transition-fade); 3 | 4 | &:not(.show) { 5 | opacity: 0; 6 | } 7 | } 8 | 9 | // scss-docs-start collapse-classes 10 | .collapse { 11 | &:not(.show) { 12 | display: none; 13 | } 14 | } 15 | 16 | .collapsing { 17 | height: 0; 18 | overflow: hidden; 19 | @include transition($transition-collapse); 20 | 21 | &.collapse-horizontal { 22 | width: 0; 23 | height: auto; 24 | @include transition($transition-collapse-width); 25 | } 26 | } 27 | // scss-docs-end collapse-classes 28 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IProxyUser.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IProxyUser 7 | { 8 | Task Login(LoginDtoRequest request); 9 | Task Register(RegistrarUsuarioDto request); 10 | Task SendTokenToResetPassword(GenerateTokenToResetDtoRequest request); 11 | Task ResetPassword(ResetPasswordDtoRequest request); 12 | Task ChangePassword(ChangePasswordDtoRequest request); 13 | Task UpdateProfile(UpdateProfileDtoRequest request); 14 | Task GetProfile(); 15 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/PersonaDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class PersonaDtoRequest 6 | { 7 | [StringLength(50)] 8 | [Required] 9 | public string Rut { get; set; } = default!; 10 | 11 | [StringLength(200)] 12 | [Required] 13 | public string NombreCompleto { get; set; } = default!; 14 | 15 | [StringLength(500)] 16 | [EmailAddress] 17 | public string Email { get; set; } = default!; 18 | 19 | [StringLength(500)] 20 | [Required] 21 | public string? Direccion { get; set; } 22 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/ICrudRestHelper.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Response; 2 | 3 | namespace AdminBaker.Client.Proxy; 4 | 5 | public interface ICrudRestHelper 6 | where TRequest : class 7 | where TResponse : class 8 | { 9 | string BaseUrl { get; set; } 10 | 11 | Task> ListAsync(string? filter, int page = 1, int pageSize = 5); 12 | Task> ListAsync(); 13 | Task FindByIdAsync(int id); 14 | Task CreateAsync(TRequest request); 15 | Task UpdateAsync(int id, TRequest request); 16 | Task DeleteAsync(int id); 17 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/IPedidoProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Client.Proxy; 5 | 6 | public interface IPedidoProxy : ICrudRestHelper 7 | { 8 | Task> ListAsync(DateTime fechaInicio, DateTime fechaFin, string? filtro); 9 | 10 | Task> ListAuditAsync(); 11 | 12 | Task TakeAsync(int id); 13 | 14 | Task CancelAsync(int id); 15 | 16 | Task ChangeStatusAsync(int id, int status); 17 | 18 | Task CreatePedidoAsync(PedidoDtoRequest request); 19 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size or overflow-wrap / word-wrap. 4 | font-style: normal; 5 | font-weight: $font-weight-normal; 6 | line-height: $line-height-base; 7 | text-align: left; // Fallback for where `start` is not supported 8 | text-align: start; 9 | text-decoration: none; 10 | text-shadow: none; 11 | text-transform: none; 12 | letter-spacing: normal; 13 | word-break: normal; 14 | word-spacing: normal; 15 | white-space: normal; 16 | line-break: auto; 17 | } 18 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/ClienteConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class ClienteConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder 12 | .Property(p => p.FechaNacimiento) 13 | .HasColumnType("date"); 14 | 15 | builder.ToTable(nameof(Cliente), o => 16 | { 17 | o.IsTemporal(); 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/PedidoItem.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class PedidoItem : EntityBase 4 | { 5 | public required Pedido Pedido { get; set; } 6 | public int PedidoId { get; set; } 7 | public Producto Producto { get; set; } = default!; 8 | public int ProductoId { get; set; } 9 | public TipoTorta TipoTorta { get; set; } = default!; 10 | public int TipoTortaId { get; set; } 11 | public double Tamanio { get; set; } 12 | public required string Relleno { get; set; } 13 | public decimal PrecioUnitario { get; set; } 14 | public decimal Cantidad { get; set; } 15 | public decimal Total { get; set; } 16 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/IdentityUserECommerce.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Identity; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace AdminBaker.DataAccess; 5 | 6 | public class IdentityUserECommerce : IdentityUser 7 | { 8 | [StringLength(50)] 9 | public string Rut { get; set; } = default!; 10 | 11 | [StringLength(200)] 12 | public string NombreCompleto { get; set; } = default!; 13 | 14 | public DateTime FechaNacimiento { get; set; } 15 | 16 | [StringLength(500)] 17 | public string? Direccion { get; set; } 18 | 19 | public string? Latitud { get; set; } 20 | 21 | public string? Longitud { get; set; } 22 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | // scss-docs-start list-group-mixin 4 | @mixin list-group-item-variant($state, $background, $color) { 5 | .list-group-item-#{$state} { 6 | color: $color; 7 | background-color: $background; 8 | 9 | &.list-group-item-action { 10 | &:hover, 11 | &:focus { 12 | color: $color; 13 | background-color: shade-color($background, 10%); 14 | } 15 | 16 | &.active { 17 | color: $white; 18 | background-color: $color; 19 | border-color: $color; 20 | } 21 | } 22 | } 23 | } 24 | // scss-docs-end list-group-mixin 25 | -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IVendedorService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IVendedorService 7 | { 8 | Task> ListAsync(string? filter); 9 | Task>> ListAuditAsync(); 10 | Task> FindByIdAsync(int id); 11 | Task CreateAsync(VendedorDtoRequest request); 12 | Task UpdateAsync(int id, VendedorDtoRequest request); 13 | Task DeleteAsync(int id); 14 | Task ReactivateAsync(int id); 15 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/helpers/_position.scss: -------------------------------------------------------------------------------- 1 | // Shorthand 2 | 3 | .fixed-top { 4 | position: fixed; 5 | top: 0; 6 | right: 0; 7 | left: 0; 8 | z-index: $zindex-fixed; 9 | } 10 | 11 | .fixed-bottom { 12 | position: fixed; 13 | right: 0; 14 | bottom: 0; 15 | left: 0; 16 | z-index: $zindex-fixed; 17 | } 18 | 19 | // Responsive sticky top 20 | @each $breakpoint in map-keys($grid-breakpoints) { 21 | @include media-breakpoint-up($breakpoint) { 22 | $infix: breakpoint-infix($breakpoint, $grid-breakpoints); 23 | 24 | .sticky#{$infix}-top { 25 | position: sticky; 26 | top: 0; 27 | z-index: $zindex-sticky; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IMateriaPrimaService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IMateriaPrimaService 7 | { 8 | 9 | Task> ListAsync(); 10 | 11 | Task>> ListAuditAsync(); 12 | 13 | Task> FindByIdAsync(int id); 14 | 15 | Task CreateAsync(MateriaPrimaDtoRequest request); 16 | 17 | Task UpdateAsync(int id, MateriaPrimaDtoRequest request); 18 | 19 | Task DeleteAsync(int id, string usuario); 20 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_deprecate.scss: -------------------------------------------------------------------------------- 1 | // Deprecate mixin 2 | // 3 | // This mixin can be used to deprecate mixins or functions. 4 | // `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to 5 | // some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap) 6 | @mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning: false) { 7 | @if ($enable-deprecation-messages != false and $ignore-warning != true) { 8 | @warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}."; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/VendedorConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class VendedorConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.CodigoTrabajador) 12 | .HasMaxLength(100); 13 | 14 | builder.Property(p => p.Horario) 15 | .HasMaxLength(500); 16 | 17 | builder.ToTable(nameof(Vendedor), o => 18 | { 19 | o.IsTemporal(); 20 | }); 21 | } 22 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/PayPalTransaction/PayPalCancel.razor: -------------------------------------------------------------------------------- 1 | @page "/paypaltransaction/cancel" 2 | @inject NavigationManager NavigationManager 3 | @inject ISessionStorageService SessionStorageService 4 |

Lo sentimos, su pago de PayPal ha sido cancelado

5 | 6 | 7 | 8 | @code 9 | { 10 | protected override async Task OnInitializedAsync() 11 | { 12 | await SessionStorageService.RemoveItemAsync("paypalResponse"); 13 | 14 | await base.OnInitializedAsync(); 15 | } 16 | 17 | private void Back() 18 | { 19 | NavigationManager.NavigateTo("/"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/LoadingComponent.razor.css: -------------------------------------------------------------------------------- 1 | .loading-overlay { 2 | position: fixed; 3 | top: 0; 4 | left: 0; 5 | width: 100%; 6 | height: 100%; 7 | background-color: #000000; 8 | background-color: rgba(0, 0, 0, 0.5); 9 | display: flex; 10 | justify-content: center; 11 | align-items: center; 12 | z-index: 9999; 13 | } 14 | 15 | .spinner { 16 | border: 5px solid #008b8b; 17 | border-top: 5px solid #3498db; 18 | border-radius: 50%; 19 | width: 200px; 20 | height: 200px; 21 | animation: spin 2s linear infinite; 22 | } 23 | 24 | @keyframes spin { 25 | 0% { 26 | transform: rotate(0deg); 27 | } 28 | 29 | 100% { 30 | transform: rotate(360deg); 31 | } 32 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/AdminBaker.Repositories.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IUserService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IUserService 7 | { 8 | Task LoginAsync(LoginDtoRequest request); 9 | 10 | Task RegisterAsync(RegistrarUsuarioDto request); 11 | Task SendTokenToResetPasswordAsync(GenerateTokenToResetDtoRequest request); 12 | Task ResetPasswordAsync(ResetPasswordDtoRequest request); 13 | Task ChangePasswordAsync(ChangePasswordDtoRequest request); 14 | Task UpdateProfileAsync(UpdateProfileDtoRequest request); 15 | Task> GetProfileAsync(string email); 16 | } -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IProductoService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | 4 | namespace AdminBaker.Services.Interfaces; 5 | 6 | public interface IProductoService 7 | { 8 | 9 | Task> ListAsync(string? filter); 10 | 11 | Task>> ListAuditAsync(); 12 | 13 | Task>> ListTopCarousel(); 14 | 15 | Task> FindByIdAsync(int id); 16 | 17 | Task CreateAsync(ProductoDtoRequest request); 18 | 19 | Task UpdateAsync(int id, ProductoDtoRequest request); 20 | 21 | Task DeleteAsync(int id, string userName); 22 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_grid.scss: -------------------------------------------------------------------------------- 1 | // Row 2 | // 3 | // Rows contain your columns. 4 | 5 | @if $enable-grid-classes { 6 | .row { 7 | @include make-row(); 8 | 9 | > * { 10 | @include make-col-ready(); 11 | } 12 | } 13 | } 14 | 15 | @if $enable-cssgrid { 16 | .grid { 17 | display: grid; 18 | grid-template-rows: repeat(var(--#{$variable-prefix}rows, 1), 1fr); 19 | grid-template-columns: repeat(var(--#{$variable-prefix}columns, #{$grid-columns}), 1fr); 20 | gap: var(--#{$variable-prefix}gap, #{$grid-gutter-width}); 21 | 22 | @include make-cssgrid(); 23 | } 24 | } 25 | 26 | 27 | // Columns 28 | // 29 | // Common styles for small and large grid columns 30 | 31 | @if $enable-grid-classes { 32 | @include make-grid-columns(); 33 | } 34 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_badge.scss: -------------------------------------------------------------------------------- 1 | // Base class 2 | // 3 | // Requires one of the contextual, color modifier classes for `color` and 4 | // `background-color`. 5 | 6 | .badge { 7 | display: inline-block; 8 | padding: $badge-padding-y $badge-padding-x; 9 | @include font-size($badge-font-size); 10 | font-weight: $badge-font-weight; 11 | line-height: 1; 12 | color: $badge-color; 13 | text-align: center; 14 | white-space: nowrap; 15 | vertical-align: baseline; 16 | @include border-radius($badge-border-radius); 17 | @include gradient-bg(); 18 | 19 | // Empty badges collapse automatically 20 | &:empty { 21 | display: none; 22 | } 23 | } 24 | 25 | // Quick fix for badges in buttons 26 | .btn .badge { 27 | position: relative; 28 | top: -1px; 29 | } 30 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /AdminBaker.Entities/Pedido.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities; 2 | 3 | public class Pedido : EntityBase 4 | { 5 | public DateTime Fecha { get; set; } 6 | public Cliente Cliente { get; set; } = null!; 7 | public int ClienteId { get; set; } 8 | public Vendedor? Vendedor { get; set; } 9 | public int? VendedorId { get; set; } 10 | public EstadoPedido EstadoPedido { get; set; } 11 | public TipoPedido TipoPedido { get; set; } 12 | public decimal TotalVenta { get; set; } 13 | public string? UrlImagen { get; set; } 14 | public DateTime? FechaRetiro { get; set; } 15 | public string? MensajePersonalizado { get; set; } 16 | public string? NroPedido { get; set; } 17 | 18 | public string? JsonPayPalResponse { get; set; } 19 | 20 | public string? PayPalUrlOrder { get; set; } 21 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/MateriaPrimaConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class MateriaPrimaConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Nombre) 12 | .HasMaxLength(100); 13 | 14 | builder.Property(p => p.Cantidad) 15 | .HasPrecision(11,2); 16 | 17 | builder.Property(p => p.Caducidad) 18 | .HasColumnType("date"); 19 | 20 | builder.ToTable(nameof(MateriaPrima), o => 21 | { 22 | o.IsTemporal(); 23 | }); 24 | } 25 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_transition.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable property-disallowed-list 2 | @mixin transition($transition...) { 3 | @if length($transition) == 0 { 4 | $transition: $transition-base; 5 | } 6 | 7 | @if length($transition) > 1 { 8 | @each $value in $transition { 9 | @if $value == null or $value == none { 10 | @warn "The keyword 'none' or 'null' must be used as a single argument."; 11 | } 12 | } 13 | } 14 | 15 | @if $enable-transitions { 16 | @if nth($transition, 1) != null { 17 | transition: $transition; 18 | } 19 | 20 | @if $enable-reduced-motion and nth($transition, 1) != null and nth($transition, 1) != none { 21 | @media (prefers-reduced-motion: reduce) { 22 | transition: none; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AdminBaker/Server/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace AdminBaker.Server.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/ProductoDtoRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class ProductoDtoRequest 6 | { 7 | [Required] 8 | public string Nombre { get; set; } = string.Empty; 9 | 10 | [Range(0, 9999)] 11 | public int Cantidad { get; set; } 12 | public decimal Precio { get; set; } 13 | public int TipoTortaId { get; set; } 14 | 15 | //public string TipoTorta { get; set; } = null!; 16 | 17 | [Required] 18 | public string Relleno { get; set; } = default!; 19 | public double Tamanio { get; set; } 20 | 21 | public string? ImagenUrl { get; set; } 22 | 23 | public string? Base64Imagen { get; set; } 24 | public string? FileName { get; set; } 25 | public bool Especial { get; set; } 26 | public string? UserName { get; set; } 27 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Auth/SessionStorageExtension.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using Blazored.SessionStorage; 3 | 4 | namespace AdminBaker.Client.Auth; 5 | 6 | public static class SessionStorageExtension 7 | { 8 | public static async Task SaveStorage(this ISessionStorageService sessionStorageService, string key, T value) 9 | where T : class 10 | { 11 | var json = JsonSerializer.Serialize(value); 12 | await sessionStorageService.SetItemAsStringAsync(key, json); 13 | } 14 | 15 | public static async Task GetStorage(this ISessionStorageService sessionStorageService, string key) 16 | where T : class 17 | { 18 | var json = await sessionStorageService.GetItemAsStringAsync(key); 19 | if (json == null) 20 | return null; 21 | 22 | return JsonSerializer.Deserialize(json); 23 | } 24 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/js/geolocation.js: -------------------------------------------------------------------------------- 1 | window.blazorGetGeolocation = () => { 2 | return new Promise((resolve, reject) => { 3 | if ("geolocation" in navigator) { 4 | navigator.geolocation.getCurrentPosition( 5 | (position) => { 6 | resolve({ 7 | latitude: position.coords.latitude, 8 | longitude: position.coords.longitude 9 | }); 10 | }, 11 | (error) => { 12 | reject(error.message); 13 | }, 14 | { 15 | enableHighAccuracy: true, 16 | timeout: 10000 17 | } 18 | ); 19 | } else { 20 | reject("La geolocalización no está disponible en este navegador."); 21 | } 22 | }); 23 | }; -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Recetas/RecetasCreate.razor: -------------------------------------------------------------------------------- 1 | @page "/recetas/create" 2 | @inject IRecetaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Crear Receta

7 | 8 | 9 | 10 | @code { 11 | private RecetaDtoRequest Model { get; set; } = new RecetaDtoRequest(); 12 | 13 | private async Task Save() 14 | { 15 | try 16 | { 17 | await Proxy.CreateAsync(Model); 18 | NavigationManager.NavigateTo("/recetas/list"); 19 | } 20 | catch (Exception ex) 21 | { 22 | await Swal.FireAsync(new SweetAlertOptions 23 | { 24 | Text = ex.Message, 25 | Icon = SweetAlertIcon.Error 26 | }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/MateriaPrimaProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | using AdminBaker.Shared.Request; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class MateriaPrimaProxy : CrudRestHelperBase, IMateriaPrimaProxy 8 | { 9 | public MateriaPrimaProxy(HttpClient httpClient) : 10 | base("api/MateriaPrimas", httpClient) 11 | { 12 | } 13 | 14 | public async Task> ListAuditAsync() 15 | { 16 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}/ListAudit"); 17 | if (response!.Success) 18 | return response.Data!; 19 | 20 | throw new InvalidOperationException(response.ErrorMessage); 21 | } 22 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Index.razor.css: -------------------------------------------------------------------------------- 1 | .container-footer { 2 | padding-top: 1.5em; 3 | margin-top: 0.5em; 4 | background-color: #1a1a1a; 5 | align-items: center; 6 | height: 5em; 7 | box-sizing: initial; 8 | } 9 | 10 | .elemento { 11 | margin: 1em; 12 | } 13 | 14 | .container-footer label { 15 | color: white; 16 | } 17 | 18 | .container-footer .footer { 19 | display: flex; 20 | justify-content: center; 21 | align-items: center; 22 | left: 0; 23 | bottom: 0; 24 | width: 100%; 25 | height: 4em; /* Altura del footer */ 26 | padding-bottom: 1px; 27 | } 28 | 29 | .container-footer .footer__social { 30 | display: flex; 31 | color: white; 32 | } 33 | 34 | 35 | /* Media Queries para ocultar el footer en el movil*/ 36 | @media (max-width: 768px) { 37 | .container-footer { 38 | display: none; 39 | } 40 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/TiposTorta/TiposTortaCreate.razor: -------------------------------------------------------------------------------- 1 | @page "/tipostorta/create" 2 | @inject ITipoTortaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Crear Tipo de Torta

7 | 8 | 9 | 10 | @code { 11 | private TipoTortaDtoRequest Model { get; set; } = new TipoTortaDtoRequest(); 12 | 13 | private async Task Save() 14 | { 15 | try 16 | { 17 | await Proxy.CreateAsync(Model); 18 | NavigationManager.NavigateTo("/tipostorta/list"); 19 | } 20 | catch (Exception ex) 21 | { 22 | await Swal.FireAsync(new SweetAlertOptions 23 | { 24 | Text = ex.Message, 25 | Icon = SweetAlertIcon.Error 26 | }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/PedidoItemConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class PedidoItemConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Cantidad) 12 | .HasPrecision(11, 2); 13 | 14 | builder.Property(p => p.PrecioUnitario) 15 | .HasPrecision(11, 2); 16 | 17 | builder.Property(p => p.Relleno) 18 | .HasMaxLength(150); 19 | 20 | builder.Property(p => p.Tamanio) 21 | .HasPrecision(11, 2); 22 | 23 | builder.Property(p => p.Total) 24 | .HasPrecision(11, 2); 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Migrations/20230709002459_v3.1.0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace AdminBaker.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class v310 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Especial", 15 | table: "Producto", 16 | type: "bit", 17 | nullable: false, 18 | defaultValue: false); 19 | } 20 | 21 | /// 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropColumn( 25 | name: "Especial", 26 | table: "Producto"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/UnidadesMedida/UnidadesMedidaCreate.razor: -------------------------------------------------------------------------------- 1 | @page "/unidadesmedida/create" 2 | @inject IUnidadMedidaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Crear Unidad de Medida

7 | 8 | 9 | 10 | @code { 11 | private UnidadMedidaDtoRequest Model { get; set; } = new UnidadMedidaDtoRequest(); 12 | 13 | private async Task Save() 14 | { 15 | try 16 | { 17 | await Proxy.CreateAsync(Model); 18 | NavigationManager.NavigateTo("/unidadesmedida/list"); 19 | } 20 | catch (Exception ex) 21 | { 22 | await Swal.FireAsync(new SweetAlertOptions 23 | { 24 | Text = ex.Message, 25 | Icon = SweetAlertIcon.Error 26 | }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | // scss-docs-start pagination-mixin 4 | @mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) { 5 | .page-link { 6 | padding: $padding-y $padding-x; 7 | @include font-size($font-size); 8 | } 9 | 10 | .page-item { 11 | @if $pagination-margin-start == (-$pagination-border-width) { 12 | &:first-child { 13 | .page-link { 14 | @include border-start-radius($border-radius); 15 | } 16 | } 17 | 18 | &:last-child { 19 | .page-link { 20 | @include border-end-radius($border-radius); 21 | } 22 | } 23 | } @else { 24 | //Add border-radius to all pageLinks in case they have left margin 25 | .page-link { 26 | @include border-radius($border-radius); 27 | } 28 | } 29 | } 30 | } 31 | // scss-docs-end pagination-mixin 32 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Migrations/20230705064727_v2.0.0.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace AdminBaker.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class v200 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "ImagenUrl", 15 | table: "Producto", 16 | type: "varchar(1000)", 17 | unicode: false, 18 | maxLength: 1000, 19 | nullable: true); 20 | } 21 | 22 | /// 23 | protected override void Down(MigrationBuilder migrationBuilder) 24 | { 25 | migrationBuilder.DropColumn( 26 | name: "ImagenUrl", 27 | table: "Producto"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Migrations/20230705214847_v3.0.1.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace AdminBaker.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class v301 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Total", 15 | table: "PedidoItem", 16 | type: "decimal(11,2)", 17 | precision: 11, 18 | scale: 2, 19 | nullable: false, 20 | defaultValue: 0m); 21 | } 22 | 23 | /// 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.DropColumn( 27 | name: "Total", 28 | table: "PedidoItem"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /AdminBaker.Services/Interfaces/IPedidoService.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Shared.Request; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Services.Interfaces; 6 | 7 | public interface IPedidoService 8 | { 9 | Task> ListAsync(DateTime fechaInicio, DateTime fechaFin, string? filter); 10 | 11 | Task>> ListAuditAsync(); 12 | 13 | Task> FindByIdAsync(int id); 14 | 15 | Task> CreateAsync(string email, PedidoDtoRequest request); 16 | 17 | Task UpdateAsync(int id, PedidoDtoRequest request); 18 | 19 | Task DeleteAsync(int id); 20 | 21 | Task TakeAsync(int idVendedor, int id, string userName); 22 | 23 | Task CancelAsync(int id, string userName); 24 | 25 | Task ChangeStateAsync(int id, EstadoPedido estado, string userName); 26 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/ProductoConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class ProductoConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Nombre) 12 | .HasMaxLength(150); 13 | 14 | builder.Property(p => p.Precio) 15 | .HasPrecision(11, 2); 16 | 17 | builder.Property(p => p.Relleno) 18 | .HasMaxLength(150); 19 | 20 | builder.Property(p => p.Tamanio) 21 | .HasPrecision(11, 2); 22 | 23 | builder.Property(p => p.ImagenUrl) 24 | .IsUnicode(false) 25 | .HasMaxLength(1000); 26 | 27 | builder.ToTable(nameof(Producto), o => 28 | { 29 | o.IsTemporal(); 30 | }); 31 | } 32 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IPedidoRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using AdminBaker.Entities.Info; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IPedidoRepository : IRepositoryBase 7 | { 8 | Task> ListAsync(DateTime fechaInicio, DateTime fechaFin, string? filter); 9 | 10 | Task> ListAuditAsync(); 11 | 12 | Task AddItemAsync(PedidoItem item); 13 | 14 | Task TomarPedidoAsync(int idVendedor, int id, string userName); 15 | 16 | Task CancelarPedidoAsync(int id, string userName); 17 | 18 | Task CambiarEstadoAsync(int id, EstadoPedido estado, string userName); 19 | 20 | Task> GetItemsAsync(int id); 21 | 22 | Task> GetReporteTipoTortaTotalAsync(DateTime fechaInicio, DateTime fechaFin); 23 | 24 | Task GetReporteCantidadesAsync(DateTime fechaInicio, DateTime fechaFin); 25 | } -------------------------------------------------------------------------------- /AdminBaker/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AdminBakerWeb": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "ASPNETCORE_ENVIRONMENT": "Development" 7 | }, 8 | "dotnetRunMessages": true, 9 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 10 | "applicationUrl": "https://localhost:8000" 11 | }, 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | }, 18 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" 19 | } 20 | }, 21 | "iisSettings": { 22 | "windowsAuthentication": false, 23 | "anonymousAuthentication": true, 24 | "iisExpress": { 25 | "applicationUrl": "http://localhost:9655", 26 | "sslPort": 44384 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /AdminBaker/Server/Controllers/PayPalController.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Services.Interfaces; 2 | using AdminBaker.Shared.Request; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace AdminBaker.Server.Controllers; 6 | 7 | [ApiController] 8 | [Route("api/[controller]/[action]")] 9 | public class PayPalController : ControllerBase 10 | { 11 | private readonly IPayPalTransactionService _service; 12 | 13 | public PayPalController(IPayPalTransactionService service) 14 | { 15 | _service = service; 16 | } 17 | 18 | [HttpPost] 19 | public async Task CreateOrder(PaymentOrderDtoRequest request) 20 | { 21 | var response = await _service.CreateOrderAsync(request); 22 | 23 | return Ok(response); 24 | } 25 | 26 | [HttpPost("{pedidoId:int}/{orderId}")] 27 | public async Task CapturePayment(int pedidoId, string orderId) 28 | { 29 | var response = await _service.CapturePaymentAsync(pedidoId, orderId); 30 | 31 | return Ok(response); 32 | } 33 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:9655", 7 | "sslPort": 44384 8 | } 9 | }, 10 | "profiles": { 11 | "AdminBakerWeb": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 16 | "applicationUrl": "https://localhost:8000", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "IIS Express": { 22 | "commandName": "IISExpress", 23 | "launchBrowser": true, 24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_breadcrumb.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | display: flex; 3 | flex-wrap: wrap; 4 | padding: $breadcrumb-padding-y $breadcrumb-padding-x; 5 | margin-bottom: $breadcrumb-margin-bottom; 6 | @include font-size($breadcrumb-font-size); 7 | list-style: none; 8 | background-color: $breadcrumb-bg; 9 | @include border-radius($breadcrumb-border-radius); 10 | } 11 | 12 | .breadcrumb-item { 13 | // The separator between breadcrumbs (by default, a forward-slash: "/") 14 | + .breadcrumb-item { 15 | padding-left: $breadcrumb-item-padding-x; 16 | 17 | &::before { 18 | float: left; // Suppress inline spacings and underlining of the separator 19 | padding-right: $breadcrumb-item-padding-x; 20 | color: $breadcrumb-divider-color; 21 | content: var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider)) #{"/* rtl:"} var(--#{$variable-prefix}breadcrumb-divider, escape-svg($breadcrumb-divider-flipped)) #{"*/"}; 22 | } 23 | } 24 | 25 | &.active { 26 | color: $breadcrumb-active-color; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /AdminBaker.Services/AdminBaker.Services.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_table-variants.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start table-variant 2 | @mixin table-variant($state, $background) { 3 | .table-#{$state} { 4 | $color: color-contrast(opaque($body-bg, $background)); 5 | $hover-bg: mix($color, $background, percentage($table-hover-bg-factor)); 6 | $striped-bg: mix($color, $background, percentage($table-striped-bg-factor)); 7 | $active-bg: mix($color, $background, percentage($table-active-bg-factor)); 8 | 9 | --#{$variable-prefix}table-bg: #{$background}; 10 | --#{$variable-prefix}table-striped-bg: #{$striped-bg}; 11 | --#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)}; 12 | --#{$variable-prefix}table-active-bg: #{$active-bg}; 13 | --#{$variable-prefix}table-active-color: #{color-contrast($active-bg)}; 14 | --#{$variable-prefix}table-hover-bg: #{$hover-bg}; 15 | --#{$variable-prefix}table-hover-color: #{color-contrast($hover-bg)}; 16 | 17 | color: $color; 18 | border-color: mix($color, $background, percentage($table-border-factor)); 19 | } 20 | } 21 | // scss-docs-end table-variant 22 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/PedidoConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class PedidoConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Fecha) 12 | .HasColumnType("date"); 13 | 14 | builder.Property(p => p.FechaRetiro) 15 | .HasColumnType("date"); 16 | 17 | builder.Property(p => p.TotalVenta) 18 | .HasPrecision(11, 2); 19 | 20 | builder.Property(p => p.UrlImagen) 21 | .IsUnicode(false) 22 | .HasMaxLength(1000); 23 | 24 | builder.Property(p => p.NroPedido) 25 | .HasMaxLength(30); 26 | 27 | builder.Property(p => p.MensajePersonalizado) 28 | .HasMaxLength(500); 29 | 30 | builder.ToTable(nameof(Pedido), o => 31 | { 32 | o.IsTemporal(); 33 | }); 34 | } 35 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Toggles 2 | // 3 | // Used in conjunction with global variables to enable certain theme features. 4 | 5 | // Vendor 6 | @import "vendor/rfs"; 7 | 8 | // Deprecate 9 | @import "mixins/deprecate"; 10 | 11 | // Helpers 12 | @import "mixins/breakpoints"; 13 | @import "mixins/color-scheme"; 14 | @import "mixins/image"; 15 | @import "mixins/resize"; 16 | @import "mixins/visually-hidden"; 17 | @import "mixins/reset-text"; 18 | @import "mixins/text-truncate"; 19 | 20 | // Utilities 21 | @import "mixins/utilities"; 22 | 23 | // Components 24 | @import "mixins/alert"; 25 | @import "mixins/backdrop"; 26 | @import "mixins/buttons"; 27 | @import "mixins/caret"; 28 | @import "mixins/pagination"; 29 | @import "mixins/lists"; 30 | @import "mixins/list-group"; 31 | @import "mixins/forms"; 32 | @import "mixins/table-variants"; 33 | 34 | // Skins 35 | @import "mixins/border-radius"; 36 | @import "mixins/box-shadow"; 37 | @import "mixins/gradients"; 38 | @import "mixins/transition"; 39 | 40 | // Layout 41 | @import "mixins/clearfix"; 42 | @import "mixins/container"; 43 | @import "mixins/grid"; 44 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_placeholders.scss: -------------------------------------------------------------------------------- 1 | .placeholder { 2 | display: inline-block; 3 | min-height: 1em; 4 | vertical-align: middle; 5 | cursor: wait; 6 | background-color: currentColor; 7 | opacity: $placeholder-opacity-max; 8 | 9 | &.btn::before { 10 | display: inline-block; 11 | content: ""; 12 | } 13 | } 14 | 15 | // Sizing 16 | .placeholder-xs { 17 | min-height: .6em; 18 | } 19 | 20 | .placeholder-sm { 21 | min-height: .8em; 22 | } 23 | 24 | .placeholder-lg { 25 | min-height: 1.2em; 26 | } 27 | 28 | // Animation 29 | .placeholder-glow { 30 | .placeholder { 31 | animation: placeholder-glow 2s ease-in-out infinite; 32 | } 33 | } 34 | 35 | @keyframes placeholder-glow { 36 | 50% { 37 | opacity: $placeholder-opacity-min; 38 | } 39 | } 40 | 41 | .placeholder-wave { 42 | mask-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%); 43 | mask-size: 200% 100%; 44 | animation: placeholder-wave 2s linear infinite; 45 | } 46 | 47 | @keyframes placeholder-wave { 48 | 100% { 49 | mask-position: -200% 0%; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /AdminBaker.DataAccess/Configurations/UnidadMedidaConfiguration.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace AdminBaker.DataAccess.Configurations; 6 | 7 | public class UnidadMedidaConfiguration : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.Property(p => p.Codigo) 12 | .HasMaxLength(10); 13 | 14 | builder.Property(p => p.Descripcion) 15 | .HasMaxLength(100); 16 | 17 | builder.HasData(new List() 18 | { 19 | new() { Id = 1, Codigo = "Und.", Descripcion = "Unidades" }, 20 | new() { Id = 2, Codigo = "Gr.", Descripcion = "Gramos" }, 21 | new() { Id = 3, Codigo = "Kg.", Descripcion = "Kilos" }, 22 | new() { Id = 4, Codigo = "Bot.", Descripcion = "Botella" }, 23 | new() { Id = 5, Codigo = "Fra.", Descripcion = "Frasco" }, 24 | new() { Id = 6, Codigo = "Bol", Descripcion = "Bolsa" }, 25 | }); 26 | } 27 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Maestros/TipoTortaEdit.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 | 8 |
9 | 10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | @code { 23 | 24 | [Parameter] 25 | public TipoTortaDtoRequest Request { get; set; } = new TipoTortaDtoRequest(); 26 | 27 | [Parameter] 28 | public EventCallback OnSaveClick { get; set; } 29 | 30 | private void Save() 31 | { 32 | OnSaveClick.InvokeAsync(); 33 | } 34 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/TiposTorta/TipoTortaEditPage.razor: -------------------------------------------------------------------------------- 1 | @page "/tipostorta/edit/{Id:int}" 2 | @inject ITipoTortaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Editar Tipo de Torta

7 | 8 | 9 | 10 | @code { 11 | [Parameter] 12 | public int Id { get; set; } 13 | 14 | private TipoTortaDtoRequest Model { get; set; } = new TipoTortaDtoRequest(); 15 | 16 | protected override async Task OnParametersSetAsync() 17 | { 18 | var response = await Proxy.FindByIdAsync(Id); 19 | Model.Nombre = response.Nombre; 20 | } 21 | 22 | private async Task Save() 23 | { 24 | try 25 | { 26 | await Proxy.UpdateAsync(Id, Model); 27 | NavigationManager.NavigateTo("/tipostorta/list"); 28 | } 29 | catch (Exception ex) 30 | { 31 | await Swal.FireAsync(new SweetAlertOptions 32 | { 33 | Text = ex.Message, 34 | Icon = SweetAlertIcon.Error 35 | }); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Recetas/RecetasEditPage.razor: -------------------------------------------------------------------------------- 1 | @page "/recetas/edit/{Id:int}" 2 | @inject IRecetaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Editar Receta

7 | 8 | 9 | 10 | @code { 11 | [Parameter] 12 | public int Id { get; set; } 13 | 14 | private RecetaDtoRequest Model { get; set; } = new RecetaDtoRequest(); 15 | 16 | protected override async Task OnParametersSetAsync() 17 | { 18 | var response = await Proxy.FindByIdAsync(Id); 19 | Model.Nombre = response.Nombre; 20 | Model.Detalle = response.Detalle; 21 | } 22 | 23 | private async Task Save() 24 | { 25 | try 26 | { 27 | await Proxy.UpdateAsync(Id, Model); 28 | NavigationManager.NavigateTo("/recetas/list"); 29 | } 30 | catch (Exception ex) 31 | { 32 | await Swal.FireAsync(new SweetAlertOptions 33 | { 34 | Text = ex.Message, 35 | Icon = SweetAlertIcon.Error 36 | }); 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Tortas/ProductoCard.razor: -------------------------------------------------------------------------------- 1 | @using System.Globalization 2 | @using AdminBaker.Shared 3 |
4 |
5 |
6 | 8 |
9 |
10 |
@Producto.Nombre
11 | $ @Producto.Precio.ToString(Constantes.Formato, new CultureInfo(Constantes.Idioma)) 12 |
13 | 20 |
21 |
22 | 23 | @code { 24 | 25 | [EditorRequired] 26 | [Parameter] 27 | public ProductoDto Producto { get; set; } = null!; 28 | 29 | [Parameter] 30 | public EventCallback OnClick { get; set; } 31 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Productos/ProductosCreate.razor: -------------------------------------------------------------------------------- 1 | @page "/productos/create" 2 | @inject IProductoProxy Proxy 3 | @inject ITipoTortaProxy ProxyTipoTorta 4 | @inject NavigationManager NavigationManager 5 | @inject SweetAlertService Swal 6 | 7 |

Crear Producto

8 | 9 | 10 | 11 | @code { 12 | private ProductoDtoRequest Model { get; set; } = new ProductoDtoRequest(); 13 | private ICollection TiposTorta { get; set; } = new List(); 14 | 15 | protected override async Task OnInitializedAsync() 16 | { 17 | TiposTorta = await ProxyTipoTorta.ListAsync(); 18 | } 19 | 20 | private async Task Save() 21 | { 22 | try 23 | { 24 | await Proxy.CreateAsync(Model); 25 | NavigationManager.NavigateTo("/productos/list"); 26 | } 27 | catch (Exception ex) 28 | { 29 | await Swal.FireAsync(new SweetAlertOptions 30 | { 31 | Text = ex.Message, 32 | Icon = SweetAlertIcon.Error 33 | }); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/RegistrarUsuarioDto.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace AdminBaker.Shared.Request; 4 | 5 | public class RegistrarUsuarioDto 6 | { 7 | [Required] 8 | [StringLength(20)] 9 | [Display(Name = "RUT")] 10 | public string Rut { get; set; } = null!; 11 | 12 | [Required] 13 | [StringLength(200)] 14 | [Display(Name = "Nombres")] 15 | public string NombreCompleto { get; set; } = null!; 16 | 17 | [EmailAddress] 18 | public string Email { get; set; } = null!; 19 | 20 | [StringLength(20)] 21 | public string Telefono { get; set; } = null!; 22 | 23 | public string? Direccion { get; set; } 24 | 25 | public string? Latitud { get; set; } 26 | 27 | public string? Longitud { get; set; } 28 | 29 | public DateTime FechaNacimiento { get; set; } 30 | 31 | public string Clave { get; set; } = null!; 32 | 33 | [Compare(nameof(Clave))] 34 | public string ConfirmarClave { get; set; } = null!; 35 | 36 | public bool Vendedor { get; set; } 37 | 38 | public RegistrarUsuarioDto() 39 | { 40 | FechaNacimiento = DateTime.Today.AddYears(-18); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker.DataAccess/AdminBaker.DataAccess.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_visually-hidden.scss: -------------------------------------------------------------------------------- 1 | // stylelint-disable declaration-no-important 2 | 3 | // Hide content visually while keeping it accessible to assistive technologies 4 | // 5 | // See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/ 6 | // See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/ 7 | 8 | @mixin visually-hidden() { 9 | position: absolute !important; 10 | width: 1px !important; 11 | height: 1px !important; 12 | padding: 0 !important; 13 | margin: -1px !important; // Fix for https://github.com/twbs/bootstrap/issues/25686 14 | overflow: hidden !important; 15 | clip: rect(0, 0, 0, 0) !important; 16 | white-space: nowrap !important; 17 | border: 0 !important; 18 | } 19 | 20 | // Use to only display content when it's focused, or one of its child elements is focused 21 | // (i.e. when focus is within the element/container that the class was applied to) 22 | // 23 | // Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 24 | 25 | @mixin visually-hidden-focusable() { 26 | &:not(:focus):not(:focus-within) { 27 | @include visually-hidden(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /AdminBaker.Repositories/Interfaces/IRepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using System.Linq.Expressions; 2 | using AdminBaker.Entities; 3 | 4 | namespace AdminBaker.Repositories.Interfaces; 5 | 6 | public interface IRepositoryBase where TEntity : EntityBase 7 | { 8 | // Listar de objetos basados en el EntityBase 9 | Task> ListAsync(Expression> predicate); 10 | 11 | // Lista de objetos con un selector 12 | Task> ListAsync( 13 | Expression> predicate, 14 | Expression> selector); 15 | 16 | // Lista de objetos con paginacion 17 | Task<(ICollection Collection, int Total)> ListAsync( 18 | Expression> predicate, 19 | Expression> selector, 20 | Expression> orderBy, 21 | int page, int rows); 22 | 23 | // Agregar 24 | 25 | Task AddAsync(TEntity entity); 26 | 27 | // Obtener por ID 28 | Task FindByIdAsync(int id); 29 | 30 | // Actualizar 31 | Task UpdateAsync(); 32 | 33 | // Eliminar 34 | Task DeleteAsync(int id); 35 | } -------------------------------------------------------------------------------- /AdminBaker.Entities/Info/PedidoInfo.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Info; 2 | 3 | public class PedidoInfo 4 | { 5 | public int Id { get; set; } 6 | public string? NroPedido { get; set; } 7 | public string? UrlImagen { get; set; } 8 | public DateTime Fecha { get; set; } 9 | public float Tamanio { get; set; } 10 | public string Relleno { get; set; } = default!; 11 | public string TipoTorta { get; set; } = default!; 12 | public decimal Precio { get; set; } 13 | public decimal Cantidad { get; set; } 14 | public int ClienteId { get; set; } 15 | public string Cliente { get; set; } = null!; 16 | public string Direccion { get; set; } = default!; 17 | public string Rut { get; set; } = default!; 18 | public string? Vendedor { get; set; } 19 | public int? VendedorId { get; set; } 20 | public decimal TotalVenta { get; set; } 21 | public DateTime? FechaRetiro { set; get; } 22 | public EstadoPedido EstadoPedido { get; set; } 23 | public string? MensajePersonalizado { get; set; } 24 | public string Origen { get; set; } = default!; 25 | public string? JsonPayPalResponse { get; set; } 26 | public string? PayPalUrlOrder { get; set; } 27 | } -------------------------------------------------------------------------------- /AdminBaker/Client/App.razor: -------------------------------------------------------------------------------- 1 | @inject NavigationManager NavigationManager 2 | 3 | 4 | 5 | 6 | 7 | 8 | @{ 9 | if (context.User.Identity!.IsAuthenticated == false) 10 | { 11 | NavigationManager.NavigateTo("/login"); 12 | } 13 | else 14 | { 15 |

No esta autorizado para ver esta pagina

16 | } 17 | } 18 |
19 |
20 |
21 | 22 | Error 404 - Pagina no encontrada 23 | 24 | 25 | 26 | 27 |
28 |
-------------------------------------------------------------------------------- /AdminBaker/Server/Controllers/ReportesController.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Services.Interfaces; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace AdminBaker.Server.Controllers; 5 | 6 | [ApiController] 7 | [Route("api/[controller]")] 8 | public class ReportesController : ControllerBase 9 | { 10 | private readonly IReporteService _service; 11 | 12 | public ReportesController(IReporteService service) 13 | { 14 | _service = service; 15 | } 16 | 17 | [HttpGet("tipotorta/{fechaInicio:datetime}/{fechaFin:datetime}")] 18 | public async Task GetReporteTipoTortaAsync(DateTime fechaInicio, DateTime fechaFin) 19 | { 20 | var response = await _service.GetReporteTipoTortaAsync(fechaInicio, fechaFin); 21 | return response.Success ? Ok(response) : BadRequest(response); 22 | } 23 | 24 | [HttpGet("cantidades/{fechaInicio:datetime}/{fechaFin:datetime}")] 25 | public async Task GetReporteCantidadesAsync(DateTime fechaInicio, DateTime fechaFin) 26 | { 27 | var response = await _service.GetReporteCantidadesAsync(fechaInicio, fechaFin); 28 | return response.Success ? Ok(response) : BadRequest(response); 29 | } 30 | } -------------------------------------------------------------------------------- /AdminBaker/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "ConnectionStrings": { 9 | "AdminBakerDb": "Server=(localdb)\\mssqllocaldb;Database=AdminBakerWeb;Trusted_Connection=True;MultipleActiveResultSets=true" 10 | }, 11 | "StorageConfiguration": { 12 | "PublicUrl": "https://cuentadealmacenamiento.blob.core.windows.net/pasteles/", 13 | "Path": "DefaultEndpointsProtocol=https;AccountName=cuentadealmacenamiento;AccountKey={{key}};EndpointSuffix=core.windows.net" 14 | }, 15 | "Jwt": { 16 | "SecretKey": "ZW4gZXN0ZSBjdXJzbyBkZSBibGF6b3IsIGhlIGFwcmVuZGlkbyBtdWNoaXNpbW8sIHkgYXVuIG1lIGZhbHRhIHBvciBhcHJlbmRlcg==", 17 | "Emisor": "Blazor", 18 | "Audiencia": "localhost" 19 | }, 20 | "SmtpConfiguration": { 21 | "UserName": "tucuentadecorreo@gmail.com", 22 | "Password": "passworddetucorreo", 23 | "PortNumber": 587, 24 | "FromName": "Admin Baker Web", 25 | "Server": "smtp.gmail.com", 26 | "EnableSsl": true 27 | }, 28 | "PayPalConfiguration": { 29 | "ClientId": "{ID DE PAYPAL}", 30 | "SecretId": "{SECRET DE PAYPAL}" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Recetas/RecetasListPage.razor: -------------------------------------------------------------------------------- 1 | @page "/recetas/list" 2 | @inject IRecetaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | 5 |

Recetas

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @code { 14 | 15 | private ICollection? List { get; set; } 16 | 17 | protected override async Task OnInitializedAsync() 18 | { 19 | await LoadData(); 20 | } 21 | 22 | private async Task LoadData() 23 | { 24 | List = await Proxy.ListAsync(); 25 | } 26 | 27 | private async Task Delete(int id) 28 | { 29 | await Proxy.DeleteAsync(id); 30 | await LoadData(); 31 | } 32 | 33 | private void Edit(int id) 34 | { 35 | NavigationManager.NavigateTo($"/recetas/edit/{id}"); 36 | } 37 | 38 | private void Add() 39 | { 40 | NavigationManager.NavigateTo("/recetas/create"); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/UnidadesMedida/UnidadesMedidaEditPage.razor: -------------------------------------------------------------------------------- 1 | @page "/unidadesmedida/edit/{Id:int}" 2 | @inject IUnidadMedidaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | @inject SweetAlertService Swal 5 | 6 |

Editar Unidad de Medida

7 | 8 | 9 | 10 | @code { 11 | [Parameter] 12 | public int Id { get; set; } 13 | 14 | private UnidadMedidaDtoRequest Model { get; set; } = new UnidadMedidaDtoRequest(); 15 | 16 | protected override async Task OnParametersSetAsync() 17 | { 18 | var response = await Proxy.FindByIdAsync(Id); 19 | Model.Codigo = response.Codigo; 20 | Model.Descripcion = response.Descripcion; 21 | } 22 | 23 | private async Task Save() 24 | { 25 | try 26 | { 27 | await Proxy.UpdateAsync(Id, Model); 28 | NavigationManager.NavigateTo("/unidadesmedida/list"); 29 | } 30 | catch (Exception ex) 31 | { 32 | await Swal.FireAsync(new SweetAlertOptions 33 | { 34 | Text = ex.Message, 35 | Icon = SweetAlertIcon.Error 36 | }); 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Productos/ProductosListPage.razor: -------------------------------------------------------------------------------- 1 | @page "/productos/list" 2 | @inject IProductoProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | 5 |

Productos

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @code { 14 | 15 | private ICollection? List { get; set; } 16 | 17 | protected override async Task OnInitializedAsync() 18 | { 19 | await LoadData(); 20 | } 21 | 22 | private async Task LoadData() 23 | { 24 | List = await Proxy.ListAsync(); 25 | } 26 | 27 | private async Task Delete(int id) 28 | { 29 | await Proxy.DeleteAsync(id); 30 | await LoadData(); 31 | } 32 | 33 | private void Edit(int id) 34 | { 35 | NavigationManager.NavigateTo($"/productos/edit/{id}"); 36 | } 37 | 38 | private void Add() 39 | { 40 | NavigationManager.NavigateTo("/productos/create"); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Auditorias/VendedorAuditoria.razor: -------------------------------------------------------------------------------- 1 |

Ultimos cambios en registro de Vendedores

2 | 3 | @if (Lista is null) 4 | { 5 |

Cargando...

6 | } 7 | else if (Lista.Count == 0) 8 | { 9 |

No se encontraron registros

10 | } 11 | else 12 | { 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var item in Lista) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | } 36 | 37 |
NombresRUTDireccionEstadoUsuarioFecha de Cambio
@item.NombreCompleto@item.Rut@item.Direccion@item.Estado@item.Usuario@item.FechaCambio.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")
38 | } 39 | 40 | @code { 41 | 42 | [Parameter] 43 | public ICollection? Lista { get; set; } 44 | 45 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/MateriasPrima/MateriasPrimaCreate.razor: -------------------------------------------------------------------------------- 1 | @page "/materiasprimas/create" 2 | @inject IMateriaPrimaProxy Proxy 3 | @inject IUnidadMedidaProxy UnidadMedidaProxy 4 | @inject NavigationManager NavigationManager 5 | @inject SweetAlertService Swal 6 | 7 |

Crear Materia Prima

8 | 9 | 10 | 11 | @code { 12 | private MateriaPrimaDtoRequest Model { get; set; } = new MateriaPrimaDtoRequest(); 13 | 14 | private ICollection UnidadesMedida { get; set; } = new List(); 15 | 16 | protected override async Task OnInitializedAsync() 17 | { 18 | UnidadesMedida = await UnidadMedidaProxy.ListAsync(); 19 | } 20 | 21 | private async Task Save() 22 | { 23 | try 24 | { 25 | await Proxy.CreateAsync(Model); 26 | NavigationManager.NavigateTo("/materiasprimas/list"); 27 | } 28 | catch (Exception ex) 29 | { 30 | await Swal.FireAsync(new SweetAlertOptions 31 | { 32 | Text = ex.Message, 33 | Icon = SweetAlertIcon.Error 34 | }); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Request/PedidoDtoRequest.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Request; 2 | 3 | public class PedidoDtoRequest 4 | { 5 | public int? VendedorId { get; set; } 6 | public int EstadoPedido { get; set; } 7 | public int TipoPedido { get; set; } 8 | public decimal TotalVenta { get; set; } 9 | public string? UrlImagen { get; set; } 10 | public DateTime? FechaRetiro { get; set; } 11 | public string? Base64Imagen { get; set; } 12 | public string? FileName { get; set; } 13 | public string? ImagenUrl { get; set; } 14 | 15 | public string? Relleno { get; set; } 16 | public double? Tamanio { get; set; } 17 | public int TipoTortaId { get; set; } 18 | public string? MensajePersonalizado { get; set; } 19 | 20 | public ICollection? Items { get; set; } 21 | } 22 | 23 | public class PedidoItemDtoRequest 24 | { 25 | public PedidoItemDtoRequest() 26 | { 27 | 28 | } 29 | 30 | public PedidoItemDtoRequest(int productoId, decimal cantidad) 31 | { 32 | ProductoId = productoId; 33 | Cantidad = cantidad; 34 | } 35 | 36 | public int ProductoId { get; set; } 37 | public int TipoTortaId { get; set; } 38 | public decimal Cantidad { get; set; } 39 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/TiposTorta/TiposTortaListPage.razor: -------------------------------------------------------------------------------- 1 | @page "/tipostorta/list" 2 | @inject ITipoTortaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | 5 |

Tipos de Torta

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @code { 14 | 15 | private ICollection? List { get; set; } 16 | 17 | protected override async Task OnInitializedAsync() 18 | { 19 | await LoadData(); 20 | } 21 | 22 | private async Task LoadData() 23 | { 24 | List = await Proxy.ListAsync(); 25 | } 26 | 27 | private async Task Delete(int id) 28 | { 29 | await Proxy.DeleteAsync(id); 30 | await LoadData(); 31 | } 32 | 33 | private void Edit(int id) 34 | { 35 | NavigationManager.NavigateTo($"/tipostorta/edit/{id}"); 36 | } 37 | 38 | private void Add() 39 | { 40 | NavigationManager.NavigateTo("/tipostorta/create"); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/MateriasPrima/MateriasPrimaListPage.razor: -------------------------------------------------------------------------------- 1 | @page "/materiasprimas/list" 2 | @inject IMateriaPrimaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | 5 |

Materias Primas

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @code { 14 | 15 | private ICollection? List { get; set; } 16 | 17 | protected override async Task OnInitializedAsync() 18 | { 19 | await LoadData(); 20 | } 21 | 22 | private async Task LoadData() 23 | { 24 | List = await Proxy.ListAsync(); 25 | } 26 | 27 | private async Task Delete(int id) 28 | { 29 | await Proxy.DeleteAsync(id); 30 | await LoadData(); 31 | } 32 | 33 | private void Edit(int id) 34 | { 35 | NavigationManager.NavigateTo($"/materiasprimas/edit/{id}"); 36 | } 37 | 38 | private void Add() 39 | { 40 | NavigationManager.NavigateTo("/materiasprimas/create"); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/UnidadesMedida/UnidadesMedidaListPage.razor: -------------------------------------------------------------------------------- 1 | @page "/unidadesmedida/list" 2 | @inject IUnidadMedidaProxy Proxy 3 | @inject NavigationManager NavigationManager 4 | 5 |

Unidades de Medida

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @code { 14 | 15 | private ICollection? List { get; set; } 16 | 17 | protected override async Task OnInitializedAsync() 18 | { 19 | await LoadData(); 20 | } 21 | 22 | private async Task LoadData() 23 | { 24 | List = await Proxy.ListAsync(); 25 | } 26 | 27 | private async Task Delete(int id) 28 | { 29 | await Proxy.DeleteAsync(id); 30 | await LoadData(); 31 | } 32 | 33 | private void Edit(int id) 34 | { 35 | NavigationManager.NavigateTo($"/unidadesmedida/edit/{id}"); 36 | } 37 | 38 | private void Add() 39 | { 40 | NavigationManager.NavigateTo("/unidadesmedida/create"); 41 | } 42 | } -------------------------------------------------------------------------------- /AdminBaker/Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using AdminBaker.Client 10 | @using AdminBaker.Client.Shared 11 | @using AdminBaker.Client.Shared.Maestros 12 | @using AdminBaker.Client.Shared.Tortas 13 | @using AdminBaker.Client.Shared.Pedidos 14 | @using AdminBaker.Client.Shared.Auditorias 15 | @using AdminBaker.Client.Proxy 16 | @using AdminBaker.Client.Proxy.Services 17 | @using AdminBaker.Shared 18 | @using AdminBaker.Shared.Request 19 | @using AdminBaker.Shared.Response 20 | @using CurrieTechnologies.Razor.SweetAlert2 21 | @using Microsoft.AspNetCore.Components.Authorization 22 | @using Microsoft.AspNetCore.Authorization 23 | @using System.IdentityModel.Tokens.Jwt 24 | @using Blazored.Toast 25 | @using Blazored.Toast.Services 26 | @using Blazored.SessionStorage 27 | @using PSC.Blazor.Components.Chartjs 28 | @using PSC.Blazor.Components.Chartjs.Enums 29 | @using PSC.Blazor.Components.Chartjs.Models 30 | @using PSC.Blazor.Components.Chartjs.Models.Common 31 | @using PSC.Blazor.Components.Chartjs.Models.Pie -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_close.scss: -------------------------------------------------------------------------------- 1 | // transparent background and border properties included for button version. 2 | // iOS requires the button element instead of an anchor tag. 3 | // If you want the anchor version, it requires `href="#"`. 4 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 5 | 6 | .btn-close { 7 | box-sizing: content-box; 8 | width: $btn-close-width; 9 | height: $btn-close-height; 10 | padding: $btn-close-padding-y $btn-close-padding-x; 11 | color: $btn-close-color; 12 | background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements 13 | border: 0; // for button elements 14 | @include border-radius(); 15 | opacity: $btn-close-opacity; 16 | 17 | // Override 's hover style 18 | &:hover { 19 | color: $btn-close-color; 20 | text-decoration: none; 21 | opacity: $btn-close-hover-opacity; 22 | } 23 | 24 | &:focus { 25 | outline: 0; 26 | box-shadow: $btn-close-focus-shadow; 27 | opacity: $btn-close-focus-opacity; 28 | } 29 | 30 | &:disabled, 31 | &.disabled { 32 | pointer-events: none; 33 | user-select: none; 34 | opacity: $btn-close-disabled-opacity; 35 | } 36 | } 37 | 38 | .btn-close-white { 39 | filter: $btn-close-white-filter; 40 | } 41 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/bootstrap.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v5.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | */ 7 | 8 | // scss-docs-start import-stack 9 | // Configuration 10 | @import "functions"; 11 | @import "variables"; 12 | @import "mixins"; 13 | @import "utilities"; 14 | 15 | // Layout & components 16 | @import "root"; 17 | @import "reboot"; 18 | @import "type"; 19 | @import "images"; 20 | @import "containers"; 21 | @import "grid"; 22 | @import "tables"; 23 | @import "forms"; 24 | @import "buttons"; 25 | @import "transitions"; 26 | @import "dropdown"; 27 | @import "button-group"; 28 | @import "nav"; 29 | @import "navbar"; 30 | @import "card"; 31 | @import "accordion"; 32 | @import "breadcrumb"; 33 | @import "pagination"; 34 | @import "badge"; 35 | @import "alert"; 36 | @import "progress"; 37 | @import "list-group"; 38 | @import "close"; 39 | @import "toasts"; 40 | @import "modal"; 41 | @import "tooltip"; 42 | @import "popover"; 43 | @import "carousel"; 44 | @import "spinners"; 45 | @import "offcanvas"; 46 | @import "placeholders"; 47 | 48 | // Helpers 49 | @import "helpers"; 50 | 51 | // Utilities 52 | @import "utilities/api"; 53 | // scss-docs-end import-stack 54 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/forms/_labels.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // 4 | 5 | .form-label { 6 | margin-bottom: $form-label-margin-bottom; 7 | @include font-size($form-label-font-size); 8 | font-style: $form-label-font-style; 9 | font-weight: $form-label-font-weight; 10 | color: $form-label-color; 11 | } 12 | 13 | // For use with horizontal and inline forms, when you need the label (or legend) 14 | // text to align with the form controls. 15 | .col-form-label { 16 | padding-top: add($input-padding-y, $input-border-width); 17 | padding-bottom: add($input-padding-y, $input-border-width); 18 | margin-bottom: 0; // Override the `` default 19 | @include font-size(inherit); // Override the `` default 20 | font-style: $form-label-font-style; 21 | font-weight: $form-label-font-weight; 22 | line-height: $input-line-height; 23 | color: $form-label-color; 24 | } 25 | 26 | .col-form-label-lg { 27 | padding-top: add($input-padding-y-lg, $input-border-width); 28 | padding-bottom: add($input-padding-y-lg, $input-border-width); 29 | @include font-size($input-font-size-lg); 30 | } 31 | 32 | .col-form-label-sm { 33 | padding-top: add($input-padding-y-sm, $input-border-width); 34 | padding-bottom: add($input-padding-y-sm, $input-border-width); 35 | @include font-size($input-font-size-sm); 36 | } 37 | -------------------------------------------------------------------------------- /AdminBaker.Entities/Configuration/AppConfig.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Entities.Configuration; 2 | 3 | public class AppConfig 4 | { 5 | public Storageconfiguration StorageConfiguration { get; set; } = null!; 6 | 7 | public Jwt Jwt { get; set; } = null!; 8 | 9 | public Smtpconfiguration SmtpConfiguration { get; set; } = null!; 10 | 11 | public PayPalConfiguration PayPalConfiguration { get; set; } = null!; 12 | 13 | } 14 | 15 | public class PayPalConfiguration 16 | { 17 | public string ClientId { get; set; } = default!; 18 | public string SecretId { get; set; } = default!; 19 | } 20 | 21 | public class Storageconfiguration 22 | { 23 | public string PublicUrl { get; set; } = null!; 24 | public string Path { get; set; } = null!; 25 | } 26 | 27 | 28 | public class Jwt 29 | { 30 | public string SecretKey { get; set; } = default!; 31 | 32 | public string Audiencia { get; set; } = default!; 33 | 34 | public string Emisor { get; set; } = default!; 35 | } 36 | 37 | public class Smtpconfiguration 38 | { 39 | public string UserName { get; set; } = default!; 40 | public string Password { get; set; } = default!; 41 | public int PortNumber { get; set; } 42 | public string FromName { get; set; } = default!; 43 | public string Server { get; set; } = default!; 44 | public bool EnableSsl { get; set; } 45 | } 46 | -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/PayPalProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | using AdminBaker.Shared.Request; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class PayPalProxy : IPayPalProxy 8 | { 9 | private readonly HttpClient _httpClient; 10 | 11 | public PayPalProxy(HttpClient httpClient) 12 | { 13 | _httpClient = httpClient; 14 | } 15 | 16 | public async Task CreateOrderAsync(PaymentOrderDtoRequest request) 17 | { 18 | var response = await _httpClient.PostAsJsonAsync("api/paypal/createorder", request); 19 | var result = await response.Content.ReadFromJsonAsync>(); 20 | if (result!.Success) 21 | return result.Data!; 22 | 23 | throw new InvalidOperationException(result.ErrorMessage); 24 | } 25 | 26 | public async Task CapturePaymentAsync(int pedidoId, string orderId) 27 | { 28 | var response = await _httpClient.PostAsync($"api/paypal/capturepayment/{pedidoId}/{orderId}", null); 29 | var result = await response.Content.ReadFromJsonAsync(); 30 | if (result!.Success) 31 | return result; 32 | 33 | throw new InvalidOperationException(result.ErrorMessage); 34 | } 35 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Pedidos/PedidoAuditoria.razor: -------------------------------------------------------------------------------- 1 |

Ultimos cambios en registro de Pedidos

2 | 3 | @if (Pedidos is null) 4 | { 5 |

Cargando...

6 | } 7 | else 8 | { 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @foreach (var item in Pedidos) 23 | { 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
Nro. PedidoFecha del PedidoClienteEstadoVendedorUsuarioFecha de Cambio
@item.NroPedido@item.Fecha.ToString(Constantes.FormatoFecha)@item.Cliente@item.EstadoPedido@item.Vendedor@item.Usuario@item.FechaCambio.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")
36 | } 37 | 38 | @code { 39 | 40 | [Parameter] 41 | public ICollection? Pedidos { get; set; } 42 | 43 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Auditorias/ClienteAuditoria.razor: -------------------------------------------------------------------------------- 1 |

Ultimos cambios en registro de Clientes

2 | 3 | @if (Lista is null) 4 | { 5 |

Cargando...

6 | } 7 | else if (Lista.Count == 0) 8 | { 9 |

No se encontraron registros

10 | } 11 | else 12 | { 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Lista) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 |
NombresFecha de NacimientoRUTDireccionEstadoUsuarioFecha de Cambio
@item.NombreCompleto@item.FechaNacimiento.ToString(Constantes.FormatoFecha)@item.Rut@item.Direccion@item.Estado@item.Usuario@item.FechaCambio.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")
40 | } 41 | 42 | @code { 43 | 44 | [Parameter] 45 | public ICollection? Lista { get; set; } 46 | 47 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_images.scss: -------------------------------------------------------------------------------- 1 | // Responsive images (ensure images don't scale beyond their parents) 2 | // 3 | // This is purposefully opt-in via an explicit class rather than being the default for all ``s. 4 | // We previously tried the "images are responsive by default" approach in Bootstrap v2, 5 | // and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps) 6 | // which weren't expecting the images within themselves to be involuntarily resized. 7 | // See also https://github.com/twbs/bootstrap/issues/18178 8 | .img-fluid { 9 | @include img-fluid(); 10 | } 11 | 12 | 13 | // Image thumbnails 14 | .img-thumbnail { 15 | padding: $thumbnail-padding; 16 | background-color: $thumbnail-bg; 17 | border: $thumbnail-border-width solid $thumbnail-border-color; 18 | @include border-radius($thumbnail-border-radius); 19 | @include box-shadow($thumbnail-box-shadow); 20 | 21 | // Keep them at most 100% wide 22 | @include img-fluid(); 23 | } 24 | 25 | // 26 | // Figures 27 | // 28 | 29 | .figure { 30 | // Ensures the caption's text aligns with the image. 31 | display: inline-block; 32 | } 33 | 34 | .figure-img { 35 | margin-bottom: $spacer * .5; 36 | line-height: 1; 37 | } 38 | 39 | .figure-caption { 40 | @include font-size($figure-caption-font-size); 41 | color: $figure-caption-color; 42 | } 43 | -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Auditorias/MateriaPrimaAuditoria.razor: -------------------------------------------------------------------------------- 1 |

Ultimos cambios en registro de Materias Primas

2 | 3 | @if (Lista is null) 4 | { 5 |

Cargando...

6 | } 7 | else if (Lista.Count == 0) 8 | { 9 |

No se encontraron registros

10 | } 11 | else 12 | { 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Lista) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 |
NombreFecha de CaducidadCantidadUnidad de MedidaEstadoUsuarioFecha de Cambio
@item.Nombre@item.Caducidad.ToString(Constantes.FormatoFecha)@item.Cantidad@item.UnidadMedida@item.Estado@item.Usuario@item.FechaCambio.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")
40 | } 41 | 42 | @code { 43 | 44 | [Parameter] 45 | public ICollection? Lista { get; set; } 46 | 47 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/AdminBaker/Server/AdminBaker.Server.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/AdminBaker/Server/AdminBaker.Server.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "--project", 36 | "${workspaceFolder}/AdminBaker/Server/AdminBaker.Server.csproj" 37 | ], 38 | "problemMatcher": "$msCompile" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_containers.scss: -------------------------------------------------------------------------------- 1 | // Container widths 2 | // 3 | // Set the container width, and override it for fixed navbars in media queries. 4 | 5 | @if $enable-grid-classes { 6 | // Single container class with breakpoint max-widths 7 | .container, 8 | // 100% wide container at all breakpoints 9 | .container-fluid { 10 | @include make-container(); 11 | } 12 | 13 | // Responsive containers that are 100% wide until a breakpoint 14 | @each $breakpoint, $container-max-width in $container-max-widths { 15 | .container-#{$breakpoint} { 16 | @extend .container-fluid; 17 | } 18 | 19 | @include media-breakpoint-up($breakpoint, $grid-breakpoints) { 20 | %responsive-container-#{$breakpoint} { 21 | max-width: $container-max-width; 22 | } 23 | 24 | // Extend each breakpoint which is smaller or equal to the current breakpoint 25 | $extend-breakpoint: true; 26 | 27 | @each $name, $width in $grid-breakpoints { 28 | @if ($extend-breakpoint) { 29 | .container#{breakpoint-infix($name, $grid-breakpoints)} { 30 | @extend %responsive-container-#{$breakpoint}; 31 | } 32 | 33 | // Once the current breakpoint is reached, stop extending 34 | @if ($breakpoint == $name) { 35 | $extend-breakpoint: false; 36 | } 37 | } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_progress.scss: -------------------------------------------------------------------------------- 1 | // Disable animation if transitions are disabled 2 | 3 | // scss-docs-start progress-keyframes 4 | @if $enable-transitions { 5 | @keyframes progress-bar-stripes { 6 | 0% { background-position-x: $progress-height; } 7 | } 8 | } 9 | // scss-docs-end progress-keyframes 10 | 11 | .progress { 12 | display: flex; 13 | height: $progress-height; 14 | overflow: hidden; // force rounded corners by cropping it 15 | @include font-size($progress-font-size); 16 | background-color: $progress-bg; 17 | @include border-radius($progress-border-radius); 18 | @include box-shadow($progress-box-shadow); 19 | } 20 | 21 | .progress-bar { 22 | display: flex; 23 | flex-direction: column; 24 | justify-content: center; 25 | overflow: hidden; 26 | color: $progress-bar-color; 27 | text-align: center; 28 | white-space: nowrap; 29 | background-color: $progress-bar-bg; 30 | @include transition($progress-bar-transition); 31 | } 32 | 33 | .progress-bar-striped { 34 | @include gradient-striped(); 35 | background-size: $progress-height $progress-height; 36 | } 37 | 38 | @if $enable-transitions { 39 | .progress-bar-animated { 40 | animation: $progress-bar-animation-timing progress-bar-stripes; 41 | 42 | @if $enable-reduced-motion { 43 | @media (prefers-reduced-motion: reduce) { 44 | animation: none; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_toasts.scss: -------------------------------------------------------------------------------- 1 | .toast { 2 | width: $toast-max-width; 3 | max-width: 100%; 4 | @include font-size($toast-font-size); 5 | color: $toast-color; 6 | pointer-events: auto; 7 | background-color: $toast-background-color; 8 | background-clip: padding-box; 9 | border: $toast-border-width solid $toast-border-color; 10 | box-shadow: $toast-box-shadow; 11 | @include border-radius($toast-border-radius); 12 | 13 | &.showing { 14 | opacity: 0; 15 | } 16 | 17 | &:not(.show) { 18 | display: none; 19 | } 20 | } 21 | 22 | .toast-container { 23 | width: max-content; 24 | max-width: 100%; 25 | pointer-events: none; 26 | 27 | > :not(:last-child) { 28 | margin-bottom: $toast-spacing; 29 | } 30 | } 31 | 32 | .toast-header { 33 | display: flex; 34 | align-items: center; 35 | padding: $toast-padding-y $toast-padding-x; 36 | color: $toast-header-color; 37 | background-color: $toast-header-background-color; 38 | background-clip: padding-box; 39 | border-bottom: $toast-border-width solid $toast-header-border-color; 40 | @include border-top-radius(subtract($toast-border-radius, $toast-border-width)); 41 | 42 | .btn-close { 43 | margin-right: $toast-padding-x * -.5; 44 | margin-left: $toast-padding-x; 45 | } 46 | } 47 | 48 | .toast-body { 49 | padding: $toast-padding-x; // apply to both vertical and horizontal 50 | word-wrap: break-word; 51 | } 52 | -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Auditorias/ProductoAuditoria.razor: -------------------------------------------------------------------------------- 1 |

Ultimos cambios en registro de Productos

2 | 3 | @if (Lista is null) 4 | { 5 |

Cargando...

6 | } 7 | else if (Lista.Count == 0) 8 | { 9 |

No se encontraron registros

10 | } 11 | else 12 | { 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @foreach (var item in Lista) 29 | { 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | } 42 | 43 |
NombrePrecioCantidadRellenoTamañoTipo de TortaEstadoUsuarioFecha de Cambio
@item.Nombre@item.Precio.ToString(Constantes.Formato)@item.Cantidad@item.Relleno@item.Tamanio@item.TipoTorta@item.Estado@item.Usuario@item.FechaCambio.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")
44 | } 45 | 46 | @code { 47 | 48 | [Parameter] 49 | public ICollection? Lista { get; set; } 50 | 51 | } -------------------------------------------------------------------------------- /AdminBaker/Shared/Response/PedidoDto.cs: -------------------------------------------------------------------------------- 1 | namespace AdminBaker.Shared.Response; 2 | 3 | public class PedidoDto : CommonDtoResponse 4 | { 5 | public string? NroPedido { get; set; } 6 | public string? UrlImagen { get; set; } 7 | public DateTime Fecha { get; set; } 8 | public float Tamanio { get; set; } 9 | public string Relleno { get; set; } = default!; 10 | public string TipoTorta { get; set; } = default!; 11 | public decimal Precio { get; set; } 12 | public decimal Cantidad { get; set; } 13 | public int ClienteId { get; set; } 14 | public string Cliente { get; set; } = null!; 15 | public string Direccion { get; set; } = default!; 16 | public string Rut { get; set; } = default!; 17 | public string? Vendedor { get; set; } 18 | public int? VendedorId { get; set; } 19 | public decimal TotalVenta { get; set; } 20 | public DateTime? FechaRetiro { set; get; } 21 | public int EstadoPedido { get; set; } = default!; 22 | public string? MensajePersonalizado { get; set; } 23 | public string Origen { get; set; } = default!; 24 | 25 | #region Modal 26 | 27 | public string Modal => $"modal-{Id}"; 28 | 29 | public string TargetModal => $"#{Modal}"; 30 | 31 | #endregion 32 | 33 | #region Auditoria 34 | 35 | public DateTime? FechaCambio { get; set; } 36 | 37 | #endregion 38 | 39 | #region PayPal 40 | 41 | public string? JsonPayPalResponse { get; set; } 42 | public string? PayPalUrlOrder { get; set; } 43 | 44 | #endregion 45 | 46 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Implementations/MateriaPrimaRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.DataAccess; 2 | using AdminBaker.Entities; 3 | using AdminBaker.Entities.Info; 4 | using AdminBaker.Repositories.Interfaces; 5 | using Dapper; 6 | using Microsoft.EntityFrameworkCore; 7 | 8 | namespace AdminBaker.Repositories.Implementations; 9 | 10 | public class MateriaPrimaRepository : RepositoryBase, IMateriaPrimaRepository 11 | { 12 | public MateriaPrimaRepository(AdminBakerDbContext context) : base(context) 13 | { 14 | } 15 | 16 | public async Task> ListAsync() 17 | { 18 | return await Context.Set() 19 | .Include(x => x.UnidadMedida) 20 | .Where(p => p.Estado) 21 | .Select(x => new MateriaPrimaInfo 22 | { 23 | Id = x.Id, 24 | Nombre = x.Nombre, 25 | Cantidad = x.Cantidad, 26 | UnidadMedida = x.UnidadMedida.Descripcion, 27 | Caducidad = x.Caducidad, 28 | UnidadMedidaId = x.UnidadMedidaId 29 | }) 30 | .ToListAsync(); 31 | } 32 | 33 | public async Task> ListAuditAsync() 34 | { 35 | var query = await Context.Database.GetDbConnection() 36 | .QueryAsync(sql: "uspAuditoriaMateriaPrimas", 37 | commandType: System.Data.CommandType.StoredProcedure); 38 | 39 | return query.ToList(); 40 | } 41 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Tortas/ProductoCarousel.razor: -------------------------------------------------------------------------------- 1 | @using System.Globalization 2 | @using AdminBaker.Shared 3 | 32 | 33 | @code { 34 | 35 | [Parameter] 36 | public ICollection? Top5Productos { get; set; } 37 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/ReporteProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | using AdminBaker.Shared; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class ReporteProxy : IReporteProxy 8 | { 9 | private readonly HttpClient _httpClient; 10 | 11 | public ReporteProxy(HttpClient httpClient) 12 | { 13 | _httpClient = httpClient; 14 | } 15 | 16 | public async Task> GetReporteTipoTortaAsync(DateTime fechaInicio, DateTime fechaFin) 17 | { 18 | var response = await _httpClient 19 | .GetFromJsonAsync>> 20 | ($"api/reportes/tipotorta/{fechaInicio.ToString(Constantes.FormatoFecha)}/{fechaFin.ToString(Constantes.FormatoFecha)}"); 21 | 22 | if (response!.Success) 23 | { 24 | return response.Data!; 25 | } 26 | 27 | throw new InvalidOperationException(response.ErrorMessage); 28 | } 29 | 30 | public async Task GetReporteCantidadesAsync(DateTime fechaInicio, DateTime fechaFin) 31 | { 32 | var response = await _httpClient 33 | .GetFromJsonAsync> 34 | ($"api/reportes/cantidades/{fechaInicio.ToString(Constantes.FormatoFecha)}/{fechaFin.ToString(Constantes.FormatoFecha)}"); 35 | 36 | if (response!.Success) 37 | return response.Data!; 38 | 39 | throw new InvalidOperationException(response.ErrorMessage); 40 | } 41 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/ProductoProxy.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Shared.Request; 2 | using AdminBaker.Shared.Response; 3 | using System.Net.Http.Json; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class ProductoProxy : CrudRestHelperBase, IProductoProxy 8 | { 9 | public ProductoProxy(HttpClient httpClient) : 10 | base("api/Productos", httpClient) 11 | { 12 | } 13 | 14 | public async Task> ListTopCarouselAsync() 15 | { 16 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}/carousel"); 17 | if (response!.Success) 18 | return response.Data!; 19 | 20 | throw new InvalidOperationException(response.ErrorMessage); 21 | } 22 | 23 | public async Task> ListAsync(string filter) 24 | { 25 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}?filter={filter}"); 26 | if (response!.Success) 27 | return response.Data!; 28 | 29 | throw new InvalidOperationException(response.ErrorMessage); 30 | } 31 | 32 | public async Task> ListAuditAsync() 33 | { 34 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}/ListAudit"); 35 | if (response!.Success) 36 | return response.Data!; 37 | 38 | throw new InvalidOperationException(response.ErrorMessage); 39 | } 40 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/MateriasPrima/MateriasPrimaEditPage.razor: -------------------------------------------------------------------------------- 1 | @page "/materiasprimas/edit/{Id:int}" 2 | @inject IMateriaPrimaProxy Proxy 3 | @inject IUnidadMedidaProxy UnidadMedidaProxy 4 | @inject NavigationManager NavigationManager 5 | @inject SweetAlertService Swal 6 | 7 |

Editar Materia Prima

8 | 9 | 10 | 11 | @code { 12 | [Parameter] 13 | public int Id { get; set; } 14 | 15 | private ICollection UnidadesMedida { get; set; } = new List(); 16 | 17 | private MateriaPrimaDtoRequest Model { get; set; } = new MateriaPrimaDtoRequest(); 18 | 19 | protected override async Task OnParametersSetAsync() 20 | { 21 | var response = await Proxy.FindByIdAsync(Id); 22 | Model.Nombre = response.Nombre; 23 | Model.Cantidad = response.Cantidad; 24 | Model.Caducidad = response.Caducidad; 25 | Model.UnidadMedidaId = response.UnidadMedidaId; 26 | 27 | UnidadesMedida = await UnidadMedidaProxy.ListAsync(); 28 | } 29 | 30 | private async Task Save() 31 | { 32 | try 33 | { 34 | await Proxy.UpdateAsync(Id, Model); 35 | NavigationManager.NavigateTo("/materiasprimas/list"); 36 | } 37 | catch (Exception ex) 38 | { 39 | await Swal.FireAsync(new SweetAlertOptions 40 | { 41 | Text = ex.Message, 42 | Icon = SweetAlertIcon.Error 43 | }); 44 | } 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Maestros/RecetaEdit.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 | @code { 33 | 34 | [Parameter] 35 | public RecetaDtoRequest Request { get; set; } = new RecetaDtoRequest(); 36 | 37 | [Parameter] 38 | public EventCallback OnSaveClick { get; set; } 39 | 40 | private void Save() 41 | { 42 | OnSaveClick.InvokeAsync(); 43 | } 44 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Maestros/UnidadMedidaEdit.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 |
20 |
21 |
22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | @code { 32 | 33 | [Parameter] 34 | public UnidadMedidaDtoRequest Request { get; set; } = new UnidadMedidaDtoRequest(); 35 | 36 | [Parameter] 37 | public EventCallback OnSaveClick { get; set; } 38 | 39 | private void Save() 40 | { 41 | OnSaveClick.InvokeAsync(); 42 | } 43 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/bootstrap-grid.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Grid v5.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors 4 | * Copyright 2011-2021 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 | */ 7 | 8 | $include-column-box-sizing: true !default; 9 | 10 | @import "functions"; 11 | @import "variables"; 12 | 13 | @import "mixins/lists"; 14 | @import "mixins/breakpoints"; 15 | @import "mixins/container"; 16 | @import "mixins/grid"; 17 | @import "mixins/utilities"; 18 | 19 | @import "vendor/rfs"; 20 | 21 | @import "root"; 22 | 23 | @import "containers"; 24 | @import "grid"; 25 | 26 | @import "utilities"; 27 | // Only use the utilities we need 28 | // stylelint-disable-next-line scss/dollar-variable-default 29 | $utilities: map-get-multiple( 30 | $utilities, 31 | ( 32 | "display", 33 | "order", 34 | "flex", 35 | "flex-direction", 36 | "flex-grow", 37 | "flex-shrink", 38 | "flex-wrap", 39 | "justify-content", 40 | "align-items", 41 | "align-content", 42 | "align-self", 43 | "margin", 44 | "margin-x", 45 | "margin-y", 46 | "margin-top", 47 | "margin-end", 48 | "margin-bottom", 49 | "margin-start", 50 | "negative-margin", 51 | "negative-margin-x", 52 | "negative-margin-y", 53 | "negative-margin-top", 54 | "negative-margin-end", 55 | "negative-margin-bottom", 56 | "negative-margin-start", 57 | "padding", 58 | "padding-x", 59 | "padding-y", 60 | "padding-top", 61 | "padding-end", 62 | "padding-bottom", 63 | "padding-start", 64 | ) 65 | ); 66 | 67 | @import "utilities/api"; 68 | -------------------------------------------------------------------------------- /AdminBaker/Server/Controllers/RecetasController.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Services.Interfaces; 2 | using AdminBaker.Shared.Request; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace AdminBaker.Server.Controllers; 6 | 7 | 8 | [ApiController] 9 | [Route("api/[controller]")] 10 | public class RecetasController : ControllerBase 11 | { 12 | private readonly IRecetaService _service; 13 | 14 | public RecetasController(IRecetaService service) 15 | { 16 | _service = service; 17 | } 18 | 19 | [HttpGet] 20 | public async Task Get() 21 | { 22 | var response = await _service.ListAsync(); 23 | 24 | return Ok(response); 25 | } 26 | 27 | [HttpGet("{id}")] 28 | public async Task Get(int id) 29 | { 30 | var response = await _service.FindByIdAsync(id); 31 | 32 | return response.Success ? Ok(response) : NotFound(response); 33 | } 34 | 35 | [HttpPost] 36 | public async Task Post(RecetaDtoRequest request) 37 | { 38 | var response = await _service.CreateAsync(request); 39 | 40 | return response.Success ? Ok(response) : BadRequest(response); 41 | } 42 | 43 | [HttpPut("{id}")] 44 | public async Task Put(int id, RecetaDtoRequest request) 45 | { 46 | var response = await _service.UpdateAsync(id, request); 47 | 48 | return response.Success ? Ok(response) : NotFound(response); 49 | } 50 | 51 | [HttpDelete("{id}")] 52 | public async Task Delete(int id) 53 | { 54 | var response = await _service.DeleteAsync(id); 55 | 56 | return response.Success ? Ok(response) : NotFound(response); 57 | } 58 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Pages/Productos/ProductosEditPage.razor: -------------------------------------------------------------------------------- 1 | @page "/productos/edit/{Id:int}" 2 | @inject IProductoProxy Proxy 3 | @inject ITipoTortaProxy ProxyTipoTorta 4 | @inject NavigationManager NavigationManager 5 | @inject SweetAlertService Swal 6 | 7 |

Editar Producto

8 | 9 | 10 | 11 | @code { 12 | [Parameter] 13 | public int Id { get; set; } 14 | 15 | private ProductoDtoRequest Model { get; set; } = new ProductoDtoRequest(); 16 | private ICollection TiposTorta { get; set; } = new List(); 17 | 18 | protected override async Task OnParametersSetAsync() 19 | { 20 | var response = await Proxy.FindByIdAsync(Id); 21 | Model.Nombre = response.Nombre; 22 | Model.Cantidad = response.Cantidad; 23 | Model.Precio = response.Precio; 24 | Model.Relleno = response.Relleno; 25 | Model.Tamanio = response.Tamanio; 26 | Model.TipoTortaId = response.TipoTortaId; 27 | Model.ImagenUrl = response.ImagenUrl; 28 | Model.Especial = response.Especial; 29 | 30 | TiposTorta = await ProxyTipoTorta.ListAsync(); 31 | } 32 | 33 | private async Task Save() 34 | { 35 | try 36 | { 37 | await Proxy.UpdateAsync(Id, Model); 38 | NavigationManager.NavigateTo("/productos/list"); 39 | } 40 | catch (Exception ex) 41 | { 42 | await Swal.FireAsync(new SweetAlertOptions 43 | { 44 | Text = ex.Message, 45 | Icon = SweetAlertIcon.Error 46 | }); 47 | } 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /AdminBaker/Server/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model AdminBaker.Server.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /AdminBaker/Server/Controllers/ClientesController.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Services.Interfaces; 2 | using AdminBaker.Shared; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace AdminBaker.Server.Controllers 7 | { 8 | 9 | [ApiController] 10 | [Route("api/[controller]")] 11 | public class ClientesController : ControllerBase 12 | { 13 | private readonly IClienteService _service; 14 | 15 | public ClientesController(IClienteService service) 16 | { 17 | _service = service; 18 | } 19 | 20 | [HttpGet] 21 | public async Task Get(string? filter) 22 | { 23 | var response = await _service.ListAsync(filter); 24 | 25 | return Ok(response); 26 | } 27 | 28 | [HttpGet("[action]")] 29 | [Authorize(Roles = Constantes.RolAdministrador)] 30 | public async Task ListAudit() 31 | { 32 | var response = await _service.ListAuditAsync(); 33 | 34 | return Ok(response); 35 | } 36 | 37 | [HttpDelete("{id}")] 38 | [Authorize(Roles = Constantes.RolAdministrador)] 39 | public async Task Delete(int id) 40 | { 41 | var response = await _service.DeleteAsync(id); 42 | 43 | return response.Success ? Ok(response) : NotFound(response); 44 | } 45 | 46 | [HttpPatch("{id}")] 47 | public async Task Patch(int id) 48 | { 49 | var response = await _service.ReactivateAsync(id); 50 | 51 | return response.Success ? Ok(response) : NotFound(response); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /AdminBaker/Server/Controllers/TipoTortasController.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Services.Interfaces; 2 | using AdminBaker.Shared.Request; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | namespace AdminBaker.Server.Controllers; 6 | 7 | [ApiController] 8 | [Route("api/[controller]")] 9 | public class TipoTortasController : ControllerBase 10 | { 11 | private readonly ITipoTortaService _service; 12 | 13 | public TipoTortasController(ITipoTortaService service) 14 | { 15 | _service = service; 16 | } 17 | 18 | [HttpGet] 19 | public async Task Get() 20 | { 21 | var response = await _service.ListAsync(); 22 | 23 | return Ok(response); 24 | } 25 | 26 | [HttpGet("{id}")] 27 | public async Task Get(int id) 28 | { 29 | var response = await _service.FindByIdAsync(id); 30 | 31 | return response.Success ? Ok(response) : NotFound(response); 32 | } 33 | 34 | [HttpPost] 35 | public async Task Post(TipoTortaDtoRequest request) 36 | { 37 | var response = await _service.CreateAsync(request); 38 | 39 | return response.Success ? Ok(response) : BadRequest(response); 40 | } 41 | 42 | [HttpPut("{id}")] 43 | public async Task Put(int id, TipoTortaDtoRequest request) 44 | { 45 | var response = await _service.UpdateAsync(id, request); 46 | 47 | return response.Success ? Ok(response) : NotFound(response); 48 | } 49 | 50 | [HttpDelete("{id}")] 51 | public async Task Delete(int id) 52 | { 53 | var response = await _service.DeleteAsync(id); 54 | 55 | return response.Success ? Ok(response) : NotFound(response); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /AdminBaker/Server/AdminBaker.Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 6079bf6f-0e52-4221-9f37-03a3a6ab4fc9 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_alert.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Base styles 3 | // 4 | 5 | .alert { 6 | position: relative; 7 | padding: $alert-padding-y $alert-padding-x; 8 | margin-bottom: $alert-margin-bottom; 9 | border: $alert-border-width solid transparent; 10 | @include border-radius($alert-border-radius); 11 | } 12 | 13 | // Headings for larger alerts 14 | .alert-heading { 15 | // Specified to prevent conflicts of changing $headings-color 16 | color: inherit; 17 | } 18 | 19 | // Provide class for links that match alerts 20 | .alert-link { 21 | font-weight: $alert-link-font-weight; 22 | } 23 | 24 | 25 | // Dismissible alerts 26 | // 27 | // Expand the right padding and account for the close button's positioning. 28 | 29 | .alert-dismissible { 30 | padding-right: $alert-dismissible-padding-r; 31 | 32 | // Adjust close link position 33 | .btn-close { 34 | position: absolute; 35 | top: 0; 36 | right: 0; 37 | z-index: $stretched-link-z-index + 1; 38 | padding: $alert-padding-y * 1.25 $alert-padding-x; 39 | } 40 | } 41 | 42 | 43 | // scss-docs-start alert-modifiers 44 | // Generate contextual modifier classes for colorizing the alert. 45 | 46 | @each $state, $value in $theme-colors { 47 | $alert-background: shift-color($value, $alert-bg-scale); 48 | $alert-border: shift-color($value, $alert-border-scale); 49 | $alert-color: shift-color($value, $alert-color-scale); 50 | @if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) { 51 | $alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale)); 52 | } 53 | .alert-#{$state} { 54 | @include alert-variant($alert-background, $alert-border, $alert-color); 55 | } 56 | } 57 | // scss-docs-end alert-modifiers 58 | -------------------------------------------------------------------------------- /AdminBaker.Services/Implementations/AzureBlobStorageUploader.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.Entities.Configuration; 2 | using AdminBaker.Services.Interfaces; 3 | using Azure.Storage.Blobs; 4 | using Microsoft.Extensions.Logging; 5 | using Microsoft.Extensions.Options; 6 | namespace AdminBaker.Services.Implementations; 7 | 8 | public class AzureBlobStorageUploader : IFileUploader 9 | { 10 | private readonly AppConfig _appConfig; 11 | private readonly ILogger _logger; 12 | 13 | public AzureBlobStorageUploader(IOptions options, ILogger logger) 14 | { 15 | _logger = logger; 16 | _appConfig = options.Value; 17 | } 18 | 19 | public async Task UploadFileAsync(string? base64String, string? fileName) 20 | { 21 | if (string.IsNullOrWhiteSpace(base64String) || string.IsNullOrWhiteSpace(fileName)) 22 | return string.Empty; 23 | 24 | try 25 | { 26 | var client = new BlobServiceClient(_appConfig.StorageConfiguration.Path); 27 | var container = client.GetBlobContainerClient("pasteles"); 28 | 29 | var blob = container.GetBlobClient(fileName); 30 | 31 | await using var stream = new MemoryStream(Convert.FromBase64String(base64String)); 32 | await blob.UploadAsync(stream, overwrite: true); 33 | 34 | _logger.LogInformation("Se subio la imagen a Azure Blob Storage"); 35 | 36 | return $"{_appConfig.StorageConfiguration.PublicUrl}{fileName}"; 37 | } 38 | catch (Exception ex) 39 | { 40 | _logger.LogError(ex, "Error al subir archivos a Azure Blob Storage {Message}", ex.Message); 41 | return string.Empty; 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/ClienteProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | using AdminBaker.Shared.Request; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class ClienteProxy : CrudRestHelperBase, IClienteProxy 8 | { 9 | public ClienteProxy(HttpClient httpClient) : 10 | base("api/Clientes", httpClient) 11 | { 12 | } 13 | 14 | public async Task> ListAsync(string? filter) 15 | { 16 | var response = await HttpClient.GetAsync($"{BaseUrl}?filter={filter}"); 17 | 18 | if (response.IsSuccessStatusCode) 19 | { 20 | var content = await response.Content.ReadFromJsonAsync>(); 21 | if (content!.Success) 22 | { 23 | return content.Data!; 24 | } 25 | } 26 | 27 | throw new InvalidOperationException(response.ReasonPhrase); 28 | } 29 | 30 | public async Task> ListAuditAsync() 31 | { 32 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}/ListAudit"); 33 | if (response!.Success) 34 | return response.Data!; 35 | 36 | throw new InvalidOperationException(response.ErrorMessage); 37 | } 38 | 39 | public async Task ReactivateAsync(int id) 40 | { 41 | var response = await HttpClient.PatchAsync($"{BaseUrl}/{id}", null); 42 | if (!response.IsSuccessStatusCode) 43 | { 44 | var content = await response.Content.ReadFromJsonAsync(); 45 | throw new InvalidOperationException(content!.ErrorMessage); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /AdminBaker/Client/Proxy/Services/VendedorProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Json; 2 | using AdminBaker.Shared.Request; 3 | using AdminBaker.Shared.Response; 4 | 5 | namespace AdminBaker.Client.Proxy.Services; 6 | 7 | public class VendedorProxy : CrudRestHelperBase, IVendedorProxy 8 | { 9 | public VendedorProxy(HttpClient httpClient) : 10 | base("api/Vendedores", httpClient) 11 | { 12 | } 13 | 14 | public async Task> ListAsync(string? filter) 15 | { 16 | var response = await HttpClient.GetAsync($"{BaseUrl}?filter={filter}"); 17 | 18 | if (response.IsSuccessStatusCode) 19 | { 20 | var content = await response.Content.ReadFromJsonAsync>(); 21 | if (content!.Success) 22 | { 23 | return content.Data!; 24 | } 25 | } 26 | 27 | throw new InvalidOperationException(response.ReasonPhrase); 28 | } 29 | 30 | public async Task> ListAuditAsync() 31 | { 32 | var response = await HttpClient.GetFromJsonAsync>>($"{BaseUrl}/ListAudit"); 33 | if (response!.Success) 34 | return response.Data!; 35 | 36 | throw new InvalidOperationException(response.ErrorMessage); 37 | } 38 | 39 | public async Task ReactivateAsync(int id) 40 | { 41 | var response = await HttpClient.PatchAsync($"{BaseUrl}/{id}", null); 42 | if (!response.IsSuccessStatusCode) 43 | { 44 | var content = await response.Content.ReadFromJsonAsync(); 45 | throw new InvalidOperationException(content!.ErrorMessage); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/mixins/_caret.scss: -------------------------------------------------------------------------------- 1 | // scss-docs-start caret-mixins 2 | @mixin caret-down { 3 | border-top: $caret-width solid; 4 | border-right: $caret-width solid transparent; 5 | border-bottom: 0; 6 | border-left: $caret-width solid transparent; 7 | } 8 | 9 | @mixin caret-up { 10 | border-top: 0; 11 | border-right: $caret-width solid transparent; 12 | border-bottom: $caret-width solid; 13 | border-left: $caret-width solid transparent; 14 | } 15 | 16 | @mixin caret-end { 17 | border-top: $caret-width solid transparent; 18 | border-right: 0; 19 | border-bottom: $caret-width solid transparent; 20 | border-left: $caret-width solid; 21 | } 22 | 23 | @mixin caret-start { 24 | border-top: $caret-width solid transparent; 25 | border-right: $caret-width solid; 26 | border-bottom: $caret-width solid transparent; 27 | } 28 | 29 | @mixin caret($direction: down) { 30 | @if $enable-caret { 31 | &::after { 32 | display: inline-block; 33 | margin-left: $caret-spacing; 34 | vertical-align: $caret-vertical-align; 35 | content: ""; 36 | @if $direction == down { 37 | @include caret-down(); 38 | } @else if $direction == up { 39 | @include caret-up(); 40 | } @else if $direction == end { 41 | @include caret-end(); 42 | } 43 | } 44 | 45 | @if $direction == start { 46 | &::after { 47 | display: none; 48 | } 49 | 50 | &::before { 51 | display: inline-block; 52 | margin-right: $caret-spacing; 53 | vertical-align: $caret-vertical-align; 54 | content: ""; 55 | @include caret-start(); 56 | } 57 | } 58 | 59 | &:empty::after { 60 | margin-left: 0; 61 | } 62 | } 63 | } 64 | // scss-docs-end caret-mixins 65 | -------------------------------------------------------------------------------- /AdminBaker/Client/Shared/Maestros/UnidadMedidaList.razor: -------------------------------------------------------------------------------- 1 | @inject SweetAlertService Swal 2 | 3 | @if (Lista is not null) 4 | { 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @foreach (var item in Lista) 14 | { 15 | 16 | 17 | 21 | 22 | } 23 | 24 |
NombreAcciones
@item.Texto 18 | 19 | 20 |
25 | } 26 | else 27 | { 28 |

No hay datos para mostrar

29 | } 30 | 31 | @code { 32 | 33 | [EditorRequired] 34 | [Parameter] 35 | public ICollection? Lista { get; set; } 36 | 37 | [Parameter] 38 | public EventCallback OnEditClick { get; set; } 39 | 40 | [Parameter] 41 | public EventCallback OnDeleteClick { get; set; } 42 | 43 | public async Task Delete(int id) 44 | { 45 | var result = await Swal.FireAsync(new SweetAlertOptions 46 | { 47 | Text = "Desea eliminar el registro?", 48 | Title = "Eliminar", 49 | Icon = SweetAlertIcon.Warning, 50 | ShowCancelButton = true, 51 | ConfirmButtonText = "Si", 52 | CancelButtonText = "No" 53 | }); 54 | 55 | if (result.IsConfirmed) 56 | { 57 | await OnDeleteClick.InvokeAsync(id); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /AdminBaker.Repositories/Implementations/VendedorRepository.cs: -------------------------------------------------------------------------------- 1 | using AdminBaker.DataAccess; 2 | using AdminBaker.Entities; 3 | using AdminBaker.Entities.Info; 4 | using AdminBaker.Repositories.Interfaces; 5 | using Dapper; 6 | using Microsoft.EntityFrameworkCore; 7 | 8 | namespace AdminBaker.Repositories.Implementations; 9 | 10 | public class VendedorRepository : RepositoryBase, IVendedorRepository 11 | { 12 | public VendedorRepository(AdminBakerDbContext context) : base(context) 13 | { 14 | } 15 | 16 | public async Task FindByEmailAsync(string email) 17 | { 18 | return await Context.Set().FirstOrDefaultAsync(x => x.Email == email); 19 | } 20 | 21 | public async Task> ListAsync(string? filter) 22 | { 23 | var query = Context.Set() 24 | .AsQueryable(); 25 | 26 | if (!string.IsNullOrWhiteSpace(filter)) 27 | { 28 | query = query.Where(x => x.NombreCompleto.Contains(filter) || x.Rut.Contains(filter)); 29 | } 30 | 31 | return await query 32 | .AsNoTracking() 33 | .ToListAsync(); 34 | } 35 | 36 | public async Task> ListAuditAsync() 37 | { 38 | var query = await Context.Database.GetDbConnection() 39 | .QueryAsync(sql: "uspAuditoriaVendedores", 40 | commandType: System.Data.CommandType.StoredProcedure); 41 | 42 | return query.ToList(); 43 | } 44 | 45 | public async Task ReactivarAsync(int id) 46 | { 47 | var registro = await Context.Set().FindAsync(id); 48 | if (registro is not null) 49 | { 50 | registro.Estado = true; 51 | await Context.SaveChangesAsync(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/css/bootstrap/scss/_spinners.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Rotating border 3 | // 4 | 5 | // scss-docs-start spinner-border-keyframes 6 | @keyframes spinner-border { 7 | to { transform: rotate(360deg) #{"/* rtl:ignore */"}; } 8 | } 9 | // scss-docs-end spinner-border-keyframes 10 | 11 | .spinner-border { 12 | display: inline-block; 13 | width: $spinner-width; 14 | height: $spinner-height; 15 | vertical-align: $spinner-vertical-align; 16 | border: $spinner-border-width solid currentColor; 17 | border-right-color: transparent; 18 | // stylelint-disable-next-line property-disallowed-list 19 | border-radius: 50%; 20 | animation: $spinner-animation-speed linear infinite spinner-border; 21 | } 22 | 23 | .spinner-border-sm { 24 | width: $spinner-width-sm; 25 | height: $spinner-height-sm; 26 | border-width: $spinner-border-width-sm; 27 | } 28 | 29 | // 30 | // Growing circle 31 | // 32 | 33 | // scss-docs-start spinner-grow-keyframes 34 | @keyframes spinner-grow { 35 | 0% { 36 | transform: scale(0); 37 | } 38 | 50% { 39 | opacity: 1; 40 | transform: none; 41 | } 42 | } 43 | // scss-docs-end spinner-grow-keyframes 44 | 45 | .spinner-grow { 46 | display: inline-block; 47 | width: $spinner-width; 48 | height: $spinner-height; 49 | vertical-align: $spinner-vertical-align; 50 | background-color: currentColor; 51 | // stylelint-disable-next-line property-disallowed-list 52 | border-radius: 50%; 53 | opacity: 0; 54 | animation: $spinner-animation-speed linear infinite spinner-grow; 55 | } 56 | 57 | .spinner-grow-sm { 58 | width: $spinner-width-sm; 59 | height: $spinner-height-sm; 60 | } 61 | 62 | @if $enable-reduced-motion { 63 | @media (prefers-reduced-motion: reduce) { 64 | .spinner-border, 65 | .spinner-grow { 66 | animation-duration: $spinner-animation-speed * 2; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /AdminBaker/Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Admin Baker 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | --------------------------------------------------------------------------------