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/weos 1505 #173

Merged
merged 56 commits into from
Jun 10, 2022
Merged

Feature/weos 1505 #173

merged 56 commits into from
Jun 10, 2022

Conversation

akeemphilbert
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

* Replaced "Property" on ContentEntity with "payload" that is a map
* Removed reference to dynamic struct builder and reader from Content Entity
* Simplified the enumeration validation
* Updated test fixtures to explicitly set nullable true since nullable true will no longer be the default
* Updated isValid to do type checks
* Got reid of using GenerateID function (this happens in the Set payload method)
* Made "FromSchemaWIthValues" use "SetValueFromPayload" method
* Update "SetValueFromPayload" to do some basic type casting and generating of default values
* Deprecated GenerateID function
* Updated GetByKey return in projection interface to use ContentEntity
* Updated GetByProperties to return a slice of ContentEntities
* Added utility method to check if string is in a slice of strings
* Updated integration test fixture  to specify nullable fields
* Updated upload fixture to specify nullable fields
* Added code if there is a payload then set the values on the gorm model
* Made it so that if there is one part in the identifier then that is used to set the id for the entity
* If the content entity does not have an id specified a ksuid will be generated by default
* Removed reference to dynamic structs from domain service (use toMap instead)
* Update test mocks to use use the updated model mocks
* Started reducing the code needed for update in the domain service
* Fixed domain service update test
* Removed the need to pass the payload in the update time method
* Added comments to update method in the domain service
* Omitted User from gorm (and new events) so that results can be serialized directly in ContentEntity
* Made more properties nullable in fixtures
* Consolidate update code in domain service
* Added debug statements to gorm projection to debug issues
* Updated mocks in projections
…bject and it was null

* Made unmarshal use SetValue method IF a schema is set
* Fixed issue with date time use
* Put back in reference to dynamic struct builder because we can't create a builder using just the schema of the current entity
* Updated GORMModel to check if the content entity was instantiated with a builder
* Added back in FromSchemaAndBuilder
* Updated entity factory to instantiate content entity with the builder
* Updated gorm methods to marshal result into dynamic struct gorm model from entity and then marshal the model into the content entity
* Fixed property casing in projection test
* Made it so that the weos_id is set on the GORM model based on the entity id
* Added tests to ensure that the weos_id is set on the entity
* Fixed nil pointer exceptions where schema is not set (this could be if the content entity was initialized directly and not through the entity factory
* Added custom Time struct so that the dates could be marshalled in the iso 8601 format
* Fixed more test fixtures
* Made it so that the Etag is only generated if the item was found
* Updated test fixtures to make some fields nullable
* Switched to using Unmarshaling so that sequence no. is set (as opposed to using setValue directly)
* Made etag generation use the retrieved entity
* Made projection functions use json.Unmarshal instead
* Updated test fixtures to have actual ids
* GormModel returns 2 values so had to change from passing it directly to the delete method
* Made it so that the handler error is returned
* Updating an non existant entity returns error
* Fixed end to end testing so that properties in the request are not automatically lower cased
* Made it so that the schema is recursively parsed
* Added statements to debug issues with table name for model not being recognized
* Updated the migrate function signature to receive the entire schema
* Deprecated CreateSchema initializer
* Removed GormModel method from content entity
* Deprecated constructure that creates an entity using the schema AND a builder (the GORM stuff is now in the GORM projection)
* Made custom Time struct implment Value/Scanner interface to be compatible with GORM
…eration

* Removed inexplicable code that tried to set a value when value was nil in the gorm dialect
* Marshalled the table name into the model correctly
* Made sequence no. an integer
* Made it so that the foreign key reference is a pointer so that nil could be set.
* removed testing code
…eration

* Updated ReplayEvents signature to use swagger config (since the projection migration also uses that now)
* Added code to drop columns when x-remove is specified (removed the automagic that was happening when a primary key was removed)
* Updated test to correctly reference an object
* Updated feature files to reference lowercased columns (the columns seem to no longer be snake cased by gorm)
* Fixed step that was not passing schema to replay events
* Made it so that if the default value returned by GORMPropertyBuilder is nil then it's not added (this is so that we could break the recursive building at a depth of 3)
* Commented out the scenario for removing a column that is part of an identifier since it was decided that should be removed
It turns out that the prescribed cases.Title(language.English).String is no the same as strings.Title (it lowercases the rest of the word instead of only uppercasing the first character)
* Turned off foreign keys during migration
* Drop table at the end of more tests to avoid conflicts
* Fixed issue in test where url was being set but not defined in the schema
* Drop table at the end of more tests to avoid conflicts
* Changed schema names in some tests to avoid collisions (the tests seem to work when they are run individually but fail when the entire suite is run which suggests an issue with table cleanup after testsare run in mysql)
* Fix for issues with mysql in pipeline (seems like GORM will set auto increment because the type is uint)
…really specific to the pipeline (the tests themselves run fine individually)
@akeemphilbert akeemphilbert marked this pull request as ready for review June 10, 2022 17:12
@akeemphilbert akeemphilbert merged commit 4484dbc into dev Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant