Compare commits
7 Commits
f6892b2166
...
pre-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a53cd3918 | ||
|
|
35e1d38859 | ||
|
|
a064895689 | ||
|
|
05e95f8880 | ||
|
|
af38d88876 | ||
|
|
02fa6247f1 | ||
|
|
428b745700 |
26
app/promociones/migrations/0001_initial.py
Normal file
26
app/promociones/migrations/0001_initial.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Promocion',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nombre', models.CharField(max_length=255)),
|
||||
('fecha_inicio', models.DateField(blank=True, null=True)),
|
||||
('fecha_modificacion', models.DateField(blank=True, null=True)),
|
||||
('descripcion', models.TextField(blank=True, null=True)),
|
||||
('activo', models.BooleanField(default=True)),
|
||||
('categoria_id', models.IntegerField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'db_table': 'promociones',
|
||||
},
|
||||
),
|
||||
]
|
||||
15
deployments/Makefile
Normal file
15
deployments/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
NETWORK = saas_network
|
||||
|
||||
.PHONY: network up down logs
|
||||
|
||||
network:
|
||||
docker network inspect $(NETWORK) >/dev/null 2>&1 || docker network create $(NETWORK)
|
||||
|
||||
up: network
|
||||
docker compose up --build -d
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
logs:
|
||||
docker compose logs -f
|
||||
@@ -45,4 +45,4 @@ volumes:
|
||||
|
||||
networks:
|
||||
saas_network:
|
||||
external: true
|
||||
name: saas_network
|
||||
|
||||
11
environments/DEV.postman_environment.json
Normal file
11
environments/DEV.postman_environment.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "x8jh10qysfo",
|
||||
"name": "DEV",
|
||||
"values": [
|
||||
{ "key": "base_url", "value": "https://dev.v-encore-lab.com", "type": "default", "enabled": true },
|
||||
{ "key": "username", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "password", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "access_token", "value": "", "type": "default", "enabled": true }
|
||||
],
|
||||
"_postman_variable_scope": "environment"
|
||||
}
|
||||
11
environments/LOCAL.postman_environment.json
Normal file
11
environments/LOCAL.postman_environment.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "ftt19d5vxuj",
|
||||
"name": "LOCAL",
|
||||
"values": [
|
||||
{ "key": "base_url", "value": "http://localhost:8000", "type": "default", "enabled": true },
|
||||
{ "key": "username", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "password", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "access_token", "value": "", "type": "default", "enabled": true }
|
||||
],
|
||||
"_postman_variable_scope": "environment"
|
||||
}
|
||||
11
environments/PROD.postman_environment.json
Normal file
11
environments/PROD.postman_environment.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "3ckrklvkf27",
|
||||
"name": "PROD",
|
||||
"values": [
|
||||
{ "key": "base_url", "value": "https://v-encore-lab.com", "type": "default", "enabled": true },
|
||||
{ "key": "username", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "password", "value": "admin", "type": "default", "enabled": true },
|
||||
{ "key": "access_token", "value": "", "type": "default", "enabled": true }
|
||||
],
|
||||
"_postman_variable_scope": "environment"
|
||||
}
|
||||
@@ -5,7 +5,10 @@
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||
"_postman_id": "django-core-base-collection"
|
||||
},
|
||||
"variable": [],
|
||||
"variable": [
|
||||
{ "key": "access_token", "value": "", "type": "string" },
|
||||
{ "key": "refresh_token", "value": "", "type": "string" }
|
||||
],
|
||||
"item": [
|
||||
{
|
||||
"name": "Auth",
|
||||
@@ -25,6 +28,29 @@
|
||||
"}"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"listen": "postrequest",
|
||||
"script": {
|
||||
"type": "text/javascript",
|
||||
"exec": [
|
||||
"// Comprobamos si la respuesta es exitosa",
|
||||
"if (pw.response.status === 200) {",
|
||||
" // Si el body ya es un objeto no hace falta JSON.parse",
|
||||
" const body = typeof pw.response.body === 'string'",
|
||||
" ? JSON.parse(pw.response.body)",
|
||||
" : pw.response.body;",
|
||||
"",
|
||||
" if (body.access) {",
|
||||
" // Guardamos el token en el entorno actual",
|
||||
" pw.env.set(\"access_token\", body.access);",
|
||||
" console.log(\"✅ Token guardado correctamente\");",
|
||||
" } else {",
|
||||
" console.log(\"❌ No se encontró el campo 'access' en la respuesta\");",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"request": {
|
||||
@@ -51,10 +77,13 @@
|
||||
{
|
||||
"name": "Obtener Promoción",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [{ "key": "token", "value": "{{access_token}}", "type": "string" }]
|
||||
},
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" },
|
||||
{ "key": "Authorization", "value": "Bearer {{access_token}}" }
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
@@ -75,10 +104,13 @@
|
||||
{
|
||||
"name": "Ejecutar Automatizaciones",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [{ "key": "token", "value": "{{access_token}}", "type": "string" }]
|
||||
},
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" },
|
||||
{ "key": "Authorization", "value": "Bearer {{access_token}}" }
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
@@ -94,10 +126,13 @@
|
||||
{
|
||||
"name": "Historial de Ejecuciones",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [{ "key": "token", "value": "{{access_token}}", "type": "string" }]
|
||||
},
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" },
|
||||
{ "key": "Authorization", "value": "Bearer {{access_token}}" }
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
@@ -113,10 +148,13 @@
|
||||
{
|
||||
"name": "Estado del Módulo",
|
||||
"request": {
|
||||
"auth": {
|
||||
"type": "bearer",
|
||||
"bearer": [{ "key": "token", "value": "{{access_token}}", "type": "string" }]
|
||||
},
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" },
|
||||
{ "key": "Authorization", "value": "Bearer {{access_token}}" }
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"local": {
|
||||
"id": "ftt19d5vxuj",
|
||||
"v": 2,
|
||||
"name": "LOCAL",
|
||||
"variables": [
|
||||
{ "key": "base_url", "secret": false, "initialValue": "http://localhost:8000", "currentValue": "http://localhost:8000" },
|
||||
{ "key": "username", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "password", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "access_token", "secret": false, "initialValue": "", "currentValue": "" }
|
||||
]
|
||||
},
|
||||
"dev": {
|
||||
"id": "x8jh10qysfo",
|
||||
"v": 2,
|
||||
"name": "DEV",
|
||||
"variables": [
|
||||
{ "key": "base_url", "secret": false, "initialValue": "https://dev.v-encore-lab.com", "currentValue": "https://dev.v-encore-lab.com" },
|
||||
{ "key": "username", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "password", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "access_token", "secret": false, "initialValue": "", "currentValue": "" }
|
||||
]
|
||||
},
|
||||
"prod": {
|
||||
"id": "3ckrklvkf27",
|
||||
"v": 2,
|
||||
"name": "PROD",
|
||||
"variables": [
|
||||
{ "key": "base_url", "secret": false, "initialValue": "https://v-encore-lab.com", "currentValue": "https://v-encore-lab.com" },
|
||||
{ "key": "username", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "password", "secret": false, "initialValue": "admin", "currentValue": "admin" },
|
||||
{ "key": "access_token", "secret": false, "initialValue": "", "currentValue": "" }
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user