added pools #14

Merged
SoXX merged 16 commits from dev/pools into main 2024-10-15 09:03:46 +00:00
Owner

Added Pools, Pool References and Pool Posts

Added Pools, Pool References and Pool Posts
SoXX added 7 commits 2024-10-15 08:21:57 +00:00
- added index for UserFavorites
feat(database): added pools
All checks were successful
Gitea Build Check / Build (push) Successful in 2m56s
c120c583e3
- added migration
- added model
- added basic CRUD for Pools
feat(pool): added pool pots
All checks were successful
Gitea Build Check / Build (push) Successful in 3m5s
a5420cc8c2
- added basic CRUD for PoolsPosts
feat(database): added pool references
All checks were successful
Gitea Build Check / Build (push) Successful in 3m12s
Gitea Build Check / Build (pull_request) Successful in 3m12s
5da2e9e52d
- added creating and deletion
SoXX requested review from Alphyron 2024-10-15 08:22:02 +00:00
SoXX added 1 commit 2024-10-15 08:26:38 +00:00
ci: Update Actions to trigger on push to main branch
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m8s
d9574ace65
Alphyron requested changes 2024-10-15 08:34:53 +00:00
Dismissed
@ -0,0 +147,4 @@
}
if len(id) != 25 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
@ -0,0 +32,4 @@
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
}
if poolID == "" {
Owner

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use `len(poolID) == 0` like in `pool.go` or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +37,4 @@
}
if len(poolID) != 25 {
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Owner

Please recheck this, you want to check if the length nis not 25!

Please recheck this, you want to check if the length nis not 25!
Alphyron marked this conversation as resolved
@ -0,0 +40,4 @@
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
}
if postID == "" {
Owner

Either you use len(postID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(postID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +45,4 @@
}
if len(postID) != 25 {
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
@ -0,0 +89,4 @@
}
if poolID == "" {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
Owner

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +93,4 @@
}
if len(poolID) != 25 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Owner

Please recheck this, you want to check if the length nis not 25!

Please recheck this, you want to check if the length nis not 25!
Alphyron marked this conversation as resolved
@ -0,0 +97,4 @@
}
if postID == "" {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDIsEmpty})
Owner

Either you use len(postID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(postID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +101,4 @@
}
if len(postID) != 25 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
@ -0,0 +33,4 @@
}
if poolID == "" {
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
Owner

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +37,4 @@
}
if len(poolID) != 25 {
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
@ -0,0 +41,4 @@
}
if sourceID == "" {
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsEmpty})
Owner

Either you use len(sourceID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(sourceID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +45,4 @@
}
if len(sourceID) != 25 {
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
@ -0,0 +49,4 @@
}
if url == "" {
return models.PoolReference{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolURLIsEmpty})
Owner

Either you check for length or for empty string... please be consistent in your variant of checking

Either you check for length or for empty string... please be consistent in your variant of checking
Owner

still existing

still existing
Alphyron marked this conversation as resolved
@ -0,0 +93,4 @@
}
if poolID == "" {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
Owner

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(poolID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +97,4 @@
}
if len(poolID) != 25 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PostIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Owner

Please recheck this, you want to check if the length nis not 25!

Please recheck this, you want to check if the length nis not 25!
@ -0,0 +101,4 @@
}
if sourceID == "" {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDIsEmpty})
Owner

Either you use len(sourceID) == 0 like in pool.go or you use this method in pool.go. But not both!

Either you use len(sourceID) == 0 like in pool.go or you use this method in pool.go. But not both!
Alphyron marked this conversation as resolved
@ -0,0 +105,4 @@
}
if len(sourceID) != 25 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.SourceIDToShort})
Owner

its not really to short, is just had a wrong length....

its not really to short, is just had a wrong length....
Alphyron marked this conversation as resolved
SoXX added 2 commits 2024-10-15 08:43:43 +00:00
- fix the error message to be more precise what it is
fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m15s
755aea20aa
- use consistent methode to check if the id is 0
SoXX added 2 commits 2024-10-15 08:50:13 +00:00
- use consistent methode to check if the id is 0
Merge branch 'dev/pools' of git.anthrove.art:Anthrove/otter-space-sdk into dev/pools
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m1s
0c9180bff3
SoXX added 1 commit 2024-10-15 08:51:02 +00:00
fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 2m59s
6b2d9e2cb5
- use consistent methode to check if the id is 0
SoXX added 1 commit 2024-10-15 08:51:27 +00:00
fix: consistent id check
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m2s
28c19101be
- use consistent methode to check if the id is 0
Alphyron requested changes 2024-10-15 08:55:53 +00:00
Dismissed
@ -0,0 +36,4 @@
return models.PoolPost{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
}
if len(poolID) == 0 {
Owner

Please recheck this, you want to check if the length nis not 25!

Please recheck this, you want to check if the length nis not 25!
Alphyron marked this conversation as resolved
@ -0,0 +92,4 @@
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.PoolIDIsEmpty})
}
if len(poolID) == 0 {
Owner

Please recheck this, you want to check if the length nis not 25!

Please recheck this, you want to check if the length nis not 25!
Alphyron marked this conversation as resolved
SoXX added 1 commit 2024-10-15 08:57:40 +00:00
fix: negation
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 1m8s
6a11dc57a4
SoXX added 1 commit 2024-10-15 08:59:14 +00:00
fix: also check if its under 25
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m10s
Gitea Build Check / Build (push) Successful in 3m6s
d753d32025
Alphyron approved these changes 2024-10-15 08:59:50 +00:00
SoXX merged commit d753d32025 into main 2024-10-15 09:03:46 +00:00
SoXX deleted branch dev/pools 2024-10-15 09:03:46 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Anthrove/otter-space-sdk#14
No description provided.