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

Upload API Prep Part 2: Refactor database and api to new table format #35

Open
wants to merge 3 commits into
base: feature/26-upload-api-part-1
Choose a base branch
from

Conversation

francisduvivier
Copy link
Collaborator

  • Includes adding and using the sql-template-tag package, for increased safety and readability of sql code.
  • Includes putting domain layer between api and db, ddd style

@francisduvivier francisduvivier changed the title Refactor database and api to new table format Refactor database and api to new table format, resolves 26 Nov 27, 2024
@francisduvivier francisduvivier changed the title Refactor database and api to new table format, resolves 26 Refactor database and api to new table format Nov 27, 2024
@francisduvivier francisduvivier changed the title Refactor database and api to new table format Refactor database and api to new table format, resolves #26 Nov 27, 2024
@francisduvivier francisduvivier changed the title Refactor database and api to new table format, resolves #26 Resolves #26, Refactor database and api to new table format Nov 27, 2024
@francisduvivier francisduvivier changed the title Resolves #26, Refactor database and api to new table format Upload API Prep Part 2: Refactor database and api to new table format Nov 27, 2024
Francis Duvivier added 2 commits November 28, 2024 00:33
…ot duplicating data

We also make a layer between the API and the database in the style of DDD
In order to write more readable queries, we also introduce the sql-template-tag library here
Copy link

github-actions bot commented Nov 27, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 34.93% 523 / 1497
🔵 Statements 34.93% 523 / 1497
🔵 Functions 55.69% 44 / 79
🔵 Branches 82.14% 46 / 56
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
migrations/20241116085102-initialize.js 0% 0% 0% 0% 1-59
src/auth/jwt.ts 0% 0% 0% 0% 1-110
src/controllers/private-rest.ts 77.77% 100% 0% 77.77% 12-13
src/controllers/public-rest.ts 37.5% 100% 22.22% 37.5% 42-43, 50-61, 68-78, 85-89, 96-101, 108-111, 118-122
src/db/BadgeHubDataPostgresAdapter.ts 28.57% 100% 27.27% 28.57% 35-39, 42-43, 47-79, 82-83, 86-91, 94-98, 120-152, 155-168
src/db/DBTypes.ts 100% 100% 100% 100%
src/db/models/DBBadge.ts 100% 100% 100% 100%
src/db/models/DBProjectStatusOnBadge.ts 100% 100% 100% 100%
src/db/models/app/DBAppMetadataJSON.ts 100% 100% 100% 100%
src/db/models/app/DBCategory.ts 100% 100% 100% 100%
src/db/models/app/DBDatedData.ts 100% 100% 100% 100%
src/db/models/app/DBFileMetadata.ts 100% 100% 100% 100%
src/db/models/app/DBProject.ts 100% 100% 100% 100%
src/db/models/app/DBUser.ts 100% 100% 100% 100%
src/db/models/app/DBVersion.ts 100% 100% 100% 100%
src/db/models/app/DBVersionedDependency.ts 100% 100% 100% 100%
src/db/models/app/DBVote.ts 100% 100% 100% 100%
src/db/models/app/DBVoteFromUser.ts 100% 100% 100% 100%
src/db/models/app/DBWarning.ts 100% 100% 100% 100%
src/db/models/app/DBWarningFromUser.ts 100% 100% 100% 100%
src/db/models/app/relations/ProjectHasCollaborators.ts 100% 100% 100% 100%
src/db/models/app/relations/ProjectHasVotes.ts 100% 100% 100% 100%
src/db/models/app/relations/ProjectHasWarnings.ts 100% 100% 100% 100%
src/db/models/app/relations/VersionHasFiles.ts 100% 100% 100% 100%
src/db/sqlHelpers/dbDates.ts 53.12% 50% 50% 53.12% 11-12, 30-36, 39-44
src/db/sqlHelpers/projectQuery.ts 13.51% 100% 0% 13.51% 12-36, 39-68
src/domain/BadgeHubDataPort.ts 100% 100% 100% 100%
src/domain/readModels/Badge.ts 100% 100% 100% 100%
src/domain/readModels/ProjectStatusOnBadge.ts 100% 100% 100% 100%
src/domain/readModels/app/AppMetadataJSON.ts 100% 100% 100% 100%
src/domain/readModels/app/Category.ts 100% 100% 100% 100%
src/domain/readModels/app/DatedData.ts 100% 100% 100% 100%
src/domain/readModels/app/FileMetadata.ts 100% 100% 100% 100%
src/domain/readModels/app/Project.ts 100% 100% 100% 100%
src/domain/readModels/app/User.ts 100% 100% 100% 100%
src/domain/readModels/app/Version.ts 100% 100% 100% 100%
src/domain/readModels/app/VoteFromUser.ts 100% 100% 100% 100%
src/domain/readModels/app/WarningFromUser.ts 100% 100% 100% 100%
src/generated/routes.ts 60.99% 66.66% 20% 60.99% 375-376, 388-417, 426-460, 469-507, 518-555, 566-609, 620-651, 662-699, 710-741
Generated in workflow #69 for commit a94a1e4 by the Vitest Coverage Report Action

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.

Update DB to match proposed App Metadata Schema and Improve type safety
1 participant