Skip to content

Commit

Permalink
feat() update models
Browse files Browse the repository at this point in the history
  • Loading branch information
aissatou-d committed Nov 27, 2021
1 parent ab64d94 commit f7eacc6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
15 changes: 11 additions & 4 deletions src/app/entities/booking.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
import { Garage } from "./garageEntity";
import { Service } from "./serviceEntity";
import { Slotime } from "./slotimesEntity";
import { User } from "./userEntity";

export interface Booking{
id: number,
status: string,
status: Status,
description: string;
price: number;
immatriculation: string,
service_garage: Service,
date: Date;
garage: Garage,
user: User,
slotime: Slotime,
service: Service,
usercomment: string;
}

export enum Status{
DRAFT = "Brouillon",
CANCELLED = "Annuler",
VALIDATE = "Valider"
}
35 changes: 19 additions & 16 deletions src/app/entities/garageEntity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Booking } from './booking';
import { OpeningHours } from './openinHours';
import { Service } from './serviceEntity';
import { Slotime } from './slotimesEntity';
import { User } from './userEntity';

export interface Garage {
Expand All @@ -9,30 +9,26 @@ export interface Garage {
description: string;
email: string;
phone_number: string;
address: string;
latitude: number;
longitude: number;
isFavori: boolean;
logo: Logo;
bookings: [];
bookings: Booking[];
ratings: [];
comments: Comment[];
opening_hours: OpeningHours[];
payments: [];
address: string;
slotimes: Slotime[];
avis: Avis[];
payment_types: PaymentType[];
services: Service[];
isFavoris: boolean;
}

export interface Avis {
id: number;
descriptionAvis: string;
dateCreated: Date;
garage: Garage;
votes: Vote[];
}

export interface Vote {
export interface Comment {
id: number;
nbVote: number;
description: string;
user: User;
nbrLikes: number;
garage: number;
}

export interface Favoris {
Expand All @@ -41,6 +37,13 @@ export interface Favoris {
user: User;
}

export interface PaymentType{
id: number;
type: string;
payment: any;
icon: Logo
}

export interface Logo {
id: number;
name: string;
Expand Down
7 changes: 2 additions & 5 deletions src/app/entities/serviceEntity.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { Garage } from "./garageEntity";
import { Slotime } from "./slotimesEntity";

export interface Service{
id: number,
nameService: string,
name: string,
description: string,
price: number,
garage: Garage,
slotimes: Slotime[]
garages: Garage[]
}

0 comments on commit f7eacc6

Please sign in to comment.