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

Indev #1

Merged
merged 2 commits into from
Nov 20, 2022
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/main/resources/application-dev.properties
src/main/resources/application-test.properties
.idea
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

19 changes: 19 additions & 0 deletions .idea/compiler.xml

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

6 changes: 6 additions & 0 deletions .idea/encodings.xml

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

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

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

7 changes: 7 additions & 0 deletions .idea/jpa-buddy.xml

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

15 changes: 15 additions & 0 deletions .idea/misc.xml

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

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.twilio.sdk</groupId>
<artifactId>twilio</artifactId>
<version>9.1.3</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.precious.truecaller.data.dto.request;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@ToString
@Setter
@Getter
public class CallRequest {
@Size(min = 11, max = 14, message = "Phone number should be 11 numbers")
@NotNull(message = "please provide a mobile number, this cannot be null")
private String mobileNumber;
@Size(min = 1, max = 3, message = "Country code should be minimum of 1 number and maximum of 3 numbers")
@NotNull(message = "please provide a mobile number, this cannot be null")
private String countryCode;

public String getMobileNumber() {
return countryCode + mobileNumber;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ContactRequest {
private String email;

@Size(min = 11, max = 14, message = "Phone number should be 11 character")
@NotNull(message = "please provide a password, this cannot be null")
@NotNull(message = "please provide a mobile number, this cannot be null")
private String mobileNumber;

private String countryCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.precious.truecaller.data.models.call;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.precious.truecaller.data.models.mobile.MobileNumber;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
Expand All @@ -8,18 +9,19 @@
import java.time.LocalDate;
import java.util.List;

@Entity(name = "callers")
@Entity(name = "audio_callers")
@Setter
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Call {
public class AudioCall {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@OneToMany
private List<MobileNumber> mobileNumber;
@CreationTimestamp
private LocalDate dateCallWasMade;
@JsonFormat(pattern = "dd/MM/yyyy")
private LocalDate callDate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.precious.truecaller.data.models.call;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.precious.truecaller.data.models.user.Account;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.time.LocalDate;
import java.util.UUID;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name="video_caller")
public class VideoCall {
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
private Integer id;
@OneToOne
private Account user;
@CreationTimestamp
@JsonFormat(pattern = "dd/MM/yyyy")
private LocalDate videoCallDate;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.precious.truecaller.data.models.contact;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.precious.truecaller.data.models.mobile.MobileNumber;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
Expand Down Expand Up @@ -31,5 +32,6 @@ public class Contact {
private Boolean isBlocked = false;

@CreationTimestamp
@JsonFormat(pattern="dd/MM/yyyy")
private LocalDate dateCreated;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.precious.truecaller.data.models.message;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.precious.truecaller.data.models.contact.Contact;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
Expand All @@ -22,5 +23,6 @@ public class SmsMessage {
private String smsSender;
private String smsReceiver;
@CreationTimestamp
@JsonFormat(pattern = "dd/MM/yyyy")
private LocalDate dateCreated;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.precious.truecaller.data.models.mobile;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;

Expand All @@ -23,5 +24,6 @@ public class MobileNumber {
private String number;
private Boolean isBlocked = false;
@CreationTimestamp
@JsonFormat(pattern = "dd/MM/yyyy")
private LocalDateTime dateCreated;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ public class Account {
private Integer id;

@Column(unique = true)
private String userName;
private String firstName;

@Column(unique = true)
private String lastName;

@Column(unique = true)
private String email;

private String password;
@OneToOne
private MobileNumber mobileNumber;

@OneToMany(fetch = FetchType.EAGER)
private List<Contact> contact;
Expand All @@ -40,6 +45,9 @@ public class Account {
@OneToMany(fetch = FetchType.EAGER)
private Set<MobileNumber> blockedNumbers;

@Embedded
private Address userAddress;

@CreationTimestamp
private LocalDate lastAccessed;
}
Loading