Skip to content
Extraits de code Groupes Projets
Valider 80e79b3a rédigé par karima hamdan's avatar karima hamdan
Parcourir les fichiers

Merge branch 'develop' into feature/MLC-311

parents dc5efa28 8d95f729
Branches
Étiquettes
1 requête de fusion!37MLC-311 "Feature/adding some missing attributes in Maintenance and maintenanceActivty entities"
Affichage de
avec 445 ajouts et 13 suppressions
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PersistenceUnitSettings">
<persistence-units>
<persistence-unit name="Default" />
</persistence-units>
</component>
</project>
\ No newline at end of file
## [0.0.34-RELEASE]
### Added
- New features that have been added.
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.33-RELEASE]
### Added
- add new entity .
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.32-RELEASE]
### Added
- New features that have been added.
### Changed
- changes some fields in the document files.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.31-RELEASE]
### Added
- Adding the VehicleDocument needed files
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.30-RELEASE]
### Added
- Add new attribute.
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.29-RELEASE]
### Changed
- MLC-331/Refactoring reservation entities.
## [0.0.28-RELEASE]
### Added
- add document entity.
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.27-RELEASE]
### Added
- New features that have been added agentDTO & client DTO .
### Changed
- Changes in existing functionality.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.26-RELEASE]
### Added
- New features that have been added.
### Changed
- MLC-275/update complaint model.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.25-RELEASE]
### Added
- New features that have been added.
### Changed
- MLC-302/refactoring fleet models and enums.
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.24-RELEASE]
### Added
- add CascadeType.ALL and orphanRemoval to Role-Permission relationship
### Changed
- refactor permissions to support multiple permissionActions per module
## [0.0.23-RELEASE]
### Added
- New features that have been added.
### Changed
- change the type of userType from String to UserType enum
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.22-RELEASE]
### Added
- add userType and the enum UserType to user
### Changed
- change the name of user_type to just type in user class
### Deprecated
- Soon-to-be removed features.
### Removed
- Features that have been removed.
### Fixed
- Any bug fixes.
### Security
- Any security improvements.
## [0.0.21-RELEASE]
### Added
- modified nexus config
## [0.0.20-RELEASE] ## [0.0.20-RELEASE]
### Added ### Added
- added uuid attributes to both User and Maintenance entities and images attribute to Maintenance entity - added uuid attributes to both User and Maintenance entities and images attribute to Maintenance entity
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<parent> <parent>
<groupId>com.marketingconfort</groupId> <groupId>com.marketingconfort</groupId>
<artifactId>mc-starter-parent</artifactId> <artifactId>mc-starter-parent</artifactId>
<version>1.0.50-RELEASE</version> <version>1.0.62-RELEASE</version>
<relativePath/> <relativePath/>
</parent> </parent>
<groupId>com.marketingconfort</groupId> <groupId>com.marketingconfort</groupId>
<artifactId>mobiloca-common</artifactId> <artifactId>mobiloca-common</artifactId>
<version>0.0.20-SNAPSHOT</version> <version>0.0.34-SNAPSHOT</version>
<name>mobiloca-common</name> <name>mobiloca-common</name>
<description>mobiLoca common project</description> <description>mobiLoca common project</description>
<url/> <url/>
......
package com.marketingconfort.mobiloca.common.Document.dtos;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DocumentDTO {
private Long id;
private String name;
private Long size;
private String createdAt;
private String modifiedAt;
private boolean isArchived;
private boolean isCritique;
private String expirationDate;
private String status;
private String type;
private String category;
private String filePath;
private String customType;
}
package com.marketingconfort.mobiloca.common.Document.enums;
public enum DocumentCategory {
PATENTE,
FISCAL_REGISTRATION_CERTIFICATE,
LEASE_CONTRACT,
CIVIL_LIABILITY_INSURANCE,
INTERNAL_REGULATIONS,
OPERATING_AUTHORIZATION,
OTHER
}
package com.marketingconfort.mobiloca.common.Document.enums;
public enum DocumentStatus {
VALID,
UPCOMING,
EXPIRED
}
package com.marketingconfort.mobiloca.common.Document.enums;
public enum FileType {
PDF, DOCX, XLSX, PNG, JPG, TXT
}
package com.marketingconfort.mobiloca.common.Document.enums;
public enum VehicleDocumentCategory {
REGISTRATION_CERTIFICATE,
INSURANCE_CERTIFICATE,
INSURANCE_STICKER,
TECHNICAL_INSPECTION_CERTIFICATE,
MAINTENANCE_HISTORY,
RENTAL_CONTRACT,
CONDITION_REPORT,
OTHER
}
package com.marketingconfort.mobiloca.common.Document.models;
import com.marketingconfort.mobiloca.common.Document.enums.DocumentCategory;
import jakarta.persistence.*;
import lombok.*;
import lombok.experimental.SuperBuilder;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@DiscriminatorValue("AGENCY")
@SuperBuilder
public class AgencyDocument extends Document {
@Column(name = "agency_id")
private Long agencyId;
@Enumerated(EnumType.STRING)
private DocumentCategory category;
}
package com.marketingconfort.mobiloca.common.Document.models;
import com.marketingconfort.mobiloca.common.Document.enums.DocumentCategory;
import com.marketingconfort.mobiloca.common.Document.enums.DocumentStatus;
import com.marketingconfort.mobiloca.common.Document.enums.FileType;
import jakarta.persistence.*;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Inheritance(strategy = InheritanceType.JOINED)
@SuperBuilder
public class Document {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private Long size;
private LocalDate createdAt;
private LocalDate modifiedAt;
private boolean isArchived;
private boolean isCritique;
private LocalDate expirationDate;
@Enumerated(EnumType.STRING)
private DocumentStatus status;
@Enumerated(EnumType.STRING)
private FileType type;
private String filePath;
private String customType;
public DocumentStatus getStatus() {
if (expirationDate == null) return null;
LocalDate today = LocalDate.now();
if (expirationDate.isBefore(today)) return DocumentStatus.EXPIRED;
if (!expirationDate.isAfter(today.plusDays(30))) return DocumentStatus.UPCOMING;
return DocumentStatus.VALID;
}
}
package com.marketingconfort.mobiloca.common.Document.models;
import com.marketingconfort.mobiloca.common.Document.enums.VehicleDocumentCategory;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.*;
import lombok.experimental.SuperBuilder;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class VehicleDocuments extends Document {
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private VehicleDocumentCategory category;
@Column(nullable = false)
private Long vehicleId;
}
\ No newline at end of file
package com.marketingconfort.mobiloca.common.Fleet.dtos;
import lombok.Builder;
@Builder
public record AgentDTO(Long id ,String firstName ,String lastName) {
}
package com.marketingconfort.mobiloca.common.Fleet.dtos;
import lombok.Builder;
@Builder
public record ReservationDetailsDTO(
Long id,
Long vehicleId,
String registration,
String brand,
String model,
Long contractId
) {}
\ No newline at end of file
package com.marketingconfort.mobiloca.common.Fleet.enums;
public enum FuelType {
DIESEL,
GASOLINE,
ELECTRIC,
HYBRID,
GAS
}
...@@ -31,7 +31,7 @@ public class Complaint{ ...@@ -31,7 +31,7 @@ public class Complaint{
@ElementCollection @ElementCollection
@CollectionTable(name = "complaint_file_evidences", joinColumns = @JoinColumn(name = "complaint_id")) @CollectionTable(name = "complaint_file_evidences", joinColumns = @JoinColumn(name = "complaint_id"))
private List<Long> fileAsEvidenceIds; private List<String> fileAsEvidenceUrls;
private LocalDate atDate; private LocalDate atDate;
...@@ -40,7 +40,8 @@ public class Complaint{ ...@@ -40,7 +40,8 @@ public class Complaint{
@Size(max = 100) @Size(max = 100)
private String rejectionReason; private String rejectionReason;
@Column(name = "last_update_date")
private LocalDate lastUpdateDate;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private ComplaintType type; private ComplaintType type;
...@@ -63,5 +64,6 @@ public class Complaint{ ...@@ -63,5 +64,6 @@ public class Complaint{
} }
this.reference = "COMP-" + LocalDate.now().getYear() + "-" + this.id; this.reference = "COMP-" + LocalDate.now().getYear() + "-" + this.id;
} }
} }
package com.marketingconfort.mobiloca.common.Fleet.models; package com.marketingconfort.mobiloca.common.Fleet.models;
import com.marketingconfort.mobiloca.common.Fleet.enums.FuelType;
import com.marketingconfort.mobiloca.common.Fleet.enums.PaymentStatus; import com.marketingconfort.mobiloca.common.Fleet.enums.PaymentStatus;
import jakarta.persistence.*; import jakarta.persistence.*;
import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Min;
...@@ -30,9 +31,14 @@ public class FuelConsumption{ ...@@ -30,9 +31,14 @@ public class FuelConsumption{
@PositiveOrZero @PositiveOrZero
private double cost; private double cost;
@Enumerated(EnumType.STRING)
private FuelType fuelType;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private PaymentStatus status; private PaymentStatus status;
@Column(name = "client_id")
private Long clientId;
@Column(name = "reservation_id") @Column(name = "reservation_id")
private Long reservationId; private Long reservationId;
......
...@@ -32,6 +32,16 @@ public class MileageRecord { ...@@ -32,6 +32,16 @@ public class MileageRecord {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private PaymentStatus status; private PaymentStatus status;
@Column(name = "client_id")
private Long clientId;
@Column(name = "reservation_id") @Column(name = "reservation_id")
private Long reservationId; private Long reservationId;
@PrePersist
@PreUpdate
public void calculateExceededMileage() {
double diff = this.currentMileage - this.contractLimit;
this.exceededMileage = Math.max(0, diff);
}
} }
package com.marketingconfort.mobiloca.common.Reservation.dto;
import lombok.Builder;
@Builder
public record BuiltInEquipmentDTO(
Long id,
String name,
Double price
) {
}
...@@ -3,5 +3,5 @@ package com.marketingconfort.mobiloca.common.Reservation.dto; ...@@ -3,5 +3,5 @@ package com.marketingconfort.mobiloca.common.Reservation.dto;
import lombok.Builder; import lombok.Builder;
@Builder @Builder
public record ClientDTO(Long id, String firstname, String lastname) { public record ClientDTO(Long id, String firstname, String lastname, String email, String phoneNumber) {
} }
package com.marketingconfort.mobiloca.common.Reservation.enums;
public enum PaymentMode {
CARD,
CASH,
CHECK,
BANK_TRANSFER,
}
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter