podkrepi-bg / api

Nest.js REST backend for charity platform Podkrepi.bg https://podkrepi.bg/swagger
https://podkrepi.bg
MIT License
82 stars 43 forks source link

add helpUsImprove field to the backend #615

Closed kdachev97 closed 5 months ago

kdachev97 commented 5 months ago

This ticket is related to the frontend ticket: feature/add-tickbox-to-registration-field

Added the helpUsImprove field to the schema.prisma and register.dto.ts files as requested

github-actions[bot] commented 5 months ago

✅ Tests will run for this PR. Once they succeed it can be merged.

kdachev97 commented 5 months ago

Should I delete the previous migration?

На пн, 18.03.2024 г. в 14:01 Aleksandar Petkov @.***> написа:

@.**** requested changes on this pull request.

In schema.prisma https://github.com/podkrepi-bg/api/pull/615#discussion_r1528413880:

@@ -40,6 +40,7 @@ model Person { updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6) // Receive marketing notifications newsletter Boolean? @default(false)

  • helpUsImporve Boolean? @default(false)

Please fix the typo, as well as add @map("help_us_improve"), as we use snake_case for referencing db fields directly

helpUsImporve Boolean? @default(false) @map("help_us_improve")

Then re-execute the yarn prisma migrate dev and yarn format

— Reply to this email directly, view it on GitHub https://github.com/podkrepi-bg/api/pull/615#pullrequestreview-1942761954, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDTQ7QAMKIAKJ4RDPAXGY7DYY3JSBAVCNFSM6AAAAABE2J2UI2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNBSG43DCOJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

sashko9807 commented 5 months ago

Should I delete the previous migration?

It would be best if you can. As it will keep the migration folder more tidier.

Please fix the typo, as well as add @map("help_us_improve"), as we use snake_case for referencing db fields directly. Example:

helpUsImprove      Boolean?            @default(false) @map("help_us_improve")

Then re-execute the yarn prisma migrate dev and yarn format Once the commands from above are executed, please also fix the failing API test job due to missing helpUsImprove field in personMock.ts, e.g. just add helpUsImprove at the end of the object.

sashko9807 commented 5 months ago

Hmm. apparently I forgot to tell you to add the following line:

helpUsImprove: registerDto.helpUsImprove ? registerDto.helpUsImprove : false

to the person.upsert method here. Do yo mind adding it? Sorry for that.

kdachev97 commented 5 months ago

Do I need to run new migrations or is it just that?

На пн, 18.03.2024 г. в 19:19 Aleksandar Petkov @.***> написа:

Hmm. apparently I forgot to tell you to add the following line:

helpUsImprove: registerDto.helpUsImprove ? registerDto.helpUsImprove : false

to the person.upsert method here https://github.com/podkrepi-bg/api/blob/master/apps/api/src/auth/auth.service.ts#L295. Do yo mind adding it? Sorry for that.

— Reply to this email directly, view it on GitHub https://github.com/podkrepi-bg/api/pull/615#issuecomment-2004506871, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDTQ7QBH5O73GYSGC3Q3C4DYY4O2XAVCNFSM6AAAAABE2J2UI2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGUYDMOBXGE . You are receiving this because you authored the thread.Message ID: @.***>

sashko9807 commented 5 months ago

Do I need to run new migrations or is it just that?

Just that change. Everything regarding the migration is OK.