Compare commits

...

19 Commits

Author SHA1 Message Date
Gitea Action
3aec07892c chore: update image tag to 4c6ff6e [skip ci] 2026-05-14 15:44:14 +00:00
Luis Eduardo Estevao
4c6ff6e148 feat: create CartSalesComponent for managing sales cart logic and order flow
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 8m31s
2026-05-14 12:34:16 -03:00
Gitea Action
cfb1d44b8c chore: update image tag to 6f91d97 [skip ci] 2026-05-05 19:20:32 +00:00
Luis Eduardo Estevao
6f91d97dcd Merge branch 'main' of http://172.35.0.216:3000/simplifique/Vendaweb-portal into claude/goofy-johnson-8a0eed
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 6m40s
2026-05-05 16:13:52 -03:00
Luis Eduardo Estevao
741ffe386c Merge branch 'main' of http://172.35.0.216:3000/simplifique/Vendaweb-portal
Some checks failed
Build (develop) / Promote (main) / build-and-push-deploy (push) Has been cancelled
2026-05-05 16:13:22 -03:00
Luis Eduardo Estevao
e5db59403d documentação do sistema 2026-05-05 16:13:10 -03:00
Luis Eduardo Estevao
4652fea8fc documentação do sistema 2026-05-05 16:12:52 -03:00
Gitea Action
fad2e1c0a8 chore: update image tag to 206b4a5 [skip ci] 2026-04-20 04:46:20 +00:00
206b4a5c6a Atualizar src/app/sales/cart-sales/cart-sales.component.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 7m10s
2026-04-20 00:39:07 -04:00
71d0592778 Atualizar src/environments/environment.prod.ts
Some checks failed
Build (develop) / Promote (main) / build-and-push-deploy (push) Has been cancelled
2026-04-20 00:36:45 -04:00
Gitea Action
f059f5cca1 chore: update image tag to bbb5d68 [skip ci] 2026-04-19 20:59:33 +00:00
Luis Eduardo Estevao
bbb5d68af1 feat: implement shopping cart module with order management and discount components
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 6m18s
2026-04-19 17:53:03 -03:00
Gitea Action
4f5e2e5944 chore: update image tag to d76c186 [skip ci] 2026-04-13 20:10:32 +00:00
d76c18614d Atualizar src/app/sales/cart-sales/cart-sales.component.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 12m3s
2026-04-13 15:58:31 -04:00
Gitea Action
9ddfc33514 chore: update image tag to e7bc050 [skip ci] 2026-04-13 19:21:33 +00:00
e7bc050b2e Atualizar src/environments/environment.prod.ts
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 9m1s
2026-04-13 15:12:30 -04:00
Gitea Action
e89895b07b chore: update image tag to c366a55 [skip ci] 2026-04-01 18:19:30 +00:00
Luis Eduardo Estevao
c366a55c15 Merge branch 'main' of https://git.simplifiquehc.com.br/simplifique/Vendaweb-portal
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 10m16s
2026-04-01 15:08:59 -03:00
Luis Eduardo Estevao
afd6b453d7 feat: create dashboard sales layout with responsive navigation and pre-order modal 2026-04-01 15:08:52 -03:00
53 changed files with 2116 additions and 176 deletions

View File

@@ -0,0 +1,10 @@
{
"permissions": {
"allow": [
"Bash(npm create *)",
"Bash(npm install *)",
"Bash(npm run *)",
"Bash(xargs grep *)"
]
}
}

27
.context/agents/README.md Normal file
View File

