Skip to content

Commit 0fb2ec5

Browse files
diazos1john
authored andcommitted
PB-393. Add creation date to API transaction object.
1 parent 117ca77 commit 0fb2ec5

7 files changed

Lines changed: 86 additions & 8 deletions

File tree

sdk/src/main/java/com/silanis/esl/api/model/BasePackage.java

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public class BasePackage extends Entity
6161
public static final String FIELD_UPDATED = "updated";
6262
@JsonIgnore
6363
public static final String FIELD_VISIBILITY = "visibility";
64+
@JsonIgnore
65+
public static final String FIELD_CREATED = "created";
6466

6567
// Empty Constructor
6668
public BasePackage ( ) {}
@@ -85,6 +87,7 @@ public BasePackage ( ) {}
8587
protected String _type = "PACKAGE";
8688
protected java.util.Date _updated;
8789
protected String _visibility = "ACCOUNT";
90+
protected java.util.Date _created;
8891

8992
// Accessors
9093

@@ -160,7 +163,7 @@ public BasePackage setDescription( String value ){
160163
// Used internally by aws. Invokes a the corresponding setter if the value is not null
161164
@JsonIgnore
162165
public BasePackage safeSetDescription( String value ){
163-
if ( value != null ) { this.setDescription( value ); }
166+
if ( value != null ) { this.setDescription(value); }
164167
return this;
165168
}
166169
public String getDescription(){
@@ -265,7 +268,7 @@ public BasePackage setLanguage( String value ){
265268
// Used internally by aws. Invokes a the corresponding setter if the value is not null
266269
@JsonIgnore
267270
public BasePackage safeSetLanguage( String value ){
268-
if ( value != null ) { this.setLanguage( value ); }
271+
if ( value != null ) { this.setLanguage(value); }
269272
return this;
270273
}
271274
public String getLanguage(){
@@ -344,7 +347,7 @@ public BasePackage setNotarized( Boolean value ){
344347
// Used internally by aws. Invokes a the corresponding setter if the value is not null
345348
@JsonIgnore
346349
public BasePackage safeSetNotarized( Boolean value ){
347-
if ( value != null ) { this.setNotarized( value ); }
350+
if ( value != null ) { this.setNotarized(value); }
348351
return this;
349352
}
350353
public Boolean getNotarized(){
@@ -537,6 +540,25 @@ public BasePackage safeSetVisibility( String value ){
537540
public String getVisibility(){
538541
return _visibility;
539542
}
540-
541-
543+
544+
545+
@JsonDeserialize(using = JsonDateDeserializer.class)
546+
public BasePackage setCreated( java.util.Date value ){
547+
SchemaSanitizer.throwOnNull(FIELD_CREATED, value);
548+
this._created = value;
549+
setDirty(FIELD_CREATED);
550+
return this;
551+
}
552+
// Used internally by aws. Invokes a the corresponding setter if the value is not null
553+
@JsonIgnore
554+
public BasePackage safeSetCreated( java.util.Date value ){
555+
if ( value != null ) { this.setCreated( value ); }
556+
return this;
557+
}
558+
559+
@JsonSerialize(using = JsonDateSerializer.class)
560+
public java.util.Date getCreated(){
561+
return _created;
562+
}
563+
542564
}

sdk/src/main/java/com/silanis/esl/api/model/Layout.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public class Layout extends BaseTemplate
5757
public static final String FIELD_UPDATED = "updated";
5858
@JsonIgnore
5959
public static final String FIELD_VISIBILITY = "visibility";
60+
@JsonIgnore
61+
public static final String FIELD_CREATED = "created";
6062

6163
// Empty Constructor
6264
public Layout ( ) {}
@@ -392,6 +394,18 @@ public Layout safeSetVisibility( String value ){
392394
if ( value != null ) { this.setVisibility( value ); }
393395
return this;
394396
}
395-
397+
398+
@JsonDeserialize(using = JsonDateDeserializer.class)
399+
@Override
400+
public Layout setCreated( java.util.Date value ){
401+
super.setCreated(value);
402+
return this;
403+
}
404+
// Used internally by aws. Invokes a the corresponding setter if the value is not null
405+
@JsonIgnore
406+
public Layout safeSetCreated( java.util.Date value ){
407+
if ( value != null ) { this.setCreated( value ); }
408+
return this;
409+
}
396410

397411
}

sdk/src/main/java/com/silanis/esl/api/model/Package.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class Package extends BasePackage
6464
public static final String FIELD_UPDATED = "updated";
6565
@JsonIgnore
6666
public static final String FIELD_VISIBILITY = "visibility";
67+
@JsonIgnore
68+
public static final String FIELD_CREATED = "created";
6769

6870
// Empty Constructor
6971
public Package ( ) {}
@@ -445,6 +447,17 @@ public Package safeSetVisibility( String value ){
445447
if ( value != null ) { this.setVisibility( value ); }
446448
return this;
447449
}
448-
450+
451+
@JsonDeserialize(using = JsonDateDeserializer.class)
452+
@Override
453+
public Package setCreated( java.util.Date value ){
454+
super.setCreated(value);
455+
return this;
456+
}
457+
@JsonIgnore
458+
public Package safeSetCreated( java.util.Date value ){
459+
if ( value != null ) { this.setCreated( value ); }
460+
return this;
461+
}
449462

450463
}

sdk/src/main/java/com/silanis/esl/api/model/Template.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public class Template extends BaseTemplate
5757
public static final String FIELD_UPDATED = "updated";
5858
@JsonIgnore
5959
public static final String FIELD_VISIBILITY = "visibility";
60+
@JsonIgnore
61+
public static final String FIELD_CREATED = "created";
6062

6163
// Empty Constructor
6264
public Template ( ) {}
@@ -391,6 +393,18 @@ public Template safeSetVisibility( String value ){
391393
if ( value != null ) { this.setVisibility( value ); }
392394
return this;
393395
}
394-
396+
397+
@JsonDeserialize(using = JsonDateDeserializer.class)
398+
@Override
399+
public Template setCreated( java.util.Date value ){
400+
super.setCreated(value);
401+
return this;
402+
}
403+
// Used internally by aws. Invokes a the corresponding setter if the value is not null
404+
@JsonIgnore
405+
public Template safeSetCreated( java.util.Date value ){
406+
if ( value != null ) { this.setCreated( value ); }
407+
return this;
408+
}
395409

396410
}

sdk/src/main/java/com/silanis/esl/sdk/DocumentPackage.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class DocumentPackage implements Serializable {
2020
private String description;
2121
private Date expiryDate;
2222
private Date updatedDate;
23+
private Date createdDate;
2324
private String packageMessage;
2425
private Boolean notarized;
2526
private Boolean trashed;
@@ -208,6 +209,15 @@ public Date getUpdatedDate() {
208209
return updatedDate;
209210
}
210211

212+
213+
public Date getCreatedDate() {
214+
return createdDate;
215+
}
216+
217+
public void setCreatedDate(Date createdDate) {
218+
this.createdDate = createdDate;
219+
}
220+
211221
/**
212222
* Sets the package message
213223
*

sdk/src/main/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ else if ( role.getSigners().get( 0 ).getGroup() != null ) {
244244
if (apiPackage.getUpdated() != null) {
245245
documentPackage.setUpdatedDate(apiPackage.getUpdated());
246246
}
247+
if (apiPackage.getCreated() != null) {
248+
documentPackage.setCreatedDate(apiPackage.getCreated());
249+
}
247250

248251
return documentPackage;
249252
}

sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverterTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public void convertAPIToSDK() {
107107
assertThat("Message status was not correctly set", apiPackage1.getMessages().get(0).getStatus().toString(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getStatus().toString())));
108108
assertThat("Message content was not correctly set", apiPackage1.getMessages().get(0).getContent(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getContent())));
109109
assertThat("Sender email address was not correctly set", apiPackage1.getSender().getEmail(), is(equalTo(sdkDocumentPackage1.getSenderInfo().getEmail())));
110+
assertThat("Creation date was not correctly set", apiPackage1.getCreated(), is(sdkDocumentPackage1.getCreatedDate()));
110111
}
111112

112113
@Override
@@ -159,6 +160,7 @@ private com.silanis.esl.api.model.Package createTypicalAPIDocumentPackage() {
159160
apiDocumentPackage.setDue(new Date());
160161
apiDocumentPackage.setName("API package name");
161162
apiDocumentPackage.setStatus(PackageStatus.DRAFT.getApiValue());
163+
apiDocumentPackage.setCreated(new Date());
162164

163165
Message apiMessage = new Message();
164166
apiMessage.setContent("opt-out reason");

0 commit comments

Comments
 (0)