pipicar/modules/applications/app.json

291 lines
12 KiB
JSON

{
"module": "pipicar",
"name": "pipicar.auto_orders",
"type": "crud",
"title": "Заявки",
"withHeader": false,
"data": {
"table": "pipi_applications",
"pk": "id",
"limit": 25,
"segment": true,
"timestamp": false,
"fields": {
"id": {
"type": "pk"
},
"car_id": {
"type": "foreign",
"table": "pipi_auto",
"foreign": "id",
"display": [
"name"
],
"validation": "required|integer"
},
"user_id": {
"type": "foreign",
"table": "core_users",
"foreign": "id",
"display": [
"name"
],
"validation": "required|integer"
},
"phone": {
"type": "string"
},
"user_name": {
"type": "string"
},
"user_surname": {
"type": "string"
},
"user_email": {
"type": "string"
},
"sum": {
"type": "int"
},
"deposit": {
"type": "int"
},
"started_at": {
"type": "date",
"validation": "required|date"
},
"ended_at": {
"type": "date",
"validation": "required|date"
},
"photos": {
"type": "json",
"validation": "nullable"
},
"address_start": {
"type": "foreign",
"table": "pipi_address",
"foreign": "id",
"display": [
"name"
],
"validation": "required|integer"
},
"address_end": {
"type": "foreign",
"table": "pipi_address",
"alias": "address_end",
"foreign": "id",
"display": [
"name"
],
"validation": "required|integer"
}
}
},
"ui": {
"grid": {
"title": "Заявки",
"component": "App.components.Grid",
"cols": [
{ "name": "id", "caption": "ID" },
{ "name": "car_id", "caption": "Машина" },
{ "name": "user_id", "caption": "Пользователь" },
{ "name": "phone", "caption": "Телефон" },
{ "name": "user_name", "caption": "Имя" },
{ "name": "user_surname", "caption": "Фамилия" },
{ "name": "user_email", "caption": "Email" },
{ "name": "started_at", "caption": "Начало" },
{ "name": "ended_at", "caption": "Дата окончания" }
],
"action": {
"head": [
"add"
],
"row": [
"delete"
]
},
"filter": {
"template": "app.base.crud.filter",
"rows": [
{
"cols": [
{
"size": 6,
"input": {
"name": "car_id",
"label": "Машина"
}
}
]
}
]
}
},
"forms": {
"add": {
"title": "Заявки",
"template": "app.base.crud.form",
"component": "App.components.Show",
"form": {
"submits": "struct:crud.form.edit.submits",
"rows": [
{
"cols": [
{ "size": 6, "input": { "name": "car_id", "label": "Машина" } },
{ "size": 6, "input": { "name": "user_id", "label": "Пользователь" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "phone", "label": "Телефон" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "user_name", "label": "Имя" } },
{ "size": 6, "input": { "name": "user_surname", "label": "Фамилия" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "user_email", "label": "Email" } },
{ "size": 6, "input": { "name": "started_at", "label": "Начало" } }
]
},
{
"cols": [
{ "size": 3, "input": { "name": "address_start", "label": "Адрес получения" } },
{ "size": 3, "input": { "name": "address_end", "label": "Конечный адрес" } },
{ "size": 3, "input": { "name": "sum", "label": "Сумма" } },
{ "size": 3, "input": { "name": "deposit", "label": "Депозит" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "ended_at", "label": "Дата окончания" } },
{ "size": 6, "input": { "name": "photos", "label": "Фотографии", "type": "files"} }
]
}
]
}
},
"edit": {
"title": "Заявки",
"template": "app.base.crud.form",
"component": "App.components.Show",
"form": {
"rows": [
{
"cols": [
{ "size": 6, "input": { "name": "car_id", "label": "Машина" } },
{ "size": 6, "input": { "name": "user_id", "label": "Пользователь" } }
]
},
{
"cols": [
{ "size": 4, "input": { "name": "phone", "label": "Телефон" } },
{ "size": 4, "input": { "name": "user_name", "label": "Имя" } },
{ "size": 4, "input": { "name": "user_surname", "label": "Фамилия" } }
]
},
{
"cols": [
{ "size": 4, "input": { "name": "user_email", "label": "Email" } },
{ "size": 4, "input": { "name": "started_at", "label": "Начало" } },
{ "size": 4, "input": { "name": "ended_at", "label": "Дата окончания" } }
]
},
{
"cols": [
{ "size": 3, "input": { "name": "address_start", "label": "Адрес получения" } },
{ "size": 3, "input": { "name": "address_end", "label": "Конечный адрес" } },
{ "size": 3, "input": { "name": "sum", "label": "Сумма" } },
{ "size": 3, "input": { "name": "deposit", "label": "Депозит" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "photos", "label": "Фотографии", "type": "files"} }
]
}
],
"submits": [
"struct:crud.form.submit.save",
"struct:crud.form.submit.close"
]
}
},
"show": {
"title": "Заявки",
"template": "app.base.crud.form",
"component": "App.components.Show",
"form": {
"rows": [
{
"cols": [
{ "size": 6, "input": { "name": "car_id", "label": "Машина" } },
{ "size": 6, "input": { "name": "user_id", "label": "Пользователь" } }
]
},
{
"cols": [
{ "size": 4, "input": { "name": "phone", "label": "Телефон" } },
{ "size": 4, "input": { "name": "user_name", "label": "Имя" } },
{ "size": 4, "input": { "name": "user_surname", "label": "Фамилия" } }
]
},
{
"cols": [
{ "size": 4, "input": { "name": "user_email", "label": "Email" } },
{ "size": 4, "input": { "name": "started_at", "label": "Начало" } },
{ "size": 4, "input": { "name": "ended_at", "label": "Дата окончания" } }
]
},
{
"cols": [
{ "size": 3, "input": { "name": "address_start", "label": "Адрес получения" } },
{ "size": 3, "input": { "name": "address_end", "label": "Конечный адрес" } },
{ "size": 3, "input": { "name": "sum", "label": "Сумма" } },
{ "size": 3, "input": { "name": "deposit", "label": "Депозит" } }
]
},
{
"cols": [
{ "size": 6, "input": { "name": "photos", "label": "Фотографии", "type": "files"} }
]
}
],
"submits": [
{
"type": "logic",
"name": "App.Modules.applications.Logic.Approve",
"label": "Подтвердить заявку",
"btn": "btn btn-success",
"condition": "status,==,pending"
},
{
"type": "logic",
"name": "App.Modules.applications.Logic.Cancel",
"label": "Отменить заявку",
"btn": "btn btn-danger",
"condition": "status,==,approved"
},
{
"type": "logic",
"name": "App.Modules.applications.Logic.Complete",
"label": "Завершить заявку",
"btn": "btn btn-success",
"condition": "status,==,review"
},
"struct:crud.form.submit.save",
"struct:crud.form.submit.close"
]
}
}
}
},
"actions": "struct:crud.actions"
}