Skip to content

Commit d40987f

Browse files
committed
update
1 parent fbc835e commit d40987f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/api/functions/auditLog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ type AuditLogParams = {
1616
function buildMarshalledAuditLogItem(entry: AuditLogEntry) {
1717
const baseNow = Date.now();
1818
const timestamp = Math.floor(baseNow / 1000);
19-
const expireAt =
19+
const expiresAt =
2020
timestamp +
2121
Math.floor((AUDIT_LOG_RETENTION_DAYS * 24 * 60 * 60 * 1000) / 1000);
2222

2323
return marshall(
2424
{
2525
...entry,
2626
createdAt: timestamp,
27-
expireAt,
27+
expiresAt,
2828
},
2929
{ removeUndefinedValues: true },
3030
);

terraform/modules/dynamo/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ resource "aws_dynamodb_table" "app_audit_log" {
1616
type = "N"
1717
}
1818
ttl {
19-
attribute_name = "expireAt"
19+
attribute_name = "expiresAt"
2020
enabled = false
2121
}
2222
}

tests/unit/functions/auditLog.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe("Audit Log Transaction tests", () => {
5353
vi.spyOn(Date, 'now').mockReturnValue(mockTimestamp);
5454

5555
const timestamp = Math.floor(mockTimestamp / 1000);
56-
const expireAt = timestamp + Math.floor((365 * 24 * 60 * 60 * 1000) / 1000);
56+
const expiresAt = timestamp + Math.floor((365 * 24 * 60 * 60 * 1000) / 1000);
5757

5858
// Create test payload
5959
const payload = {
@@ -68,7 +68,7 @@ describe("Audit Log Transaction tests", () => {
6868
const expectedItem = marshall({
6969
...payload,
7070
createdAt: timestamp,
71-
expireAt: expireAt
71+
expiresAt: expiresAt
7272
});
7373

7474
// Call the function being tested
@@ -90,7 +90,7 @@ describe("Audit Log Transaction tests", () => {
9090
vi.spyOn(Date, 'now').mockReturnValue(mockTimestamp);
9191

9292
const timestamp = Math.floor(mockTimestamp / 1000);
93-
const expireAt = timestamp + Math.floor((365 * 24 * 60 * 60 * 1000) / 1000);
93+
const expiresAt = timestamp + Math.floor((365 * 24 * 60 * 60 * 1000) / 1000);
9494

9595
// Create test payload with only required fields
9696
const payload = {
@@ -103,7 +103,7 @@ describe("Audit Log Transaction tests", () => {
103103
const expectedItem = marshall({
104104
...payload,
105105
createdAt: timestamp,
106-
expireAt: expireAt
106+
expiresAt: expiresAt
107107
});
108108

109109
// Call the function being tested

0 commit comments

Comments
 (0)