parity between inputs for graph & rest resource creation
ex. graph let you specify group enabled/disabled, whereas rest always set as enabled
can no longer specify unintended fields in rest such as createdAt or fingerprint
receiver creation through graph lacked schema validation
string/id fields cannot be blank (including whitespace, inputs trimmed)
groups need at least one receiver id
E2e tests are closer to passing, now the only failures should be:
TestCreateInvalidGroup/non-existent_receiver - creating group with invalid receiver yields 5xx response instead of 4xx. This happens because there's no code checks, only a failed foreign key constraint from the db layer
TestToggleGroup - UpdatedAt field never updated. Gorm should do this automatically but is "broken" by us using types besides time.Time (we use a custom graph scalar)
Centralize resource creation logic & add basic input validation.
Issues this PR fixes:
createdAt
orfingerprint
E2e tests are closer to passing, now the only failures should be:
TestCreateInvalidGroup/non-existent_receiver
- creating group with invalid receiver yields 5xx response instead of 4xx. This happens because there's no code checks, only a failed foreign key constraint from the db layerTestToggleGroup
- UpdatedAt field never updated. Gorm should do this automatically but is "broken" by us using types besidestime.Time
(we use a custom graph scalar)Closes #70