Many fix and improvements

This commit is contained in:
Jonathan Bourdon
2024-08-03 04:15:55 -04:00
parent 0d94d79c77
commit 78ead7e387
37 changed files with 669 additions and 735 deletions

View File

@@ -1,48 +0,0 @@
import UserTransactionsModel from "@/models/userTransactionsModel.js";
import SocialNetworksModel from "@/models/socialNetworksModel.js";
import ProfileColorsModel from "@/models/profileColorsModel.js";
import StoredDataUrlsModel from "@/models/storedDataUrlsModel.js";
export default class MyUserModel
{
id = "";
creatorAlias = "";
alias = null;
firstName = "";
lastName = "";
userName = "";
occupation = "";
email = "";
phoneNumber = "";
birthDate = "";
country = "";
city = "";
address = "";
about = "";
description = "";
socialNetworks = new SocialNetworksModel();
profileColors = new ProfileColorsModel();
storedDataUrls = new StoredDataUrlsModel();
totalBalance = "";
userTransactions = [];
static createFromApiResult(apiResult){
const userModel = Object.assign(new MyUserModel(), apiResult);
const notMapperTransaction = Object.freeze(userModel.userTransactions);
userModel.userTransactions = [];
for (const transaction of notMapperTransaction) {
userModel.userTransactions.push(UserTransactionsModel.createFromApiResult(transaction))
}
return userModel;
}
static getDefaultUser(){
const defaultUser = new MyUserModel();
defaultUser.userName = "Anonyme"
return defaultUser;
}
}

View File

@@ -1,11 +0,0 @@
export default class ProfileColorsModel
{
bannerTop = "";
bannerBottom = "";
accent = "";
menu = "";
static createFromApiResult(apiResult){
return Object.assign(new ProfileColorsModel(), apiResult)
}
}

View File

@@ -1,15 +0,0 @@
export default class SocialNetworksModel
{
facebookUrl = "";
instagramUrl = "";
xUrl = "";
linkedInUrl = "";
tikTokUrl = "";
youtubeUrl = "";
redditUrl = "";
yourWebsiteUrl = "";
static createFromApiResult(apiResult){
return Object.assign(new SocialNetworksModel(), apiResult)
}
}

View File

@@ -1,10 +0,0 @@
export default class StoredDataUrlsModel
{
bannerPictureUrl = null;
profilePictureUrl = null;
websiteIconUrl = null;
static createFromApiResult(apiResult){
return Object.assign(new StoredDataUrlsModel(), apiResult)
}
}