refactor: rename voluntaryfuehrungsassistent to fuehrungsassistentrequired
This commit is contained in:
parent
c74716cc3a
commit
bddeaefe4f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"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 ",
|
"query": "\n INSERT INTO event (startTimestamp, endTimestamp, name, locationId, voluntaryWachhabender, fuehrungsassistentRequired, amountOfPosten, clothing, note)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);\n ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [],
|
"columns": [],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@ -18,5 +18,5 @@
|
|||||||
},
|
},
|
||||||
"nullable": []
|
"nullable": []
|
||||||
},
|
},
|
||||||
"hash": "b259a464a99501cb60551791af069f662da9fed90243ac4a42d1cf1020b614d3"
|
"hash": "1c9bb8c34c501a3a24708b14d93a3889a11c37dfab085cd777db859ff28b519b"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"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 ",
|
"query": "\n UPDATE event SET startTimestamp = $1, endTimestamp = $2, name = $3, locationId = $4, voluntaryWachhabender = $5, fuehrungsassistentRequired = $6, amountOfPosten = $7, clothing = $8, note = $9 WHERE id = $10;\n ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [],
|
"columns": [],
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@ -19,5 +19,5 @@
|
|||||||
},
|
},
|
||||||
"nullable": []
|
"nullable": []
|
||||||
},
|
},
|
||||||
"hash": "ee7abc2204854f5934e683d732493037de6b72d3311f10fa0cf74b7ce7ae11bf"
|
"hash": "1ff3f7006fd5594586c2c5c8604e92cf350c1649c02d8355c9ed600385f6b096"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "SELECT\n event.starttimestamp,\n event.endtimestamp,\n event.amountofposten,\n event.voluntaryfuehrungsassistent,\n event.voluntarywachhabender,\n location.name AS locationName,\n event.name AS eventName,\n array (\n SELECT\n row (user_.name, assignment.function) ::simpleAssignment\n FROM\n assignment\n JOIN availability on\n assignment.availabilityid = availability.id\n JOIN user_ on\n availability.userid = user_.id\n WHERE\n assignment.eventId = event.id) AS \"assignments: Vec<SimpleAssignment>\",\n array (\n SELECT\n vehicle.station || ' ' || vehicle.radiocallname\n FROM\n vehicleassignment\n JOIN vehicle on\n vehicleassignment.vehicleId = vehicle.id\n WHERE\n vehicleassignment.eventId = event.id) AS vehicles\n FROM\n event\n JOIN location on\n event.locationId = location.id\n WHERE\n event.starttimestamp::date >= $1\n AND event.starttimestamp::date <= $2\n AND location.areaId = $3\n ORDER BY\n event.starttimestamp\n",
|
"query": "SELECT\n event.starttimestamp,\n event.endtimestamp,\n event.amountofposten,\n event.fuehrungsassistentrequired,\n event.voluntarywachhabender,\n location.name AS locationName,\n event.name AS eventName,\n array (\n SELECT\n row (user_.name, assignment.function) ::simpleAssignment\n FROM\n assignment\n JOIN availability on\n assignment.availabilityid = availability.id\n JOIN user_ on\n availability.userid = user_.id\n WHERE\n assignment.eventId = event.id) AS \"assignments: Vec<SimpleAssignment>\",\n array (\n SELECT\n vehicle.station || ' ' || vehicle.radiocallname\n FROM\n vehicleassignment\n JOIN vehicle on\n vehicleassignment.vehicleId = vehicle.id\n WHERE\n vehicleassignment.eventId = event.id) AS vehicles\n FROM\n event\n JOIN location on\n event.locationId = location.id\n WHERE\n event.starttimestamp::date >= $1\n AND event.starttimestamp::date <= $2\n AND location.areaId = $3\n ORDER BY\n event.starttimestamp\n",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -20,7 +20,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 3,
|
"ordinal": 3,
|
||||||
"name": "voluntaryfuehrungsassistent",
|
"name": "fuehrungsassistentrequired",
|
||||||
"type_info": "Bool"
|
"type_info": "Bool"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -102,5 +102,5 @@
|
|||||||
null
|
null
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "8a9f517c18b13e6cbf47404d69c2e1c59660250aa5d1074d4da9c0589d0a6bb3"
|
"hash": "2975aea80c391b613e9c12ae5f2802806688720e03f0df81b6dc5c79c7642133"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE starttimestamp::date = $1\n AND location.areaId = $2;\n ",
|
"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.fuehrungsassistentRequired,\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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE starttimestamp::date = $1\n AND location.areaId = $2;\n ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "voluntaryfuehrungsassistent",
|
"name": "fuehrungsassistentrequired",
|
||||||
"type_info": "Bool"
|
"type_info": "Bool"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -109,5 +109,5 @@
|
|||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "4ceb2c7e3d921c2718e75ba131eee1706e008b783deb687e04eba08f4b919ac8"
|
"hash": "32d009eb1d61484466cfbb8bc77cd3d965a1e52c73f5b9d92df4e956286b06a6"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE starttimestamp::date >= $1\n AND starttimestamp::date <= $2\n AND location.areaId = $3\n ORDER BY event.starttimestamp;\n ",
|
"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.fuehrungsassistentRequired,\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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE starttimestamp::date >= $1\n AND starttimestamp::date <= $2\n AND location.areaId = $3\n ORDER BY event.starttimestamp;\n ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "voluntaryfuehrungsassistent",
|
"name": "fuehrungsassistentrequired",
|
||||||
"type_info": "Bool"
|
"type_info": "Bool"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -110,5 +110,5 @@
|
|||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "65367483e39e07cd0aa142f9bb76c7a5d6dd0611e6b41edd5a593c9f955b5d04"
|
"hash": "fb4edba6e7bffb9f61c9d825c57f445d0dd79705531c367277b19bbecedff3e3"
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE event.id = $1;\n ",
|
"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.fuehrungsassistentRequired,\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 clothing.id AS clothingId,\n clothing.name AS clothingName\n FROM event\n JOIN location ON event.locationId = location.id\n JOIN clothing ON event.clothing = clothing.id\n WHERE event.id = $1;\n ",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ordinal": 6,
|
"ordinal": 6,
|
||||||
"name": "voluntaryfuehrungsassistent",
|
"name": "fuehrungsassistentrequired",
|
||||||
"type_info": "Bool"
|
"type_info": "Bool"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -108,5 +108,5 @@
|
|||||||
false
|
false
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "6dc18993de451d1e0aa4080f00f46ce3339e020922b9ef130c4289b080a2af7d"
|
"hash": "ffb7d4117a008368ab3f1c63118b0fea13eda90942246e65d1bd803dbc5585b1"
|
||||||
}
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE event
|
||||||
|
RENAME COLUMN voluntaryFuehrungsassistent TO fuehrungsassistentRequired;
|
@ -2,7 +2,7 @@ SELECT
|
|||||||
event.starttimestamp,
|
event.starttimestamp,
|
||||||
event.endtimestamp,
|
event.endtimestamp,
|
||||||
event.amountofposten,
|
event.amountofposten,
|
||||||
event.voluntaryfuehrungsassistent,
|
event.fuehrungsassistentrequired,
|
||||||
event.voluntarywachhabender,
|
event.voluntarywachhabender,
|
||||||
location.name AS locationName,
|
location.name AS locationName,
|
||||||
event.name AS eventName,
|
event.name AS eventName,
|
||||||
|
@ -128,7 +128,7 @@ async fn event_has_free_slot_for_function(
|
|||||||
if match *value {
|
if match *value {
|
||||||
Function::Posten => assignments_with_function >= event.amount_of_posten as usize,
|
Function::Posten => assignments_with_function >= event.amount_of_posten as usize,
|
||||||
Function::Fuehrungsassistent => {
|
Function::Fuehrungsassistent => {
|
||||||
event.voluntary_fuehrungsassistent && assignments_with_function >= 1
|
event.fuehrungsassistent_required && assignments_with_function >= 1
|
||||||
}
|
}
|
||||||
Function::Wachhabender => event.voluntary_wachhabender && assignments_with_function >= 1,
|
Function::Wachhabender => event.voluntary_wachhabender && assignments_with_function >= 1,
|
||||||
} {
|
} {
|
||||||
|
@ -12,7 +12,7 @@ pub struct Event {
|
|||||||
pub location_id: i32,
|
pub location_id: i32,
|
||||||
pub location: Option<Location>,
|
pub location: Option<Location>,
|
||||||
pub voluntary_wachhabender: bool,
|
pub voluntary_wachhabender: bool,
|
||||||
pub voluntary_fuehrungsassistent: bool,
|
pub fuehrungsassistent_required: bool,
|
||||||
pub amount_of_posten: i16,
|
pub amount_of_posten: i16,
|
||||||
pub clothing: Clothing,
|
pub clothing: Clothing,
|
||||||
pub canceled: bool,
|
pub canceled: bool,
|
||||||
@ -22,10 +22,10 @@ pub struct Event {
|
|||||||
impl Event {
|
impl Event {
|
||||||
pub async fn create(pool: &PgPool, changeset: EventChangeset) -> Result<()> {
|
pub async fn create(pool: &PgPool, changeset: EventChangeset) -> Result<()> {
|
||||||
query!(r#"
|
query!(r#"
|
||||||
INSERT INTO event (startTimestamp, endTimestamp, name, locationId, voluntaryWachhabender, voluntaryFuehrungsassistent, amountOfPosten, clothing, note)
|
INSERT INTO event (startTimestamp, endTimestamp, name, locationId, voluntaryWachhabender, fuehrungsassistentRequired, amountOfPosten, clothing, note)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);
|
||||||
"#,
|
"#,
|
||||||
changeset.time.0.and_utc(), changeset.time.1.and_utc(), changeset.name, changeset.location_id, changeset.voluntary_wachhabender, changeset.voluntary_fuehrungsassistent, changeset.amount_of_posten, changeset.clothing, changeset.note).execute(pool).await?;
|
changeset.time.0.and_utc(), changeset.time.1.and_utc(), changeset.name, changeset.location_id, changeset.voluntary_wachhabender, changeset.fuehrungsassistent_required, changeset.amount_of_posten, changeset.clothing, changeset.note).execute(pool).await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ impl Event {
|
|||||||
event.name,
|
event.name,
|
||||||
event.locationId,
|
event.locationId,
|
||||||
event.voluntaryWachhabender,
|
event.voluntaryWachhabender,
|
||||||
event.voluntaryFuehrungsassistent,
|
event.fuehrungsassistentRequired,
|
||||||
event.amountOfPosten,
|
event.amountOfPosten,
|
||||||
event.clothing,
|
event.clothing,
|
||||||
event.canceled,
|
event.canceled,
|
||||||
@ -81,7 +81,7 @@ impl Event {
|
|||||||
area: None,
|
area: None,
|
||||||
}),
|
}),
|
||||||
voluntary_wachhabender: record.voluntarywachhabender,
|
voluntary_wachhabender: record.voluntarywachhabender,
|
||||||
voluntary_fuehrungsassistent: record.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: record.fuehrungsassistentrequired,
|
||||||
amount_of_posten: record.amountofposten,
|
amount_of_posten: record.amountofposten,
|
||||||
clothing: Clothing {
|
clothing: Clothing {
|
||||||
id: record.clothingid,
|
id: record.clothingid,
|
||||||
@ -109,7 +109,7 @@ impl Event {
|
|||||||
event.name,
|
event.name,
|
||||||
event.locationId,
|
event.locationId,
|
||||||
event.voluntaryWachhabender,
|
event.voluntaryWachhabender,
|
||||||
event.voluntaryFuehrungsassistent,
|
event.fuehrungsassistentRequired,
|
||||||
event.amountOfPosten,
|
event.amountOfPosten,
|
||||||
event.clothing,
|
event.clothing,
|
||||||
event.canceled,
|
event.canceled,
|
||||||
@ -149,7 +149,7 @@ impl Event {
|
|||||||
area: None,
|
area: None,
|
||||||
}),
|
}),
|
||||||
voluntary_wachhabender: record.voluntarywachhabender,
|
voluntary_wachhabender: record.voluntarywachhabender,
|
||||||
voluntary_fuehrungsassistent: record.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: record.fuehrungsassistentrequired,
|
||||||
amount_of_posten: record.amountofposten,
|
amount_of_posten: record.amountofposten,
|
||||||
clothing: Clothing {
|
clothing: Clothing {
|
||||||
id: record.clothingid,
|
id: record.clothingid,
|
||||||
@ -173,7 +173,7 @@ impl Event {
|
|||||||
event.name,
|
event.name,
|
||||||
event.locationId,
|
event.locationId,
|
||||||
event.voluntaryWachhabender,
|
event.voluntaryWachhabender,
|
||||||
event.voluntaryFuehrungsassistent,
|
event.fuehrungsassistentRequired,
|
||||||
event.amountOfPosten,
|
event.amountOfPosten,
|
||||||
event.clothing,
|
event.clothing,
|
||||||
event.canceled,
|
event.canceled,
|
||||||
@ -206,7 +206,7 @@ impl Event {
|
|||||||
area: None,
|
area: None,
|
||||||
}),
|
}),
|
||||||
voluntary_wachhabender: record.voluntarywachhabender,
|
voluntary_wachhabender: record.voluntarywachhabender,
|
||||||
voluntary_fuehrungsassistent: record.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: record.fuehrungsassistentrequired,
|
||||||
amount_of_posten: record.amountofposten,
|
amount_of_posten: record.amountofposten,
|
||||||
clothing: Clothing {
|
clothing: Clothing {
|
||||||
id: record.clothingid,
|
id: record.clothingid,
|
||||||
@ -221,14 +221,14 @@ impl Event {
|
|||||||
|
|
||||||
pub async fn update(pool: &PgPool, id: i32, changeset: EventChangeset) -> Result<()> {
|
pub async fn update(pool: &PgPool, id: i32, changeset: EventChangeset) -> Result<()> {
|
||||||
query!(r#"
|
query!(r#"
|
||||||
UPDATE event SET startTimestamp = $1, endTimestamp = $2, name = $3, locationId = $4, voluntaryWachhabender = $5, voluntaryFuehrungsassistent = $6, amountOfPosten = $7, clothing = $8, note = $9 WHERE id = $10;
|
UPDATE event SET startTimestamp = $1, endTimestamp = $2, name = $3, locationId = $4, voluntaryWachhabender = $5, fuehrungsassistentRequired = $6, amountOfPosten = $7, clothing = $8, note = $9 WHERE id = $10;
|
||||||
"#,
|
"#,
|
||||||
changeset.time.0.and_utc(),
|
changeset.time.0.and_utc(),
|
||||||
changeset.time.1.and_utc(),
|
changeset.time.1.and_utc(),
|
||||||
changeset.name,
|
changeset.name,
|
||||||
changeset.location_id,
|
changeset.location_id,
|
||||||
changeset.voluntary_wachhabender,
|
changeset.voluntary_wachhabender,
|
||||||
changeset.voluntary_fuehrungsassistent,
|
changeset.fuehrungsassistent_required,
|
||||||
changeset.amount_of_posten,
|
changeset.amount_of_posten,
|
||||||
changeset.clothing,
|
changeset.clothing,
|
||||||
changeset.note, id)
|
changeset.note, id)
|
||||||
|
@ -23,7 +23,7 @@ pub struct EventChangeset {
|
|||||||
pub name: String,
|
pub name: String,
|
||||||
pub location_id: i32,
|
pub location_id: i32,
|
||||||
pub voluntary_wachhabender: bool,
|
pub voluntary_wachhabender: bool,
|
||||||
pub voluntary_fuehrungsassistent: bool,
|
pub fuehrungsassistent_required: bool,
|
||||||
pub amount_of_posten: i16,
|
pub amount_of_posten: i16,
|
||||||
pub clothing: i32,
|
pub clothing: i32,
|
||||||
pub note: Option<String>,
|
pub note: Option<String>,
|
||||||
@ -69,7 +69,7 @@ impl<'a> AsyncValidate<'a> for EventChangeset {
|
|||||||
date_unchanged_if_edit(&self.time, &event.start.date())?;
|
date_unchanged_if_edit(&self.time, &event.start.date())?;
|
||||||
can_unset_wachhabender(&self.voluntary_wachhabender, &assignments_for_event)?;
|
can_unset_wachhabender(&self.voluntary_wachhabender, &assignments_for_event)?;
|
||||||
can_unset_fuehrungsassistent(
|
can_unset_fuehrungsassistent(
|
||||||
&self.voluntary_fuehrungsassistent,
|
&self.fuehrungsassistent_required,
|
||||||
&assignments_for_event,
|
&assignments_for_event,
|
||||||
)?;
|
)?;
|
||||||
if location.area_id != event.location.unwrap().area_id {
|
if location.area_id != event.location.unwrap().area_id {
|
||||||
@ -237,7 +237,7 @@ impl EventChangeset {
|
|||||||
name: Faker.fake(),
|
name: Faker.fake(),
|
||||||
location_id: 1,
|
location_id: 1,
|
||||||
voluntary_wachhabender: true,
|
voluntary_wachhabender: true,
|
||||||
voluntary_fuehrungsassistent: true,
|
fuehrungsassistent_required: true,
|
||||||
amount_of_posten: 5,
|
amount_of_posten: 5,
|
||||||
clothing: 1,
|
clothing: 1,
|
||||||
note: None,
|
note: None,
|
||||||
|
@ -11,7 +11,7 @@ pub struct ExportEventRow {
|
|||||||
pub start_timestamp: NaiveDateTime,
|
pub start_timestamp: NaiveDateTime,
|
||||||
pub end_timestamp: NaiveDateTime,
|
pub end_timestamp: NaiveDateTime,
|
||||||
pub amount_of_posten: i16,
|
pub amount_of_posten: i16,
|
||||||
pub voluntary_fuehrungsassistent: bool,
|
pub fuehrungsassistent_required: bool,
|
||||||
pub voluntary_wachhabender: bool,
|
pub voluntary_wachhabender: bool,
|
||||||
pub location_name: String,
|
pub location_name: String,
|
||||||
pub event_name: String,
|
pub event_name: String,
|
||||||
@ -53,7 +53,7 @@ impl ExportEventRow {
|
|||||||
start_timestamp: r.starttimestamp.naive_utc(),
|
start_timestamp: r.starttimestamp.naive_utc(),
|
||||||
end_timestamp: r.endtimestamp.naive_utc(),
|
end_timestamp: r.endtimestamp.naive_utc(),
|
||||||
amount_of_posten: r.amountofposten,
|
amount_of_posten: r.amountofposten,
|
||||||
voluntary_fuehrungsassistent: r.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: r.fuehrungsassistentrequired,
|
||||||
voluntary_wachhabender: r.voluntarywachhabender,
|
voluntary_wachhabender: r.voluntarywachhabender,
|
||||||
location_name: r.locationname,
|
location_name: r.locationname,
|
||||||
event_name: r.eventname,
|
event_name: r.eventname,
|
||||||
|
@ -12,7 +12,7 @@ snapshot_kind: text
|
|||||||
|
|
||||||
<input type="hidden" name="date" value="2025-01-01">
|
<input type="hidden" name="date" value="2025-01-01">
|
||||||
<input type="hidden" name="voluntarywachhabender" id="voluntarywachhabender" value="false">
|
<input type="hidden" name="voluntarywachhabender" id="voluntarywachhabender" value="false">
|
||||||
<input type="hidden" name="voluntaryfuehrungsassistent" id="voluntaryfuehrungsassistent"
|
<input type="hidden" name="fuehrungsassistentrequired" id="fuehrungsassistentrequired"
|
||||||
value="false">
|
value="false">
|
||||||
|
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ snapshot_kind: text
|
|||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input class="checkbox" type="checkbox"
|
<input class="checkbox" type="checkbox"
|
||||||
|
|
||||||
_="on click put (the value of #voluntaryfuehrungsassistent) as inverseBool into the value of #voluntaryfuehrungsassistent">
|
_="on click put (the value of #fuehrungsassistentrequired) as inverseBool into the value of #fuehrungsassistentrequired">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ pub async fn get(
|
|||||||
name: Some(event.name),
|
name: Some(event.name),
|
||||||
location: Some(event.location_id),
|
location: Some(event.location_id),
|
||||||
voluntary_wachhabender: event.voluntary_wachhabender,
|
voluntary_wachhabender: event.voluntary_wachhabender,
|
||||||
voluntary_fuehrungsassistent: event.voluntary_fuehrungsassistent,
|
fuehrungsassistent_required: event.fuehrungsassistent_required,
|
||||||
amount_of_posten: Some(event.amount_of_posten),
|
amount_of_posten: Some(event.amount_of_posten),
|
||||||
clothing: Some(event.clothing.id),
|
clothing: Some(event.clothing.id),
|
||||||
clothing_options,
|
clothing_options,
|
||||||
@ -86,7 +86,7 @@ mod tests {
|
|||||||
),
|
),
|
||||||
name: "Vorstellung".to_string(),
|
name: "Vorstellung".to_string(),
|
||||||
location_id: 1,
|
location_id: 1,
|
||||||
voluntary_fuehrungsassistent: false,
|
fuehrungsassistent_required: false,
|
||||||
voluntary_wachhabender: false,
|
voluntary_wachhabender: false,
|
||||||
amount_of_posten: 2,
|
amount_of_posten: 2,
|
||||||
clothing: 1,
|
clothing: 1,
|
||||||
|
@ -41,7 +41,7 @@ pub async fn get(
|
|||||||
name: None,
|
name: None,
|
||||||
location: None,
|
location: None,
|
||||||
voluntary_wachhabender: false,
|
voluntary_wachhabender: false,
|
||||||
voluntary_fuehrungsassistent: false,
|
fuehrungsassistent_required: false,
|
||||||
amount_of_posten: None,
|
amount_of_posten: None,
|
||||||
clothing: None,
|
clothing: None,
|
||||||
clothing_options,
|
clothing_options,
|
||||||
|
@ -30,7 +30,7 @@ pub struct NewOrEditEventTemplate {
|
|||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
location: Option<i32>,
|
location: Option<i32>,
|
||||||
voluntary_wachhabender: bool,
|
voluntary_wachhabender: bool,
|
||||||
voluntary_fuehrungsassistent: bool,
|
fuehrungsassistent_required: bool,
|
||||||
amount_of_posten: Option<i16>,
|
amount_of_posten: Option<i16>,
|
||||||
clothing: Option<i32>,
|
clothing: Option<i32>,
|
||||||
clothing_options: Vec<Clothing>,
|
clothing_options: Vec<Clothing>,
|
||||||
@ -50,7 +50,7 @@ pub struct NewOrEditEventForm {
|
|||||||
end: NaiveDateTime,
|
end: NaiveDateTime,
|
||||||
location: i32,
|
location: i32,
|
||||||
voluntarywachhabender: bool,
|
voluntarywachhabender: bool,
|
||||||
voluntaryfuehrungsassistent: bool,
|
fuehrungsassistentrequired: bool,
|
||||||
amount: i16,
|
amount: i16,
|
||||||
clothing: i32,
|
clothing: i32,
|
||||||
note: Option<String>,
|
note: Option<String>,
|
||||||
|
@ -36,7 +36,7 @@ pub async fn post(
|
|||||||
.clone()
|
.clone()
|
||||||
.and_then(|n| if !n.is_empty() { Some(n) } else { None }),
|
.and_then(|n| if !n.is_empty() { Some(n) } else { None }),
|
||||||
voluntary_wachhabender: form.voluntarywachhabender,
|
voluntary_wachhabender: form.voluntarywachhabender,
|
||||||
voluntary_fuehrungsassistent: form.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: form.fuehrungsassistentrequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
let context = EventContext {
|
let context = EventContext {
|
||||||
|
@ -31,7 +31,7 @@ pub async fn post(
|
|||||||
.clone()
|
.clone()
|
||||||
.and_then(|n| if !n.is_empty() { Some(n) } else { None }),
|
.and_then(|n| if !n.is_empty() { Some(n) } else { None }),
|
||||||
voluntary_wachhabender: form.voluntarywachhabender,
|
voluntary_wachhabender: form.voluntarywachhabender,
|
||||||
voluntary_fuehrungsassistent: form.voluntaryfuehrungsassistent,
|
fuehrungsassistent_required: form.fuehrungsassistentrequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
let event_context = EventContext {
|
let event_context = EventContext {
|
||||||
|
@ -87,7 +87,7 @@ fn read(rows: Vec<ExportEventRow>) -> Vec<EventExportEntry> {
|
|||||||
Some(&assigned_fuass.name),
|
Some(&assigned_fuass.name),
|
||||||
Some(&assigned_fuass.function.short_display()),
|
Some(&assigned_fuass.function.short_display()),
|
||||||
));
|
));
|
||||||
} else if r.voluntary_fuehrungsassistent {
|
} else if r.fuehrungsassistent_required {
|
||||||
entries.push(create_new_entry(
|
entries.push(create_new_entry(
|
||||||
None,
|
None,
|
||||||
Some(&Function::Fuehrungsassistent.short_display()),
|
Some(&Function::Fuehrungsassistent.short_display()),
|
||||||
|
@ -76,7 +76,7 @@ pub async fn generate_status_whether_staff_is_required(
|
|||||||
.count()
|
.count()
|
||||||
< event.amount_of_posten as usize;
|
< event.amount_of_posten as usize;
|
||||||
|
|
||||||
let further_fuehrungsassistent_required = event.voluntary_fuehrungsassistent
|
let further_fuehrungsassistent_required = event.fuehrungsassistent_required
|
||||||
&& existing_assignments_for_event
|
&& existing_assignments_for_event
|
||||||
.iter()
|
.iter()
|
||||||
.all(|a| a.function != Function::Fuehrungsassistent);
|
.all(|a| a.function != Function::Fuehrungsassistent);
|
||||||
|
@ -22,7 +22,7 @@ use chrono::{NaiveDate, Utc};
|
|||||||
pub fn get_return_url_for_date(date: &NaiveDate) -> String {
|
pub fn get_return_url_for_date(date: &NaiveDate) -> String {
|
||||||
let today = Utc::now().date_naive();
|
let today = Utc::now().date_naive();
|
||||||
if date == &today {
|
if date == &today {
|
||||||
return String::from("/");
|
return String::from("/calendar");
|
||||||
}
|
}
|
||||||
|
|
||||||
format!("/calendar?date={}", date)
|
format!("/calendar?date={}", date)
|
||||||
|
@ -167,7 +167,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<p><b>Führungsassistent benötigt:</b> {% if event.voluntary_fuehrungsassistent %}ja{% else %}nein{% endif
|
<p><b>Führungsassistent benötigt:</b> {% if event.fuehrungsassistent_required %}ja{% else %}nein{% endif
|
||||||
%}</p>
|
%}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
<input type="hidden" name="date" value="{{ date }}">
|
<input type="hidden" name="date" value="{{ date }}">
|
||||||
<input type="hidden" name="voluntarywachhabender" id="voluntarywachhabender" value="{{ voluntary_wachhabender }}">
|
<input type="hidden" name="voluntarywachhabender" id="voluntarywachhabender" value="{{ voluntary_wachhabender }}">
|
||||||
<input type="hidden" name="voluntaryfuehrungsassistent" id="voluntaryfuehrungsassistent"
|
<input type="hidden" name="fuehrungsassistentrequired" id="fuehrungsassistentrequired"
|
||||||
value="{{ voluntary_fuehrungsassistent }}">
|
value="{{ fuehrungsassistent_required }}">
|
||||||
|
|
||||||
{% if let Some(id) = id %}
|
{% if let Some(id) = id %}
|
||||||
<div class="field is-horizontal">
|
<div class="field is-horizontal">
|
||||||
@ -141,8 +141,8 @@
|
|||||||
<div class="control">
|
<div class="control">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input class="checkbox" type="checkbox" {{ (fa_disabled || canceled)|cond_show("disabled") }}
|
<input class="checkbox" type="checkbox" {{ (fa_disabled || canceled)|cond_show("disabled") }}
|
||||||
{{ voluntary_fuehrungsassistent|cond_show("checked") }}
|
{{ fuehrungsassistent_required|cond_show("checked") }}
|
||||||
_="on click put (the value of #voluntaryfuehrungsassistent) as inverseBool into the value of #voluntaryfuehrungsassistent">
|
_="on click put (the value of #fuehrungsassistentrequired) as inverseBool into the value of #fuehrungsassistentrequired">
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{% if fa_disabled %}
|
{% if fa_disabled %}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<p><b>Führungsassistent benötigt:</b> {% if event.voluntary_fuehrungsassistent %}ja{% else %}nein{% endif %}
|
<p><b>Führungsassistent benötigt:</b> {% if event.fuehrungsassistent_required %}ja{% else %}nein{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user