Skip to content

feat: add timestamp header helper for public creator responses#99

Merged
Chucks1093 merged 5 commits intoaccesslayerorg:mainfrom
johnsmccain:main
Apr 3, 2026
Merged

feat: add timestamp header helper for public creator responses#99
Chucks1093 merged 5 commits intoaccesslayerorg:mainfrom
johnsmccain:main

Conversation

@johnsmccain
Copy link
Copy Markdown
Contributor

Summary

Adds a small utility for attaching X-Response-Timestamp headers to public creator-facing responses, and fixes the Prisma multi-file schema client generation that was blocking the build.

Changes

src/utils/timestamp-headers.utils.ts (new)

Centralizes timestamp header logic in one place:

  • RESPONSE_TIMESTAMP_HEADER — the header name constant
  • formatTimestampHeader(date?) — pure formatter, returns ISO 8601 string
  • attachTimestampHeader(res, date?) — sets the header on an Express response

src/modules/creators/creators.controllers.ts

Calls attachTimestampHeader(res) before sendSuccess in both httpListCreators and httpGetCreatorStats.

src/modules/creator/creator.controller.ts

Calls attachTimestampHeader(res) before sendSuccess in listCreators.

prisma/schema/schema.prisma

Added previewFeatures = ["prismaSchemaFolder"] to the generator block so prisma generate picks up all model files (user.prisma, creator.prisma, wallet.prisma) when pointed at the schema directory. Without this the generated client was missing all models and the build failed.

How to test

pnpm prisma generate --schema=prisma/schema
pnpm run build

Any public creator list or stats response will now include an X-Response-Timestamp header with the current UTC time in ISO 8601 format.

Commits

  • 826af55 feat: add timestamp header helper for public creator responses
  • 6ea35d1 fix: enable prismaSchemaFolder to include all model files in client generation

Close #77

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@johnsmccain Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Copy link
Copy Markdown
Contributor

@johnsmccain fix merge conflicts

@johnsmccain
Copy link
Copy Markdown
Contributor Author

Done

@Chucks1093
Copy link
Copy Markdown
Contributor

@johnsmccain fix merge conflict and send link to the group. Check issue description for link

@johnsmccain
Copy link
Copy Markdown
Contributor Author

Okay sir, done

@Chucks1093 Chucks1093 merged commit e9930cf into accesslayerorg:main Apr 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add creator response timestamp header helper

2 participants