...
|
...
|
@@ -50,6 +50,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
"deleted_at",
|
|
|
"updated_at",
|
|
|
"cooperation_contract_undertaker_id",
|
|
|
"credit_account_id",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -90,6 +91,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
÷ndsEstimate.CreditAccountId,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -116,6 +118,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
dividendsEstimate.CreditAccountId,
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
|
|
}
|
...
|
...
|
@@ -146,6 +149,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
dividendsEstimate.CreditAccountId,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -172,6 +176,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
dividendsEstimate.CreditAccountId,
|
|
|
dividendsEstimate.Identify(),
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
...
|
...
|
@@ -266,6 +271,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* |
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: time.Now(),
|
|
|
CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
|
CreditAccountId: dividendsEstimate.CreditAccountId,
|
|
|
})
|
|
|
}
|
|
|
if _, err := tx.Model(÷ndsEstimateModels).WherePK().Update(); err != nil {
|
...
|
...
|
|