Daniel il y a 1 an
Parent
révision
46aa4723f0
13 fichiers modifiés avec 96 ajouts et 40 suppressions
  1. +1
    -1
      angular/openapi.json
  2. +12
    -10
      angular/openapi.yaml
  3. +27
    -0
      angular/src/app/_components/search-select/search-select.component.ts
  4. +4
    -4
      angular/src/app/_forms/apiForms.ts
  5. +0
    -1
      angular/src/app/_views/trip/trip-detail/trip-detail.component.html
  6. +7
    -1
      angular/src/app/_views/user/user-list/user-list.component.ts
  7. +2
    -2
      angular/src/app/core/api/v1/model/userTrip.ts
  8. +2
    -2
      angular/src/app/core/api/v1/model/userTripJsonld.ts
  9. +3
    -1
      angular/src/assets/i18n/en.json
  10. +31
    -0
      httpdocs/migrations/Version20250311143225.php
  11. +2
    -4
      httpdocs/src/ApiResource/UserTripApi.php
  12. +5
    -11
      httpdocs/src/Entity/UserTrip.php
  13. +0
    -3
      httpdocs/src/Mapper/UserTripApiToEntityMapper.php

+ 1
- 1
angular/openapi.json
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 12
- 10
angular/openapi.yaml Voir le fichier

@@ -2783,14 +2783,18 @@ components:
user:
$ref: '#/components/schemas/User'
captainName:
type: string
type:
- string
- 'null'
signatureUrl:
readOnly: true
type:
- string
- 'null'
completedDate:
type: string
type:
- string
- 'null'
format: date-time
createdAt:
readOnly: true
@@ -2798,9 +2802,6 @@ components:
- string
- 'null'
format: date-time
required:
- captainName
- completedDate
UserTrip.jsonld:
type: object
description: ''
@@ -2839,14 +2840,18 @@ components:
user:
$ref: '#/components/schemas/User.jsonld'
captainName:
type: string
type:
- string
- 'null'
signatureUrl:
readOnly: true
type:
- string
- 'null'
completedDate:
type: string
type:
- string
- 'null'
format: date-time
createdAt:
readOnly: true
@@ -2854,9 +2859,6 @@ components:
- string
- 'null'
format: date-time
required:
- captainName
- completedDate
UserTripEvent:
type: object
description: ''


+ 27
- 0
angular/src/app/_components/search-select/search-select.component.ts Voir le fichier

@@ -214,4 +214,31 @@ export class SearchSelectComponent implements OnInit, AfterViewInit {
} 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,
];
}
}

+ 4
- 4
angular/src/app/_forms/apiForms.ts Voir le fichier

