Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

142 changes: 142 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config-server/target/classes/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.application.name=config-server
Binary file not shown.
8 changes: 8 additions & 0 deletions security/security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<artifactId>jjwt-impl</artifactId>
<version>0.11.5</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.5</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -60,6 +66,8 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>


</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.roba.security.Client;

import com.roba.security.Project.BudgetBasedOn;
import com.roba.security.Project.BudgetType;
import com.roba.security.Project.Project;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.antlr.v4.runtime.misc.NotNull;

import java.util.Date;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "Client")
public class Client {
@Id
@SequenceGenerator(
name = "client_id_sequence",
sequenceName = "client_id_sequence"
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "client_id_sequence"
)
private Integer id;

@Column(nullable = false)
private String name;

@Column(nullable = false)
private String email;

@NotNull
@OneToMany(mappedBy = "client", cascade = CascadeType.ALL)
private List<Project> projects;
private String phoneNumber;
private String emailAddress;
//private Budget budget;
private boolean billable;
private BudgetType budgetType;
private BudgetBasedOn budgetBasedOn;
private Double budgetCost;
private Double budgetNotifyAt;
private Date budgetStartDate;
private boolean budgetIncludeNonBillabeTime;
private Integer organizationId;
}
12 changes: 0 additions & 12 deletions security/security/src/main/java/com/roba/security/JwtService.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.roba.security.Project;

public enum BudgetBasedOn {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.roba.security.Project;

public enum BudgetType {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.roba.security.Project;



import com.roba.security.Client.Client;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.antlr.v4.runtime.misc.NotNull;

import java.util.Date;
//import javax.*;


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "Project")
public class Project {
@Id
@SequenceGenerator(
name = "project_id_sequence",
sequenceName = "project_id_sequence"
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "project_id_sequence"
)
private Integer id;
// @NotNull
private String projectName;
private boolean disableActivity;
private boolean disableIdleTime;
//private Integer clientId;
@ManyToOne
@JoinColumn(name = "client_id", nullable = false)
private Client client;
// @NotNull
//private Budget budget;
private boolean billable;
private BudgetType budgetType;
private BudgetBasedOn budgetBasedOn;
private Double budgetCost;
private Double budgetNotifyAt;
private Date budgetStartDate;
private boolean budgetIncludeNonBillabeTime;
// @NotNull
private Integer organizationId;
//members
//users
//managers
//CONSTRAINTS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.roba.security.Project;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Optional;

@Slf4j
@RestController
@RequestMapping("api/v1/project")
public record ProjectController(ProjectService projectService) {

@PostMapping
public void createProject(@RequestBody ProjectCreationRequest projectRequest){
System.out.printf("new project added {}", projectRequest);
projectService.createProject(projectRequest);
}
@PutMapping
public void editProject(@RequestBody ProjectEditRequest projectRequest){
//log.info("project edited {}", projectRequest);
projectService.editProject(projectRequest);
}
@GetMapping
public Optional<Project> findById(@RequestParam Integer id){
//log.info("find project {}", id);
return projectService.findById(id);
}


// @GetMapping("/{managerId}")
// public List<Project> findByManagerId(@PathVariable Integer managerId){
// //log.info("find project {}", id);
// return projectService.findAllByManager(managerId);
// }
@DeleteMapping
public void deleteProject(@RequestParam Integer id){
//log.info("project deleted {}", id);
projectService.deleteProject(id);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.roba.security.Project;



import com.roba.security.Client.Client;

import java.util.Date;

public record ProjectCreationRequest(
String projectName,
boolean disableActivity,
boolean disableIdleTime,
//Integer clientId,
Client client,
boolean billable,
BudgetType budgetType,
BudgetBasedOn budgetBasedOn,
Double budgetCost,
Double budgetNotifyAt,
Date budgetStartDate,
boolean budgetIncludeNonBillabeTime,
//Budget budget,
Integer organizationId
) {
}
Loading