@@ -0,0 +1,27 @@
# Agent Handbook
This directory contains ready-to-customize playbooks for AI agents collaborating on the repository.
## Available Agents
- [Code Reviewer](./code-reviewer.md) — Review code changes for quality, style, and best practices
- [Bug Fixer](./bug-fixer.md) — Analyze bug reports and error messages
- [Feature Developer](./feature-developer.md) — Implement new features according to specifications
- [Refactoring Specialist](./refactoring-specialist.md) — Identify code smells and improvement opportunities
- [Test Writer](./test-writer.md) — Write comprehensive unit and integration tests
- [Documentation Writer](./documentation-writer.md) — Create clear, comprehensive documentation
- [Performance Optimizer](./performance-optimizer.md) — Identify performance bottlenecks
- [Security Auditor](./security-auditor.md) — Identify security vulnerabilities
- [Frontend Specialist](./frontend-specialist.md) — Design and implement user interfaces
- [Architect Specialist](./architect-specialist.md) — Design overall system architecture and patterns
- [Devops Specialist](./devops-specialist.md) — Design and maintain CI/CD pipelines
## How To Use These Playbooks
1. Pick the agent that matches your task.
2. Enrich the template with project-specific context or links.
3. Share the final prompt with your AI assistant.
4. Capture learnings in the relevant documentation file so future runs improve.
## Related Resources
- [Documentation Index](../docs/README.md)
- [Agent Knowledge Base](../../AGENTS.md)
- [Contributor Guidelines](../../CONTRIBUTING.md)

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Architect Specialist
description: Design overall system architecture and patterns
agentType: architect-specialist
phases: [P, R]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Bug Fixer
description: Analyze bug reports and error messages
agentType: bug-fixer
phases: [E, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Code Reviewer
description: Review code changes for quality, style, and best practices
agentType: code-reviewer
phases: [R, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Devops Specialist
description: Design and maintain CI/CD pipelines
agentType: devops-specialist
phases: [E, C]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Documentation Writer
description: Create clear, comprehensive documentation
agentType: documentation-writer
phases: [P, C]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Feature Developer
description: Implement new features according to specifications
agentType: feature-developer
phases: [P, E]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Frontend Specialist
description: Design and implement user interfaces
agentType: frontend-specialist
phases: [P, E]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Performance Optimizer
description: Identify performance bottlenecks
agentType: performance-optimizer
phases: [E, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Refactoring Specialist
description: Identify code smells and improvement opportunities
agentType: refactoring-specialist
phases: [E]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Security Auditor
description: Identify security vulnerabilities
agentType: security-auditor
phases: [R, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: agent
name: Test Writer
description: Write comprehensive unit and integration tests
agentType: test-writer
phases: [E, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

42
.context/docs/README.md Normal file
View File

@@ -0,0 +1,42 @@
# Documentation Index
Welcome to the repository knowledge base. Start with the project overview, then dive into specific guides as needed.
## Core Guides
- [Project Overview](./project-overview.md)
- [Architecture Notes](./architecture.md)
- [Development Workflow](./development-workflow.md)
- [Testing Strategy](./testing-strategy.md)
- [Glossary & Domain Concepts](./glossary.md)
- [Security & Compliance Notes](./security.md)
- [Tooling & Productivity Guide](./tooling.md)
## Repository Snapshot
- `angular.json/`
- `browserslist/`
- `docker-compose.yml/`
- `Dockerfile/`
- `e2e/`
- `k8s/`
- `karma.conf.js/`
- `kendo-ui-license.txt/`
- `nginx.conf/`
- `package-lock.json/`
- `package.json/`
- `README.md/`
- `src/` — TypeScript source files and CLI entrypoints.
- `tsconfig.app.json/`
- `tsconfig.json/`
- `tsconfig.spec.json/`
- `tslint.json/`
## Document Map
| Guide | File | Primary Inputs |
| --- | --- | --- |
| Project Overview | `project-overview.md` | Roadmap, README, stakeholder notes |
| Architecture Notes | `architecture.md` | ADRs, service boundaries, dependency graphs |
| Development Workflow | `development-workflow.md` | Branching rules, CI config, contributing guide |
| Testing Strategy | `testing-strategy.md` | Test configs, CI gates, known flaky suites |
| Glossary & Domain Concepts | `glossary.md` | Business terminology, user personas, domain rules |
| Security & Compliance Notes | `security.md` | Auth model, secrets management, compliance requirements |
| Tooling & Productivity Guide | `tooling.md` | CLI scripts, IDE configs, automation workflows |

View File

@@ -0,0 +1,61 @@
---
type: doc
name: architecture
description: System architecture, layers, patterns, and design decisions
category: architecture
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Architecture Notes
## System Architecture Overview
The system is a modular frontend web application built using Angular. It follows a modular monolith architecture where features are grouped into specific modules such as `Sales`, `Partners`, `Financial`, and `CRM`. The application heavily relies on Redux-pattern state management (likely NgRx) to manage global state such as shopping carts, customer sales, and application data flow. Data is fetched via Angular services which communicate with a backend REST API.
## Architectural Layers
- **Components**: UI elements and pages organized by feature domain (`src/app/sales/`, `src/app/partners/`, `src/app/crm/`).
- **Services**: Business logic and API communication layer (`src/app/services/`, `src/app/shared/services/`).
- **Store / State Management**: Reducers, actions, and models handling complex state management (`src/app/sales/store/`).
- **Models**: TypeScript interfaces and classes defining data structures (`src/app/models/`).
- **Shared Utils**: Common messages, loading indicators, and validators (`src/app/shared/`).
> See [`codebase-map.json`](./codebase-map.json) for complete symbol counts and dependency graphs.
## Detected Design Patterns
| Pattern | Confidence | Locations | Description |
|---------|------------|-----------|-------------|
| Module | 100% | `src/app/*.module.ts` | Angular feature modules for separation of concerns |
| Redux / Store | 95% | `src/app/sales/store/` | State management using Actions, Reducers, and Store |
| Dependency Injection | 100% | `src/app/services/` | Angular DI for injecting services into components |
| Observable / Reactive | 90% | Services & Store | Heavy use of RxJS Observables for async data flows |
## Entry Points
- [AppModule](file:///d:/desenvolvimento/Simplifique/vendaweb/Vendaweb-portal/src/app/app.module.ts)
- [AppComponent](file:///d:/desenvolvimento/Simplifique/vendaweb/Vendaweb-portal/src/app/app.component.ts)
## Public API
| Symbol | Type | Location |
|--------|------|----------|
| `AppModule` | Class | `src/app/app.module.ts` |
| `SalesModule` | Class | `src/app/sales/sales.module.ts` |
| `PartnersModule` | Class | `src/app/partners/partners.module.ts` |
| `ShoppingReducer` | Function | `src/app/sales/store/reducers/shopping.reducer.ts` |
## Internal System Boundaries
The application is clearly separated into bounded contexts:
- **Sales**: Core module handling product listings, shopping carts, checkout, and ordering.
- **Partners**: Module for managing partner ranges, reports, and payments.
- **CRM**: Module handling customer data, editing, and listing.
- **Admin/Auth**: Authentication and user permission management.
## Top Directories Snapshot
- `src/app/sales/` (~50+ files)
- `src/app/models/` (~40+ files)
- `src/app/shared/` (~30+ files)
- `src/app/partners/` (~20+ files)
- `src/app/components/` (~10+ files)
## Related Resources
- [Project Overview](./project-overview.md)
- [Data Flow](./data-flow.md)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
---
type: doc
name: development-workflow
description: Day-to-day engineering processes, branching, and contribution guidelines
category: workflow
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Development Workflow
## Day-to-Day Process
This Angular repository requires developers to implement features within their respective feature modules (e.g., `Sales`, `Partners`, `CRM`). Developers should ensure that all new services, components, and state management changes are properly typed using the `src/app/models` directory.
## Branching & Releases
We follow a standard Git workflow:
- `main` / `master`: The stable production branch.
- `develop`: The primary integration branch.
- Feature branches: Created from `develop` using a standard naming convention like `feat/feature-name` or `bugfix/issue-description`.
Commits should follow Conventional Commits (e.g., `feat(sales): add discount module`).
## Local Development
- Install dependencies: `npm install`
- Run local development server: `npm start` or `npm run dev` (uses Angular CLI `ng serve`)
- Run tests: `npm test`
- Build for production: `npm run build`
## Code Review Expectations
- Ensure Angular best practices are followed (e.g., Unsubscribing from Observables, using `OnPush` change detection where applicable).
- Avoid mutating state directly in components; use the Store actions.
- Keep components small and focused, extracting complex business logic into Services.
- All new features should include proper TypeScript models.
## Onboarding Tasks
New developers should begin by reading the `Project Overview` and familiarizing themselves with the `Sales` module, as it is the core of the application.
## Cross-References
- [Testing Strategy](./testing-strategy.md)
- [Tooling](./tooling.md)

45
.context/docs/glossary.md Normal file
View File

@@ -0,0 +1,45 @@
---
type: doc
name: glossary
description: Project terminology, type definitions, domain entities, and business rules
category: glossary
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Glossary & Domain Concepts
## Glossary
- **PreOrder (Pré-venda)**: An order created by a seller that has not yet been billed.
- **Cart (Carrinho)**: A temporary collection of products a customer intends to purchase.
- **Checkout**: The process of finalizing an order, choosing payment methods and installments.
- **Seller (Vendedor)**: The user using the application to sell products to customers.
- **Partner (Parceiro)**: A B2B entity that works with the company, has specific commission and range logic.
- **Tintométrico**: A specific feature related to color mixing, usually for paint products.
## Type Definitions
- `Customer` (src/app/models/customer.model.ts)
- `Product` (src/app/models/product.model.ts)
- `Order` (src/app/models/order.model.ts)
- `PreOrder` (src/app/models/pre-order.model.ts)
- `CartModel` (src/app/models/cart.model.ts)
- `SaleProduct` (src/app/models/sale-product.model.ts)
## Enumerations
- `ShoppingActionTypes` (src/app/sales/store/actions/shopping.action.ts)
- `CustomerSaleActionTypes` (src/app/sales/store/actions/customer-sale.action.ts)
## Core Terms
- **State/Store**: Refers to the application's global Redux state (NgRx) which holds the current customer, cart contents, and authentication status.
- **CRM**: Customer Relationship Management section where sellers can view, create, or edit customer profiles.
## Personas / Actors
- **Seller (Vendedor)**: Wants to quickly look up products, add them to a cart, apply discounts, and checkout on behalf of a customer.
- **Admin**: Configures permissions, views high-level dashboard KPIs.
- **Partner (Parceiro)**: Checks commissions, extracts, and ranges.
## Domain Rules & Invariants
- A cart must be associated with a customer before checkout.
- Discounts are governed by specific authorization roles.
- The `Tintométrico` module calculates specific prices based on color compositions.

View File

@@ -0,0 +1,49 @@
---
type: doc
name: project-overview
description: High-level overview of the project, its purpose, and key components
category: overview
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Project Overview
This project is an Angular-based B2B/B2C Sales Portal (VendaWeb). It empowers sellers to manage customers, browse product catalogs, assemble carts, and process orders, while also offering CRM, Partner Management, and administrative capabilities.
> **Detailed Analysis**: For complete symbol counts, architecture layers, and dependency graphs, see [`codebase-map.json`](./codebase-map.json).
## Quick Facts
- **Root**: `/`
- **Languages**: TypeScript, HTML, SCSS
- **Framework**: Angular
- **State Management**: NgRx (Redux pattern)
## Entry Points
- [AppModule](file:///d:/desenvolvimento/Simplifique/vendaweb/Vendaweb-portal/src/app/app.module.ts)
- [main.ts](file:///d:/desenvolvimento/Simplifique/vendaweb/Vendaweb-portal/src/main.ts)
## Key Exports
- `AppModule`
- `SalesModule`
- `PartnersModule`
## File Structure & Code Organization
- `src/app/sales/` — Core point-of-sale functionality (cart, products, checkout).
- `src/app/crm/` — Customer management interfaces.
- `src/app/partners/` — Partner reporting, commissions, and management.
- `src/app/financial/` — Financial operations and checkout.
- `src/app/models/` — TypeScript interfaces representing business entities.
- `src/app/shared/` — Reusable UI components, interceptors, and services.
- `src/app/auth/` — Authentication and login flows.
## Technology Stack Summary
- **Frontend**: Angular
- **State**: NgRx Store
- **Styling**: SCSS, Kendo UI (`kendo-ui-license.txt` indicates Kendo usage)
- **Tooling**: Angular CLI, TypeScript, npm
## Getting Started Checklist
1. Install dependencies with `npm install`.
2. Run the application locally with `npm run start` or `ng serve`.
3. Navigate to `http://localhost:4200` to view the app.

View File

@@ -0,0 +1,23 @@
# Q&A Index
Project type: **web-app**
Generated: 2026-04-29T20:15:44.291Z
## Getting-started
- [How do I set up and run this project?](./getting-started.md)
## Architecture
- [How is the codebase organized?](./project-structure.md)
## Features
- [How does authentication work?](./authentication.md)
- [How is data stored and accessed?](./database.md)
- [What API endpoints are available?](./api-endpoints.md)
## Operations
- [How do I deploy this project?](./deployment.md)

View File

@@ -0,0 +1,11 @@
---
slug: api-endpoints
category: features
generatedAt: 2026-04-29T20:15:39.516Z
---
# What API endpoints are available?
## API Endpoints
### Detected API Files

View File

@@ -0,0 +1,23 @@
---
slug: authentication
category: features
generatedAt: 2026-04-29T20:15:39.516Z
relevantFiles:
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\guards\auth.guard.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\auth\auth-login\auth-login.component.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\auth\auth.module.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\auth\services\auth.service.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\shared\messages\auth-user\auth-user.component.ts
---
# How does authentication work?
## Authentication
### Implementation Details
- Auth-related symbol: AuthGuard
- Auth-related symbol: AuthLoginComponent
- Auth-related symbol: AuthModule
- Auth-related symbol: AuthService
- Auth-related symbol: AuthUserComponent

View File

@@ -0,0 +1,22 @@
---
slug: database
category: features
generatedAt: 2026-04-29T20:15:39.516Z
relevantFiles:
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\sales\store\models\action.model.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\models\cart-itens.model.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\models\cart.model.ts
- C:\Users\luis.estevao\AppData\Local\Programs\Antigravity\src\app\sales\components\create-customer-modal\create-customer-modal.component.ts
---
# How is data stored and accessed?
## Database
### Implementation Details
- Database-related symbol: ActionModel
- Database-related symbol: CartItensModel
- Database-related symbol: CartModel
- Database-related symbol: JsonModel
- Data layer detected in architecture

View File

@@ -0,0 +1,21 @@
---
slug: deployment
category: operations
generatedAt: 2026-04-29T20:15:44.246Z
relevantFiles:
- docker-compose.yml
- Dockerfile
---
# How do I deploy this project?
## Deployment
### Docker
This project includes Docker configuration.
```bash
docker build -t app .
docker run -p 3000:3000 app
```

View File

@@ -0,0 +1,32 @@
---
slug: getting-started
category: getting-started
generatedAt: 2026-04-29T20:11:48.572Z
---
# How do I set up and run this project?
## Getting Started
### Prerequisites
- Node.js (LTS version recommended)
- npm
### Installation
```bash
# Clone the repository
git clone <repository-url>
cd Vendaweb-portal
# Install dependencies
npm install
```
### Running
```bash
# See package.json for available scripts
npm run <script-name>
```

View File

@@ -0,0 +1,15 @@
---
slug: project-structure
category: architecture
generatedAt: 2026-04-29T20:15:39.515Z
---
# How is the codebase organized?
## Project Structure
```
e2e/
k8s/
src/
```

25
.context/docs/security.md Normal file
View File

@@ -0,0 +1,25 @@
---
type: doc
name: security
description: Security policies, authentication, secrets management, and compliance requirements
category: security
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Security & Compliance Notes
## Authentication & Authorization
The application uses JWT (JSON Web Tokens) for authentication.
- The `AuthModule` handles user login (`AuthLoginComponent`).
- An `AuthGuard` is implemented to protect specific routes, ensuring that unauthenticated users are redirected to the login page.
- Role-based access control (RBAC) is implemented via `PermissionUser` components and specific guards.
## Secrets & Sensitive Data
- Environment variables (`src/environments/`) contain API endpoints.
- Avoid hardcoding tokens or sensitive keys directly into the source code.
- JWT tokens are stored in `localStorage` or `sessionStorage` and attached to outgoing requests via an HttpInterceptor.
## Cross-References
- [Architecture](./architecture.md)

View File

@@ -0,0 +1,25 @@
---
type: doc
name: testing-strategy
description: Test frameworks, patterns, coverage requirements, and quality gates
category: testing
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Testing Strategy
## Test Types
- **Unit**: Jasmine and Karma, files named `*.spec.ts`.
- **E2E**: Protractor (`e2e/` folder), files named `*.e2e-spec.ts`.
## Running Tests
- All tests: `npm run test` or `ng test`
- E2E tests: `npm run e2e` or `ng e2e`
- Watch mode: `npm run test -- --watch`
## Quality Gates
- Components should have accompanying `.spec.ts` files ensuring fundamental rendering and interactions.
- NgRx reducers and effects must be covered by unit tests.
- TypeScript strict typing helps catch compile-time issues before tests even run.

33
.context/docs/tooling.md Normal file
View File

@@ -0,0 +1,33 @@
---
type: doc
name: tooling
description: Scripts, IDE settings, automation, and developer productivity tips
category: tooling
generated: 2026-04-29
status: active
scaffoldVersion: "2.0.0"
---
# Tooling & Productivity Guide
## Required Tooling
- **Node.js**: The JavaScript runtime.
- **npm**: Package manager.
- **Angular CLI**: Install globally via `npm install -g @angular/cli`.
## Recommended Automation
- Formatting: Prettier/ESLint integration should be configured.
- Scaffolding: Use Angular CLI to generate boilerplate.
- Generate component: `ng g c component-name`
- Generate service: `ng g s service-name`
## IDE / Editor Setup
- **VS Code** is highly recommended.
- **Extensions**:
- Angular Language Service
- ESLint
- Prettier
- NgRx Snippets
## Productivity Tips
- Utilize the Redux DevTools extension in your browser to debug NgRx state changes in real-time.

73
.context/skills/README.md Normal file
View File

@@ -0,0 +1,73 @@
# Skills
On-demand expertise for AI agents. Skills are task-specific procedures that get activated when relevant.
> Project: Vendaweb-portal
## How Skills Work
1. **Discovery**: AI agents discover available skills
2. **Matching**: When a task matches a skill's description, it's activated
3. **Execution**: The skill's instructions guide the AI's behavior
## Available Skills
### Built-in Skills
| Skill | Description | Phases |
|-------|-------------|--------|
| [Commit Message](./commit-message/SKILL.md) | Generate commit messages following conventional commits with scope detection | E, C |
| [Pr Review](./pr-review/SKILL.md) | Review pull requests against team standards and best practices | R, V |
| [Code Review](./code-review/SKILL.md) | Review code quality, patterns, and best practices | R, V |
| [Test Generation](./test-generation/SKILL.md) | Generate comprehensive test cases for code | E, V |
| [Documentation](./documentation/SKILL.md) | Generate and update technical documentation | P, C |
| [Refactoring](./refactoring/SKILL.md) | Safe code refactoring with step-by-step approach | E |
| [Bug Investigation](./bug-investigation/SKILL.md) | Systematic bug investigation and root cause analysis | E, V |
| [Feature Breakdown](./feature-breakdown/SKILL.md) | Break down features into implementable tasks | P |
| [Api Design](./api-design/SKILL.md) | Design RESTful APIs following best practices | P, R |
| [Security Audit](./security-audit/SKILL.md) | Security review checklist for code and infrastructure | R, V |
## Creating Custom Skills
Create a new skill by adding a directory with a `SKILL.md` file:
```
.context/skills/
└── my-skill/
├── SKILL.md # Required: skill definition
└── templates/ # Optional: helper resources
└── checklist.md
```
### SKILL.md Format
```yaml
---
name: my-skill
description: When to use this skill
phases: [P, E, V] # Optional: PREVC phases
mode: false # Optional: mode command?
---
# My Skill
## When to Use
[Description of when this skill applies]
## Instructions
1. Step one
2. Step two
## Examples
[Usage examples]
```
## PREVC Phase Mapping
| Phase | Name | Skills |
|-------|------|--------|
| P | Planning | feature-breakdown, documentation, api-design |
| R | Review | pr-review, code-review, api-design, security-audit |
| E | Execution | commit-message, test-generation, refactoring, bug-investigation |
| V | Validation | pr-review, code-review, test-generation, security-audit |
| C | Confirmation | commit-message, documentation |

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Api Design
description: Design RESTful APIs following best practices
skillSlug: api-design
phases: [P, R]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Bug Investigation
description: Systematic bug investigation and root cause analysis
skillSlug: bug-investigation
phases: [E, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Code Review
description: Review code quality, patterns, and best practices
skillSlug: code-review
phases: [R, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Commit Message
description: Generate commit messages following conventional commits with scope detection
skillSlug: commit-message
phases: [E, C]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Documentation
description: Generate and update technical documentation
skillSlug: documentation
phases: [P, C]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Feature Breakdown
description: Break down features into implementable tasks
skillSlug: feature-breakdown
phases: [P]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Pr Review
description: Review pull requests against team standards and best practices
skillSlug: pr-review
phases: [R, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Refactoring
description: Safe code refactoring with step-by-step approach
skillSlug: refactoring
phases: [E]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Security Audit
description: Security review checklist for code and infrastructure
skillSlug: security-audit
phases: [R, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,10 @@
---
type: skill
name: Test Generation
description: Generate comprehensive test cases for code
skillSlug: test-generation
phases: [E, V]
generated: 2026-04-29
status: unfilled
scaffoldVersion: "2.0.0"
---

View File

@@ -0,0 +1,4 @@
{"timestamp":"2026-04-29T20:15:44.301Z","tool":"context","action":"init","status":"success","details":{"params":{"action":"init","repoPath":"d:\\desenvolvimento\\Simplifique\\vendaweb\\Vendaweb-portal","autoFill":true},"result":{"status":"incomplete"}}}
{"timestamp":"2026-04-29T20:17:00.305Z","tool":"context","action":"listToFill","status":"success","details":{"params":{"action":"listToFill","repoPath":"d:\\desenvolvimento\\Simplifique\\vendaweb\\Vendaweb-portal","target":"docs"},"result":{"success":true}}}
{"timestamp":"2026-04-29T20:17:21.000Z","tool":"context","action":"fill","status":"success","details":{"params":{"action":"fill","repoPath":"d:\\desenvolvimento\\Simplifique\\vendaweb\\Vendaweb-portal","target":"docs"},"result":{"success":true}}}
{"timestamp":"2026-04-29T20:18:01.149Z","tool":"context","action":"fill","status":"success","details":{"params":{"action":"fill","repoPath":"d:\\desenvolvimento\\Simplifique\\vendaweb\\Vendaweb-portal","target":"docs","offset":3,"limit":5},"result":{"success":true}}}

34
AGENTS.md Normal file
View File

@@ -0,0 +1,34 @@
# AGENTS.md
## Dev environment tips
- Install dependencies with `npm install` before running scaffolds.
- Use `npm run dev` for the interactive TypeScript session that powers local experimentation.
- Run `npm run build` to refresh the CommonJS bundle in `dist/` before shipping changes.
- Store generated artefacts in `.context/` so reruns stay deterministic.
## Testing instructions
- Execute `npm run test` to run the Jest suite.
- Append `-- --watch` while iterating on a failing spec.
- Trigger `npm run build && npm run test` before opening a PR to mimic CI.
- Add or update tests alongside any generator or CLI changes.
## PR instructions
- Follow Conventional Commits (for example, `feat(scaffolding): add doc links`).
- Cross-link new scaffolds in `docs/README.md` and `agents/README.md` so future agents can find them.
- Attach sample CLI output or generated markdown when behaviour shifts.
- Confirm the built artefacts in `dist/` match the new source changes.
## Repository map
- `angular.json/` — explain what lives here and when agents should edit it.
- `browserslist/` — explain what lives here and when agents should edit it.
- `docker-compose.yml/` — explain what lives here and when agents should edit it.
- `Dockerfile/` — explain what lives here and when agents should edit it.
- `e2e/` — explain what lives here and when agents should edit it.
- `k8s/` — explain what lives here and when agents should edit it.
- `karma.conf.js/` — explain what lives here and when agents should edit it.
- `kendo-ui-license.txt/` — explain what lives here and when agents should edit it.
## AI Context References
- Documentation index: `.context/docs/README.md`
- Agent playbooks: `.context/agents/README.md`
- Contributor guide: `CONTRIBUTING.md`

View File

@@ -7,4 +7,4 @@ spec:
spec:
containers:
- name: portal
image: 172.35.0.216:3000/simplifique/vendaweb-portal:47945c9
image: 172.35.0.216:3000/simplifique/vendaweb-portal:4c6ff6e

View File

@@ -1,5 +1,11 @@
<app-header-admin></app-header-admin>
<div class="d-flex flex-column wrapper">
<div class="loading-overlay" *ngIf="(loading$ | async) || (updating$ | async)">
<div class="loading-content">
<kendo-loader type="converging-spinner" themeColor="primary" size="large"></kendo-loader>
<div class="mt-2">Carregando dados do pedido...</div>
</div>
</div>
<div class="container cart-container my-4">
<!-- Primeira Linha -->
<!-- <div class="row mb-3">
@@ -854,7 +860,7 @@
<span *ngIf="!isLoadingPreOrder" class="text-btn-order">Fechar orçamento</span>
</button> -->
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-order w-100"
<button *ngIf="!isLoadingPreOrder" kendoButton class="btn-pre-order w-100"
(click)="showConfirmation()" [disabled]="isLoadingPreOrder" [icon]="loadingIconOrder">
<span class="text-btn-order">Fechar orçamento</span>
</button>
@@ -933,7 +939,7 @@
message="{{ messageConfirmation }}" textButtonConfirmation="{{ textButtonConfirmation }}"
textButtonCancel="{{ textButtonCancel }}" (resultEvent)="confirmChangePaymentPlan($event)"></app-confirmation>
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="{{ titleMessage }}"
<app-discount-item-sales *ngIf="showDiscountItem" opened="showDiscountItem" title="Desconto por Item"
textButtonConfirmation="{{ textButtonConfirmation }}" textButtonCancel="{{ textButtonCancel }}"
[shoppingItem]="itemSelect" (resultEvent)="returnDiscountItem($event)"></app-discount-item-sales>

View File

@@ -991,6 +991,26 @@ kendo-treeview:hover {
}
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(255, 255, 255, 0.7);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.loading-content {
text-align: center;
font-weight: 600;
color: #2d2e83;
}
/* Responsividade para desktops maiores (largura > 1200px) */
@media (min-width: 1200px) {
.card-resume {

View File

@@ -278,7 +278,7 @@ export class CartSalesComponent
) { }
ngOnChanges(changes: SimpleChanges): void {
this.loadShopping();
//this.loadShopping();
}
ngAfterViewInit(): void { }
@@ -326,18 +326,9 @@ export class CartSalesComponent
}
}
loadShopping() {
this.shoppingSubscription = this.shopping$.subscribe((data) => {
this.shopping = data;
if (this.shopping !== null) {
this.totalWeight = data.totpeso;
this.loadFormOrder();
}
});
}
getTaxValue() {
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
if (!this.formResumeOrder) return 0;
const taxValue = Number.parseFloat(
this.formResumeOrder.get('taxValue').value
);
@@ -345,19 +336,25 @@ export class CartSalesComponent
return taxDelivery != null ? taxDelivery.taxValue : taxValue;
}
loadFormOrder() {
this.subscriptionShopping = this.shopping$.subscribe((data) => {
loadFormOrder(data?: Shopping) {
if (!data && this.shopping) {
data = this.shopping;
}
if (!data) return;
const taxDelivery = JSON.parse(localStorage.getItem('taxDelivery'));
this.formResumeOrder = this.fb.group({
taxValue: [
taxDelivery.taxValue > 0 ? taxDelivery.taxValue.toFixed(2) : '0',
],
discount: [data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00'],
carrierId: [taxDelivery.carrierId],
deliveryTaxId: [taxDelivery.deliveryTaxId],
});
if (this.formResumeOrder) {
this.formResumeOrder.patchValue({
taxValue:
taxDelivery != null && taxDelivery.taxValue > 0
? taxDelivery.taxValue.toFixed(2)
: '0',
discount: data.vldesconto > 0 ? data.vldesconto.toFixed(2) : '0,00',
carrierId: taxDelivery != null ? taxDelivery.carrierId : 0,
deliveryTaxId: taxDelivery != null ? taxDelivery.deliveryTaxId : 0,
});
}
}
ngOnInit(): void {
this.userForm = this.fb.group({
@@ -449,6 +446,7 @@ export class CartSalesComponent
taxValue: new FormControl(this.cartData.taxValue.toFixed(2), []),
discount: new FormControl(this.cartData.discountValue.toFixed(2), []),
carrierId: new FormControl(this.cartData.carrierId, []),
deliveryTaxId: new FormControl(0, []),
});
this.formPayment = this.fb.group({
invoiceStore: new FormControl(null),
@@ -499,7 +497,7 @@ export class CartSalesComponent
this.shopping = data;
if (this.shopping !== null) {
this.totalWeight = data.totpeso;
this.loadFormOrder();
this.loadFormOrder(data);
}
});
@@ -1432,10 +1430,10 @@ export class CartSalesComponent
let carrierId = 0;
if (taxValue >= 0) {
deliveryTaxId = Number.parseFloat(
this.formResumeOrder.get('deliveryTaxId').value
this.formResumeOrder.get('deliveryTaxId') ? this.formResumeOrder.get('deliveryTaxId').value : 0
);
carrierId = Number.parseFloat(
this.formResumeOrder.get('carrierId').value
this.formResumeOrder.get('carrierId') ? this.formResumeOrder.get('carrierId').value : 0
);
}
const order: OrderDeliveryTax = {
@@ -1446,7 +1444,6 @@ export class CartSalesComponent
};
localStorage.setItem('taxDelivery', JSON.stringify(order));
this.loadFormOrder();
this.loadShopping();
/* this.store.dispatch(new UpdateDeliveryTaxAction(order));
this.updating$.subscribe((update) => {
@@ -1588,6 +1585,7 @@ export class CartSalesComponent
console.log('Retorno cadastro endereço: ' + result);
if (result != null) {
localStorage.setItem('address', JSON.stringify(result));
this.updateCart(this.shoppingService.getCart());
this.updateFormAddress(result);
}
}
@@ -2146,10 +2144,10 @@ export class CartSalesComponent
);
let percentOrder = (discountValue / orderValue) * 100;
console.log('Percentual do pedido: ' + percentOrder);
if (this.percentSeller < percentOrder) {
this.openedAuthUser = true;
return;
}
// if (this.percentSeller < percentOrder) {
// this.openedAuthUser = true;
// return;
// }
if (discountValue <= 0.01) {
percentOrder = 0;
}
@@ -2159,8 +2157,9 @@ export class CartSalesComponent
idUserAuth: this.authService.getUser(),
};
this.store.dispatch(new ApplyDiscountOrderAction(order));
this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart()));
// this.store.dispatch(new LoadShoppingAction(this.shoppingService.getCart())); // Reloader moved to Effect
this.loadFormOrder();
this.calculateTaxDelivery(true);
}
applyDiscountOrder() {
@@ -2249,6 +2248,7 @@ export class CartSalesComponent
this.showInformation = true;
return;
}
this.loadFormOrder();
}
calcDiscountOrderValue() {
@@ -2591,6 +2591,7 @@ export class CartSalesComponent
priorityDelivery: priorityDelivery,
};
console.log('dataDeliveryTax', JSON.stringify(dataDeliveryTax));
this.shoppingService.calculateDeliveryTax(dataDeliveryTax).subscribe(
(result) => {
this.dataDeliveryTax = result;

View File

@@ -3,7 +3,7 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { Store } from '@ngrx/store';
import { ActionsLayout } from '@progress/kendo-angular-dialog';
import { Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { catchError, map } from 'rxjs/operators';
import { AuthService } from 'src/app/auth/services/auth.service';
import { ResultApi } from 'src/app/models/result-api.model';
import { UserAuth } from 'src/app/models/user-auth.model';
@@ -55,7 +55,7 @@ export class DiscountItemSalesComponent implements OnInit {
constructor(
private fb: FormBuilder,
private authService: AuthService,
private store: Store<SaleState>, ) {
private store: Store<SaleState>,) {
this.formDiscountItem = this.fb.group({
description: [''],
@@ -96,7 +96,7 @@ export class DiscountItemSalesComponent implements OnInit {
calcPercentDiscount() {
const discountValue = this.formDiscountItem.get('discountValue').value;
const percent = Number.parseFloat(( discountValue / this.shoppingItem.listPrice ).toFixed(2)) * 100;
const percent = Number.parseFloat((discountValue / this.shoppingItem.listPrice).toFixed(2)) * 100;
const salePrice = Number.parseFloat((this.shoppingItem.listPrice - discountValue).toFixed(2));
this.formDiscountItem.patchValue({
discount: percent,
@@ -107,30 +107,28 @@ export class DiscountItemSalesComponent implements OnInit {
async confirmDiscount() {
let discount = Number.parseFloat(this.formDiscountItem.get('discount').value);
console.log('discount', discount);
const discountValue = Number.parseFloat(this.formDiscountItem.get('discountValue').value);
const salePrice = Number.parseFloat((this.shoppingItem.listPrice - discountValue).toFixed(2));
if (this.percentSeller < discount) {
this.openedAuthUser = true;
return;
}
// if (this.percentSeller < discount) {
// this.openedAuthUser = true;
// return;
// }
if (discountValue <= 0.01) {
discount = 0;
}
this.shoppingItem.discount = discount;
this.shoppingItem.discountValue = discountValue;
this.shoppingItem.price = salePrice;
this.shoppingItem.userDiscount = this.authService.getUser();
this.store.dispatch(new UpdatePriceItemAction(this.shoppingItem));
this.updating$.pipe(
map((updating) => {
if (!updating) {
console.log('shoppingItem', JSON.stringify(this.shoppingItem));
const updateItem = { ...this.shoppingItem };
updateItem.discount = discount;
updateItem.discountValue = discountValue;
updateItem.price = salePrice;
updateItem.userDiscount = this.authService.getUser();
this.store.dispatch(new UpdatePriceItemAction(updateItem));
this.resultEvent.emit(true);
}
})
);
}
async returnAuthUser(userAuth: any) {
this.openedAuthUser = false;
@@ -149,13 +147,7 @@ export class DiscountItemSalesComponent implements OnInit {
updateItem.price = salePrice;
updateItem.userDiscount = userAuth.id;
this.store.dispatch(new UpdatePriceItemAction(updateItem));
this.updating$.subscribe(
(updating) => {
if (!updating) {
this.resultEvent.emit(true);
}
}
);
} else {
console.log('Não localizou o id.');
}

View File

@@ -1,35 +1,24 @@
<div class="container-fluid">
<form class="k-form" [formGroup]="formDiscount">
<fieldset>
<legend>Dados do pedido</legend>
<legend>Dados do pedido xxx</legend>
<label class="k-form-field">
<span>Valor dos produtos</span>
<kendo-numerictextbox
[spinners]="false"
[readonly]="true"
[value]="orderValue"
formControlName="value"
>
<kendo-numerictextbox [spinners]="false" [readonly]="true" [value]="orderValue" formControlName="value">
</kendo-numerictextbox>
</label>
<div class="">
<label class="k-form-field">
<span>% Desconto desejado</span>
<kendo-numerictextbox
formControlName="discount"
[spinners]="false"
>
<kendo-numerictextbox formControlName="discount" [spinners]="false">
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
</kendo-numerictextbox>
</label>
<label class="k-form-field">
<span>Valor do desconto</span>
<kendo-numerictextbox
formControlName="discountValue"
[spinners]="false"
>
<kendo-numerictextbox formControlName="discountValue" [spinners]="false">
<kendo-formerror>Error: Percentual acima do permitido para o usuário.</kendo-formerror>
</kendo-numerictextbox>
</label>
@@ -37,12 +26,8 @@
<label class="k-form-field">
<span>Valor do pedido com desconto</span>
<kendo-numerictextbox
formcontrolName="valueWithDiscount"
[spinners]="false"
[readonly]="true"
[value]="orderWithDiscount"
>
<kendo-numerictextbox formcontrolName="valueWithDiscount" [spinners]="false" [readonly]="true"
[value]="orderWithDiscount">
</kendo-numerictextbox>
</label>
@@ -60,12 +45,7 @@
<fieldset>
<kendo-formfield>
<kendo-label [for]="email" text="Email"></kendo-label>
<kendo-textbox
formControlName="email"
[clearButton]="true"
#email
required
></kendo-textbox>
<kendo-textbox formControlName="email" [clearButton]="true" #email required></kendo-textbox>
<!--kendo-formerror *ngIf="formDiscount.controls.formUser.email.errors?.required"
>Erro: Email é obrigatório</kendo-formerror
@@ -77,13 +57,7 @@
<kendo-formfield class="mt-2">
<kendo-label [for]="password" text="Senha"></kendo-label>
<input
kendoTextBox
type="password"
placeholder="Password"
#password
formControlName="password"
/>
<input kendoTextBox type="password" placeholder="Password" #password formControlName="password" />
<kendo-formerror>Error: Password is required</kendo-formerror>
</kendo-formfield>
@@ -92,8 +66,9 @@
<div class="k-actions k-actions-end">
<button type="button" [disabled]="!formDiscount.valid" class="k-button" (click)="closeMsgDiscount()">Cancel</button>
<button type="button" class="k-button k-primary" (click)="confirmDiscount()" >Submit</button>
<button type="button" [disabled]="!formDiscount.valid" class="k-button"
(click)="closeMsgDiscount()">Cancel</button>
<button type="button" class="k-button k-primary" (click)="confirmDiscount()">Submit</button>
</div>

View File

@@ -43,13 +43,13 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
discountValue: [(this.orderValue - this.orderWithDiscount),
Validators.compose([Validators.required])],
valueWithDiscount: [this.orderWithDiscount, [Validators.required]],
formUser: this.formBuilder.group({
email: new FormControl(null, Validators.required),
password: new FormControl(null, Validators.required),
}),
formGroup: this.formBuilder.group({
userAuth: new FormControl(null, Validators.required),
}),
// formUser: this.formBuilder.group({
// email: new FormControl(null, Validators.required),
// password: new FormControl(null, Validators.required),
// }),
// formGroup: this.formBuilder.group({
// userAuth: new FormControl(null, Validators.required),
// }),
});
this.formDiscount.valueChanges.subscribe(f => {
this.percent = this.formDiscount.get('discount').value;
@@ -84,12 +84,16 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
}
confirmDiscount() {
this.submitForm.emit(this.formDiscount);
return;
let email = this.formDiscount.get('formUser.email').value;
const emailUpperCase = email.toUpperCase();
const passwordUpperCase = this.formDiscount.get('formUser.password').value.toUpperCase();
if (this.discountAuthorization < this.percent) {
// if (this.discountAuthorization < this.percent) {
if (this.formDiscount.controls.formGroup.get('userAuth').value) {
this.SubscriptionAuth = this.authService.authenticate({
email: emailUpperCase,
@@ -120,42 +124,42 @@ export class DiscountOrderComponent implements OnInit, OnDestroy {
}
} else {
this.close();
}
// } else {
// this.close();
// }
}
getAuthorization() {
return this.formDiscount.controls.formGroup.get('userAuth').value;
return false; //this.formDiscount.controls.formGroup.get('userAuth').value;
}
validationUser() {
this.formDiscount.markAllAsTouched();
if (this.formDiscount.valid) {
// this.loadingIcon = 'loading';
this.authService.authenticate({
email: this.formDiscount.get('formUser.email').value,
password: this.formDiscount.get('formUser.password').value
})
.subscribe((res: ResultApi) => {
console.log(res);
if (res.success) {
this.discountAuthorization = res.data.discountPercent;
return this.discountAuthorization;
// this.loadingIcon = '';
} else {
// this.loadingIcon = '';
// this.showErrorMessage(res.message);
return this.discountAuthorization;
}
}, err => {
return this.discountAuthorization;
// this.loadingIcon = '';
// this.showErrorMessage('Erro ao processar sua requisição,
// tente novamente e caso persista o erro contacte o departamento de TI.');
});
return this.discountAuthorization;
}
// if (this.formDiscount.valid) {
// // this.loadingIcon = 'loading';
// this.authService.authenticate({
// email: this.formDiscount.get('formUser.email').value,
// password: this.formDiscount.get('formUser.password').value
// })
// .subscribe((res: ResultApi) => {
// console.log(res);
// if (res.success) {
// this.discountAuthorization = res.data.discountPercent;
// return this.discountAuthorization;
// // this.loadingIcon = '';
// } else {
// // this.loadingIcon = '';
// // this.showErrorMessage(res.message);
// return this.discountAuthorization;
// }
// }, err => {
// return this.discountAuthorization;
// // this.loadingIcon = '';
// // this.showErrorMessage('Erro ao processar sua requisição,
// // tente novamente e caso persista o erro contacte o departamento de TI.');
// });
// return this.discountAuthorization;
// }
}
}

View File

@@ -40,8 +40,8 @@
</button>
<div *ngIf="isMobileMenuOpen" class="mobile-menu-items shadow-sm">
<button class="dropdown-item w-100" (click)="openNewOrder()">Novo pedido</button>
<button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>
<!-- <button class="dropdown-item w-100" (click)="openDashTodaysale()">Dashboard Venda dia</button>
<button class="dropdown-item w-100" (click)="openDashSeller()">Dashboard Vendedor</button>-->
<button class="dropdown-item w-100" (click)="openOrders()">Pedidos de venda</button>
<button class="dropdown-item w-100" (click)="openProductOrder()">Produtos Vendidos</button>
<button class="dropdown-item w-100" (click)="openClose(true)">Orçamentos pendentes</button>

View File

@@ -38,7 +38,8 @@
</div>
<div class="col-md-6 col-sm-12 mt-3 mt-md-0">
<label>
<span class="d-block">CPF / CNPJ</span>
<span class="d-block">CPF / CNPJ ou</span>
<span class="d-block">Código do Cliente</span>
<kendo-textbox formControlName="document" placeholder="Informe o CPF ou CNPJ do cliente"></kendo-textbox>
</label>
</div>

View File

@@ -98,7 +98,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.updatePriceItemShopping(data.payload)
.pipe(
map(() => new UpdatePriceItemSuccessAction(data.payload)),
mergeMap(() => [
new UpdatePriceItemSuccessAction(data.payload),
new LoadShoppingAction(data.payload.idCart)
]),
catchError(error => of(new UpdatePriceItemFailureAction(error)))
)
)
@@ -110,7 +113,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.applyDiscountOrder(data.payload)
.pipe(
map((items) => new ApplyDiscountOrderSuccessAction(items)),
mergeMap((items) => [
new ApplyDiscountOrderSuccessAction(items),
new LoadShoppingAction(data.payload.id)
]),
catchError(error => of(new ApplyDiscountOrderFailureAction(error)))
)
)
@@ -122,7 +128,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.updateQuantityItemShopping(data.payload)
.pipe(
map(() => new UpdateQuantityItemSuccessAction(data.payload)),
mergeMap(() => [
new UpdateQuantityItemSuccessAction(data.payload),
new LoadShoppingAction(data.payload.idCart)
]),
catchError(error => of(new UpdateQuantityItemFailureAction(error)))
)
)
@@ -134,7 +143,10 @@ export class ShoppingEffects {
mergeMap(
(data) => this.shoppingService.deleteItemShopping(data.payload)
.pipe(
map((result) => new DeleteItemSuccessAction(result)),
mergeMap((result) => [
new DeleteItemSuccessAction(result),
new LoadShoppingAction(localStorage.getItem('cart'))
]),
catchError(error => of(new DeleteItemFailureAction(error)))
)
)

View File

@@ -1,6 +1,6 @@
export const environment = {
production: true,
// url: 'http://10.1.1.124:8065/api/v1/',
// url: 'http://172.35.0.217:32619/api/v1/',
url: 'https://api.vendaweb.simplifiquehc.com.br/api/v1/',
// url: 'http://vendaweb.jurunense.com.br/api/v1/',
URL_PIX: 'http://10.1.1.205:8078/api/v1/',