Skip to content
Snippets Groups Projects
Commit 331d9904 authored by Anders Montsko Austlid's avatar Anders Montsko Austlid
Browse files

Merge branch 'javadoc' into 'main'

Javadoc

See merge request idatt2106-v23-03/backend!237
parents ed93cffd 227f37ca
No related branches found
No related tags found
No related merge requests found
Showing
with 66 additions and 33 deletions
......@@ -7,7 +7,9 @@ import java.sql.Date;
* @param username the username of the user
* @param password the password of the user
* @param email the email of the user
*
* @param firstName the first name of the user
* @param lastName the last name of the user
* @param birthDate the birth date of the user
*/
public record RegisterUserRequest(String username, String password, String email, String firstName, String lastName,
Date birthDate){
......
......@@ -5,9 +5,6 @@ import java.util.List;
/**
* This class represents a request to update a user
* @author Birk
* @version 1.0
* @since 26.04.2023
*
* @param firstName the first name of the user
* @param lastName the last name of the user
......
package ntnu.idatt2016.v233.SmartMat.dto.request;
/**
* WasteRequest is a record class representing a request to add a product to a fridge.
* @param groupId the id of the group
* @param ean the ean of the product
* @param amount the amount of the product
* @param unit the unit of the product
*/
public record WasteRequest(long groupId, long ean, double amount, String unit) {
}
package ntnu.idatt2016.v233.SmartMat.dto.request.group;
/**
* ChangeAuthorityRequest is a record class representing a request to change the authority of a user in a group.
* @param username the username of the user
* @param groupId the id of the group
* @param authority the new authority of the user
*/
public record ChangeAuthorityRequest(String username, long groupId, String authority) {}
......@@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* This class represents a response for a weekly menu.
* This class represents an allergy response
*/
@Data
@Builder
......
......@@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* This class represents a response for a weekly menu.
* This class represents recipe details response
*/
@Data
@Builder
......
......@@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* This class represents a response for a weekly menu.
* This class represents recipe response with match count
*/
@Data
@Builder
......
......@@ -5,6 +5,9 @@ import ntnu.idatt2016.v233.SmartMat.entity.group.Group;
import java.util.List;
/**
* GroupDetailsResponse is a class representing a response containing details about a group.
*/
@Data
public class GroupDetailsResponse {
private long groupId;
......
package ntnu.idatt2016.v233.SmartMat.dto.response.group;
/**
* UserAuthorityInfo is a record class representing a response to a group request.
* @param username the username of the user
* @param authority the authority of the user
*/
public record UserAuthorityInfo(String username, String authority) {}
......@@ -17,10 +17,8 @@ import ntnu.idatt2016.v233.SmartMat.entity.user.User;
/**
* Recipe is an entity class representing a recipe in the system.
*
* @author Anders & Stian + Birk
* @version 1.1
* @since 25.04.2023
*
* @author Anders, Stian, Birk
* @version 1.7
*/
@NoArgsConstructor
......
......@@ -14,10 +14,8 @@ import java.util.List;
/**
* This class represents a shopping list
*
* @author Stian Lyng and Anders
* @version 1.0.001
* @since 19.04.2023
*
* @author Stian Lyng, Anders, Birk
* @version 1.3
*/
@NoArgsConstructor
......
......@@ -15,10 +15,8 @@ import java.sql.Timestamp;
/**
* This class represents a waste made by a group.
*
* @author Stian Lyng and Anders
* @version 1.0.001
* @since 19.04.2023
*
* @author Anders, Birk, Pedro
* @version 1.3
*/
@NoArgsConstructor
......
......@@ -11,6 +11,12 @@ import ntnu.idatt2016.v233.SmartMat.entity.product.Product;
import java.sql.Date;
/**
* FridgeProductAsso is an entity class representing a fridge product association.
*
* @author Birk, Pedro
* @version 1.1
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
......
......@@ -14,9 +14,8 @@ import java.util.List;
/**
* Achievement is an entity class representing an achievement in the system.
*
* @author Anders
* @version 1.0
* @since 19.04.2023
* @author Anders, Birk
* @version 1.1
*
*/
......
......@@ -20,7 +20,6 @@ import org.hibernate.annotations.OnDeleteAction;
*
* @author Anders & Birk
* @version 1.2
* @since 25.04.2023
*/
@NoArgsConstructor
......
......@@ -16,11 +16,10 @@ import java.util.ArrayList;
import java.util.List;
/**
* Group is an entity class representing a group in the system.
* Group is an entity class representing a user group in the system.
*
* @author Stian Lyng, Anders Austlid
* @version 1.0.1
* @since 20.04.2023
* @author Stian Lyng, Anders Austlid, Birk, Pedro
* @version 1.3
*/
@NoArgsConstructor
......
......@@ -9,9 +9,8 @@ import ntnu.idatt2016.v233.SmartMat.entity.user.User;
/**
* UserGroupTable is a class representing the user_group table in the database.
* It is used to represent the many-to-many relationship between users and groups.
* @Author Birk
* @Version 1.0
* @Since 25.04
* @Author Birk, Pedro
* @Version 1.2
*/
@Entity
@AllArgsConstructor
......
......@@ -10,6 +10,12 @@ import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Objects;
/**
* This class represents a user group id
*
* @author Birk
* @version 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
......@@ -21,7 +27,6 @@ public class UserGroupId implements Serializable {
@Column(name = "group_id")
private long groupId;
@Override
public boolean equals(Object o) {
if (this == o) return true;
......
......@@ -17,8 +17,6 @@ import java.util.List;
*
* @author Stian Lyng and Anders
* @version 1.3
* @since 24.04.2023
*
*/
@NoArgsConstructor
......@@ -62,6 +60,10 @@ public class Allergy{
}
/**
* adds a product to the allergy
* @param product adds a product to the list of products with this allergy
*/
public void addProduct(Product product) {
if (products == null)
products = new ArrayList<>();
......
......@@ -10,6 +10,12 @@ import lombok.NoArgsConstructor;
import java.util.List;
/**
* Category is an entity class representing a product category
*
* @author Pedro, Birk
* @version 1.1
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
......@@ -26,6 +32,10 @@ public class Category {
@JsonIgnore
private List<Product> products;
/**
* adds a product to the category
* @param product adds a product to the list of products in this category
*/
public void addProduct(Product product) {
if (products == null)
products = List.of(product);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment