Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/migrations/schema/Version20251003000000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251003000000 extends AbstractMigration {
public function getDescription(): string {
return 'Done-Column for MaterialItem';
}

public function up(Schema $schema): void {
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE material_item ADD done BOOLEAN DEFAULT false NOT NULL');
}

public function down(Schema $schema): void {
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE material_item DROP done');
}
}
8 changes: 8 additions & 0 deletions api/src/Entity/MaterialItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ class MaterialItem extends BaseEntity implements BelongsToCampInterface, CopyFro
#[ORM\Column(type: 'text', nullable: true)]
public ?string $unit = null;

/**
* Whether the item has been prepared and is ready to be brought to the camp.
*/
#[ApiProperty(example: true)]
#[Groups(['read', 'write'])]
#[ORM\Column(type: 'boolean', options: ['default' => false])]
public bool $done = false;

public function __construct() {
parent::__construct();
$this->periodMaterialItems = new ArrayCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand All @@ -39,6 +40,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand All @@ -60,6 +62,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand All @@ -81,6 +84,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand All @@ -102,6 +106,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}
},
"article": "escaped_value",
"done": "escaped_value",
"id": "escaped_value",
"quantity": "escaped_value",
"unit": "escaped_value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14132,6 +14132,11 @@ components:
format: iri-reference
readOnly: true
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
id:
description: 'An internal, unique, randomly generated identifier of this entity.'
example: 1a2b3c4d
Expand Down Expand Up @@ -14177,6 +14182,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialItem-write:
Expand All @@ -14187,6 +14193,11 @@ components:
description: 'The name of the item that is required.'
example: Volleyball
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
materialList:
description: |-
The list to which this item belongs. Lists are used to keep track of who is
Expand Down Expand Up @@ -14232,6 +14243,11 @@ components:
example: Volleyball
maxLength: 64
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
materialList:
description: |-
The list to which this item belongs. Lists are used to keep track of who is
Expand Down Expand Up @@ -14271,6 +14287,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialItem.jsonapi:
Expand All @@ -14292,6 +14309,11 @@ components:
example: Volleyball
maxLength: 64
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
quantity:
description: 'The number of items or the amount in the unit of items that are required.'
example: 1.5
Expand All @@ -14304,6 +14326,7 @@ components:
type: ['null', string]
required:
- article
- done
type: object
id:
type: string
Expand Down Expand Up @@ -14367,6 +14390,11 @@ components:
format: iri-reference
readOnly: true
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
id:
description: 'An internal, unique, randomly generated identifier of this entity.'
example: 1a2b3c4d
Expand Down Expand Up @@ -14412,6 +14440,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialItem.jsonhal-write_create:
Expand All @@ -14432,6 +14461,11 @@ components:
example: Volleyball
maxLength: 64
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
materialList:
description: |-
The list to which this item belongs. Lists are used to keep track of who is
Expand Down Expand Up @@ -14471,6 +14505,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialItem.jsonld-read:
Expand Down Expand Up @@ -14511,6 +14546,11 @@ components:
format: iri-reference
readOnly: true
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
id:
description: 'An internal, unique, randomly generated identifier of this entity.'
example: 1a2b3c4d
Expand Down Expand Up @@ -14556,6 +14596,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialItem.jsonld-write_create:
Expand All @@ -14567,6 +14608,11 @@ components:
example: Volleyball
maxLength: 64
type: string
done:
default: false
description: 'Whether the item has been prepared and is ready to be brought to the camp.'
example: true
type: boolean
materialList:
description: |-
The list to which this item belongs. Lists are used to keep track of who is
Expand Down Expand Up @@ -14606,6 +14652,7 @@ components:
- string
required:
- article
- done
- materialList
type: object
MaterialList-read:
Expand Down