refactor: WIP datetime availability
This commit is contained in:
parent
3a66ef0340
commit
93e6a79a38
46
.sqlx/query-0342272c9798389c37e229018e30bed399723ca0dba70438ba519d3ee7dad01b.json
generated
Normal file
46
.sqlx/query-0342272c9798389c37e229018e30bed399723ca0dba70438ba519d3ee7dad01b.json
generated
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM availabillity WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "0342272c9798389c37e229018e30bed399723ca0dba70438ba519d3ee7dad01b"
|
||||
}
|
28
.sqlx/query-0a5318ab6466385e805f83e13cc0797146a27d523ad5ffab1828806fb2935af9.json
generated
Normal file
28
.sqlx/query-0a5318ab6466385e805f83e13cc0797146a27d523ad5ffab1828806fb2935af9.json
generated
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM area WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "0a5318ab6466385e805f83e13cc0797146a27d523ad5ffab1828806fb2935af9"
|
||||
}
|
57
.sqlx/query-0eafc423ff404eadb5300ad47e5b81d5f3be1fb0c1723600b6f9bbe73b1e8155.json
generated
Normal file
57
.sqlx/query-0eafc423ff404eadb5300ad47e5b81d5f3be1fb0c1723600b6f9bbe73b1e8155.json
generated
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO user_ (name, email, password, salt, role, function, areaId)\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n RETURNING id;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
"Text",
|
||||
"Text",
|
||||
{
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "0eafc423ff404eadb5300ad47e5b81d5f3be1fb0c1723600b6f9bbe73b1e8155"
|
||||
}
|
40
.sqlx/query-126a17ad3fe8937dfbf70e9a8c2bd7aee56eb35fdff0d0e47037b9af3e08b34f.json
generated
Normal file
40
.sqlx/query-126a17ad3fe8937dfbf70e9a8c2bd7aee56eb35fdff0d0e47037b9af3e08b34f.json
generated
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM vehicleAssignement WHERE vehicleAssignement.eventId = $1;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "vehicleid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "126a17ad3fe8937dfbf70e9a8c2bd7aee56eb35fdff0d0e47037b9af3e08b34f"
|
||||
}
|
47
.sqlx/query-13d164ba2c29ac2bb4ee9428309807693ff1b29c61e7d07cbf8fb5fcd553f233.json
generated
Normal file
47
.sqlx/query-13d164ba2c29ac2bb4ee9428309807693ff1b29c61e7d07cbf8fb5fcd553f233.json
generated
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n availabillity.id,\n availabillity.userId,\n availabillity.startTimestamp,\n availabillity.endTimestamp,\n availabillity.comment\n FROM availabillity\n WHERE availabillity.userId = $1\n AND availabillity.starttimestamp::date = $2;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Date"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "13d164ba2c29ac2bb4ee9428309807693ff1b29c61e7d07cbf8fb5fcd553f233"
|
||||
}
|
28
.sqlx/query-1452258f916025c6367477e11a442360d2f6211d3f47b465c0024994006e0c08.json
generated
Normal file
28
.sqlx/query-1452258f916025c6367477e11a442360d2f6211d3f47b465c0024994006e0c08.json
generated
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT token, userId FROM registration WHERE token = $1 AND expires > NOW();",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "1452258f916025c6367477e11a442360d2f6211d3f47b465c0024994006e0c08"
|
||||
}
|
41
.sqlx/query-159c257e9e7a164d369de950940166706b5adf4815de81481c9eb67d94b7ee0d.json
generated
Normal file
41
.sqlx/query-159c257e9e7a164d369de950940166706b5adf4815de81481c9eb67d94b7ee0d.json
generated
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM vehicleAssignement WHERE vehicleAssignement.eventId = $1 AND vehicleAssignement.vehicleId = $2;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "vehicleid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "159c257e9e7a164d369de950940166706b5adf4815de81481c9eb67d94b7ee0d"
|
||||
}
|
15
.sqlx/query-17f79edd7138f29f4279aeb2e72be1d1cea46d8aca559788420f532be0426723.json
generated
Normal file
15
.sqlx/query-17f79edd7138f29f4279aeb2e72be1d1cea46d8aca559788420f532be0426723.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE area SET name = $1 WHERE id = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "17f79edd7138f29f4279aeb2e72be1d1cea46d8aca559788420f532be0426723"
|
||||
}
|
136
.sqlx/query-18d37157e02280e00c1f3db9650775e04a665d5ac1475cc7a88f9b469438c942.json
generated
Normal file
136
.sqlx/query-18d37157e02280e00c1f3db9650775e04a665d5ac1475cc7a88f9b469438c942.json
generated
Normal file
@ -0,0 +1,136 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n availabillity.id,\n availabillity.userId,\n availabillity.startTimestamp,\n availabillity.endTimestamp,\n availabillity.comment,\n user_.name,\n user_.email,\n user_.password,\n user_.salt,\n user_.role AS \"role: Role\",\n user_.function AS \"function: UserFunction\",\n user_.areaId,\n user_.locked,\n user_.lastLogin,\n user_.receiveNotifications\n FROM availabillity\n JOIN user_ ON availabillity.userId = user_.id\n WHERE availabillity.startTimestamp::date = $1\n AND user_.areaId = $2;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Date",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "18d37157e02280e00c1f3db9650775e04a665d5ac1475cc7a88f9b469438c942"
|
||||
}
|
14
.sqlx/query-1c996712f62a1005990733cd9eee7a94bdcf2ef01b559304aea1d642fab7ae22.json
generated
Normal file
14
.sqlx/query-1c996712f62a1005990733cd9eee7a94bdcf2ef01b559304aea1d642fab7ae22.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM location WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "1c996712f62a1005990733cd9eee7a94bdcf2ef01b559304aea1d642fab7ae22"
|
||||
}
|
29
.sqlx/query-1e0bac00becc335dbd0f71a3b65a91a77a9e4b1e323321fc41e29df7dda2b9da.json
generated
Normal file
29
.sqlx/query-1e0bac00becc335dbd0f71a3b65a91a77a9e4b1e323321fc41e29df7dda2b9da.json
generated
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO assignment (eventId, availabillityId, function, startTimestamp, endTimestamp)\n VALUES ($1, $2, $3, $4, $5);\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4",
|
||||
{
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Timestamptz",
|
||||
"Timestamptz"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "1e0bac00becc335dbd0f71a3b65a91a77a9e4b1e323321fc41e29df7dda2b9da"
|
||||
}
|
111
.sqlx/query-24449d7fa57151cc7bbe17b757c4a155eaf85f51b91e0724a100e7eedfa096ce.json
generated
Normal file
111
.sqlx/query-24449d7fa57151cc7bbe17b757c4a155eaf85f51b91e0724a100e7eedfa096ce.json
generated
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id,\n name,\n email,\n password,\n salt,\n role AS \"role: Role\",\n function AS \"function: UserFunction\",\n areaId,\n locked,\n lastLogin,\n receiveNotifications\n FROM user_\n WHERE id = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "24449d7fa57151cc7bbe17b757c4a155eaf85f51b91e0724a100e7eedfa096ce"
|
||||
}
|
14
.sqlx/query-24fecf0d262d800b26cf90db0e12fea535a7b630000db10ea89419bff998f58d.json
generated
Normal file
14
.sqlx/query-24fecf0d262d800b26cf90db0e12fea535a7b630000db10ea89419bff998f58d.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM user_ WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "24fecf0d262d800b26cf90db0e12fea535a7b630000db10ea89419bff998f58d"
|
||||
}
|
32
.sqlx/query-2d9f2d0728983dfac09f6649da74aa5659072539a8f222b8ae202786ce958c37.json
generated
Normal file
32
.sqlx/query-2d9f2d0728983dfac09f6649da74aa5659072539a8f222b8ae202786ce958c37.json
generated
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM location",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "2d9f2d0728983dfac09f6649da74aa5659072539a8f222b8ae202786ce958c37"
|
||||
}
|
15
.sqlx/query-348365fd1e76ebfcfa065d1ea7e22cd7cbcd2e981f75fce75f29f1c4fbfc3df5.json
generated
Normal file
15
.sqlx/query-348365fd1e76ebfcfa065d1ea7e22cd7cbcd2e981f75fce75f29f1c4fbfc3df5.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE user_ SET locked = $1 WHERE id = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Bool",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "348365fd1e76ebfcfa065d1ea7e22cd7cbcd2e981f75fce75f29f1c4fbfc3df5"
|
||||
}
|
14
.sqlx/query-36afabfbbe056a63386f94edf2d49beb2d63130f8ea1bf4a840d7729bcb6f9cc.json
generated
Normal file
14
.sqlx/query-36afabfbbe056a63386f94edf2d49beb2d63130f8ea1bf4a840d7729bcb6f9cc.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE user_ SET lastLogin = NOW() WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "36afabfbbe056a63386f94edf2d49beb2d63130f8ea1bf4a840d7729bcb6f9cc"
|
||||
}
|
16
.sqlx/query-39415450c15de43079d87443b71cf9bacb8e852fa434448d3cc4c52bad0bcf01.json
generated
Normal file
16
.sqlx/query-39415450c15de43079d87443b71cf9bacb8e852fa434448d3cc4c52bad0bcf01.json
generated
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE vehicle SET radiocallname = $1, station = $2 WHERE id = $3;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "39415450c15de43079d87443b71cf9bacb8e852fa434448d3cc4c52bad0bcf01"
|
||||
}
|
15
.sqlx/query-3e246c54d31804140272a6fc2e3c241c17b086ff219d6084684a0f2b7c31eeed.json
generated
Normal file
15
.sqlx/query-3e246c54d31804140272a6fc2e3c241c17b086ff219d6084684a0f2b7c31eeed.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE user_ SET receiveNotifications = $1 WHERE id = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Bool",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "3e246c54d31804140272a6fc2e3c241c17b086ff219d6084684a0f2b7c31eeed"
|
||||
}
|
57
.sqlx/query-40254661a2d8a7e4b803551419e082b6ae3a5cb32ddc30a8fa844a4be67564ff.json
generated
Normal file
57
.sqlx/query-40254661a2d8a7e4b803551419e082b6ae3a5cb32ddc30a8fa844a4be67564ff.json
generated
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n assignment.eventId,\n assignment.availabillityId,\n assignment.function AS \"function: Function\",\n assignment.startTimestamp,\n assignment.endTimestamp\n FROM assignment\n WHERE assignment.AvailabillityId = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "availabillityid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "function: Function",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "40254661a2d8a7e4b803551419e082b6ae3a5cb32ddc30a8fa844a4be67564ff"
|
||||
}
|
30
.sqlx/query-413a3b2bdb7c23ab0f44bcc3ece79de6106c087ff85ca075fd9ca65a42cfa8cc.json
generated
Normal file
30
.sqlx/query-413a3b2bdb7c23ab0f44bcc3ece79de6106c087ff85ca075fd9ca65a42cfa8cc.json
generated
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO registration (token, userId, expires) VALUES ($1, $2, $3) RETURNING token, userId;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4",
|
||||
"Timestamp"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "413a3b2bdb7c23ab0f44bcc3ece79de6106c087ff85ca075fd9ca65a42cfa8cc"
|
||||
}
|
57
.sqlx/query-478a745b8953efab4fbc915d99a4ad6a47a5c83e7054bc9fda81a31e6555f4ff.json
generated
Normal file
57
.sqlx/query-478a745b8953efab4fbc915d99a4ad6a47a5c83e7054bc9fda81a31e6555f4ff.json
generated
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n assignment.eventId,\n assignment.availabillityId,\n assignment.function AS \"function: Function\",\n assignment.startTimestamp,\n assignment.endTimestamp\n FROM assignment\n WHERE assignment.eventId = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "availabillityid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "function: Function",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "478a745b8953efab4fbc915d99a4ad6a47a5c83e7054bc9fda81a31e6555f4ff"
|
||||
}
|
111
.sqlx/query-483ad933fa1e935058cbe42b7ff083ceee80f74564ee3e8b7da6ab57e906368b.json
generated
Normal file
111
.sqlx/query-483ad933fa1e935058cbe42b7ff083ceee80f74564ee3e8b7da6ab57e906368b.json
generated
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id,\n name,\n email,\n password,\n salt,\n role AS \"role: Role\",\n function AS \"function: UserFunction\",\n areaId,\n locked,\n lastLogin,\n receiveNotifications\n FROM user_\n WHERE areaId = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "483ad933fa1e935058cbe42b7ff083ceee80f74564ee3e8b7da6ab57e906368b"
|
||||
}
|
15
.sqlx/query-48e3cab60736bf95958b063013090c64160aff1bad2f0db851db2e421711a156.json
generated
Normal file
15
.sqlx/query-48e3cab60736bf95958b063013090c64160aff1bad2f0db851db2e421711a156.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM vehicleassignement WHERE eventId = $1 AND vehicleId = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "48e3cab60736bf95958b063013090c64160aff1bad2f0db851db2e421711a156"
|
||||
}
|
41
.sqlx/query-4b3eebd13b23df2046dabf6ad161f1ec32d95ec24d6da507387e9a7cf8287eaf.json
generated
Normal file
41
.sqlx/query-4b3eebd13b23df2046dabf6ad161f1ec32d95ec24d6da507387e9a7cf8287eaf.json
generated
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n vehicleAssignement.eventId,\n vehicleAssignement.vehicleId,\n vehicleAssignement.starttimestamp,\n vehicleAssignement.endtimestamp\n FROM vehicleAssignement\n JOIN event ON vehicleAssignement.eventId = event.id\n WHERE vehicleAssignement.vehicleid = $1\n AND event.starttimestamp::date = $2;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "vehicleid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Date"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "4b3eebd13b23df2046dabf6ad161f1ec32d95ec24d6da507387e9a7cf8287eaf"
|
||||
}
|
14
.sqlx/query-4bfce344fc6f0bfbb2b460677ce3eba3793ecf697355e81012e721357ba351b9.json
generated
Normal file
14
.sqlx/query-4bfce344fc6f0bfbb2b460677ce3eba3793ecf697355e81012e721357ba351b9.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM event WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "4bfce344fc6f0bfbb2b460677ce3eba3793ecf697355e81012e721357ba351b9"
|
||||
}
|
109
.sqlx/query-5573e93ccc0b6a5ecc6183a5d5c589ccd58f786e70a3ff1efa662085c2035156.json
generated
Normal file
109
.sqlx/query-5573e93ccc0b6a5ecc6183a5d5c589ccd58f786e70a3ff1efa662085c2035156.json
generated
Normal file
@ -0,0 +1,109 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id,\n name,\n email,\n password,\n salt,\n role AS \"role: Role\",\n function AS \"function: UserFunction\",\n areaId,\n locked,\n lastLogin,\n receiveNotifications\n FROM user_;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "5573e93ccc0b6a5ecc6183a5d5c589ccd58f786e70a3ff1efa662085c2035156"
|
||||
}
|
100
.sqlx/query-55a70284a5ddc7bff778ed1ea012b05b1daadbe41c77a8bd317f7fb17b7991cb.json
generated
Normal file
100
.sqlx/query-55a70284a5ddc7bff778ed1ea012b05b1daadbe41c77a8bd317f7fb17b7991cb.json
generated
Normal file
@ -0,0 +1,100 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n event.id AS eventId,\n event.startTimestamp,\n event.endTimestamp,\n event.name,\n event.locationId,\n event.voluntaryWachhabender,\n event.voluntaryFuehrungsassistent,\n event.amountOfPosten,\n event.clothing,\n event.canceled,\n event.note,\n location.id,\n location.name AS locationName,\n location.areaId AS locationAreaId\n FROM event\n JOIN location ON event.locationId = location.id\n WHERE event.id = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "locationid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "voluntarywachhabender",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "voluntaryfuehrungsassistent",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "amountofposten",
|
||||
"type_info": "Int2"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "clothing",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "canceled",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "note",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locationname",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "locationareaid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "55a70284a5ddc7bff778ed1ea012b05b1daadbe41c77a8bd317f7fb17b7991cb"
|
||||
}
|
32
.sqlx/query-5b87f4da0924338da1a30d7b74711d8073f6d62cf30a42381484846f0917bc33.json
generated
Normal file
32
.sqlx/query-5b87f4da0924338da1a30d7b74711d8073f6d62cf30a42381484846f0917bc33.json
generated
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM vehicle;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "radiocallname",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "station",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "5b87f4da0924338da1a30d7b74711d8073f6d62cf30a42381484846f0917bc33"
|
||||
}
|
14
.sqlx/query-5c492ff7ad44ae4876bae9b9ba947d12ad03cda345ba6d1120e38081fdb1fa06.json
generated
Normal file
14
.sqlx/query-5c492ff7ad44ae4876bae9b9ba947d12ad03cda345ba6d1120e38081fdb1fa06.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM registration WHERE userId = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "5c492ff7ad44ae4876bae9b9ba947d12ad03cda345ba6d1120e38081fdb1fa06"
|
||||
}
|
143
.sqlx/query-5ef1494706bb6c9d41f19f57d8120e57b274a5b38c0ded9f26824d4aba1822e9.json
generated
Normal file
143
.sqlx/query-5ef1494706bb6c9d41f19f57d8120e57b274a5b38c0ded9f26824d4aba1822e9.json
generated
Normal file
@ -0,0 +1,143 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n availabillity.id,\n availabillity.userId,\n availabillity.startTimestamp,\n availabillity.endTimestamp,\n availabillity.comment,\n user_.name,\n user_.email,\n user_.password,\n user_.salt,\n user_.role AS \"role: Role\",\n user_.function AS \"function: UserFunction\",\n user_.areaId,\n user_.locked,\n user_.lastLogin,\n user_.receiveNotifications,\n area.name AS areaName\n FROM availabillity\n JOIN user_ ON availabillity.userId = user_.id\n JOIN area ON user_.areaId = area.id\n WHERE user_.areaId = $1 AND\n availabillity.starttimestamp::date >= $2 AND\n availabillity.starttimestamp::date <= $3;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 15,
|
||||
"name": "areaname",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Date",
|
||||
"Date"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "5ef1494706bb6c9d41f19f57d8120e57b274a5b38c0ded9f26824d4aba1822e9"
|
||||
}
|
34
.sqlx/query-68d2b1ed0dc56056ec85ca38ba033ffcb6a480ca13c2beea0a543067840c64a7.json
generated
Normal file
34
.sqlx/query-68d2b1ed0dc56056ec85ca38ba033ffcb6a480ca13c2beea0a543067840c64a7.json
generated
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM vehicle WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "radiocallname",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "station",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "68d2b1ed0dc56056ec85ca38ba033ffcb6a480ca13c2beea0a543067840c64a7"
|
||||
}
|
46
.sqlx/query-70850ec3f7c519c1fc104fead6a44d07ba76023567bc6ea0eec2267d1c592479.json
generated
Normal file
46
.sqlx/query-70850ec3f7c519c1fc104fead6a44d07ba76023567bc6ea0eec2267d1c592479.json
generated
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT location.id AS locationId, location.name, location.areaId, area.id, area.name AS areaName FROM location JOIN area ON location.areaId = area.id WHERE areaId = $1;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "locationid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "areaname",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "70850ec3f7c519c1fc104fead6a44d07ba76023567bc6ea0eec2267d1c592479"
|
||||
}
|
14
.sqlx/query-73eba57512af51a7a7d5ea9b6b375dba701bf829b8cf8e37388c1de1c302f486.json
generated
Normal file
14
.sqlx/query-73eba57512af51a7a7d5ea9b6b375dba701bf829b8cf8e37388c1de1c302f486.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM passwordReset WHERE token = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "73eba57512af51a7a7d5ea9b6b375dba701bf829b8cf8e37388c1de1c302f486"
|
||||
}
|
29
.sqlx/query-75d96d0b937b8e222aa2ad6b9fc0fc185e2b6b5f1a7c80507d39d813af3e3478.json
generated
Normal file
29
.sqlx/query-75d96d0b937b8e222aa2ad6b9fc0fc185e2b6b5f1a7c80507d39d813af3e3478.json
generated
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE assignment SET function = $1, startTimestamp = $2, endTimestamp = $3 WHERE eventId = $4 AND availabillityId = $5;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
{
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Timestamptz",
|
||||
"Timestamptz",
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "75d96d0b937b8e222aa2ad6b9fc0fc185e2b6b5f1a7c80507d39d813af3e3478"
|
||||
}
|
15
.sqlx/query-7bc06d40e0e7f43f73861bb5fa9fe954aea7c821abf785b68d0731fcaf0f4845.json
generated
Normal file
15
.sqlx/query-7bc06d40e0e7f43f73861bb5fa9fe954aea7c821abf785b68d0731fcaf0f4845.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE event SET canceled = $1 WHERE id = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Bool",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "7bc06d40e0e7f43f73861bb5fa9fe954aea7c821abf785b68d0731fcaf0f4845"
|
||||
}
|
15
.sqlx/query-7d2e4fcde5bee6c9dcd85e35fa5f0dd4ae6b638b85f0e3a54afc85a46de6ae3a.json
generated
Normal file
15
.sqlx/query-7d2e4fcde5bee6c9dcd85e35fa5f0dd4ae6b638b85f0e3a54afc85a46de6ae3a.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM assignment WHERE assignment.eventId = $1 AND assignment.availabillityId = $2;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "7d2e4fcde5bee6c9dcd85e35fa5f0dd4ae6b638b85f0e3a54afc85a46de6ae3a"
|
||||
}
|
26
.sqlx/query-7f6c89117e8d4249e032235d03d264c3d5d47bd119c563237486cf47e402ae2e.json
generated
Normal file
26
.sqlx/query-7f6c89117e8d4249e032235d03d264c3d5d47bd119c563237486cf47e402ae2e.json
generated
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM area ORDER by id",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "7f6c89117e8d4249e032235d03d264c3d5d47bd119c563237486cf47e402ae2e"
|
||||
}
|
17
.sqlx/query-843da813342d6d7875667d43a76f6f2820ef97b85e1185b846ff245113889096.json
generated
Normal file
17
.sqlx/query-843da813342d6d7875667d43a76f6f2820ef97b85e1185b846ff245113889096.json
generated
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO availabillity (userId, startTimestamp, endTimestamp, comment)\n VALUES ($1, $2, $3, $4);\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Timestamptz",
|
||||
"Timestamptz",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "843da813342d6d7875667d43a76f6f2820ef97b85e1185b846ff245113889096"
|
||||
}
|
138
.sqlx/query-85dc89689632abde0930ca3fde05ac1b6f3acb52e5ac2d2a98b966f05d5b9953.json
generated
Normal file
138
.sqlx/query-85dc89689632abde0930ca3fde05ac1b6f3acb52e5ac2d2a98b966f05d5b9953.json
generated
Normal file
@ -0,0 +1,138 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n availabillity.id,\n availabillity.userId,\n availabillity.startTimestamp,\n availabillity.endTimestamp,\n availabillity.comment,\n user_.name,\n user_.email,\n user_.password,\n user_.salt,\n user_.role AS \"role: Role\",\n user_.function AS \"function: UserFunction\",\n user_.areaId,\n user_.locked,\n user_.lastLogin,\n user_.receiveNotifications\n FROM availabillity\n JOIN user_ ON availabillity.userId = user_.id\n WHERE availabillity.starttimestamp::date = $1\n AND user_.areaId = $2\n AND availabillity.startTimestamp <= $3 AND availabillity.endTimestamp >= $4;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Date",
|
||||
"Int4",
|
||||
"Timestamptz",
|
||||
"Timestamptz"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "85dc89689632abde0930ca3fde05ac1b6f3acb52e5ac2d2a98b966f05d5b9953"
|
||||
}
|
16
.sqlx/query-868bbdcb65f0ee862f221b7e3d1a4f4dbc4d818315d1713a110c4ad7acd09e3e.json
generated
Normal file
16
.sqlx/query-868bbdcb65f0ee862f221b7e3d1a4f4dbc4d818315d1713a110c4ad7acd09e3e.json
generated
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE user_ SET password = $1, salt = $2 WHERE id = $3;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "868bbdcb65f0ee862f221b7e3d1a4f4dbc4d818315d1713a110c4ad7acd09e3e"
|
||||
}
|
135
.sqlx/query-890ac023f7b2a6517ca46dfff5fc10e5e1d0c4757aa097294f5d7d6b6368b558.json
generated
Normal file
135
.sqlx/query-890ac023f7b2a6517ca46dfff5fc10e5e1d0c4757aa097294f5d7d6b6368b558.json
generated
Normal file
@ -0,0 +1,135 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n availabillity.id,\n availabillity.userId,\n availabillity.startTimestamp,\n availabillity.endTimestamp,\n availabillity.comment,\n user_.name,\n user_.email,\n user_.password,\n user_.salt,\n user_.role AS \"role: Role\",\n user_.function AS \"function: UserFunction\",\n user_.areaId,\n user_.locked,\n user_.lastLogin,\n user_.receiveNotifications\n FROM availabillity\n LEFT JOIN assignment ON availabillity.Id = assignment.availabillityId\n JOIN user_ ON availabillity.userId = user_.id\n WHERE availabillity.id = $1;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "comment",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 14,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "890ac023f7b2a6517ca46dfff5fc10e5e1d0c4757aa097294f5d7d6b6368b558"
|
||||
}
|
111
.sqlx/query-9091186ff6f2e2013cdca9d66c6f5be5207b0e868b6de0f558a469138838a650.json
generated
Normal file
111
.sqlx/query-9091186ff6f2e2013cdca9d66c6f5be5207b0e868b6de0f558a469138838a650.json
generated
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT id,\n name,\n email,\n password,\n salt,\n role AS \"role: Role\",\n function AS \"function: UserFunction\",\n areaId,\n locked,\n lastLogin,\n receiveNotifications\n FROM user_\n WHERE email = $1 AND locked = FALSE AND password IS NOT NULL AND salt IS NOT NULL;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "9091186ff6f2e2013cdca9d66c6f5be5207b0e868b6de0f558a469138838a650"
|
||||
}
|
58
.sqlx/query-9e77980b06e46b1c2d8cbcab7006b984c81afc8ef02fbe289170f48411147022.json
generated
Normal file
58
.sqlx/query-9e77980b06e46b1c2d8cbcab7006b984c81afc8ef02fbe289170f48411147022.json
generated
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n assignment.eventId,\n assignment.availabillityId,\n assignment.function AS \"function: Function\",\n assignment.startTimestamp,\n assignment.endTimestamp\n FROM assignment\n WHERE\n assignment.eventId = $1 AND\n assignment.availabillityId = $2;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "availabillityid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "function: Function",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "9e77980b06e46b1c2d8cbcab7006b984c81afc8ef02fbe289170f48411147022"
|
||||
}
|
17
.sqlx/query-a517738fabdf4a8c48778ea953f5ab6a3fa9a224ebacc32f75b60cbc91a11fea.json
generated
Normal file
17
.sqlx/query-a517738fabdf4a8c48778ea953f5ab6a3fa9a224ebacc32f75b60cbc91a11fea.json
generated
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE availabillity SET startTimestamp = $1, endTimestamp = $2, comment = $3 WHERE id = $4",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Timestamptz",
|
||||
"Timestamptz",
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "a517738fabdf4a8c48778ea953f5ab6a3fa9a224ebacc32f75b60cbc91a11fea"
|
||||
}
|
121
.sqlx/query-a7f6e57733c655534c3ae6379b8616fc3aa63ce322cc2d718f4b4e4e23903a61.json
generated
Normal file
121
.sqlx/query-a7f6e57733c655534c3ae6379b8616fc3aa63ce322cc2d718f4b4e4e23903a61.json
generated
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n user_.id AS userId,\n user_.name,\n user_.email,\n user_.password,\n user_.salt,\n user_.role AS \"role: Role\",\n function AS \"function: UserFunction\",\n user_.areaId,\n user_.locked,\n user_.lastLogin,\n user_.receiveNotifications,\n area.id,\n area.name AS areaName\n FROM user_\n JOIN area ON user_.areaId = area.id\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "email",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "password",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "salt",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "role: Role",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "function: UserFunction",
|
||||
"type_info": {
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "locked",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "lastlogin",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "receivenotifications",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "areaname",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "a7f6e57733c655534c3ae6379b8616fc3aa63ce322cc2d718f4b4e4e23903a61"
|
||||
}
|
55
.sqlx/query-ad4419211e4c98292eaa47ab04e0ea0201f1789ac906acc8cf79aacfbecd9f05.json
generated
Normal file
55
.sqlx/query-ad4419211e4c98292eaa47ab04e0ea0201f1789ac906acc8cf79aacfbecd9f05.json
generated
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO user_ (name, email, role, function, areaId)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING id;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
{
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ad4419211e4c98292eaa47ab04e0ea0201f1789ac906acc8cf79aacfbecd9f05"
|
||||
}
|
28
.sqlx/query-b1e4b7c5d9a08923ab0512b2f2d402865f5d63cb828507c856293be62102aeef.json
generated
Normal file
28
.sqlx/query-b1e4b7c5d9a08923ab0512b2f2d402865f5d63cb828507c856293be62102aeef.json
generated
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT token, userId FROM passwordReset WHERE token = $1 AND expires > NOW();",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "b1e4b7c5d9a08923ab0512b2f2d402865f5d63cb828507c856293be62102aeef"
|
||||
}
|
22
.sqlx/query-b259a464a99501cb60551791af069f662da9fed90243ac4a42d1cf1020b614d3.json
generated
Normal file
22
.sqlx/query-b259a464a99501cb60551791af069f662da9fed90243ac4a42d1cf1020b614d3.json
generated
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n INSERT INTO event (startTimestamp, endTimestamp, name, locationId, voluntaryWachhabender, voluntaryFuehrungsassistent, amountOfPosten, clothing, note)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Timestamptz",
|
||||
"Timestamptz",
|
||||
"Text",
|
||||
"Int4",
|
||||
"Bool",
|
||||
"Bool",
|
||||
"Int2",
|
||||
"Text",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "b259a464a99501cb60551791af069f662da9fed90243ac4a42d1cf1020b614d3"
|
||||
}
|
14
.sqlx/query-b55283e681bed3f5666cefca8acf2504e78ee2c8e094d96b89b68e8e7dddce48.json
generated
Normal file
14
.sqlx/query-b55283e681bed3f5666cefca8acf2504e78ee2c8e094d96b89b68e8e7dddce48.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM registration WHERE token = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "b55283e681bed3f5666cefca8acf2504e78ee2c8e094d96b89b68e8e7dddce48"
|
||||
}
|
22
.sqlx/query-b670053eb906a244d3ce12a7eb36982d6b21ed1e637fbf0eee841031e217c6c5.json
generated
Normal file
22
.sqlx/query-b670053eb906a244d3ce12a7eb36982d6b21ed1e637fbf0eee841031e217c6c5.json
generated
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO area (name) VALUES ($1) RETURNING id;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "b670053eb906a244d3ce12a7eb36982d6b21ed1e637fbf0eee841031e217c6c5"
|
||||
}
|
17
.sqlx/query-bc79bfefe13543d35aca3443919dd4a2d4d8ee88a6bcdf0ee331cff0f7064811.json
generated
Normal file
17
.sqlx/query-bc79bfefe13543d35aca3443919dd4a2d4d8ee88a6bcdf0ee331cff0f7064811.json
generated
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO vehicleassignement (eventId, vehicleId, startTimestamp, endTimestamp) VALUES ($1, $2, $3, $4);",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4",
|
||||
"Int4",
|
||||
"Timestamptz",
|
||||
"Timestamptz"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "bc79bfefe13543d35aca3443919dd4a2d4d8ee88a6bcdf0ee331cff0f7064811"
|
||||
}
|
15
.sqlx/query-c28c0fd372fa23b0053ec38ce59b5bf791d8a75ba68937609698bd52c97c8d0d.json
generated
Normal file
15
.sqlx/query-c28c0fd372fa23b0053ec38ce59b5bf791d8a75ba68937609698bd52c97c8d0d.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO vehicle (radioCallName, station) VALUES ($1, $2);",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "c28c0fd372fa23b0053ec38ce59b5bf791d8a75ba68937609698bd52c97c8d0d"
|
||||
}
|
14
.sqlx/query-cca2b280d655073557f035932eb7919b7e8263eee1e8026d9143a15f12fa81a5.json
generated
Normal file
14
.sqlx/query-cca2b280d655073557f035932eb7919b7e8263eee1e8026d9143a15f12fa81a5.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM area WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "cca2b280d655073557f035932eb7919b7e8263eee1e8026d9143a15f12fa81a5"
|
||||
}
|
15
.sqlx/query-d1d97d9f6cc8d9777dc4ce38a4b50041db855227c8d465d56e985bad86f0c8d9.json
generated
Normal file
15
.sqlx/query-d1d97d9f6cc8d9777dc4ce38a4b50041db855227c8d465d56e985bad86f0c8d9.json
generated
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO location (name, areaId) VALUES ($1, $2);",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "d1d97d9f6cc8d9777dc4ce38a4b50041db855227c8d465d56e985bad86f0c8d9"
|
||||
}
|
101
.sqlx/query-d4a8fe79186f648212fb270323942e60edd5163b6463c2f0ef22baaf8be7bcd5.json
generated
Normal file
101
.sqlx/query-d4a8fe79186f648212fb270323942e60edd5163b6463c2f0ef22baaf8be7bcd5.json
generated
Normal file
@ -0,0 +1,101 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n SELECT\n event.id AS eventId,\n event.startTimestamp,\n event.endTimestamp,\n event.name,\n event.locationId,\n event.voluntaryWachhabender,\n event.voluntaryFuehrungsassistent,\n event.amountOfPosten,\n event.clothing,\n event.canceled,\n event.note,\n location.id,\n location.name AS locationName,\n location.areaId AS locationAreaId\n FROM event\n JOIN location ON event.locationId = location.id\n WHERE starttimestamp::date = $1\n AND location.areaId = $2;\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "eventid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "starttimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "endtimestamp",
|
||||
"type_info": "Timestamptz"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "locationid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 5,
|
||||
"name": "voluntarywachhabender",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 6,
|
||||
"name": "voluntaryfuehrungsassistent",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 7,
|
||||
"name": "amountofposten",
|
||||
"type_info": "Int2"
|
||||
},
|
||||
{
|
||||
"ordinal": 8,
|
||||
"name": "clothing",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 9,
|
||||
"name": "canceled",
|
||||
"type_info": "Bool"
|
||||
},
|
||||
{
|
||||
"ordinal": 10,
|
||||
"name": "note",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 11,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 12,
|
||||
"name": "locationname",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 13,
|
||||
"name": "locationareaid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Date",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "d4a8fe79186f648212fb270323942e60edd5163b6463c2f0ef22baaf8be7bcd5"
|
||||
}
|
34
.sqlx/query-d556cb1971f386a7997c2e3dbce191cde2d488c55c05edbfe3746208a782d5f6.json
generated
Normal file
34
.sqlx/query-d556cb1971f386a7997c2e3dbce191cde2d488c55c05edbfe3746208a782d5f6.json
generated
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM location WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "d556cb1971f386a7997c2e3dbce191cde2d488c55c05edbfe3746208a782d5f6"
|
||||
}
|
14
.sqlx/query-d79f4733454dfe8df4209fa94b3a3512716812561516c0fd602d8b9d9af4eca6.json
generated
Normal file
14
.sqlx/query-d79f4733454dfe8df4209fa94b3a3512716812561516c0fd602d8b9d9af4eca6.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM vehicle WHERE id = $1;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "d79f4733454dfe8df4209fa94b3a3512716812561516c0fd602d8b9d9af4eca6"
|
||||
}
|
34
.sqlx/query-ea9f427b5d5a3e3c5f720d6bab2417cb3b42de0a5bf1d8b48b11a6e6275cc8e4.json
generated
Normal file
34
.sqlx/query-ea9f427b5d5a3e3c5f720d6bab2417cb3b42de0a5bf1d8b48b11a6e6275cc8e4.json
generated
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT * FROM location WHERE areaId = $1;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ea9f427b5d5a3e3c5f720d6bab2417cb3b42de0a5bf1d8b48b11a6e6275cc8e4"
|
||||
}
|
23
.sqlx/query-ee7abc2204854f5934e683d732493037de6b72d3311f10fa0cf74b7ce7ae11bf.json
generated
Normal file
23
.sqlx/query-ee7abc2204854f5934e683d732493037de6b72d3311f10fa0cf74b7ce7ae11bf.json
generated
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "\n UPDATE event SET startTimestamp = $1, endTimestamp = $2, name = $3, locationId = $4, voluntaryWachhabender = $5, voluntaryFuehrungsassistent = $6, amountOfPosten = $7, clothing = $8, note = $9 WHERE id = $10;\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Timestamptz",
|
||||
"Timestamptz",
|
||||
"Text",
|
||||
"Int4",
|
||||
"Bool",
|
||||
"Bool",
|
||||
"Int2",
|
||||
"Text",
|
||||
"Text",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "ee7abc2204854f5934e683d732493037de6b72d3311f10fa0cf74b7ce7ae11bf"
|
||||
}
|
30
.sqlx/query-effd0882ab00e5f91a97fa7ee4275775f369e2f8683a6b1aaa87c35984357804.json
generated
Normal file
30
.sqlx/query-effd0882ab00e5f91a97fa7ee4275775f369e2f8683a6b1aaa87c35984357804.json
generated
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "INSERT INTO passwordReset (token, userId, expires) VALUES ($1, $2, $3) RETURNING token, userid;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "token",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "userid",
|
||||
"type_info": "Int4"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4",
|
||||
"Timestamp"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "effd0882ab00e5f91a97fa7ee4275775f369e2f8683a6b1aaa87c35984357804"
|
||||
}
|
16
.sqlx/query-f613f4cbd2d89bc061e41f69fe913e69d658242344be7c46ba4f4df90f8b74b3.json
generated
Normal file
16
.sqlx/query-f613f4cbd2d89bc061e41f69fe913e69d658242344be7c46ba4f4df90f8b74b3.json
generated
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE location SET name = $1, areaid = $2 WHERE id = $3;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "f613f4cbd2d89bc061e41f69fe913e69d658242344be7c46ba4f4df90f8b74b3"
|
||||
}
|
44
.sqlx/query-f94d7fe59a2d4b7d246711a796571367172bce9446b9fb1e7ba057917a98d958.json
generated
Normal file
44
.sqlx/query-f94d7fe59a2d4b7d246711a796571367172bce9446b9fb1e7ba057917a98d958.json
generated
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT location.id AS locationId, location.name, location.areaId, area.id, area.name AS areaName FROM location JOIN area ON location.areaId = area.id;",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "locationid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 1,
|
||||
"name": "name",
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"ordinal": 2,
|
||||
"name": "areaid",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 3,
|
||||
"name": "id",
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"ordinal": 4,
|
||||
"name": "areaname",
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "f94d7fe59a2d4b7d246711a796571367172bce9446b9fb1e7ba057917a98d958"
|
||||
}
|
14
.sqlx/query-fc09093ce791d2d690b2e3f5ff2125a10757b06ff7d60c8843cb7814ea452f13.json
generated
Normal file
14
.sqlx/query-fc09093ce791d2d690b2e3f5ff2125a10757b06ff7d60c8843cb7814ea452f13.json
generated
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "DELETE FROM availabillity WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "fc09093ce791d2d690b2e3f5ff2125a10757b06ff7d60c8843cb7814ea452f13"
|
||||
}
|
48
.sqlx/query-fd2f782d28612d969aa20eb35ea8da4bfdba6f059dbd45b510122210807ac5b6.json
generated
Normal file
48
.sqlx/query-fd2f782d28612d969aa20eb35ea8da4bfdba6f059dbd45b510122210807ac5b6.json
generated
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "UPDATE user_ SET name = $1, email = $2, role = $3, function = $4, areaId = $5 WHERE id = $6;",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Text",
|
||||
"Text",
|
||||
{
|
||||
"Custom": {
|
||||
"name": "role",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"staff",
|
||||
"areamanager",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Custom": {
|
||||
"name": "function[]",
|
||||
"kind": {
|
||||
"Array": {
|
||||
"Custom": {
|
||||
"name": "function",
|
||||
"kind": {
|
||||
"Enum": [
|
||||
"posten",
|
||||
"fuehrungsassistent",
|
||||
"wachhabender"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Int4",
|
||||
"Int4"
|
||||
]
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "fd2f782d28612d969aa20eb35ea8da4bfdba6f059dbd45b510122210807ac5b6"
|
||||
}
|
@ -73,8 +73,8 @@ mod tests {
|
||||
|
||||
use crate::{
|
||||
models::{
|
||||
Assignment, AssignmentChangeset, Availability, AvailabilityChangeset, AvailabilityTime,
|
||||
Event, EventChangeset, Function, Location, Role, User,
|
||||
Assignment, AssignmentChangeset, Availability, AvailabilityChangeset, Event,
|
||||
EventChangeset, Function, Location, Role, User,
|
||||
},
|
||||
utils::test_helper::{test_delete, DbTestContext, RequestConfig},
|
||||
};
|
||||
@ -92,10 +92,10 @@ mod tests {
|
||||
Event::create(pool, new_event).await?;
|
||||
|
||||
let new_availability = AvailabilityChangeset {
|
||||
time: AvailabilityTime::WholeDay,
|
||||
time: (date.and_hms_opt(12, 0, 0).unwrap(), date.and_hms_opt(15, 0, 0).unwrap()),
|
||||
comment: None,
|
||||
};
|
||||
Availability::create(pool, 1, date, new_availability).await?;
|
||||
Availability::create(pool, 1, new_availability).await?;
|
||||
|
||||
let new_assignment = AssignmentChangeset {
|
||||
function: Function::Posten,
|
||||
|
@ -2,7 +2,7 @@ use askama::Template;
|
||||
|
||||
use crate::{
|
||||
filters,
|
||||
models::{Availability, AvailabilityTime, AvailabillityAssignmentState, Event},
|
||||
models::{Availability, AvailabillityAssignmentState, Event},
|
||||
};
|
||||
|
||||
pub mod delete;
|
||||
|
@ -5,16 +5,12 @@ use sqlx::PgPool;
|
||||
|
||||
use crate::endpoints::availability::NewOrEditAvailabilityTemplate;
|
||||
use crate::models::{
|
||||
find_free_time_slots, only_one_availability_exists_and_is_whole_day, Availability,
|
||||
AvailabilityTime, User,
|
||||
find_free_date_time_slots, Availability, User,
|
||||
};
|
||||
use crate::utils::{ApplicationError, TemplateResponse};
|
||||
use crate::{END_OF_DAY, START_OF_DAY};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct AvailabilityNewQuery {
|
||||
#[serde(rename(deserialize = "wholeday"))]
|
||||
whole_day: Option<bool>,
|
||||
date: NaiveDate,
|
||||
}
|
||||
|
||||
@ -26,29 +22,23 @@ pub async fn get(
|
||||
) -> Result<impl Responder, ApplicationError> {
|
||||
let availabilities_from_user =
|
||||
Availability::read_by_user_and_date(pool.get_ref(), user.id, &query.date).await?;
|
||||
let free_slots = find_free_time_slots(&availabilities_from_user);
|
||||
let slot_suggestions = find_free_date_time_slots(&availabilities_from_user);
|
||||
|
||||
let user_can_create_availabillity = availabilities_from_user.is_empty()
|
||||
|| !only_one_availability_exists_and_is_whole_day(&availabilities_from_user)
|
||||
|| !free_slots.is_empty();
|
||||
|| !slot_suggestions.is_empty();
|
||||
|
||||
if !user_can_create_availabillity {
|
||||
return Ok(HttpResponse::BadRequest().finish());
|
||||
}
|
||||
|
||||
let time_selection = if query.whole_day.unwrap_or(true) {
|
||||
AvailabilityTime::WholeDay
|
||||
} else {
|
||||
AvailabilityTime::Temporarily(START_OF_DAY, END_OF_DAY)
|
||||
};
|
||||
|
||||
let template = NewOrEditAvailabilityTemplate {
|
||||
user: user.into_inner(),
|
||||
date: query.date,
|
||||
time_selection,
|
||||
id: None,
|
||||
start: None,
|
||||
end: None,
|
||||
comment: None,
|
||||
slot_suggestions: free_slots,
|
||||
slot_suggestions,
|
||||
};
|
||||
|
||||
Ok(template.to_response()?)
|
||||
|
@ -1,14 +1,14 @@
|
||||
use crate::{
|
||||
filters,
|
||||
models::{
|
||||
find_free_time_slots, only_one_availability_exists_and_is_whole_day, Assignment,
|
||||
AvailabilityTime, Function, Vehicle,
|
||||
models::{find_free_date_time_slots, Assignment, Function, Vehicle},
|
||||
utils::{
|
||||
event_planning_template::generate_vehicles_assigned_and_available, ApplicationError,
|
||||
TemplateResponse,
|
||||
},
|
||||
utils::{event_planning_template::generate_vehicles_assigned_and_available, ApplicationError, TemplateResponse},
|
||||
};
|
||||
use actix_web::{web, HttpResponse, Responder};
|
||||
use chrono::{NaiveDate, Utc};
|
||||
use askama::Template;
|
||||
use chrono::{NaiveDate, Utc};
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@ -74,8 +74,7 @@ async fn get(
|
||||
//println!("{availabilities_from_user:#?}");
|
||||
|
||||
let user_can_create_availabillity = availabilities_from_user.is_empty()
|
||||
|| !only_one_availability_exists_and_is_whole_day(&availabilities_from_user)
|
||||
|| !find_free_time_slots(&availabilities_from_user).is_empty();
|
||||
|| !find_free_date_time_slots(&availabilities_from_user).is_empty();
|
||||
|
||||
//println!("{} || {} || {} = {user_can_create_availabillity}", availabilities_from_user.is_empty(),
|
||||
// !only_one_availability_exists_and_is_whole_day(&availabilities_from_user),
|
||||
@ -116,24 +115,28 @@ async fn get(
|
||||
.clone()
|
||||
})
|
||||
.collect(),
|
||||
fuehrungsassistent.first().map(|fa| availabillities
|
||||
.iter()
|
||||
.find(|a| a.id == fa.availabillity_id)
|
||||
.unwrap()
|
||||
.user
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()),
|
||||
wachhabender.first().map(|wh| availabillities
|
||||
.iter()
|
||||
.find(|a| a.id == wh.availabillity_id)
|
||||
.unwrap()
|
||||
.user
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()),
|
||||
fuehrungsassistent.first().map(|fa| {
|
||||
availabillities
|
||||
.iter()
|
||||
.find(|a| a.id == fa.availabillity_id)
|
||||
.unwrap()
|
||||
.user
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()
|
||||
}),
|
||||
wachhabender.first().map(|wh| {
|
||||
availabillities
|
||||
.iter()
|
||||
.find(|a| a.id == wh.availabillity_id)
|
||||
.unwrap()
|
||||
.user
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.name
|
||||
.clone()
|
||||
}),
|
||||
assigned_vehicle,
|
||||
));
|
||||
}
|
||||
|
@ -1,26 +1,17 @@
|
||||
use actix_web::{web, HttpResponse, Responder};
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::{
|
||||
endpoints::{availability::NewOrEditAvailabilityTemplate, IdPath},
|
||||
models::{find_free_time_slots, Availability, AvailabilityTime, User},
|
||||
models::{find_free_date_time_slots, Availability, User},
|
||||
utils::{ApplicationError, TemplateResponse},
|
||||
END_OF_DAY, START_OF_DAY,
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct EditAvailabilityQuery {
|
||||
#[serde(rename(deserialize = "wholeday"))]
|
||||
whole_day: Option<bool>,
|
||||
}
|
||||
|
||||
#[actix_web::get("/availabillity/edit/{id}")]
|
||||
pub async fn get(
|
||||
user: web::ReqData<User>,
|
||||
pool: web::Data<PgPool>,
|
||||
path: web::Path<IdPath>,
|
||||
query: web::Query<EditAvailabilityQuery>,
|
||||
) -> Result<impl Responder, ApplicationError> {
|
||||
let Some(availability) = Availability::read_by_id(pool.get_ref(), path.id).await? else {
|
||||
return Ok(HttpResponse::NotFound().finish());
|
||||
@ -30,37 +21,23 @@ pub async fn get(
|
||||
return Err(ApplicationError::Unauthorized);
|
||||
}
|
||||
|
||||
let suggestions = if let AvailabilityTime::Temporarily(start, end) = availability.time {
|
||||
let availabilities =
|
||||
Availability::read_by_user_and_date(pool.get_ref(), user.id, &availability.date)
|
||||
.await?;
|
||||
let availabilities =
|
||||
Availability::read_by_user_and_date(pool.get_ref(), user.id, &availability.start.date())
|
||||
.await?;
|
||||
|
||||
find_free_time_slots(&availabilities)
|
||||
.into_iter()
|
||||
.filter(|(a, b)| *b == start || *a == end)
|
||||
.collect()
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let slot_suggestions = find_free_date_time_slots(&availabilities)
|
||||
.into_iter()
|
||||
.filter(|(a, b)| *b == availability.start || *a == availability.end)
|
||||
.collect();
|
||||
|
||||
let time_selection = if let Some(whole_day) = query.whole_day {
|
||||
if whole_day {
|
||||
AvailabilityTime::WholeDay
|
||||
} else {
|
||||
AvailabilityTime::Temporarily(START_OF_DAY, END_OF_DAY)
|
||||
}
|
||||
} else {
|
||||
availability.time.clone()
|
||||
};
|
||||
|
||||
//println!("{:?}", availability.time);
|
||||
let template = NewOrEditAvailabilityTemplate {
|
||||
user: user.into_inner(),
|
||||
date: availability.date,
|
||||
date: availability.start.date(),
|
||||
id: Some(path.id),
|
||||
time_selection,
|
||||
start: Some(availability.start.time()),
|
||||
end: Some(availability.end),
|
||||
comment: availability.comment.as_deref(),
|
||||
slot_suggestions: suggestions,
|
||||
slot_suggestions
|
||||
};
|
||||
|
||||
Ok(template.to_response()?)
|
||||
|
@ -1,8 +1,7 @@
|
||||
use chrono::{NaiveDate, NaiveTime};
|
||||
use askama::Template;
|
||||
use chrono::{Days, NaiveDate, NaiveDateTime, NaiveTime};
|
||||
|
||||
use crate::filters;
|
||||
use crate::models::{Availability, AvailabilityChangeset, AvailabilityTime, Role, User};
|
||||
use crate::models::{Availability, AvailabilityChangeset, Role, User};
|
||||
|
||||
pub mod delete;
|
||||
pub mod get_new;
|
||||
@ -17,9 +16,10 @@ struct NewOrEditAvailabilityTemplate<'a> {
|
||||
user: User,
|
||||
date: NaiveDate,
|
||||
id: Option<i32>,
|
||||
time_selection: AvailabilityTime,
|
||||
start: Option<NaiveTime>,
|
||||
end: Option<NaiveDateTime>,
|
||||
comment: Option<&'a str>,
|
||||
slot_suggestions: Vec<(NaiveTime, NaiveTime)>,
|
||||
slot_suggestions: Vec<(NaiveDateTime, NaiveDateTime)>,
|
||||
}
|
||||
|
||||
fn find_adjacend_availability<'a>(
|
||||
@ -27,20 +27,10 @@ fn find_adjacend_availability<'a>(
|
||||
availability_id_to_be_updated: Option<i32>,
|
||||
existing_availabilities: &'a [Availability],
|
||||
) -> Option<&'a Availability> {
|
||||
let AvailabilityTime::Temporarily(changeset_start, changeset_end) = changeset.time else {
|
||||
return None;
|
||||
};
|
||||
|
||||
for a in existing_availabilities
|
||||
let existing_availability = existing_availabilities
|
||||
.iter()
|
||||
.filter(|a| availability_id_to_be_updated.is_none_or(|id| a.id != id))
|
||||
{
|
||||
if let AvailabilityTime::Temporarily(start, end) = a.time {
|
||||
if start == changeset_end || end == changeset_start {
|
||||
return Some(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
.find(|a| a.start == changeset.time.1 || a.end == changeset.time.0);
|
||||
|
||||
None
|
||||
return existing_availability;
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
use actix_web::{http::header::LOCATION, web, HttpResponse, Responder};
|
||||
use chrono::{NaiveDate, NaiveTime};
|
||||
use chrono::{NaiveDate, NaiveDateTime, NaiveTime};
|
||||
use garde::Validate;
|
||||
use serde::Deserialize;
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::{
|
||||
endpoints::availability::find_adjacend_availability,
|
||||
models::{Availability, AvailabilityChangeset, AvailabilityContext, AvailabilityTime, User},
|
||||
models::{Availability, AvailabilityChangeset, AvailabilityContext, User},
|
||||
utils::{self, ApplicationError},
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct AvailabillityForm {
|
||||
pub date: NaiveDate,
|
||||
pub from: Option<NaiveTime>,
|
||||
pub till: Option<NaiveTime>,
|
||||
pub from: NaiveTime,
|
||||
pub till: NaiveDateTime,
|
||||
pub comment: Option<String>,
|
||||
}
|
||||
|
||||
@ -30,14 +30,8 @@ pub async fn post(
|
||||
existing_availabilities: existing_availabilities.clone(),
|
||||
};
|
||||
|
||||
let time = if form.from.is_some() && form.till.is_some() {
|
||||
AvailabilityTime::Temporarily(form.from.unwrap(), form.till.unwrap())
|
||||
} else {
|
||||
AvailabilityTime::WholeDay
|
||||
};
|
||||
|
||||
let mut changeset = AvailabilityChangeset {
|
||||
time,
|
||||
time: (form.date.and_time(form.from), form.till),
|
||||
comment: form.comment.clone(),
|
||||
};
|
||||
|
||||
@ -46,20 +40,19 @@ pub async fn post(
|
||||
};
|
||||
|
||||
if let Some(a) = find_adjacend_availability(&changeset, None, &existing_availabilities) {
|
||||
let (changeset_start, changeset_end) = changeset.time.time_tuple_opt().unwrap();
|
||||
let (adjacent_start, adjacent_end) = changeset.time.time_tuple_opt().unwrap();
|
||||
let (changeset_start, changeset_end) = changeset.time;
|
||||
|
||||
if adjacent_end == changeset_start {
|
||||
changeset.time = AvailabilityTime::Temporarily(adjacent_start, changeset_end);
|
||||
if a.end == changeset_start {
|
||||
changeset.time.0 = a.start;
|
||||
}
|
||||
|
||||
if adjacent_start == changeset_end {
|
||||
changeset.time = AvailabilityTime::Temporarily(changeset_start, adjacent_end);
|
||||
if a.start == changeset_end {
|
||||
changeset.time.1 = a.end;
|
||||
}
|
||||
|
||||
Availability::update(pool.get_ref(), a.id, changeset).await?;
|
||||
} else {
|
||||
Availability::create(pool.get_ref(), user.id, form.date, changeset).await?;
|
||||
Availability::create(pool.get_ref(), user.id, changeset).await?;
|
||||
}
|
||||
|
||||
let url = utils::get_return_url_for_date(&form.date);
|
||||
|
@ -8,7 +8,7 @@ use crate::{
|
||||
availability::{find_adjacend_availability, post_new::AvailabillityForm},
|
||||
IdPath,
|
||||
},
|
||||
models::{Availability, AvailabilityChangeset, AvailabilityContext, AvailabilityTime, User},
|
||||
models::{Availability, AvailabilityChangeset, AvailabilityContext, User},
|
||||
utils::{self, ApplicationError},
|
||||
END_OF_DAY,
|
||||
};
|
||||
@ -29,7 +29,7 @@ pub async fn post(
|
||||
}
|
||||
|
||||
let existing_availabilities: Vec<Availability> =
|
||||
Availability::read_by_user_and_date(pool.get_ref(), user.id, &availability.date)
|
||||
Availability::read_by_user_and_date(pool.get_ref(), user.id, &availability.start.date())
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|a| a.id != availability.id)
|
||||
@ -39,19 +39,8 @@ pub async fn post(
|
||||
existing_availabilities: existing_availabilities.clone(),
|
||||
};
|
||||
|
||||
let time = if form.from.is_some() && form.till.is_some() {
|
||||
let end_time = if form.till.unwrap() == NaiveTime::from_hms_opt(23, 59, 0).unwrap() {
|
||||
END_OF_DAY
|
||||
} else {
|
||||
form.till.unwrap()
|
||||
};
|
||||
AvailabilityTime::Temporarily(form.from.unwrap(), end_time)
|
||||
} else {
|
||||
AvailabilityTime::WholeDay
|
||||
};
|
||||
|
||||
let mut changeset = AvailabilityChangeset {
|
||||
time,
|
||||
time: (form.date.and_time(form.from), form.till),
|
||||
comment: form.comment.clone(),
|
||||
};
|
||||
|
||||
@ -62,15 +51,14 @@ pub async fn post(
|
||||
if let Some(a) =
|
||||
find_adjacend_availability(&changeset, Some(availability.id), &existing_availabilities)
|
||||
{
|
||||
let (changeset_start, changeset_end) = changeset.time.time_tuple_opt().unwrap();
|
||||
let (adjacent_start, adjacent_end) = changeset.time.time_tuple_opt().unwrap();
|
||||
let (changeset_start, changeset_end) = changeset.time;
|
||||
|
||||
if adjacent_end == changeset_start {
|
||||
changeset.time = AvailabilityTime::Temporarily(adjacent_start, changeset_end);
|
||||
if a.end == changeset_start {
|
||||
changeset.time.0 = a.start;
|
||||
}
|
||||
|
||||
if adjacent_start == changeset_end {
|
||||
changeset.time = AvailabilityTime::Temporarily(changeset_start, adjacent_end);
|
||||
if a.start == changeset_end {
|
||||
changeset.time.1 = a.end;
|
||||
}
|
||||
|
||||
Availability::update(pool.get_ref(), a.id, changeset).await?;
|
||||
|
@ -5,7 +5,7 @@ use sqlx::PgPool;
|
||||
use crate::{
|
||||
endpoints::IdPath,
|
||||
filters,
|
||||
models::{Availability, AvailabilityTime, AvailabillityAssignmentState, Event, Role, User, Vehicle},
|
||||
models::{Availability, AvailabillityAssignmentState, Event, Role, User, Vehicle},
|
||||
utils::{
|
||||
event_planning_template::{
|
||||
generate_availabillity_assignment_list, generate_status_whether_staff_is_required,
|
||||
|
@ -7,11 +7,10 @@ use sqlx::PgPool;
|
||||
use crate::{
|
||||
endpoints::IdPath,
|
||||
models::{
|
||||
Assignment, AssignmentChangeset, Availability, AvailabilityTime, Event, EventChangeset,
|
||||
Assignment, AssignmentChangeset, Availability, Event, EventChangeset,
|
||||
EventContext, Function, Location, Role, User,
|
||||
},
|
||||
utils::{self, ApplicationError},
|
||||
END_OF_DAY, START_OF_DAY,
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@ -88,21 +87,17 @@ pub async fn post(
|
||||
.await?;
|
||||
|
||||
if all_assignments.len() == 1 {
|
||||
if let AvailabilityTime::Temporarily(start, end) = availability.time {
|
||||
if start > common_time.0 {
|
||||
common_time.0 = start;
|
||||
// TODO: refactor
|
||||
if availability.start.time() > common_time.0 {
|
||||
common_time.0 = availability.start.time();
|
||||
}
|
||||
|
||||
if end < common_time.1 {
|
||||
common_time.1 = end;
|
||||
if availability.end.time() < common_time.1 {
|
||||
common_time.1 = availability.end.time();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let mut slots = if let AvailabilityTime::Temporarily(start, end) = availability.time {
|
||||
vec![(start, end)]
|
||||
} else {
|
||||
vec![(START_OF_DAY, END_OF_DAY)]
|
||||
};
|
||||
// TODO: refactor
|
||||
let mut slots = vec![(availability.start.time(), availability.end.time())];
|
||||
for a in all_assignments
|
||||
.iter()
|
||||
.filter(|x| x.event_id != assignment.event_id)
|
||||
|
@ -2,15 +2,14 @@ use actix_web::{
|
||||
http::header::{ContentDisposition, ContentType, CONTENT_DISPOSITION},
|
||||
web, HttpResponse, Responder,
|
||||
};
|
||||
use chrono::{Months, NaiveDate, NaiveTime, Utc};
|
||||
use chrono::{Months, NaiveDate, NaiveDateTime, Utc};
|
||||
use quick_xml::se::Serializer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::PgPool;
|
||||
|
||||
use crate::{
|
||||
models::{Area, Availability, AvailabilityTime, UserFunction, Role, User},
|
||||
models::{Area, Availability, Role, User, UserFunction},
|
||||
utils::ApplicationError,
|
||||
END_OF_DAY, START_OF_DAY,
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@ -34,12 +33,10 @@ struct ExportAvailabillity {
|
||||
name: String,
|
||||
area: String,
|
||||
function: UserFunction,
|
||||
date: NaiveDate,
|
||||
whole_day: bool,
|
||||
start_time: NaiveTime,
|
||||
end_time: NaiveTime,
|
||||
start: NaiveDateTime,
|
||||
end: NaiveDateTime,
|
||||
assigned: bool,
|
||||
comment: String
|
||||
comment: String,
|
||||
}
|
||||
|
||||
#[actix_web::get("/export/availabilitydata")]
|
||||
@ -71,24 +68,14 @@ pub async fn get(
|
||||
|
||||
let export_availabillities = availabillities
|
||||
.into_iter()
|
||||
.map(|a| {
|
||||
let (start_time, end_time) = if let AvailabilityTime::Temporarily(start, end) = a.time {
|
||||
(start, end)
|
||||
} else {
|
||||
(START_OF_DAY, END_OF_DAY)
|
||||
};
|
||||
|
||||
ExportAvailabillity {
|
||||
name: a.user.as_ref().unwrap().name.clone(),
|
||||
area: a.user.as_ref().unwrap().area.as_ref().unwrap().name.clone(),
|
||||
function: a.user.unwrap().function,
|
||||
date: a.date,
|
||||
whole_day: a.time == AvailabilityTime::WholeDay,
|
||||
start_time,
|
||||
end_time,
|
||||
assigned: false,
|
||||
comment: a.comment.unwrap_or(String::new())
|
||||
}
|
||||
.map(|a| ExportAvailabillity {
|
||||
name: a.user.as_ref().unwrap().name.clone(),
|
||||
area: a.user.as_ref().unwrap().area.as_ref().unwrap().name.clone(),
|
||||
function: a.user.unwrap().function,
|
||||
start: a.start,
|
||||
end: a.end,
|
||||
assigned: false,
|
||||
comment: a.comment.unwrap_or(String::new()),
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
@ -2,7 +2,7 @@ use chrono::NaiveTime;
|
||||
use garde::Validate;
|
||||
|
||||
use super::{
|
||||
start_time_lies_before_end_time, Assignment, Availability, AvailabilityTime, Event, Function, UserFunction,
|
||||
start_time_lies_before_end_time, Assignment, Availability, Event, Function, UserFunction,
|
||||
};
|
||||
|
||||
#[derive(Validate)]
|
||||
@ -35,13 +35,13 @@ fn available_time_fits(
|
||||
value: &(NaiveTime, NaiveTime),
|
||||
context: &AssignmentContext,
|
||||
) -> garde::Result {
|
||||
if let AvailabilityTime::Temporarily(start, end) = context.availabillity.time {
|
||||
if value.0 < start || value.1 > end {
|
||||
return Err(garde::Error::new(
|
||||
"time not made available can't be assigned",
|
||||
));
|
||||
}
|
||||
}
|
||||
// if let AvailabilityTime::Temporarily(start, end) = context.availabillity.time {
|
||||
// if value.0 < start || value.1 > end {
|
||||
// return Err(garde::Error::new(
|
||||
// "time not made available can't be assigned",
|
||||
// ));
|
||||
// }
|
||||
// }
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
use chrono::NaiveTime;
|
||||
use chrono::NaiveDateTime;
|
||||
use garde::Validate;
|
||||
|
||||
use crate::{END_OF_DAY, START_OF_DAY};
|
||||
|
||||
use super::{start_time_lies_before_end_time, Availability, AvailabilityTime};
|
||||
use super::{start_date_time_lies_before_end_time, Availability};
|
||||
|
||||
#[derive(Validate)]
|
||||
#[garde(allow_unvalidated)]
|
||||
@ -11,9 +11,9 @@ use super::{start_time_lies_before_end_time, Availability, AvailabilityTime};
|
||||
pub struct AvailabilityChangeset {
|
||||
#[garde(
|
||||
custom(time_is_not_already_made_available),
|
||||
custom(temporarily_start_time_before_end_time)
|
||||
custom(start_date_time_lies_before_end_time)
|
||||
)]
|
||||
pub time: AvailabilityTime,
|
||||
pub time: (NaiveDateTime, NaiveDateTime),
|
||||
pub comment: Option<String>,
|
||||
}
|
||||
|
||||
@ -21,60 +21,45 @@ pub struct AvailabilityContext {
|
||||
pub existing_availabilities: Vec<Availability>,
|
||||
}
|
||||
|
||||
pub fn only_one_availability_exists_and_is_whole_day(a: &[Availability]) -> bool {
|
||||
a.len() == 1 && a[0].time == AvailabilityTime::WholeDay
|
||||
}
|
||||
|
||||
fn time_is_not_already_made_available(
|
||||
value: &AvailabilityTime,
|
||||
value: &(NaiveDateTime, NaiveDateTime),
|
||||
context: &AvailabilityContext,
|
||||
) -> garde::Result {
|
||||
if let AvailabilityTime::Temporarily(_, _) = value {
|
||||
if only_one_availability_exists_and_is_whole_day(&context.existing_availabilities) {
|
||||
return Err(garde::Error::new("cant create a availability while an other availability for the whole day is already present"));
|
||||
}
|
||||
if context.existing_availabilities.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if !context.existing_availabilities.is_empty() && find_free_time_slots(&context.existing_availabilities).is_empty() {
|
||||
return Err(garde::Error::new(
|
||||
"cant create a availability as every time slot is already filled",
|
||||
));
|
||||
}
|
||||
} else if !context.existing_availabilities.is_empty() {
|
||||
return Err(garde::Error::new("cant create a availability for the whole day while an other availability is already present"));
|
||||
let free_slots = find_free_date_time_slots(&context.existing_availabilities);
|
||||
|
||||
if free_slots.is_empty() {
|
||||
return Err(garde::Error::new(
|
||||
"cant create a availability as every time slot is already filled",
|
||||
));
|
||||
}
|
||||
|
||||
let free_block_found_for_start = free_slots.iter().any(|s| s.0 <= value.0 && s.1 >= value.0);
|
||||
let free_block_found_for_end = free_slots.iter().any(|s| s.0 <= value.1 && s.1 >= value.1);
|
||||
|
||||
if !free_block_found_for_start || !free_block_found_for_end {
|
||||
return Err(garde::Error::new(
|
||||
"cant create availability as there exists already a availability with the desired time",
|
||||
));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn temporarily_start_time_before_end_time(
|
||||
value: &AvailabilityTime,
|
||||
context: &AvailabilityContext,
|
||||
) -> garde::Result {
|
||||
if let AvailabilityTime::Temporarily(start, end) = value {
|
||||
return start_time_lies_before_end_time(&(*start, *end), context);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn find_free_time_slots(availabilities: &[Availability]) -> Vec<(NaiveTime, NaiveTime)> {
|
||||
let mut times = Vec::new();
|
||||
|
||||
for a in availabilities {
|
||||
if let AvailabilityTime::Temporarily(start, end) = a.time {
|
||||
times.push((start, end));
|
||||
}
|
||||
}
|
||||
|
||||
if times.is_empty() {
|
||||
pub fn find_free_date_time_slots(
|
||||
availabilities: &[Availability],
|
||||
) -> Vec<(NaiveDateTime, NaiveDateTime)> {
|
||||
if availabilities.is_empty() {
|
||||
return Vec::new();
|
||||
}
|
||||
println!("zeiten {times:?}");
|
||||
|
||||
let mut times: Vec<(NaiveDateTime, NaiveDateTime)> =
|
||||
availabilities.iter().map(|a| (a.start, a.end)).collect();
|
||||
times.sort();
|
||||
|
||||
//println!("zeiten sort {times:?}");
|
||||
|
||||
let mut changed = true;
|
||||
while changed {
|
||||
changed = false;
|
||||
@ -94,12 +79,17 @@ pub fn find_free_time_slots(availabilities: &[Availability]) -> Vec<(NaiveTime,
|
||||
|
||||
//println!("zeiten unified {times:?}");
|
||||
|
||||
let date = times.first().unwrap().0.date();
|
||||
let start_of_day = date.and_time(START_OF_DAY);
|
||||
// for now only calculate suggestions for the same day (if not add one day for end_of_Day:)
|
||||
let end_of_day = date.and_time(END_OF_DAY);
|
||||
|
||||
// now times contains unified list of existing availabilities -> now calculate the "inverse"
|
||||
|
||||
let mut available_slots = Vec::new();
|
||||
let start = times.first().unwrap();
|
||||
if start.0 != START_OF_DAY {
|
||||
available_slots.push((START_OF_DAY, start.0));
|
||||
if start.0 != start_of_day {
|
||||
available_slots.push((start_of_day, start.0));
|
||||
}
|
||||
|
||||
let mut iterator = times.iter().peekable();
|
||||
@ -110,10 +100,9 @@ pub fn find_free_time_slots(availabilities: &[Availability]) -> Vec<(NaiveTime,
|
||||
}
|
||||
|
||||
let end = times.last().unwrap();
|
||||
if end.1 != END_OF_DAY {
|
||||
available_slots.push((end.1, END_OF_DAY));
|
||||
if end.1 != end_of_day {
|
||||
available_slots.push((end.1, end_of_day));
|
||||
}
|
||||
|
||||
//println!("available {available_slots:?}");
|
||||
available_slots
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
use chrono::{Local, NaiveDate, NaiveTime};
|
||||
use chrono::{Local, NaiveDate, NaiveDateTime, NaiveTime};
|
||||
use sqlx::{query, PgPool};
|
||||
|
||||
use crate::{END_OF_DAY, START_OF_DAY};
|
||||
|
||||
use super::{Area, AvailabilityChangeset, Result, Role, User, UserFunction};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -10,59 +8,26 @@ pub struct Availability {
|
||||
pub id: i32,
|
||||
pub user_id: i32,
|
||||
pub user: Option<User>,
|
||||
pub date: NaiveDate,
|
||||
pub time: AvailabilityTime,
|
||||
pub start: NaiveDateTime,
|
||||
pub end: NaiveDateTime,
|
||||
pub comment: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum AvailabilityTime {
|
||||
WholeDay,
|
||||
Temporarily(NaiveTime, NaiveTime),
|
||||
}
|
||||
|
||||
impl AvailabilityTime {
|
||||
pub fn time_tuple(&self) -> (NaiveTime, NaiveTime) {
|
||||
match self {
|
||||
AvailabilityTime::WholeDay => (START_OF_DAY, END_OF_DAY),
|
||||
AvailabilityTime::Temporarily(start, end) => (*start, *end),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn time_tuple_opt(&self) -> Option<(NaiveTime, NaiveTime)> {
|
||||
match self {
|
||||
AvailabilityTime::WholeDay => None,
|
||||
AvailabilityTime::Temporarily(start, end) => Some((*start, *end)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Availability {
|
||||
// TODO: fix db name
|
||||
pub async fn create(
|
||||
pool: &PgPool,
|
||||
user_id: i32,
|
||||
date: NaiveDate,
|
||||
changeset: AvailabilityChangeset,
|
||||
) -> Result<()> {
|
||||
let (start, end) = if let AvailabilityTime::Temporarily(s, e) = changeset.time {
|
||||
(Some(s), Some(e))
|
||||
} else {
|
||||
(None, None)
|
||||
};
|
||||
|
||||
// TODO: refactor
|
||||
let date1 = Local::now();
|
||||
let date2 = Local::now();
|
||||
|
||||
query!(
|
||||
r#"
|
||||
INSERT INTO availabillity (userId, startTimestamp, endTimestamp, comment)
|
||||
VALUES ($1, $2, $3, $4);
|
||||
"#,
|
||||
user_id,
|
||||
date1,
|
||||
date2,
|
||||
changeset.time.0.and_utc(),
|
||||
changeset.time.1.and_utc(),
|
||||
changeset.comment
|
||||
)
|
||||
.execute(pool)
|
||||
@ -125,12 +90,8 @@ impl Availability {
|
||||
last_login: r.lastlogin,
|
||||
receive_notifications: r.receivenotifications,
|
||||
}),
|
||||
date: r.starttimestamp.date_naive(),
|
||||
// TODO: refactor
|
||||
time: AvailabilityTime::Temporarily(r.starttimestamp.time(), r.endtimestamp.time()),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: r.starttimestamp.naive_utc(),
|
||||
end: r.endtimestamp.naive_utc(),
|
||||
comment: r.comment.clone(),
|
||||
})
|
||||
.collect();
|
||||
@ -141,13 +102,9 @@ impl Availability {
|
||||
pub async fn read_by_date_time_area_including_user(
|
||||
pool: &PgPool,
|
||||
date: NaiveDate,
|
||||
time: (NaiveTime, NaiveTime),
|
||||
time: (NaiveDateTime, NaiveDateTime),
|
||||
area_id: i32,
|
||||
) -> Result<Vec<Availability>> {
|
||||
// TODO: refactor
|
||||
let date1 = Local::now();
|
||||
let date2 = Local::now();
|
||||
|
||||
let records = query!(
|
||||
r##"
|
||||
SELECT
|
||||
@ -174,8 +131,8 @@ impl Availability {
|
||||
"##,
|
||||
date,
|
||||
area_id,
|
||||
date1,
|
||||
date2
|
||||
time.0.and_utc(),
|
||||
time.1.and_utc()
|
||||
)
|
||||
.fetch_all(pool)
|
||||
.await?;
|
||||
@ -200,12 +157,8 @@ impl Availability {
|
||||
last_login: r.lastlogin,
|
||||
receive_notifications: r.receivenotifications,
|
||||
}),
|
||||
// TODO: refactor
|
||||
date: r.starttimestamp.date_naive(),
|
||||
time: AvailabilityTime::Temporarily(r.starttimestamp.time(), r.endtimestamp.time()),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: r.starttimestamp.naive_utc(),
|
||||
end: r.endtimestamp.naive_utc(),
|
||||
comment: r.comment.clone(),
|
||||
})
|
||||
.collect();
|
||||
@ -259,12 +212,8 @@ impl Availability {
|
||||
last_login: r.lastlogin,
|
||||
receive_notifications: r.receivenotifications,
|
||||
}),
|
||||
// TODO: refactor
|
||||
date: r.starttimestamp.date_naive(),
|
||||
time: AvailabilityTime::Temporarily(r.starttimestamp.time(), r.endtimestamp.time()),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: r.starttimestamp.naive_utc(),
|
||||
end: r.endtimestamp.naive_utc(),
|
||||
comment: r.comment.clone(),
|
||||
});
|
||||
|
||||
@ -280,15 +229,8 @@ impl Availability {
|
||||
id: record.id,
|
||||
user_id: record.userid,
|
||||
user: None,
|
||||
// TODO: refactor
|
||||
date: record.starttimestamp.date_naive(),
|
||||
time: AvailabilityTime::Temporarily(
|
||||
record.starttimestamp.time(),
|
||||
record.endtimestamp.time(),
|
||||
),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: record.starttimestamp.naive_utc(),
|
||||
end: record.endtimestamp.naive_utc(),
|
||||
comment: record.comment.clone(),
|
||||
});
|
||||
|
||||
@ -356,12 +298,8 @@ impl Availability {
|
||||
last_login: r.lastlogin,
|
||||
receive_notifications: r.receivenotifications,
|
||||
}),
|
||||
// TODO: refactor
|
||||
date: r.starttimestamp.date_naive(),
|
||||
time: AvailabilityTime::Temporarily(r.starttimestamp.time(), r.endtimestamp.time()),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: r.starttimestamp.naive_utc(),
|
||||
end: r.endtimestamp.naive_utc(),
|
||||
comment: r.comment.clone(),
|
||||
})
|
||||
.collect();
|
||||
@ -399,12 +337,8 @@ impl Availability {
|
||||
id: r.id,
|
||||
user_id: r.userid,
|
||||
user: None,
|
||||
// TODO: refactor
|
||||
date: r.starttimestamp.date_naive(),
|
||||
time: AvailabilityTime::Temporarily(r.starttimestamp.time(), r.endtimestamp.time()),
|
||||
// (Some(start), Some(end)) => AvailabilityTime::Temporarily(start, end),
|
||||
// (_, _) => AvailabilityTime::WholeDay,
|
||||
// },
|
||||
start: r.starttimestamp.naive_utc(),
|
||||
end: r.endtimestamp.naive_utc(),
|
||||
comment: r.comment.clone(),
|
||||
})
|
||||
.collect();
|
||||
@ -413,20 +347,10 @@ impl Availability {
|
||||
}
|
||||
|
||||
pub async fn update(pool: &PgPool, id: i32, changeset: AvailabilityChangeset) -> Result<()> {
|
||||
let (start, end) = if let AvailabilityTime::Temporarily(s, e) = changeset.time {
|
||||
(Some(s), Some(e))
|
||||
} else {
|
||||
(None, None)
|
||||
};
|
||||
|
||||
// TODO: refactor
|
||||
let date1 = Local::now();
|
||||
let date2 = Local::now();
|
||||
|
||||
query!(
|
||||
"UPDATE availabillity SET startTimestamp = $1, endTimestamp = $2, comment = $3 WHERE id = $4",
|
||||
date1,
|
||||
date2,
|
||||
changeset.time.0.and_utc(),
|
||||
changeset.time.1.and_utc(),
|
||||
changeset.comment,
|
||||
id
|
||||
)
|
||||
|
@ -21,12 +21,11 @@ pub use area::Area;
|
||||
pub use assignement::Assignment;
|
||||
pub use assignment_changeset::{AssignmentChangeset, AssignmentContext};
|
||||
pub use availability_changeset::{
|
||||
find_free_time_slots, only_one_availability_exists_and_is_whole_day, AvailabilityChangeset,
|
||||
AvailabilityContext,
|
||||
find_free_date_time_slots, AvailabilityChangeset, AvailabilityContext,
|
||||
};
|
||||
pub use availabillity::{Availability, AvailabilityTime};
|
||||
pub use availabillity::Availability;
|
||||
pub use availabillity_assignment_state::AvailabillityAssignmentState;
|
||||
use chrono::NaiveTime;
|
||||
use chrono::{NaiveDateTime, NaiveTime};
|
||||
pub use event::Event;
|
||||
pub use event_changeset::{EventChangeset, EventContext};
|
||||
pub use function::Function;
|
||||
@ -52,3 +51,14 @@ fn start_time_lies_before_end_time<T>(
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn start_date_time_lies_before_end_time<T>(
|
||||
value: &(NaiveDateTime, NaiveDateTime),
|
||||
_context: &T,
|
||||
) -> garde::Result {
|
||||
if value.0 >= value.1 {
|
||||
return Err(garde::Error::new("endtime can't lie before starttime"));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -12,57 +12,29 @@
|
||||
{% endif %}
|
||||
|
||||
<input type="hidden" name="date" value="{{ date }}">
|
||||
{% let whole_day_selected = time_selection == AvailabilityTime::WholeDay %}
|
||||
{% let time = "%R" %}
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">Dauer</label>
|
||||
<label class="label">Dauer Von - Bis</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control" hx-target="closest body">
|
||||
<label class="radio">
|
||||
{% let time_url -%}
|
||||
{% if id.is_some() -%}
|
||||
{% let time_url = "/availabillity/edit/{}?wholeday="|format(id.unwrap()) -%}
|
||||
{% else -%}
|
||||
{% let time_url = "/availabillity/new?date={}&wholeday="|format(date) -%}
|
||||
{% endif -%}
|
||||
<input type="radio" name="hasTime" hx-get="{{ time_url }}true" {{
|
||||
whole_day_selected|cond_show("checked") }} />
|
||||
ganztägig
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="hasTime" hx-get="{{ time_url }}false" {{
|
||||
whole_day_selected|invert|ref|cond_show("checked") }} />
|
||||
zeitweise
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">Von - Bis</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
{% let times = time_selection.time_tuple() -%}
|
||||
<div class="field">
|
||||
<input class="input" type="time" id="from" name="from" value='{{ times.0.format("%R") }}' {{
|
||||
whole_day_selected|cond_show("disabled") }} {{ whole_day_selected|invert|ref|cond_show("required") }}>
|
||||
<input class="input" type="time" id="from" name="from" required {% if let Some(start)=start
|
||||
%}value="{{start}}" {% endif %}>
|
||||
{% if slot_suggestions.len() > 0 %}
|
||||
<p class="help">noch mögliche Zeiträume:</p>
|
||||
<div class="tags help">
|
||||
{% for (s, e) in slot_suggestions %}
|
||||
<span class="tag">{{ s.format("%R") }} - {{ e.format("%R") }}</span>
|
||||
<span class="tag">{{ s.format(time) }} - {{ e.format(time) }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="field">
|
||||
<input class="input" type="time" id="till" name="till" value='{{ times.1.format("%R") }}' {{
|
||||
whole_day_selected|cond_show("disabled") }} {{ whole_day_selected|invert|ref|cond_show("required") }}>
|
||||
<input class="input" type="datetime-local" id="till" name="till" required min="{{ date }}T00:00"
|
||||
max="{{ date.checked_add_days(Days::new(1)).unwrap() }}T23:59" {% if let Some(end)=end %}value="{{end}}"
|
||||
{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -27,12 +27,7 @@
|
||||
{{ u.function|show_tree|safe }}
|
||||
</td>
|
||||
<td>
|
||||
{% match availabillity.time %}
|
||||
{% when AvailabilityTime::Temporarily(start, end) %}
|
||||
{{ start.format("%R") }} bis {{ end.format("%R") }}
|
||||
{% when _ %}
|
||||
ganztägig
|
||||
{% endmatch %}
|
||||
{{ availabillity.start.format("%R") }} bis {{ availabillity.end.format("%d.%m.%Y %R") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ availabillity.comment.as_deref().unwrap_or("") }}
|
||||
|
@ -220,12 +220,7 @@
|
||||
{{ u.function|show_tree|safe }}
|
||||
</td>
|
||||
<td>
|
||||
{% match availabillity.time %}
|
||||
{% when AvailabilityTime::Temporarily(start, end) %}
|
||||
{{ start.format("%R") }} bis {{ end.format("%R") }}
|
||||
{% when _ %}
|
||||
ganztägig
|
||||
{% endmatch %}
|
||||
{{ availabillity.start.format("%R") }} bis {{ availabillity.end.format("%d.%m.%Y %R") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ availabillity.comment.as_deref().unwrap_or("") }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user