| @@ -2783,14 +2783,18 @@ components: | |||||
| user: | user: | ||||
| $ref: '#/components/schemas/User' | $ref: '#/components/schemas/User' | ||||
| captainName: | captainName: | ||||
| type: string | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| signatureUrl: | signatureUrl: | ||||
| readOnly: true | readOnly: true | ||||
| type: | type: | ||||
| - string | - string | ||||
| - 'null' | - 'null' | ||||
| completedDate: | completedDate: | ||||
| type: string | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| format: date-time | format: date-time | ||||
| createdAt: | createdAt: | ||||
| readOnly: true | readOnly: true | ||||
| @@ -2798,9 +2802,6 @@ components: | |||||
| - string | - string | ||||
| - 'null' | - 'null' | ||||
| format: date-time | format: date-time | ||||
| required: | |||||
| - captainName | |||||
| - completedDate | |||||
| UserTrip.jsonld: | UserTrip.jsonld: | ||||
| type: object | type: object | ||||
| description: '' | description: '' | ||||
| @@ -2839,14 +2840,18 @@ components: | |||||
| user: | user: | ||||
| $ref: '#/components/schemas/User.jsonld' | $ref: '#/components/schemas/User.jsonld' | ||||
| captainName: | captainName: | ||||
| type: string | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| signatureUrl: | signatureUrl: | ||||
| readOnly: true | readOnly: true | ||||
| type: | type: | ||||
| - string | - string | ||||
| - 'null' | - 'null' | ||||
| completedDate: | completedDate: | ||||
| type: string | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| format: date-time | format: date-time | ||||
| createdAt: | createdAt: | ||||
| readOnly: true | readOnly: true | ||||
| @@ -2854,9 +2859,6 @@ components: | |||||
| - string | - string | ||||
| - 'null' | - 'null' | ||||
| format: date-time | format: date-time | ||||
| required: | |||||
| - captainName | |||||
| - completedDate | |||||
| UserTripEvent: | UserTripEvent: | ||||
| type: object | type: object | ||||
| description: '' | description: '' | ||||
| @@ -214,4 +214,31 @@ export class SearchSelectComponent implements OnInit, AfterViewInit { | |||||
| } as ListColDefinition, | } as ListColDefinition, | ||||
| ]; | ]; | ||||
| } | } | ||||
| public static getDefaultColDefUsers(subResource?: string): ListColDefinition[] { | |||||
| return [ | |||||
| { | |||||
| name: 'fullName', | |||||
| text: 'users.full_name', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'fullName', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| }, | |||||
| { | |||||
| name: 'email', | |||||
| text: 'users.email', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| field: 'email', | |||||
| sortable: true, | |||||
| filterType: FilterBarComponent.FILTER_TYPE_TEXT, | |||||
| }, | |||||
| { | |||||
| name: 'referenceId', | |||||
| text: 'users.pilotIdNo', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT_BOLD, | |||||
| field: 'referenceId', | |||||
| } as ListColDefinition, | |||||
| ]; | |||||
| } | |||||
| } | } | ||||
| @@ -132,9 +132,9 @@ export const userTripForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| trip: new FormControl(null, []), | trip: new FormControl(null, []), | ||||
| user: new FormControl(null, []), | user: new FormControl(null, []), | ||||
| captainName: new FormControl(null, [Validators.required]), | |||||
| captainName: new FormControl(null, []), | |||||
| signatureUrl: new FormControl(null, []), | signatureUrl: new FormControl(null, []), | ||||
| completedDate: new FormControl(null, [Validators.required]), | |||||
| completedDate: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -142,9 +142,9 @@ export const userTripJsonldForm = new FormGroup({ | |||||
| dbId: new FormControl(null, []), | dbId: new FormControl(null, []), | ||||
| trip: new FormControl(null, []), | trip: new FormControl(null, []), | ||||
| user: new FormControl(null, []), | user: new FormControl(null, []), | ||||
| captainName: new FormControl(null, [Validators.required]), | |||||
| captainName: new FormControl(null, []), | |||||
| signatureUrl: new FormControl(null, []), | signatureUrl: new FormControl(null, []), | ||||
| completedDate: new FormControl(null, [Validators.required]), | |||||
| completedDate: new FormControl(null, []), | |||||
| createdAt: new FormControl(null, []) | createdAt: new FormControl(null, []) | ||||
| }); | }); | ||||
| @@ -31,7 +31,6 @@ | |||||
| [dataSet]="tripLocation.location" | [dataSet]="tripLocation.location" | ||||
| > | > | ||||
| </app-search-select> | </app-search-select> | ||||
| <!-- <input [id]="'location_' + i" type="hidden" formControlName="location"/>--> | |||||
| </div> | </div> | ||||
| <div class="col-12 col-md-2 mb-3"> | <div class="col-12 col-md-2 mb-3"> | ||||
| @@ -46,7 +46,7 @@ export class UserListComponent implements OnInit, AfterViewInit { | |||||
| { | { | ||||
| name: 'lastName', | name: 'lastName', | ||||
| text: 'users.lastname', | text: 'users.lastname', | ||||
| type: ListComponent.COLUMN_TYPE_TEXT, | |||||
| type: ListComponent.COLUMN_TYPE_TEXT_BOLD, | |||||
| field: 'lastName', | field: 'lastName', | ||||
| sortable: true, | sortable: true, | ||||
| } as ListColDefinition, | } as ListColDefinition, | ||||
| @@ -56,6 +56,12 @@ export class UserListComponent implements OnInit, AfterViewInit { | |||||
| type: ListComponent.COLUMN_TYPE_EMAIL, | type: ListComponent.COLUMN_TYPE_EMAIL, | ||||
| field: 'email', | field: 'email', | ||||
| } as ListColDefinition, | } as ListColDefinition, | ||||
| { | |||||
| name: 'referenceId', | |||||
| text: 'users.pilotIdNo', | |||||
| type: ListComponent.COLUMN_TYPE_TEXT_BOLD, | |||||
| field: 'referenceId', | |||||
| } as ListColDefinition, | |||||
| ]; | ]; | ||||
| } | } | ||||
| @@ -20,9 +20,9 @@ export interface UserTrip { | |||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| trip?: Trip; | trip?: Trip; | ||||
| user?: User; | user?: User; | ||||
| captainName: string; | |||||
| captainName?: string | null; | |||||
| readonly signatureUrl?: string | null; | readonly signatureUrl?: string | null; | ||||
| completedDate: string; | |||||
| completedDate?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -24,9 +24,9 @@ export interface UserTripJsonld { | |||||
| readonly dbId?: number | null; | readonly dbId?: number | null; | ||||
| trip?: TripJsonld; | trip?: TripJsonld; | ||||
| user?: UserJsonld; | user?: UserJsonld; | ||||
| captainName: string; | |||||
| captainName?: string | null; | |||||
| readonly signatureUrl?: string | null; | readonly signatureUrl?: string | null; | ||||
| completedDate: string; | |||||
| completedDate?: string | null; | |||||
| readonly createdAt?: string | null; | readonly createdAt?: string | null; | ||||
| } | } | ||||
| @@ -107,9 +107,11 @@ | |||||
| "view": "Users", | "view": "Users", | ||||
| "user": "User", | "user": "User", | ||||
| "email": "Email", | "email": "Email", | ||||
| "full_name": "Name", | |||||
| "firstname": "Firstname", | "firstname": "Firstname", | ||||
| "lastname": "Lastname", | "lastname": "Lastname", | ||||
| "userTrips": "User trips" | |||||
| "userTrips": "User trips", | |||||
| "pilotIdNo": "#Pilot id" | |||||
| }, | }, | ||||
| "form": | "form": | ||||
| { | { | ||||
| @@ -0,0 +1,31 @@ | |||||
| <?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 Version20250311143225 extends AbstractMigration | |||||
| { | |||||
| public function getDescription(): string | |||||
| { | |||||
| return ''; | |||||
| } | |||||
| public function up(Schema $schema): void | |||||
| { | |||||
| // this up() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE user_trip CHANGE captain_name captain_name VARCHAR(255) DEFAULT NULL, CHANGE completed_date completed_date DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\''); | |||||
| } | |||||
| public function down(Schema $schema): void | |||||
| { | |||||
| // this down() migration is auto-generated, please modify it to your needs | |||||
| $this->addSql('ALTER TABLE user_trip CHANGE captain_name captain_name VARCHAR(255) NOT NULL, CHANGE completed_date completed_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\''); | |||||
| } | |||||
| } | |||||
| @@ -91,14 +91,12 @@ class UserTripApi | |||||
| )] | )] | ||||
| public ?UserApi $user = null; | public ?UserApi $user = null; | ||||
| #[Assert\NotBlank] | |||||
| public string $captainName; | |||||
| public ?string $captainName = null; | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?string $signatureUrl = null; | public ?string $signatureUrl = null; | ||||
| #[Assert\NotBlank] | |||||
| public \DateTimeImmutable $completedDate; | |||||
| public ?\DateTimeImmutable $completedDate = null; | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| @@ -27,14 +27,14 @@ class UserTrip | |||||
| #[ORM\JoinColumn(nullable: false)] | #[ORM\JoinColumn(nullable: false)] | ||||
| private User $user; | private User $user; | ||||
| #[ORM\Column(length: 255)] | |||||
| private string $captainName; | |||||
| #[ORM\Column(length: 255, nullable: true)] | |||||
| private ?string $captainName = null; | |||||
| #[ORM\ManyToOne] | #[ORM\ManyToOne] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | ||||
| private ?MediaObject $signature = null; | private ?MediaObject $signature = null; | ||||
| #[ORM\Column] | |||||
| #[ORM\Column(nullable: true)] | |||||
| private DateTimeImmutable $completedDate; | private DateTimeImmutable $completedDate; | ||||
| #[ORM\Column] | #[ORM\Column] | ||||
| @@ -46,14 +46,9 @@ class UserTrip | |||||
| public function __construct( | public function __construct( | ||||
| Trip $trip, | Trip $trip, | ||||
| User $user, | User $user, | ||||
| string $captainName, | |||||
| DateTimeImmutable $startDate, | |||||
| DateTimeImmutable $endDate | |||||
| ) { | ) { | ||||
| $this->trip = $trip; | $this->trip = $trip; | ||||
| $this->user = $user; | $this->user = $user; | ||||
| $this->captainName = $captainName; | |||||
| $this->completedDate = $endDate; | |||||
| $this->createdAt = new DateTimeImmutable(); | $this->createdAt = new DateTimeImmutable(); | ||||
| $this->userTripEvents = new ArrayCollection(); | $this->userTripEvents = new ArrayCollection(); | ||||
| } | } | ||||
| @@ -85,15 +80,14 @@ class UserTrip | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getCaptainName(): string | |||||
| public function getCaptainName(): ?string | |||||
| { | { | ||||
| return $this->captainName; | return $this->captainName; | ||||
| } | } | ||||
| public function setCaptainName(string $captainName): self | |||||
| public function setCaptainName(?string $captainName): void | |||||
| { | { | ||||
| $this->captainName = $captainName; | $this->captainName = $captainName; | ||||
| return $this; | |||||
| } | } | ||||
| public function getSignature(): ?MediaObject | public function getSignature(): ?MediaObject | ||||
| @@ -52,9 +52,6 @@ class UserTripApiToEntityMapper implements MapperInterface | |||||
| return new UserTrip( | return new UserTrip( | ||||
| $trip, | $trip, | ||||
| $user, | $user, | ||||
| $dto->captainName, | |||||
| $dto->startDate, | |||||
| $dto->endDate | |||||
| ); | ); | ||||
| } | } | ||||