...
|
...
|
@@ -48,6 +48,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
"created_at",
|
|
|
"deleted_at",
|
|
|
"updated_at",
|
|
|
"cooperation_contract_undertaker_id",
|
|
|
}
|
|
|
insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
|
|
|
insertPlaceHoldersSnippet := sqlbuilder.SqlPlaceHoldersSnippet(sqlBuildFields)
|
...
|
...
|
@@ -86,6 +87,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.CreatedAt,
|
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
),
|
|
|
fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -110,6 +112,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
dividendsEstimate.CreatedAt,
|
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
|
|
}
|
...
|
...
|
@@ -138,6 +141,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
÷ndsEstimate.CreatedAt,
|
|
|
÷ndsEstimate.DeletedAt,
|
|
|
÷ndsEstimate.UpdatedAt,
|
|
|
÷ndsEstimate.CooperationContractUndertakerId,
|
|
|
),
|
|
|
fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
|
|
|
dividendsEstimate.DividendsEstimateId,
|
...
|
...
|
@@ -162,6 +166,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di |
|
|
dividendsEstimate.CreatedAt,
|
|
|
nil,
|
|
|
dividendsEstimate.UpdatedAt,
|
|
|
dividendsEstimate.CooperationContractUndertakerId,
|
|
|
dividendsEstimate.Identify(),
|
|
|
); err != nil {
|
|
|
return dividendsEstimate, err
|
...
|
...
|
@@ -205,6 +210,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do |
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: dividendsEstimate.UpdatedAt,
|
|
|
CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
|
})
|
|
|
}
|
|
|
if len(dividendsEstimateModels) > 0 {
|
...
|
...
|
@@ -251,6 +257,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* |
|
|
CreatedAt: dividendsEstimate.CreatedAt,
|
|
|
DeletedAt: dividendsEstimate.DeletedAt,
|
|
|
UpdatedAt: time.Now(),
|
|
|
CooperationContractUndertakerId: dividendsEstimate.CooperationContractUndertakerId,
|
|
|
})
|
|
|
}
|
|
|
if _, err := tx.Model(÷ndsEstimateModels).WherePK().Update(); err != nil {
|
...
|
...
|
|