Skip to content

refactor: unset contacts from accounts #124

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
54fd51e
feat(core): add ContactsRepository with persist, find and update methods
esaugomez31 Apr 28, 2025
ebf7f83
feat: graphql accountContactUpsert mutation, initial version
esaugomez31 Apr 30, 2025
ce36e1a
chore: file to updated and add contact renamed
esaugomez31 Apr 30, 2025
944a87f
refactor: move contact storage from accounts collection to dedicated …
esaugomez31 May 7, 2025
d4211b6
feat(core): migrate-contacts-to-collection
esaugomez31 May 8, 2025
d7a1b6b
test(core|e2e): test upsert contact mutation
esaugomez31 May 8, 2025
63e5ba3
chore: renaming mutation accountContactUpsert to contactCreate
esaugomez31 May 9, 2025
573bf20
chore: renamin contact with upsert references
esaugomez31 May 9, 2025
9ddf452
refactor: referencing the contacts collection in accounts object
esaugomez31 May 12, 2025
5b1db89
refactor(graphql): rename Contact.identifier to handle and Contact.al…
esaugomez31 Jun 19, 2025
10d91fe
refactor(contacts): clean schema and rename repository methods
esaugomez31 Jun 23, 2025
f8ed4ee
refactor(contacts): clean up embedded contacts after migration
esaugomez31 Jun 23, 2025
4c37475
refactor(graphql): rename contact-create.ts to contact.ts to match ob…
esaugomez31 Jun 23, 2025
600fb23
refactor(contacts): unify contact creation logic and align with app c…
esaugomez31 Jun 24, 2025
7a9751e
refactor(account): remove contact query from translateToAccount
esaugomez31 Jun 24, 2025
89ae4b8
chore(migration): move contacts unset operation to separate migration
esaugomez31 Jul 3, 2025
255e73b
refactor(domain): unify handle validation and remove casts from domai…
esaugomez31 Jul 3, 2025
c541cd6
fix: rebase solve conflicts
esaugomez31 Aug 7, 2025
edb4119
fix(apps): solve conflicts
esaugomez31 Aug 7, 2025
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
2 changes: 1 addition & 1 deletion apps/consent/app/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2346,4 +2346,4 @@ export function useGetUserIdSuspenseQuery(baseOptions?: Apollo.SkipToken | Apoll
export type GetUserIdQueryHookResult = ReturnType<typeof useGetUserIdQuery>;
export type GetUserIdLazyQueryHookResult = ReturnType<typeof useGetUserIdLazyQuery>;
export type GetUserIdSuspenseQueryHookResult = ReturnType<typeof useGetUserIdSuspenseQuery>;
export type GetUserIdQueryResult = Apollo.QueryResult<GetUserIdQuery, GetUserIdQueryVariables>;
export type GetUserIdQueryResult = Apollo.QueryResult<GetUserIdQuery, GetUserIdQueryVariables>;
2 changes: 1 addition & 1 deletion apps/map/services/galoy/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2360,4 +2360,4 @@ export function useBusinessMapMarkersSuspenseQuery(baseOptions?: Apollo.SkipToke
export type BusinessMapMarkersQueryHookResult = ReturnType<typeof useBusinessMapMarkersQuery>;
export type BusinessMapMarkersLazyQueryHookResult = ReturnType<typeof useBusinessMapMarkersLazyQuery>;
export type BusinessMapMarkersSuspenseQueryHookResult = ReturnType<typeof useBusinessMapMarkersSuspenseQuery>;
export type BusinessMapMarkersQueryResult = Apollo.QueryResult<BusinessMapMarkersQuery, BusinessMapMarkersQueryVariables>;
export type BusinessMapMarkersQueryResult = Apollo.QueryResult<BusinessMapMarkersQuery, BusinessMapMarkersQueryVariables>;
2 changes: 1 addition & 1 deletion apps/pay/lib/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3016,4 +3016,4 @@ export function usePriceSubscription(baseOptions: Apollo.SubscriptionHookOptions
return Apollo.useSubscription<PriceSubscription, PriceSubscriptionVariables>(PriceDocument, options);
}
export type PriceSubscriptionHookResult = ReturnType<typeof usePriceSubscription>;
export type PriceSubscriptionResult = Apollo.SubscriptionResult<PriceSubscription>;
export type PriceSubscriptionResult = Apollo.SubscriptionResult<PriceSubscription>;
17 changes: 17 additions & 0 deletions core/api/src/migrations/20250702204019-remove-embedded-contacts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
module.exports = {
async up(db) {
console.log("Removing embedded contacts from accounts...")

const result = await db.collection("accounts").updateMany(
{},
{ $unset: { contacts: "" } }
)

console.log(`Unset contacts field in ${result.modifiedCount} accounts`)
},

async down() {
return true
},
}
Loading