Skip to content

Commit

Permalink
working on added basic boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Kemosalamy committed May 8, 2024
1 parent a62b1cd commit c0e981e
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 5 deletions.
34 changes: 31 additions & 3 deletions services/contracts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<maven.compiler.target>21</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand All @@ -36,17 +40,41 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.19.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<version>1.19.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>rabbitmq</artifactId>
<version>1.19.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.workup.contracts.commands;

import com.workup.shared.commands.contracts.requests.EvaluateMilestoneRequest;

import com.workup.shared.commands.contracts.responses.EvaluateMilestoneResponse;

public class EvaluateMilestoneCommand
extends ContractCommand<EvaluateMilestoneRequest, EvaluateMilestoneResponse> {

@Override
public EvaluateMilestoneResponse Run(EvaluateMilestoneRequest request) {
// First we will get the milestones and add them to the database first,
// This will allow us to have their IDs for when we insert the contract.

return null;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.workup.contracts.commands;

import com.workup.shared.commands.contracts.requests.EvaluateMilestoneRequest;

import com.workup.shared.commands.contracts.requests.GetContractRequest;
import com.workup.shared.commands.contracts.responses.EvaluateMilestoneResponse;
import com.workup.shared.commands.contracts.responses.GetContractResponse;

public class GetContractCommand
extends ContractCommand<GetContractRequest, GetContractResponse> {

@Override
public GetContractResponse Run(GetContractRequest request) {
// First we will get the milestones and add them to the database first,
// This will allow us to have their IDs for when we insert the contract.

return null;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.workup.contracts.commands;

import com.workup.shared.commands.contracts.requests.EvaluateMilestoneRequest;

import com.workup.shared.commands.contracts.requests.GetContractRequest;
import com.workup.shared.commands.contracts.requests.GetMilestoneRequest;
import com.workup.shared.commands.contracts.responses.EvaluateMilestoneResponse;
import com.workup.shared.commands.contracts.responses.GetContractResponse;
import com.workup.shared.commands.contracts.responses.GetMilestoneResponse;

public class GetMilestoneCommand
extends ContractCommand<GetMilestoneRequest, GetMilestoneResponse> {

@Override
public GetMilestoneResponse Run(GetMilestoneRequest request) {
// First we will get the milestones and add them to the database first,
// This will allow us to have their IDs for when we insert the contract.

return null;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.workup.contracts.commands;

import com.workup.shared.commands.contracts.requests.EvaluateMilestoneRequest;

import com.workup.shared.commands.contracts.requests.GetContractRequest;
import com.workup.shared.commands.contracts.requests.GetMilestoneRequest;
import com.workup.shared.commands.contracts.requests.GetPendingTerminationsRequest;
import com.workup.shared.commands.contracts.responses.EvaluateMilestoneResponse;
import com.workup.shared.commands.contracts.responses.GetContractResponse;
import com.workup.shared.commands.contracts.responses.GetMilestoneResponse;
import com.workup.shared.commands.contracts.responses.GetPendingTerminationsResponse;

public class GetPendingTerminationsCommand
extends ContractCommand<GetPendingTerminationsRequest, GetPendingTerminationsResponse> {

@Override
public GetPendingTerminationsResponse Run(GetPendingTerminationsRequest request) {
// First we will get the milestones and add them to the database first,
// This will allow us to have their IDs for when we insert the contract.

return null;

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.workup.contracts.commands;

import com.workup.shared.commands.contracts.requests.EvaluateMilestoneRequest;

import com.workup.shared.commands.contracts.requests.ProgressMilestoneRequest;
import com.workup.shared.commands.contracts.responses.EvaluateMilestoneResponse;
import com.workup.shared.commands.contracts.responses.ProgressMilestoneResponse;

public class ProgressMilestoneCommand
extends ContractCommand<ProgressMilestoneRequest, ProgressMilestoneResponse> {

@Override
public ProgressMilestoneResponse Run(ProgressMilestoneRequest request) {
// First we will get the milestones and add them to the database first,
// This will allow us to have their IDs for when we insert the contract.

return null;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Jacksonized
public class Milestone {

private final String milestoneId; // Not Needed when initiating contract, make it null
private final String milestoneId; // Not needed when initiating contract, make it null
private final String contractId; // Not needed when initiating contract, make it null

private final String description;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.workup.shared.commands.contracts.requests;

import com.workup.shared.commands.CommandRequest;
import com.workup.shared.enums.contracts.TerminationRequestStatus;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

// PURPOSE : To fulfill the need for the read of CRUD for our contract repository
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetContractRequest extends CommandRequest {
private final String contractId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.workup.shared.commands.contracts.requests;

import com.workup.shared.commands.CommandRequest;
import com.workup.shared.enums.contracts.TerminationRequestStatus;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

// PURPOSE : To fulfill the need for the read of CRUD for our milestone repository
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetMilestoneRequest extends CommandRequest {

private final String milestoneId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.workup.shared.commands.contracts.requests;

import com.workup.shared.commands.CommandRequest;
import com.workup.shared.enums.contracts.TerminationRequestStatus;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

// PURPOSE : To fulfill the need for the read of CRUD for our terminations repository
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetPendingTerminationsRequest extends CommandRequest {
private final String contractId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class EvaluatedMilestoneResponse extends CommandResponse {}
public class EvaluateMilestoneResponse extends CommandResponse {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.workup.shared.commands.contracts.responses;

import com.workup.shared.commands.CommandResponse;
import com.workup.shared.enums.contracts.ContractState;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

import java.util.List;
import java.util.UUID;

@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetContractResponse extends CommandResponse {
private final String contractId;
private String jobTitle;
private String jobId;
private String proposalId;
private String freelancerId;
private String clientId;
private List<String> milestonesIds;
private ContractState status;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.workup.shared.commands.contracts.responses;

import com.workup.shared.commands.CommandResponse;
import com.workup.shared.commands.contracts.Milestone;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetMilestoneResponse extends CommandResponse {
private final Milestone milestone;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.workup.shared.commands.contracts.responses;

import com.workup.shared.commands.CommandResponse;
import com.workup.shared.commands.contracts.Milestone;
import com.workup.shared.enums.contracts.TerminationRequestStatus;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

import java.util.UUID;

@Getter
@SuperBuilder(setterPrefix = "with")
@Jacksonized
public class GetPendingTerminationsResponse extends CommandResponse {
private String requestId;

private String contractId;
private String requesterId;
private String reason;

private TerminationRequestStatus status;
}

0 comments on commit c0e981e

Please sign in to comment.