Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/project #253

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2ff5b0b
add gitignore file #84
Anamml001 Feb 23, 2024
a004287
add prework files#17
Anamml001 Feb 23, 2024
8d7c5f4
add liveshare files #63
Anamml001 Feb 23, 2024
47df264
move objects to their branch
Anamml001 Feb 26, 2024
cc99c7e
delate carrito de la compra #17
Anamml001 Feb 26, 2024
15d2919
add apocalipsis-clock #135
Anamml001 Apr 22, 2024
f357c5d
add fix develop branch
Anamml001 Apr 23, 2024
9261f32
add readme of my project #252
Anamml001 May 4, 2024
3f32f5e
add schema in data, and add registerAdmin, registerUser and authentic…
Anamml001 May 6, 2024
3ffbec1
prove tests in api, and loginUser.js, registerUser.js, home.js of log…
Anamml001 May 8, 2024
2b3b26e
add createPost.js and removePost.js in logic and test of the api #252
Anamml001 May 9, 2024
b29b31c
implement the logic and test of api with retrievePosts.js and modifyP…
Anamml001 May 9, 2024
7d68d43
implement the logic in app: reatePost.js, removePost.js, retrievePost…
Anamml001 May 10, 2024
61628b5
correct any errors in the app and api, and implement createComment.js…
Anamml001 May 14, 2024
be96fc1
implement logic of the api: retrieveComment, removeComment, modifyCom…
Anamml001 May 16, 2024
3e89f4a
implement logic of app(createComment.js, retrieveComment.js, modifyCo…
Anamml001 May 22, 2024
7933584
implement toggleLikePost.js in the logic in api and implement compone…
Anamml001 May 23, 2024
066f560
change token expired; and change images and text of recurses, and any…
Anamml001 May 24, 2024
153db6c
implement form.reset in contact.js and change any errors #252
Anamml001 May 27, 2024
f73ebec
implement the author in the comments in post.jsx, and change any styl…
Anamml001 Jun 5, 2024
deac202
change gitignore #252
Anamml001 Jun 6, 2024
3d3d535
change styles and img of bizum #252
Anamml001 Jun 6, 2024
bccd12d
change number of telephone of Whatssap in components #252
Anamml001 Jun 6, 2024
14881da
change number of whtassap in components #252
Anamml001 Jun 6, 2024
8c76666
change logo of web and change styles of any bottons #252
Anamml001 Jun 7, 2024
ec77858
add stile en el background of the app #252
Anamml001 Jun 7, 2024
fae982b
implement createProduct.js and retrieveProducts.js with the test in l…
Anamml001 Jun 11, 2024
848eee9
implement removeProduct.js and modifyProduct.js with the test in logi…
Anamml001 Jun 11, 2024
e21db4f
implement in logic of api: createOrder.js and createOrder.test.js, an…
Anamml001 Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions staff/ana-maria-moya/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
node_modules
8 changes: 8 additions & 0 deletions staff/ana-maria-moya/liveshare/app/.vite/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hash": "8fdc3953",
"configHash": "dad0571b",
"lockfileHash": "e3b0c442",
"browserHash": "c5db3649",
"optimized": {},
"chunks": {}
}
3 changes: 3 additions & 0 deletions staff/ana-maria-moya/liveshare/app/.vite/deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Empty file.
2 changes: 2 additions & 0 deletions staff/ana-maria-moya/project/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.envCopy
.env
154 changes: 154 additions & 0 deletions staff/ana-maria-moya/project/api/data/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import mongoose from 'mongoose'

const { Schema, model } = mongoose

const { Types: { ObjectId } } = Schema

const user = new Schema({
name: {
type: String,
required: true
},
surname: {
type: String,
required: true
},
birthdate: {
type: Date,
required: true
},
email: {
type: String,
required: true
},
password: {
type: String,
required: true
},
role: {
type: String,
required: true,
enum: ['regular', 'admin'],
default: 'regular'
}
})

const post = new Schema({
author: {
type: ObjectId,
required: true,
ref: 'User'
},
title: {
type: String,
required: true,
},
image: {
type: String,
},
video: {
type: String,
},
text: {
type: String,
required: true
},
date: {
type: Date,
required: true,
},
likes: {
type: [{ type: ObjectId, ref: 'User' }]
}
})

const comment = new Schema({
post: {
type: ObjectId,
required: true,
ref: 'Post',
},
author: {
type: ObjectId,
required: true,
ref: 'User'
},
text: {
type: String,
required: true,
},
date: {
type: Date,
required: true
}

})

const product = new Schema({
name: {
type: String,
required: true
},
image: {
type: String,
required: true
},
description: {
type: String,
required: true,

},
stock: {
type: Number,
required: true
},
price: {
type: Number,
required: true
}

})

const item = new Schema({
product: product,
quantity: {
type: Number,
default: 1,
required: true
}
})

const cart = new Schema({
items: [item]
})

const order = new Schema({
buyer: {
type: ObjectId,
required: true,
ref: 'User'
},
cart: cart,
date: {
type: Date,
required: true
}
})

const User = model('User', user)
const Post = model('Post', post)
const Comment = model('Comment', comment)
const Product = model('Product', product)
const Item = model('Item', item)
const Cart = model('Cart', cart)
const Order = model('Order', order)

export {
User,
Post,
Comment,
Product,
Order,
Cart,
Item
}
Loading