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

Add Targeted Messaging Datasource #1975

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Conversation

hectorgomezv
Copy link
Member

@hectorgomezv hectorgomezv commented Sep 30, 2024

Summary

This adds a new datasource for the Targeted Messaging feature, consisting of the following persistence entities.

  • Outreach: a messaging campaign with name, start date, and end date.
  • Targeted Safe: an entity representing a Safe address targeted for a given Outreach.
  • Submission: a response to a given Outreach, given by a signer address of the Targeted Safe.

Changes

  • Adds a database migration to initialize the tables for each entity.
  • Adds a TargetedMessagingDatasource containing methods to interact with Outreaches, Targeted Safes, and Submissions.

@hectorgomezv hectorgomezv self-assigned this Sep 30, 2024
@coveralls
Copy link

coveralls commented Sep 30, 2024

Pull Request Test Coverage Report for Build 11106068331

Details

  • 42 of 67 (62.69%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 90.714%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/domain/targeted-messaging/entities/outreach.entity.ts 0 3 0.0%
src/domain/targeted-messaging/entities/targeted-safe.entity.ts 0 4 0.0%
src/domain/targeted-messaging/entities/create-outreach.dto.entity.ts 0 6 0.0%
src/domain/targeted-messaging/entities/create-targeted-safes.dto.entity.ts 0 6 0.0%
src/domain/targeted-messaging/entities/submission.entity.ts 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
src/routes/transactions/mappers/common/transaction-info.mapper.ts 1 54.61%
Totals Coverage Status
Change from base Build 11102081679: -0.2%
Covered Lines: 8468
Relevant Lines: 8970

💛 - Coveralls

@hectorgomezv hectorgomezv changed the title Add outreaches datasource Add Targeted Messaging Datasource Sep 30, 2024
@hectorgomezv hectorgomezv marked this pull request as ready for review September 30, 2024 10:58
@hectorgomezv hectorgomezv requested a review from a team as a code owner September 30, 2024 10:58
Comment on lines +42 to +43
created_at: outreach.created_at,
updated_at: outreach.updated_at,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should make these camel case for consistency? (I won't mark the others.)

Suggested change
created_at: outreach.created_at,
updated_at: outreach.updated_at,
createdAt: outreach.created_at,
updatedAt: outreach.updated_at,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue we would have with that is created_at is inherited from RowSchema, which defines those. Maybe at the domain level we could use Partial<> typescript types, and ignore the database-specific date-control fields, but that would require a general refactor. I'd let this as is for now, and re-evaluate the need for those fields after the ORM integration, wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine as is.

hectorgomezv and others added 2 commits September 30, 2024 14:26
…ce.spec.ts

Co-authored-by: Aaron Cook <aaron@safe.global>
…ce.spec.ts

Co-authored-by: Aaron Cook <aaron@safe.global>
@hectorgomezv hectorgomezv merged commit 9bf3ca6 into main Sep 30, 2024
18 checks passed
@hectorgomezv hectorgomezv deleted the add-outreaches-datasource branch September 30, 2024 13:42
PooyaRaki pushed a commit that referenced this pull request Oct 15, 2024
- Adds a database migration to initialize the tables for each entity.
- Adds a `TargetedMessagingDatasource` containing methods to interact with `Outreaches`, `Targeted Safes`, and `Submissions`.
PooyaRaki pushed a commit that referenced this pull request Oct 15, 2024
- Adds a database migration to initialize the tables for each entity.
- Adds a `TargetedMessagingDatasource` containing methods to interact with `Outreaches`, `Targeted Safes`, and `Submissions`.
DenSmolonski pushed a commit to Zilliqa/safe-client-gateway that referenced this pull request Oct 24, 2024
- Adds a database migration to initialize the tables for each entity.
- Adds a `TargetedMessagingDatasource` containing methods to interact with `Outreaches`, `Targeted Safes`, and `Submissions`.
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.

3 participants