@@ -132,9 +132,9 @@ export const userTripForm = new FormGroup({
dbId: new FormControl(null, []),
trip: new FormControl(null, []),
user: new FormControl(null, []),
captainName: new FormControl(null, [Validators.required]),
captainName: new FormControl(null, []),
signatureUrl: new FormControl(null, []),
completedDate: new FormControl(null, [Validators.required]),
completedDate: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

@@ -142,9 +142,9 @@ export const userTripJsonldForm = new FormGroup({
dbId: new FormControl(null, []),
trip: new FormControl(null, []),
user: new FormControl(null, []),
captainName: new FormControl(null, [Validators.required]),
captainName: new FormControl(null, []),
signatureUrl: new FormControl(null, []),
completedDate: new FormControl(null, [Validators.required]),
completedDate: new FormControl(null, []),
createdAt: new FormControl(null, [])
});



+ 0
- 1
angular/src/app/_views/trip/trip-detail/trip-detail.component.html Voir le fichier

@@ -31,7 +31,6 @@
[dataSet]="tripLocation.location"
>
</app-search-select>
<!-- <input [id]="'location_' + i" type="hidden" formControlName="location"/>-->
</div>

<div class="col-12 col-md-2 mb-3">


+ 7
- 1
angular/src/app/_views/user/user-list/user-list.component.ts Voir le fichier

@@ -46,7 +46,7 @@ export class UserListComponent implements OnInit, AfterViewInit {
{
name: 'lastName',
text: 'users.lastname',
type: ListComponent.COLUMN_TYPE_TEXT,
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'lastName',
sortable: true,
} as ListColDefinition,
@@ -56,6 +56,12 @@ export class UserListComponent implements OnInit, AfterViewInit {
type: ListComponent.COLUMN_TYPE_EMAIL,
field: 'email',
} as ListColDefinition,
{
name: 'referenceId',
text: 'users.pilotIdNo',
type: ListComponent.COLUMN_TYPE_TEXT_BOLD,
field: 'referenceId',
} as ListColDefinition,
];
}



+ 2
- 2
angular/src/app/core/api/v1/model/userTrip.ts Voir le fichier

@@ -20,9 +20,9 @@ export interface UserTrip {
readonly dbId?: number | null;
trip?: Trip;
user?: User;
captainName: string;
captainName?: string | null;
readonly signatureUrl?: string | null;
completedDate: string;
completedDate?: string | null;
readonly createdAt?: string | null;
}


+ 2
- 2
angular/src/app/core/api/v1/model/userTripJsonld.ts Voir le fichier

@@ -24,9 +24,9 @@ export interface UserTripJsonld {
readonly dbId?: number | null;
trip?: TripJsonld;
user?: UserJsonld;
captainName: string;
captainName?: string | null;
readonly signatureUrl?: string | null;
completedDate: string;
completedDate?: string | null;
readonly createdAt?: string | null;
}


+ 3
- 1
angular/src/assets/i18n/en.json Voir le fichier

@@ -107,9 +107,11 @@
"view": "Users",
"user": "User",
"email": "Email",
"full_name": "Name",
"firstname": "Firstname",
"lastname": "Lastname",
"userTrips": "User trips"
"userTrips": "User trips",
"pilotIdNo": "#Pilot id"
},
"form":
{


+ 31
- 0
httpdocs/migrations/Version20250311143225.php Voir le fichier

@@ -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)\'');
}
}

+ 2
- 4
httpdocs/src/ApiResource/UserTripApi.php Voir le fichier

@@ -91,14 +91,12 @@ class UserTripApi
)]
public ?UserApi $user = null;

#[Assert\NotBlank]
public string $captainName;
public ?string $captainName = null;

#[ApiProperty(writable: false)]
public ?string $signatureUrl = null;

#[Assert\NotBlank]
public \DateTimeImmutable $completedDate;
public ?\DateTimeImmutable $completedDate = null;

#[ApiProperty(writable: false)]
public ?\DateTimeImmutable $createdAt = null;

+ 5
- 11
httpdocs/src/Entity/UserTrip.php Voir le fichier

@@ -27,14 +27,14 @@ class UserTrip
#[ORM\JoinColumn(nullable: false)]
private User $user;

#[ORM\Column(length: 255)]
private string $captainName;
#[ORM\Column(length: 255, nullable: true)]
private ?string $captainName = null;

#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")]
private ?MediaObject $signature = null;

#[ORM\Column]
#[ORM\Column(nullable: true)]
private DateTimeImmutable $completedDate;

#[ORM\Column]
@@ -46,14 +46,9 @@ class UserTrip
public function __construct(
Trip $trip,
User $user,
string $captainName,
DateTimeImmutable $startDate,
DateTimeImmutable $endDate
) {
$this->trip = $trip;
$this->user = $user;
$this->captainName = $captainName;
$this->completedDate = $endDate;
$this->createdAt = new DateTimeImmutable();
$this->userTripEvents = new ArrayCollection();
}
@@ -85,15 +80,14 @@ class UserTrip
return $this;
}

public function getCaptainName(): string
public function getCaptainName(): ?string
{
return $this->captainName;
}

public function setCaptainName(string $captainName): self
public function setCaptainName(?string $captainName): void
{
$this->captainName = $captainName;
return $this;
}

public function getSignature(): ?MediaObject


+ 0
- 3
httpdocs/src/Mapper/UserTripApiToEntityMapper.php Voir le fichier

@@ -52,9 +52,6 @@ class UserTripApiToEntityMapper implements MapperInterface
return new UserTrip(
$trip,
$user,
$dto->captainName,
$dto->startDate,
$dto->endDate
);
}



Chargement…
Annuler
Enregistrer