Repository navigation
OM-536: Inicio de trabajo #173
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
699f432
OM-536: Inicio de trabajo
Benjakr04 be847d0
OM-536: nueva migracion
Benjakr04 88694fd
OM-536: fix 1
Benjakr04 63d610f
OM-536: fix 2
Benjakr04 0e6a363
OM-536: fix 3
Benjakr04 805ce3d
OM-536: fix 4
Benjakr04 f5d5b7e
OM-536: fix 5
Benjakr04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20260528123758_allow_multiple_checked_out_carts/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* | ||
| Warnings: | ||
|
|
||
| - A unique constraint covering the columns `[fk_user,fk_store,cart_status]` on the table `Carts` will be added. If there are existing duplicate values, this will fail. | ||
|
|
||
| */ | ||
| -- DropIndex | ||
| DROP INDEX "Carts_fk_user_fk_store_cart_status_key"; | ||
|
|
||
| -- CreateIndex | ||
| CREATE UNIQUE INDEX "Carts_fk_user_fk_store_cart_status_key" ON "Carts"("fk_user", "fk_store", "cart_status") WHERE ("cart_status" = 'ACTIVE'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| // src/docs/schemas/users/cart.schema.js | ||
|
|
||
| export const cartSchemas = { | ||
| CartItem: { | ||
| type: "object", | ||
| properties: { | ||
| id: { type: "integer", example: 1 }, | ||
| quantity: { type: "integer", example: 2 }, | ||
| product: { | ||
| type: "object", | ||
| properties: { | ||
| id: { type: "integer", example: 10 }, | ||
| name: { type: "string", example: "Laptop Dell" }, | ||
| price: { type: "number", example: 1500000 }, | ||
| originalPrice: { type: "number", example: 1500000 }, | ||
| offerPrice: { type: "number", nullable: true, example: 1350000 }, | ||
| isOffer: { type: "boolean", example: true }, | ||
| imageUrl: { type: "string", nullable: true, example: "https://cdn.example.com/products/10/image.jpg" } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| CartCommerceInfo: { | ||
| type: "object", | ||
| properties: { | ||
| id: { type: "integer", example: 1 }, | ||
| name: { type: "string", example: "Electrónica Carlos" }, | ||
| logo: { type: "string", nullable: true, example: "https://cdn.example.com/stores/1/logo.jpg" } | ||
| } | ||
| }, | ||
|
|
||
| Cart: { | ||
| type: "object", | ||
| properties: { | ||
| id: { type: "integer", example: 5 }, | ||
| storeId: { type: "integer", example: 1 }, | ||
| commerce: { $ref: "#/components/schemas/CartCommerceInfo" }, | ||
| status: { type: "string", example: "ACTIVE" }, | ||
| items: { | ||
| type: "array", | ||
| items: { $ref: "#/components/schemas/CartItem" } | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| GetCartsResponse: { | ||
| type: "object", | ||
| properties: { | ||
| carts: { | ||
| type: "array", | ||
| items: { $ref: "#/components/schemas/Cart" } | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| DeleteCartResponse: { | ||
| type: "object", | ||
| properties: { | ||
| success: { type: "boolean", example: true }, | ||
| message: { type: "string", example: "Carrito eliminado correctamente" } | ||
| } | ||
| }, | ||
|
|
||
| DeleteAllCartsResponse: { | ||
| type: "object", | ||
| properties: { | ||
| success: { type: "boolean", example: true }, | ||
| message: { type: "string", example: "Todos los carritos fueron eliminados correctamente" } | ||
| } | ||
| }, | ||
|
|
||
| CartErrorResponse: { | ||
| type: "object", | ||
| properties: { | ||
| message: { type: "string", example: "Carrito no encontrado" } | ||
| } | ||
| }, | ||
|
|
||
| CartValidationError: { | ||
| type: "object", | ||
| properties: { | ||
| message: { | ||
| type: "string", | ||
| example: "No tienes permisos para eliminar este carrito" | ||
| } | ||
| } | ||
| } | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.