From 12284dfb772f89412435c3769576109193387323 Mon Sep 17 00:00:00 2001 From: lerian-studio Date: Tue, 24 Feb 2026 12:53:02 +0000 Subject: [PATCH 1/4] chore(release): Update CHANGELOG --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a093eb7..4d7dd4b9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,91 @@ +## [v3.5.2] - 2026-02-24 + +### ✨ Features +- add idempotency cache retrieval for transactions with unit tests +- implement idempotency key mapping for transactions and add caching mechanism + +### 🐛 Bug Fixes +- update release version +- update version +- suppress gosec G706 false positive on sanitized log input +- remove no-op semantic-release/exec plugin entry +- linting +- add write-behind cache mock expectations to existing transaction tests +- update deps +- remove filterStaleBalances to prevent silent balance update drops +- add redis backup queue for commit/cancel transactions and correct consumer fromTo logic for canceled status +- prevent balance version increment when no actual balance change occurs in Lua script +- replace broken itoa helper with strconv.Itoa for multi-digit support +- remove unused validateTransactionExists function from Redis Lua script +- return updated balance atomically via RETURNING instead of separate read-after-write +- go.sum +- update sqlmock expectations to include balance version columns +- loop through all state transitions in CheckHealth to handle cold-start connections +- adjust semantic release flow +- releaserc +- remove write-behind lookup from RevertTransaction to prevent FK violations +- remove publisher confirms +- skip write-behind update in sync mode to prevent orphaned Redis entries +- fix: add TTL safety nets and correct write-behind cache lifecycle +- add SetNX revert lock with write-behind-first lookup to prevent duplicate reversals +- remove idempotency reverse lookup in favor of write-behind cache +- promote transaction status to APPROVED before write-behind and queue +- resolve async transaction 404 by implementing write-behind cache +- implement NullFields tracking in account updates to support JSON Merge Patch semantics +- race condition, test and remove panic from rabbit initialization +- update RabbitMQ producer to handle publish confirmations and improve idempotency key management +- update version to 3.3.14 +- define explicit column lists for account and operation queries to ensure backward compatibility +- update hotfix version to 3.3.13 +- implement account alias sanitization in transaction processing and add utility function for alias cleanup +- simplify GitHub Actions workflow by removing hotfix branch triggers and updating tag handling +- update hotfix version from 3.3.11 to 3.3.12 in .releaserc.yml and comment out transaction validation in Lua script +- remove trailing newline at end of Dockerfile for consistent formatting +- change release type for feat from minor to patch in .releaserc.yml +- update application version from 3.3.10 to 3.3.11 in .env.example +- add missing newline at end of Dockerfile for proper formatting +- update hotfix version from 3.3.10 to 3.3.11 in .releaserc.yml +- enhance balance key handling in Redis consumer to ensure default key is used when not specified +- update group size in Lua script and add balance key handling in Redis consumer +- remove trailing newline in Dockerfile for cleaner formatting +- update lib-commons dependency to v2.3.1 in go.mod and go.sum +- update CronTimeToRun and MessageTimeOfLife constants in Redis consumer for improved processing efficiency +- remove handleReturns method and update message publishing parameters in RabbitMQ producer +- implement distributed lock mechanism in Redis consumer to prevent duplicate transaction processing across pods +- add default balance key handling in operation model and update balance structure in Redis consumer +- reduce CronTimeToRun and MessageTimeOfLife constants in Redis consumer to improve responsiveness +- add logging and handle unroutable messages in RabbitMQ producer +- change ContentType to application/octet-stream for msgpack binary payload in RabbitMQ producer +- update lib-commons dependency to v2.3.1 and update go.sum +- add transaction validation in Lua script and enhance error handling in Redis consumer +- enhance error handling for transaction backup cache operations +- add complexity comment +- initialize operations slice for new transactions in PostgreSQL repository +- simplify logging for duplicate operation and transaction inserts +- refactor operation scanning in transaction retrieval to improve handling of nullable fields +- handle nil operation ID in transaction retrieval to prevent nil pointer dereference +- handle unique constraint violations for operation and transaction inserts +- update hotfix branch version to 3.3.10 +- add panic recovery and nil validation for transaction messages in Redis consumer +- remove lock deletion on transaction errors after balance retrieval +- update hotfix branch version to 3.3.9 +- remove pending transaction lock after errors only +- update next version to 15.5.7 and react to 19.1.2 +- update releaserc.yml to version 3.3.8 +- update next version to 15.5.7 and react to 19.1.2 +- correct comment wording in transaction handler for clarity +- update hotfix branch configuration in release settings +- update version + +### 🔧 Maintenance +- Update GitHub Actions workflow to ignore workflow files and remove trigger from hotfix branches. +- update release configuration to remove hotfix branch and rename to maintenance branch +- Update CHANGELOG +- configuring pipe to trigger build on hotfix branches +- configuring pipe to trigger build on hotfix branches +- configuring pipe to trigger build on hotfix branches + + ## [v3.5.1] - 2026-01-19 ### 🐛 Bug Fixes From 4cd4f651e6fdaa46791e180787e4d3838eaf7ece Mon Sep 17 00:00:00 2001 From: Ygohr Medeiros Date: Mon, 9 Mar 2026 13:39:45 -0300 Subject: [PATCH 2/4] fix: restore description field to CRM Address model --- components/crm/Dockerfile | 2 +- components/crm/api/crm_docs.go | 8 +++- components/crm/api/crm_swagger.json | 8 +++- components/crm/api/crm_swagger.yaml | 10 ++++- components/crm/api/openapi.yaml | 23 ++++++++++- .../adapters/mongodb/holder/holder.go | 28 ++++++------- .../adapters/mongodb/holder/holder_test.go | 32 +++++++++++++++ components/ledger/Dockerfile | 2 +- components/onboarding/Dockerfile | 2 +- components/transaction/Dockerfile | 2 +- go.mod | 20 +++++----- go.sum | 40 +++++++++---------- pkg/mmodel/organization.go | 7 +++- pkg/mmodel/organization_test.go | 39 +++++++++++++++--- 14 files changed, 164 insertions(+), 59 deletions(-) diff --git a/components/crm/Dockerfile b/components/crm/Dockerfile index 0faea1475..0b300bd60 100644 --- a/components/crm/Dockerfile +++ b/components/crm/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1.4 -FROM --platform=$BUILDPLATFORM golang:1.25.1-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25.8-alpine AS builder WORKDIR /crm-app diff --git a/components/crm/api/crm_docs.go b/components/crm/api/crm_docs.go index c88b4cad7..22ff20b2f 100644 --- a/components/crm/api/crm_docs.go +++ b/components/crm/api/crm_docs.go @@ -938,6 +938,12 @@ const docTemplatecrm = `{ "minLength": 2, "example": "US" }, + "description": { + "description": "A descriptive label for the address (e.g., \"Home\", \"Office\", \"Billing\")\nexample: Home\nmaxLength: 100", + "type": "string", + "maxLength": 100, + "example": "Home" + }, "line1": { "description": "Primary address line (street address or PO Box)\nexample: 123 Financial Avenue\nmaxLength: 256", "type": "string", @@ -1183,7 +1189,7 @@ const docTemplatecrm = `{ ] }, "document": { - "description": "The holder’s identification document.", + "description": "The holder's identification document.", "type": "string", "example": "91315026015" }, diff --git a/components/crm/api/crm_swagger.json b/components/crm/api/crm_swagger.json index 48a216013..04f7f2f2f 100644 --- a/components/crm/api/crm_swagger.json +++ b/components/crm/api/crm_swagger.json @@ -932,6 +932,12 @@ "minLength": 2, "example": "US" }, + "description": { + "description": "A descriptive label for the address (e.g., \"Home\", \"Office\", \"Billing\")\nexample: Home\nmaxLength: 100", + "type": "string", + "maxLength": 100, + "example": "Home" + }, "line1": { "description": "Primary address line (street address or PO Box)\nexample: 123 Financial Avenue\nmaxLength: 256", "type": "string", @@ -1177,7 +1183,7 @@ ] }, "document": { - "description": "The holder’s identification document.", + "description": "The holder's identification document.", "type": "string", "example": "91315026015" }, diff --git a/components/crm/api/crm_swagger.yaml b/components/crm/api/crm_swagger.yaml index 81db26d84..6d3405a2c 100644 --- a/components/crm/api/crm_swagger.yaml +++ b/components/crm/api/crm_swagger.yaml @@ -23,6 +23,14 @@ definitions: maxLength: 2 minLength: 2 type: string + description: + description: |- + A descriptive label for the address (e.g., "Home", "Office", "Billing") + example: Home + maxLength: 100 + example: Home + maxLength: 100 + type: string line1: description: |- Primary address line (street address or PO Box) @@ -210,7 +218,7 @@ definitions: - $ref: '#/definitions/Contact' description: Object with contact information. document: - description: The holder’s identification document. + description: The holder's identification document. example: "91315026015" type: string externalId: diff --git a/components/crm/api/openapi.yaml b/components/crm/api/openapi.yaml index bfd8034c7..97fc577c6 100644 --- a/components/crm/api/openapi.yaml +++ b/components/crm/api/openapi.yaml @@ -768,6 +768,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -790,6 +791,14 @@ components: maxLength: 2 minLength: 2 type: string + description: + description: |- + A descriptive label for the address (e.g., "Home", "Office", "Billing") + example: Home + maxLength: 100 + example: Home + maxLength: 100 + type: string line1: description: |- Primary address line (street address or PO Box) @@ -830,6 +839,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -837,6 +847,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -844,6 +855,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1086,7 +1098,7 @@ components: description: Object with contact information. type: object document: - description: The holder’s identification document. + description: The holder's identification document. example: "91315026015" type: string externalId: @@ -1139,6 +1151,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1146,6 +1159,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1153,6 +1167,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1641,6 +1656,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1648,6 +1664,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1655,6 +1672,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1696,6 +1714,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1703,6 +1722,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue @@ -1710,6 +1730,7 @@ components: country: US zipCode: "10001" city: New York + description: Home state: NY line2: Suite 1500 line1: 123 Financial Avenue diff --git a/components/crm/internal/adapters/mongodb/holder/holder.go b/components/crm/internal/adapters/mongodb/holder/holder.go index 29bfa7501..bd95a1ceb 100644 --- a/components/crm/internal/adapters/mongodb/holder/holder.go +++ b/components/crm/internal/adapters/mongodb/holder/holder.go @@ -261,13 +261,13 @@ func mapAddressFromEntity(a *mmodel.Address) *AddressMongoDBModel { } return &AddressMongoDBModel{ - Line1: &a.Line1, - Line2: a.Line2, - ZipCode: &a.ZipCode, - City: &a.City, - State: &a.State, - Country: &a.Country, - // Description: &a.Description, // TODO: Check if this is needed + Line1: &a.Line1, + Line2: a.Line2, + ZipCode: &a.ZipCode, + City: &a.City, + State: &a.State, + Country: &a.Country, + Description: a.Description, } } @@ -476,12 +476,12 @@ func mapAddressToEntity(a *AddressMongoDBModel) *mmodel.Address { } return &mmodel.Address{ - Line1: line1, - Line2: a.Line2, - ZipCode: zipCode, - City: city, - State: state, - Country: country, - // Description: a.Description, + Line1: line1, + Line2: a.Line2, + ZipCode: zipCode, + City: city, + State: state, + Country: country, + Description: a.Description, } } diff --git a/components/crm/internal/adapters/mongodb/holder/holder_test.go b/components/crm/internal/adapters/mongodb/holder/holder_test.go index cee095b91..1a276b692 100644 --- a/components/crm/internal/adapters/mongodb/holder/holder_test.go +++ b/components/crm/internal/adapters/mongodb/holder/holder_test.go @@ -400,6 +400,19 @@ func TestMapAddressFromEntity(t *testing.T) { }, wantNil: false, }, + { + name: "address with description", + address: &mmodel.Address{ + Line1: "789 Office Blvd", + Line2: testutils.Ptr("Suite 200"), + ZipCode: "54321", + City: "Business City", + State: "BC", + Country: "US", + Description: testutils.Ptr("Corporate Office"), + }, + wantNil: false, + }, } for _, tt := range tests { @@ -417,6 +430,9 @@ func TestMapAddressFromEntity(t *testing.T) { assert.Equal(t, tt.address.City, *result.City) assert.Equal(t, tt.address.State, *result.State) assert.Equal(t, tt.address.Country, *result.Country) + if tt.address.Description != nil { + assert.Equal(t, *tt.address.Description, *result.Description) + } }) } } @@ -456,6 +472,19 @@ func TestMapAddressToEntity(t *testing.T) { }, wantNil: false, }, + { + name: "model with description", + model: &AddressMongoDBModel{ + Line1: testutils.Ptr("321 Home Lane"), + Line2: testutils.Ptr("Unit 5"), + ZipCode: testutils.Ptr("11111"), + City: testutils.Ptr("Hometown"), + State: testutils.Ptr("HT"), + Country: testutils.Ptr("US"), + Description: testutils.Ptr("Primary Residence"), + }, + wantNil: false, + }, } for _, tt := range tests { @@ -473,6 +502,9 @@ func TestMapAddressToEntity(t *testing.T) { } else { assert.Empty(t, result.Line1) } + if tt.model.Description != nil { + assert.Equal(t, *tt.model.Description, *result.Description) + } }) } } diff --git a/components/ledger/Dockerfile b/components/ledger/Dockerfile index 002d417ed..4dcb368fe 100644 --- a/components/ledger/Dockerfile +++ b/components/ledger/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.25.1-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25.8-alpine AS builder WORKDIR /ledger-app diff --git a/components/onboarding/Dockerfile b/components/onboarding/Dockerfile index 7456074c5..6a4545bbb 100644 --- a/components/onboarding/Dockerfile +++ b/components/onboarding/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.25.1-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25.8-alpine AS builder WORKDIR /onboarding-app diff --git a/components/transaction/Dockerfile b/components/transaction/Dockerfile index bc01443ee..94da6b952 100644 --- a/components/transaction/Dockerfile +++ b/components/transaction/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM golang:1.25.1-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.25.8-alpine AS builder WORKDIR /transaction-app diff --git a/go.mod b/go.mod index a8424c582..3b659f711 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/LerianStudio/midaz/v3 go 1.24.2 -toolchain go1.25.5 +toolchain go1.25.8 require ( github.com/LerianStudio/lib-auth/v2 v2.3.0 @@ -11,7 +11,7 @@ require ( github.com/antlr4-go/antlr/v4 v4.13.1 github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 - github.com/gofiber/fiber/v2 v2.52.11 + github.com/gofiber/fiber/v2 v2.52.12 github.com/jackc/pgx/v5 v5.8.0 github.com/lib/pq v1.10.9 github.com/pkg/errors v0.9.1 // indirect @@ -23,7 +23,7 @@ require ( github.com/swaggo/swag v1.16.6 github.com/testcontainers/testcontainers-go v0.40.0 github.com/vmihailenco/msgpack/v5 v5.4.1 - go.mongodb.org/mongo-driver v1.17.6 + go.mongodb.org/mongo-driver v1.17.7 go.opentelemetry.io/otel v1.39.0 go.opentelemetry.io/otel/trace v1.39.0 go.uber.org/mock v0.6.0 @@ -62,7 +62,7 @@ require ( github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/golang-migrate/migrate/v4 v4.19.1 // indirect github.com/google/s2a-go v0.1.9 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.9 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect github.com/googleapis/gax-go/v2 v2.16.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.4 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect @@ -92,14 +92,14 @@ require ( go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/mod v0.32.0 // indirect - golang.org/x/net v0.48.0 // indirect - golang.org/x/oauth2 v0.34.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/oauth2 v0.35.0 // indirect golang.org/x/text v0.33.0 // indirect golang.org/x/time v0.14.0 // indirect golang.org/x/tools v0.40.0 // indirect - google.golang.org/api v0.259.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect + google.golang.org/api v0.260.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect ) @@ -151,7 +151,7 @@ require ( github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.46.0 // indirect + golang.org/x/crypto v0.47.0 // indirect golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect golang.org/x/sync v0.19.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index c8317a0ea..861fe4a3e 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,8 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-redsync/redsync/v4 v4.15.0 h1:KH/XymuxSV7vyKs6z1Cxxj+N+N18JlPxgXeP6x4JY54= github.com/go-redsync/redsync/v4 v4.15.0/go.mod h1:qNp+lLs3vkfZbtA/aM/OjlZHfEr5YTAYhRktFPKHC7s= github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= -github.com/gofiber/fiber/v2 v2.52.11 h1:5f4yzKLcBcF8ha1GQTWB+mpblWz3Vz6nSAbTL31HkWs= -github.com/gofiber/fiber/v2 v2.52.11/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw= +github.com/gofiber/fiber/v2 v2.52.12 h1:0LdToKclcPOj8PktUdIKo9BUohjjwfnQl42Dhw8/WUw= +github.com/gofiber/fiber/v2 v2.52.12/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw= github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang-migrate/migrate/v4 v4.19.1 h1:OCyb44lFuQfYXYLx1SCxPZQGU7mcaZ7gH9yH4jSFbBA= @@ -172,8 +172,8 @@ github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.9 h1:TOpi/QG8iDcZlkQlGlFUti/ZtyLkliXvHDcyUIMuFrU= -github.com/googleapis/enterprise-certificate-proxy v0.3.9/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= +github.com/googleapis/enterprise-certificate-proxy v0.3.11 h1:vAe81Msw+8tKUxi2Dqh/NZMz7475yUvmRIkXr4oN2ao= +github.com/googleapis/enterprise-certificate-proxy v0.3.11/go.mod h1:RFV7MUdlb7AgEq2v7FmMCfeSMCllAzWxFgRdusoGks8= github.com/googleapis/gax-go/v2 v2.16.0 h1:iHbQmKLLZrexmb0OSsNGTeSTS0HO4YvFOG8g5E4Zd0Y= github.com/googleapis/gax-go/v2 v2.16.0/go.mod h1:o1vfQjjNZn4+dPnRdl/4ZD7S9414Y4xA+a/6Icj6l14= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -351,8 +351,8 @@ github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= -go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.mongodb.org/mongo-driver v1.17.7 h1:a9w+U3Vt67eYzcfq3k/OAv284/uUUkL0uP75VE5rCOU= +go.mongodb.org/mongo-driver v1.17.7/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 h1:2nKw2ZXZOC0N8RBsBbYwGwfKR7kJWzzyCZ6QfUGW/es= @@ -405,8 +405,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= -golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -423,10 +423,10 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= +golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -455,8 +455,8 @@ golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= -golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= +golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= +golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -480,14 +480,14 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/api v0.259.0 h1:90TaGVIxScrh1Vn/XI2426kRpBqHwWIzVBzJsVZ5XrQ= -google.golang.org/api v0.259.0/go.mod h1:LC2ISWGWbRoyQVpxGntWwLWN/vLNxxKBK9KuJRI8Te4= +google.golang.org/api v0.260.0 h1:XbNi5E6bOVEj/uLXQRlt6TKuEzMD7zvW/6tNwltE4P4= +google.golang.org/api v0.260.0/go.mod h1:Shj1j0Phr/9sloYrKomICzdYgsSDImpTxME8rGLaZ/o= google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 h1:GvESR9BIyHUahIb0NcTum6itIWtdoglGX+rnGxm2934= google.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:yJ2HH4EHEDTd3JiLmhds6NkJ17ITVYOdV3m3VKOnws0= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3 h1:X9z6obt+cWRX8XjDVOn+SZWhWe5kZHm46TThU9j+jss= +google.golang.org/genproto/googleapis/api v0.0.0-20260114163908-3f89685c29c3/go.mod h1:dd646eSK+Dk9kxVBl1nChEOhJPtMXriCcVb4x3o6J+E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 h1:C4WAdL+FbjnGlpp2S+HMVhBeCq2Lcib4xZqfPNF6OoQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= diff --git a/pkg/mmodel/organization.go b/pkg/mmodel/organization.go index 6619bc356..cb06b39da 100644 --- a/pkg/mmodel/organization.go +++ b/pkg/mmodel/organization.go @@ -237,13 +237,18 @@ type Address struct { // minLength: 2 // maxLength: 2 Country string `json:"country" example:"US" minLength:"2" maxLength:"2"` // According to ISO 3166-1 alpha-2 + + // A descriptive label for the address (e.g., "Home", "Office", "Billing") + // example: Home + // maxLength: 100 + Description *string `json:"description,omitempty" validate:"omitempty,max=100" example:"Home" maxLength:"100"` } // @name Address // IsEmpty method determines if an Address is empty or nil in all fields // // Returns true if all fields of the address are empty or nil, false otherwise func (a Address) IsEmpty() bool { - return a.Line1 == "" && a.Line2 == nil && a.ZipCode == "" && a.City == "" && a.State == "" && a.Country == "" + return a.Line1 == "" && a.Line2 == nil && a.ZipCode == "" && a.City == "" && a.State == "" && a.Country == "" && a.Description == nil } // Organizations struct to return paginated list of organizations. diff --git a/pkg/mmodel/organization_test.go b/pkg/mmodel/organization_test.go index a847e8629..6044d847a 100644 --- a/pkg/mmodel/organization_test.go +++ b/pkg/mmodel/organization_test.go @@ -18,12 +18,13 @@ func TestAddress_IsEmpty(t *testing.T) { { name: "completely empty address", address: Address{ - Line1: "", - Line2: nil, - ZipCode: "", - City: "", - State: "", - Country: "", + Line1: "", + Line2: nil, + ZipCode: "", + City: "", + State: "", + Country: "", + Description: nil, }, want: true, }, @@ -111,6 +112,32 @@ func TestAddress_IsEmpty(t *testing.T) { }, want: false, }, + { + name: "address with only Description", + address: Address{ + Line1: "", + Line2: nil, + ZipCode: "", + City: "", + State: "", + Country: "", + Description: utils.StringPtr("Home"), + }, + want: false, + }, + { + name: "complete address with Description", + address: Address{ + Line1: "123 Main St", + Line2: utils.StringPtr("Apt 4B"), + ZipCode: "12345", + City: "New York", + State: "NY", + Country: "US", + Description: utils.StringPtr("Primary Residence"), + }, + want: false, + }, } for _, tt := range tests { From 522dafa5ffdd46a82c49fa5c0318658db6a7d0a0 Mon Sep 17 00:00:00 2001 From: Ygohr Medeiros Date: Mon, 9 Mar 2026 11:14:17 -0300 Subject: [PATCH 3/4] chore: update fiber to 2.52.12 --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 3b659f711..95109e4cb 100644 --- a/go.mod +++ b/go.mod @@ -104,6 +104,7 @@ require ( ) require ( + github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18 github.com/Shopify/toxiproxy/v2 v2.12.0 github.com/docker/docker v28.5.2+incompatible github.com/docker/go-connections v0.6.0 diff --git a/go.sum b/go.sum index 861fe4a3e..a8d93e146 100644 --- a/go.sum +++ b/go.sum @@ -21,6 +21,8 @@ github.com/LerianStudio/lib-auth/v2 v2.3.0 h1:DWU1z2/DAqrBqwWDey+Wi75je3lbVG5mz/ github.com/LerianStudio/lib-auth/v2 v2.3.0/go.mod h1:SBu9aj37eB1ogARnUY7PRKZppHt/YpMwrfcwsm6EoWU= github.com/LerianStudio/lib-commons/v2 v2.6.2 h1:Ng3PjpC/KXwJjgjycAKDTzQWGqtX2lc4mZHFRpaGgHA= github.com/LerianStudio/lib-commons/v2 v2.6.2/go.mod h1:p3gWgBPt9NSKMmRstYtlWOV1BkcSe6yFpdb1i+/NdrQ= +github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18 h1:O5pkTQB99A3zhyMJPp495n4RTswzV9R2QfJA67JPiCY= +github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18/go.mod h1:56UddH8AvrAsH0Q84ZdkChQOmhtX48P6GhV5AxSM4xA= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= From 0014717de7255c54829c869dd9d3bc8665439753 Mon Sep 17 00:00:00 2001 From: Ygohr Medeiros Date: Mon, 9 Mar 2026 11:21:07 -0300 Subject: [PATCH 4/4] chore: remove beta version libCommons --- go.mod | 1 - go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/go.mod b/go.mod index 95109e4cb..3b659f711 100644 --- a/go.mod +++ b/go.mod @@ -104,7 +104,6 @@ require ( ) require ( - github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18 github.com/Shopify/toxiproxy/v2 v2.12.0 github.com/docker/docker v28.5.2+incompatible github.com/docker/go-connections v0.6.0 diff --git a/go.sum b/go.sum index a8d93e146..861fe4a3e 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,6 @@ github.com/LerianStudio/lib-auth/v2 v2.3.0 h1:DWU1z2/DAqrBqwWDey+Wi75je3lbVG5mz/ github.com/LerianStudio/lib-auth/v2 v2.3.0/go.mod h1:SBu9aj37eB1ogARnUY7PRKZppHt/YpMwrfcwsm6EoWU= github.com/LerianStudio/lib-commons/v2 v2.6.2 h1:Ng3PjpC/KXwJjgjycAKDTzQWGqtX2lc4mZHFRpaGgHA= github.com/LerianStudio/lib-commons/v2 v2.6.2/go.mod h1:p3gWgBPt9NSKMmRstYtlWOV1BkcSe6yFpdb1i+/NdrQ= -github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18 h1:O5pkTQB99A3zhyMJPp495n4RTswzV9R2QfJA67JPiCY= -github.com/LerianStudio/lib-commons/v3 v3.0.0-beta.18/go.mod h1:56UddH8AvrAsH0Q84ZdkChQOmhtX48P6GhV5AxSM4xA= github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8afzqM= github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=