Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-valero authored Jun 22, 2024
2 parents b513679 + 56aea13 commit 8ad4db9
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions client.http
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ Authorization: Bearer {{authToken}}
###

# @name fetchNearbyOrders

GET {{baseUrl}}/orders/{{firstCourierId}}/nearby?latitude={{currentLatitude}}&longitude={{currentLongitude}}
Content-Type: application/json
Authorization: Bearer {{authToken}}
Expand Down
28 changes: 28 additions & 0 deletions keys/private_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCb2arF98U+xNCi
Tid9aYct7r9IbTCYA2xj2f+evcIywms5agMSSYHH/rHSMi/IK+pHCxuEbPb2kH3Q
rg67QrrqP7YP/ZfIrZP9mh3QzxTanckFyAfvmVPlSXCH4wz4FTcXHk+k3wa0k3/5
/tt1uZlJ21+WzxD+qROkm1ONNCMdwCQXPXw9065fRZJTFuGZ9VcLESup7ZxEYidu
MnCDmShQ3xwiwGpnw7hOo+5aZYP62h4ZTrZVi76iNz8mAYG1k43PjLxIFwqb77Ad
fOSXkHeu314E2WZN5nJfO3qjFE8w5olEMF04jH+sikKA8FyMnsrVb9Dco71cRE9i
i5/Y25hNAgMBAAECggEAHygYA505tcd3dSceLmyBHY3n+DT5/L3cdqbPez7w2qBy
+qamqAqBc0fH6V9mnYQoAR1nmiUFhzvSJzyQzd90ih2ECnTWWgRXfGDJ2qN3hg/6
rtjzOzNiKgmxQT1DK7pkCc9huTJr/wAo2sPYQFQDINiGJtpNCbgn6OWzgZxdc9YU
ktemF6iT3S1Ggr+S60o4kHJIlKogMpOp/wnXMxuBTYlDA2my5TEYmTA8aXIc3fJU
UxrY2xtAbjH1vaR5dFD2lK5yrBXcOy5DxEdzm9ETlNgfJo4HRkrxwCzeSo01EzJm
zvTsP3FkiMuHUaSldG+kIp3A0wzSHBArEf63XntXWQKBgQDJme0Snp+Z1CJAp/8R
D45O27Q3cAo2R1BoZ8mMqEsMkxKmm43O8a07BPKy1qHezCDiCPpx9HxUsI+PdLVo
WHaaclzaoZLbV8WA0KMRhgP6/DY9/qb8FsKEh9CTxIWOyHXJZjLW0YjEbe6Ne1E/
no2Vr5OBlEGIjKlnopWbX/oGxQKBgQDF52JXWzj+dEOv7QHoXx65d6Wo1F9PXiYF
kWgAUlhBhR0aHVgHZ1/3aITXibanvHLWtt6izdf0my5HlvQ4BmxilY182J6a/u1V
1fvUf9wNrT1IUhqZiJJAniF1eCMbURihtf0cVeU0291hsWSSNWORzu/daT76gzri
3J/iu8yj6QKBgFOLhXJ859kgzx0KQaq5TpkhdTqwJJs/zHOn5x9yMr/ARy9iMU88
WjSmJUm1ppkk8M+bNuZ4kfmqvaOOkwrt9iClGhPEd46Mfh2W2K0PY6DkWjowyNSZ
Pf0cJ3TFMS/tpNpUjub1KH92qzBYlWAO/c+1ViSR4uKKoD2BZAxipsOdAoGANA3W
ag/Of+9o1l9Kvyo11KbJ5gxmPWQQMCq85kjCeglfTD0nqFrifRr6xg6tApWoxx02
li/6e5ZNp/rmpc3auFuJ6aq4nSAsoQU1xgETim1kzx75bCTmAyUUu+crpMXB6tcJ
imh1b1/dbRLR1zs/w1xg7yX9sLrPxFgvnd2zx/ECgYBkI7tpq1NVnWDGtt/JDHrR
Ukiuk7rJ8yCdxBLGFsDhF7QXIoSSPW5AATptEs3TVVNiRXmOHjzSiKVvp7h+zXe/
eb10OkfEuQYnZidPr1HyD3tqtcko3XK3fPGruXwX4SnM20Eh5JUJv+fQzzTZ136W
huL3jGmD0p3naEeDL6HZIA==
-----END PRIVATE KEY-----
1 change: 1 addition & 0 deletions keys/private_key_base64.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LS0tLS1CRUdJT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WdnA3aCt6WGUvDQplYjEwT2tmRXVRWW5aaWRQcjFIeUQzdHF0Y2tvM1hLM2ZQR3J1WHdYNFNuTTIwRWg1SlVKditmUXp6VFoxMzZXDQpodUwzakdtRDBwM25hRWVETDZIWklBPT0NCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0NCg==
9 changes: 9 additions & 0 deletions keys/public_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm9mqxffFPsTQok4nfWmH
Le6/SG0wmANsY9n/nr3CMsJrOWoDEkmBx/6x0jIvyCvqRwsbhGz29pB90K4Ou0K6
6j+2D/2XyK2T/Zod0M8U2p3JBcgH75lT5Ulwh+MM+BU3Fx5PpN8GtJN/+f7bdbmZ
Sdtfls8Q/qkTpJtTjTQjHcAkFz18PdOuX0WSUxbhmfVXCxErqe2cRGInbjJwg5ko
UN8cIsBqZ8O4TqPuWmWD+toeGU62VYu+ojc/JgGBtZONz4y8SBcKm++wHXzkl5B3
rt9eBNlmTeZyXzt6oxRPMOaJRDBdOIx/rIpCgPBcjJ7K1W/Q3KO9XERPYouf2NuY
TQIDAQAB
-----END PUBLIC KEY-----
1 change: 1 addition & 0 deletions keys/public_key_base64.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0NCk1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbTltcXhmZkZQc1RRb2s0bmZXbUgNCkxlNi9TRzB3bUFOc1k5bi9ucjNDTXNKck9Xb0RFa21CeC82eDBqSXZ5Q3ZxUndzYmhHejI5cEI5MEs0T3UwSzYNCjZqKzJELzJYeUsyVC9ab2QwTThVMnAzSkJjZ0g3NWxUNVVsd2grTU0rQlUzRng1UHBOOEd0Sk4vK2Y3YmRibVoNClNkdGZsczhRL3FrVHBKdFRqVFFqSGNBa0Z6MThQZE91WDBXU1V4YmhtZlZYQ3hFcnFlMmNSR0luYmpKd2c1a28NClVOOGNJc0JxWjhPNFRxUHVXbVdEK3RvZUdVNjJWWXUrb2pjL0pnR0J0Wk9OejR5OFNCY0ttKyt3SFh6a2w1QjMNCnJ0OWVCTmxtVGVaeVh6dDZveFJQTU9hSlJEQmRPSXgvcklwQ2dQQmNqSjdLMVcvUTNLTzlYRVJQWW91ZjJOdVkNClRRSURBUUFCDQotLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0NCg==
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { OrderCourierCollectedEvent } from '../events/order-courier-collected-ev
import z from 'zod'
import { OrderAlreadyCollectedError } from '@/core/errors/errors/order-errors/order-already-collected-error'


export const orderPropsSchema = z.object({
recipientId: uniqueEntityIdInstanceSchema,
courierId: uniqueEntityIdInstanceSchema.nullable(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ export class PrismaUpdateOrderMapper {
}

static domainToPrisma(update: UpdateOrder): PrismaUpdates {

const changes = JSON.stringify({
before: update.changes.before.toJson(),
after: update.changes.after.toJson(),
})


const prismaUpdate: PrismaUpdates = {
changes,
date: update.date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { OrderIsClosedError } from '@/core/errors/errors/order-errors/order-is-c
import { InternalServerError } from '@/core/errors/errors/internal-server-error'
import { OrderAlreadyCollectedError } from '@/core/errors/errors/order-errors/order-already-collected-error'


const paramsSchema = z.object({
id: z.string().uuid(),
})
Expand Down Expand Up @@ -62,6 +63,7 @@ export class CollectOrderController {
if (value instanceof UnauthorizedError) {
throw new UnauthorizedException({ message: value.message })
}

if (value instanceof OrderAlreadyCollectedError) {
throw new BadRequestException({ message: value.message })
}
Expand Down

0 comments on commit 8ad4db9

Please sign in to comment.