Skip to content

feat(Devices): Categories, models and makers for known devices#49

Merged
risixdzn merged 9 commits into
developfrom
rick/feat/devices
Jun 12, 2026
Merged

feat(Devices): Categories, models and makers for known devices#49
risixdzn merged 9 commits into
developfrom
rick/feat/devices

Conversation

@risixdzn

Copy link
Copy Markdown
Member
  • Scraped devices from GSMArena, LaptopMedia and DisplayResolutions at devices.etl
  • Around 8k devices: about 4500 phones, tablets, smartwatches, 2k laptops and the rest being tvs and monitors.
  • Created tables to hold scraped data+ CRUD routes for that.
image

risixdzn added 8 commits May 27, 2026 14:15
…used columns

- Flatten modelMinimalListSelect to fix 500 error with nested selects + $dynamic()
- Remove imageLocalPath and imageUrl references (columns dropped from DB)
- Source primary image from model_images table; return presigned URL as imageUrl
- Remove originalUrl from model_images response, schema, and insert
- Add batch queryPrimaryImages + generateImagePresignedUrl helpers
- Add "Available" status fallback for null status in all model endpoints
- Add 416 code to httpStatusCodes to fix page_out_of_bounds serialization
- Create migration 0010 for FULLTEXT index on models (name, models_text, ...)
@risixdzn risixdzn changed the base branch from main to develop May 31, 2026 22:55
@risixdzn risixdzn requested review from Copilot and felipemartinezmelo and removed request for felipemartinezmelo May 31, 2026 22:58
@risixdzn risixdzn requested a review from Sofia-Freitas54 May 31, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 56 out of 56 changed files in this pull request and generated 11 comments.

Comment thread packages/schemas/src/models.ts Outdated
Comment on lines +348 to +350
const model = await ModelsRepository.queryModelBySlug(
modelId,
userJwt.company.id
Comment on lines +422 to +425
const model = await ModelsRepository.queryModelBySlug(
modelId,
userJwt.company.id
);
Comment on lines +472 to +475
const model = await ModelsRepository.queryModelBySlug(
modelId,
userJwt.company.id
);
Comment on lines +533 to +536
const model = await ModelsRepository.queryModelBySlug(
modelId,
userJwt.company.id
);
Comment thread packages/db/package.json Outdated
"db:generate": "bunx --bun drizzle-kit generate",
"db:studio": "bunx --bun drizzle-kit studio",
"db:migrate": "tsx src/migrate.ts",
"db:seed": "bun src/seed.ts",
@@ -0,0 +1 @@
ALTER TABLE `models` ADD FULLTEXT INDEX `models_fulltext_idx` (`name`, `models_text`, `chipset`, `cpu`, `internal_memory`, `os`);
Comment on lines +296 to +303
static async attachPresignedUrlsToImages(
images: ModelImageSelect[]
): Promise<(ModelImageSelect & { presignedUrl: string })[]> {
return await Promise.all(
images.map(async (img) => {
const r2Key = img.r2Key as string;
const presignedUrl = await generatePresignedGetUrl(r2Key);
return { ...img, presignedUrl };

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Use Nullable<>

description: `
**Creates a model image record, linking an uploaded file to a device model.**

Provide the \`r2Key\` (and optional \`originalUrl\`) returned from the presign upload endpoint. Returns the created model image with a presigned URL.
Comment on lines +83 to +86
slugCompanyUnique: unique("slug_company_unique").on(
table.slug,
table.companyId
),

@Sofia-Freitas54 Sofia-Freitas54 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

showw, bem completinho. Só dá uma olhada no que o copilot sugeriu em alguns commits, ver se eh valido ou nao. No mais tá otimo

@risixdzn

Copy link
Copy Markdown
Member Author

Related #50

@risixdzn risixdzn changed the title feat(Devices): Categories, models and makers for known devices feat(Devices): Categories, models and makers for known devices #50 Jun 11, 2026
@risixdzn risixdzn changed the title feat(Devices): Categories, models and makers for known devices #50 feat(Devices): Categories, models and makers for known devices Jun 11, 2026
@risixdzn risixdzn merged commit bf9c8c3 into develop Jun 12, 2026
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