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

Feature/MZ-256 #146

Merged
merged 4 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ type LedgerPostgreSQLModel struct {

// CreateLedgerInput is a struct design to encapsulate request create payload data.
type CreateLedgerInput struct {
Name string `json:"name" validate:"required"`
Name string `json:"name" validate:"required,max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdateLedgerInput is a struct design to encapsulate request update payload data.
type UpdateLedgerInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}
Expand All @@ -48,8 +48,8 @@ type Ledger struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ type OrganizationPostgreSQLModel struct {

// CreateOrganizationInput is a struct design to encapsulate request create payload data.
type CreateOrganizationInput struct {
LegalName string `json:"legalName" validate:"required"`
LegalName string `json:"legalName" validate:"required,max=256"`
ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid"`
DoingBusinessAs *string `json:"doingBusinessAs"`
LegalDocument string `json:"legalDocument" validate:"required"`
DoingBusinessAs *string `json:"doingBusinessAs" validate:"max=256"`
LegalDocument string `json:"legalDocument" validate:"required,max=256"`
Address Address `json:"address"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdateOrganizationInput is a struct design to encapsulate request update payload data.
type UpdateOrganizationInput struct {
LegalName string `json:"legalName" validate:"required"`
LegalName string `json:"legalName" validate:"required,max=256"`
ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid"`
DoingBusinessAs *string `json:"doingBusinessAs"`
DoingBusinessAs *string `json:"doingBusinessAs" validate:"max=256"`
Address Address `json:"address"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
Expand All @@ -61,8 +61,8 @@ type Organization struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand Down
16 changes: 8 additions & 8 deletions components/ledger/internal/domain/portfolio/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ type AccountPostgreSQLModel struct {

// CreateAccountInput is a struct design to encapsulate request create payload data.
type CreateAccountInput struct {
AssetCode string `json:"assetCode" validate:"required"`
Name string `json:"name"`
Alias *string `json:"alias"`
AssetCode string `json:"assetCode" validate:"required,max=100"`
Name string `json:"name" validate:"max=256"`
Alias *string `json:"alias" validate:"max=100"`
Type string `json:"type" validate:"required"`
ParentAccountID *string `json:"parentAccountId" validate:"omitempty,uuid"`
ProductID *string `json:"productId" validate:"omitempty,uuid"`
EntityID *string `json:"entityId"`
EntityID *string `json:"entityId" validate:"omitempty,max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdateAccountInput is a struct design to encapsulate request update payload data.
type UpdateAccountInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Status Status `json:"status"`
Alias *string `json:"alias"`
Alias *string `json:"alias" validate:"max=100"`
ProductID *string `json:"productId" validate:"uuid"`
Metadata map[string]any `json:"metadata"`
}
Expand Down Expand Up @@ -79,8 +79,8 @@ type Account struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
AllowSending bool `json:"allowSending"`
AllowReceiving bool `json:"allowReceiving"`
}
Expand Down
10 changes: 5 additions & 5 deletions components/ledger/internal/domain/portfolio/asset/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ type AssetPostgreSQLModel struct {

// CreateAssetInput is a struct design to encapsulate request create payload data.
type CreateAssetInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Type string `json:"type"`
Code string `json:"code" validate:"required"`
Code string `json:"code" validate:"required,max=100"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdateAssetInput is a struct design to encapsulate request update payload data.
type UpdateAssetInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}
Expand All @@ -56,8 +56,8 @@ type Asset struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type PortfolioPostgreSQLModel struct {

// CreatePortfolioInput is a struct design to encapsulate request create payload data.
type CreatePortfolioInput struct {
EntityID string `json:"entityId" validate:"required"`
Name string `json:"name" validate:"required"`
EntityID string `json:"entityId" validate:"required,max=256"`
Name string `json:"name" validate:"required,max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdatePortfolioInput is a struct design to encapsulate payload data.
type UpdatePortfolioInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}
Expand All @@ -55,8 +55,8 @@ type Portfolio struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
AllowSending bool `json:"allowSending"`
AllowReceiving bool `json:"allowReceiving"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ type ProductPostgreSQLModel struct {

// CreateProductInput is a struct design to encapsulate request create payload data.
type CreateProductInput struct {
Name string `json:"name" validate:"required"`
Name string `json:"name" validate:"required,max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}

// UpdateProductInput is a struct design to encapsulate request update payload data.
type UpdateProductInput struct {
Name string `json:"name"`
Name string `json:"name" validate:"max=256"`
Status Status `json:"status"`
Metadata map[string]any `json:"metadata"`
}
Expand All @@ -50,8 +50,8 @@ type Product struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type OperationPostgreSQLModel struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand Down Expand Up @@ -182,6 +182,6 @@ func (t *OperationPostgreSQLModel) FromEntity(operation *Operation) {

// UpdateOperationInput is a struct design to encapsulate payload data.
type UpdateOperationInput struct {
Description string `json:"description"`
Description string `json:"description" validate:"max=256"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ type TransactionPostgreSQLModel struct {

// Status structure for marshaling/unmarshalling JSON.
type Status struct {
Code string `json:"code"`
Description *string `json:"description"`
Code string `json:"code" validate:"max=100"`
Description *string `json:"description" validate:"max=256"`
}

// IsEmpty method that set empty or nil in fields
Expand All @@ -42,9 +42,9 @@ func (s Status) IsEmpty() bool {

// CreateTransactionInput is a struct design to encapsulate payload data.
type CreateTransactionInput struct {
ChartOfAccountsGroupName string `json:"chartOfAccountsGroupName"`
Description string `json:"description,omitempty"`
Code string `json:"code,omitempty"`
ChartOfAccountsGroupName string `json:"chartOfAccountsGroupName" validate:"max=256"`
Description string `json:"description,omitempty" validate:"max=256"`
Code string `json:"code,omitempty" validate:"max=100"`
Pending bool `json:"pending,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Send gold.Send `json:"send,omitempty"`
Expand All @@ -60,7 +60,7 @@ type InputDSL struct {

// UpdateTransactionInput is a struct design to encapsulate payload data.
type UpdateTransactionInput struct {
Description string `json:"description"`
Description string `json:"description" validate:"max=256"`
Metadata map[string]any `json:"metadata,omitempty"`
}

Expand Down
Loading