-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeedData_Sales.sql
More file actions
100 lines (84 loc) · 3.82 KB
/
Copy pathSeedData_Sales.sql
File metadata and controls
100 lines (84 loc) · 3.82 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
-- ============================================================
-- SCRIPT DE DATOS DE PRUEBA - MÓDULO SALES (VENTAS)
-- ============================================================
-- Descripción: Inserta datos de prueba para clientes
-- Prerequisitos: Debe ejecutarse después de las migraciones
-- Módulo: Sales (Clientes y Facturación)
-- ============================================================
USE PoliMarketDb;
GO
SET QUOTED_IDENTIFIER ON;
GO
-- ============================================================
-- 1. LIMPIAR DATOS EXISTENTES (OPCIONAL - SOLO PARA TESTING)
-- ============================================================
PRINT 'Limpiando datos existentes de Sales...';
-- Eliminar en orden debido a las foreign keys
DELETE FROM Sales.InvoiceDetails;
DELETE FROM Sales.Invoices;
DELETE FROM Sales.Customers;
PRINT 'Datos existentes eliminados.';
GO
-- ============================================================
-- 2. INSERTAR CLIENTES DE PRUEBA
-- ============================================================
PRINT 'Insertando clientes de prueba...';
SET IDENTITY_INSERT Sales.Customers ON;
INSERT INTO Sales.Customers (Id, Name, Address, Email)
VALUES
(1, 'Empresa ABC S.A.', 'Av. Principal 123, Quito, Ecuador', 'ventas@empresaabc.com'),
(2, 'Comercial XYZ Ltda.', 'Calle Secundaria 456, Guayaquil, Ecuador', 'contacto@comercialxyz.com'),
(3, 'Distribuidora Los Andes', 'Carrera 10 #20-30, Cuenca, Ecuador', 'compras@losandes.com'),
(4, 'TechSolutions Ecuador', 'Av. 6 de Diciembre N35-123, Quito, Ecuador', 'info@techsolutions.ec'),
(5, 'Supermercado El Ahorro', 'Av. Malecón 789, Manta, Ecuador', 'gerencia@elahorro.com'),
(6, 'Papelería Universitaria', 'Av. Universitaria 234, Loja, Ecuador', 'ventas@papeleriauniversitaria.com'),
(7, 'Importadora Costa S.A.', 'Km 5.5 Vía a la Costa, Guayaquil, Ecuador', 'importaciones@costa.com.ec'),
(8, 'Ferretería El Constructor', 'Calle Bolívar 567, Ambato, Ecuador', 'info@elconstructor.com'),
(9, 'Electrónica Digital', 'Centro Comercial El Recreo, Local 45, Quito, Ecuador', 'ventas@electronicadigital.ec'),
(10, 'Oficinas Premium', 'Parque Industrial Norte, Bodega 12, Quito, Ecuador', 'premium@oficinas.com');
SET IDENTITY_INSERT Sales.Customers OFF;
PRINT 'Clientes insertados correctamente';
GO
-- ============================================================
-- 3. VERIFICACIÓN Y RESUMEN
-- ============================================================
PRINT '';
PRINT '============================================================';
PRINT 'RESUMEN DE DATOS DE PRUEBA - MÓDULO SALES';
PRINT '============================================================';
PRINT '';
SELECT
COUNT(*) AS [Total Clientes]
FROM Sales.Customers;
PRINT '';
PRINT '--- Top 5 Clientes ---';
SELECT TOP 5
Id,
Name AS [Nombre],
Email,
Address AS [Dirección]
FROM Sales.Customers
ORDER BY Id;
PRINT '';
PRINT '============================================================';
PRINT 'CLIENTES DISPONIBLES PARA TESTING DE FACTURACIÓN (RF03/RF04)';
PRINT '============================================================';
PRINT '';
PRINT '✅ CLIENTES EMPRESARIALES:';
PRINT ' - Cliente ID 1: Empresa ABC S.A.';
PRINT ' - Cliente ID 4: TechSolutions Ecuador';
PRINT ' - Cliente ID 7: Importadora Costa S.A.';
PRINT '';
PRINT '✅ CLIENTES COMERCIALES:';
PRINT ' - Cliente ID 2: Comercial XYZ Ltda.';
PRINT ' - Cliente ID 5: Supermercado El Ahorro';
PRINT ' - Cliente ID 8: Ferretería El Constructor';
PRINT '';
PRINT '💡 NOTA: Estos clientes pueden usarse junto con:';
PRINT ' - Vendedor ID 2 (Activo) del módulo Security';
PRINT ' - Productos ID 1-10 del módulo Inventory';
PRINT '';
PRINT '============================================================';
PRINT 'Scripts completados exitosamente';
PRINT '============================================================';
GO