-
-
Save chebykinn/0c2905f07d76082bd9d63a56a720371c to your computer and use it in GitHub Desktop.
Todo models definitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package domain | |
import ( | |
"time" | |
"example.com/namespace/todo-app/go-services/internal/todo-backend/generated/core" | |
) | |
type TodoNote struct { | |
ID int64 | |
Title string | |
Description string | |
IsCompleted bool | |
CreatedAt time.Time | |
UpdatedAt time.Time | |
} | |
// Storage interface with it we can choose different implementations and write | |
// unit tests. | |
type TodoStorage interface { | |
InsertTodoNote(ctx *core.MifyRequestContext, todoNote TodoNote) (TodoNote, error) | |
UpdateTodoNote(ctx *core.MifyRequestContext, todoNote TodoNote) (TodoNote, error) | |
SelectTodoNote(ctx *core.MifyRequestContext, id int64) (TodoNote, error) | |
DeleteTodoNote(ctx *core.MifyRequestContext, id int64) error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment