ajout du support pour les réseaux sociaux

This commit is contained in:
2022-12-24 22:29:49 +01:00
parent 9657ac5aa5
commit 75d37f44d7
6 changed files with 138 additions and 18 deletions

View File

@@ -0,0 +1,39 @@
import { Review } from "../borne/structures.js";
export class ReseauxReview extends Review{
/**
*
* @param {ReseauxAuteur} auteur Auteur de l'avis
* @param {String} source La source de l'avis
* @param {String} date La date de l'avis au format YYYY-MM-DD
* @param {Number} note Nombre entre 0 et 10, la note attribuée
* @param {String} commentaire Le commentaire laissé par l'utilisateur
* @param {String} lien Lien vers le commentaire
*/
constructor(auteur, source, date, note=null, commentaire=null, lien=null,) {
super(auteur,note,source,commentaire);
this.lien = lien;
this.date = date;
if(!lien instanceof String && lien != null) {
throw new Error("Lien invalide");
}
}
}
export class ReseauxAuteur {
/**
*
* @param {String} nom Nom de l'utilisateur
* @param {String} source Réseau social de provenance de l'utilisateur
* @param {String} lien Lien vers le profil de l'utilisateur
*/
constructor(nom, source, lien=null) {
this.nom = nom;
this.source = source;
this.lien = lien;
if(!this.nom instanceof String || !this.source instanceof String || !this.lien instanceof String) {
throw new Error("Auteur invalide");
}
}
}