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

feat: implement sqlc #35

Merged
merged 7 commits into from
Aug 27, 2024
Merged

feat: implement sqlc #35

merged 7 commits into from
Aug 27, 2024

Conversation

choffmann
Copy link
Member

@choffmann choffmann commented Aug 5, 2024

Close #21

  • Implementing database schema with sqlc
  • Add postgres connection
  • Add Makefile
  • Remove mongodb stuff

Note

The hole business logic has been removed. The API handlers and routes are still active and the repositories are implemented, but the business logic is missing.

@choffmann choffmann added this to the Release 1 milestone Aug 5, 2024
@choffmann choffmann self-assigned this Aug 5, 2024
@choffmann choffmann force-pushed the feature/sqlc branch 2 times, most recently from 05d7bc0 to c5d1310 Compare August 7, 2024 16:55
UpdatedAt time.Time
Name string
CanEditTrees bool
CanViewTrees bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can already add some here for route planning?

EmployeeID string
PhoneNumber string
Email string
ProfileImage *Image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Avatar? It's a little shorter

Species string
SoilCondition TreeSoilCondition
TreeNumber int32
AdditionalInfo string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the AdditionalInfo field?

HeightAboveSeaLevel float64
PlantingYear int32
Species string
SoilCondition TreeSoilCondition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SoilCondition maybe to TreeCluster?

CreatedAt time.Time
UpdatedAt time.Time
Status RouteStatus
Automatic bool
Copy link
Contributor

@doriengr doriengr Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automatic should be a value in the WateringPlan struct and maybe we can call it something like is_created_automatically

"time"
)

type PlantingArea struct {
Copy link
Contributor

@doriengr doriengr Aug 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the name Flowerbed?

Description string
NumberOfPlants int32
CurrentMoistureLevel float64
AdditionalInfo string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it shorter: MoistureLevel - and AdditionalInfo is also maybe not needed here

ID int32
CreatedAt time.Time
UpdatedAt time.Time
FirstUsed time.Time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For which case do we need this value?

Sensor *Sensor
Images []*Image
Age int32
HeightAboveSeaLevel float64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just Height?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but then it can also mean the height of the tree?

PlantingYear int32
Species string
SoilCondition TreeSoilCondition
TreeNumber int32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just Number

UpdatedAt time.Time
WateringStatus TreeClusterWateringStatus
LastWatered time.Time
CurrentMoistureLevel float64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MoistureLevel maybe?

UpdatedAt time.Time
NumberPlate string
Description string
Routes []*Route
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WaterCapacity is missing

Description string
StartDate time.Time
EndDate time.Time
RouteLengthKm float64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just Length?

UpdatedAt time.Time
Name string
Description string
StartDate time.Time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be saved in the route, right?

RouteLengthKm float64
WaterRequiredLitres float64
WaterConsumedLitres float64
Routes []*Route
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is missing the starting point of the watering plan, because there are only two options possible in Flensburg.

@choffmann choffmann force-pushed the feature/sqlc branch 6 times, most recently from 58f3d12 to b1574f2 Compare August 26, 2024 19:39
@choffmann choffmann marked this pull request as ready for review August 26, 2024 19:52
@choffmann choffmann added the need-reviewer Send notification in Discord label Aug 26, 2024
Copy link
Contributor

@doriengr doriengr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

feat: implement person repository

feat: implement mapper

fix: build issue with mapper

feat: add roles

feat: add seed.sql

feat: add makefile

feat: finished init migration and change docker postgres to postgis

feat: create repo interfaces (wip)

feat: implement domain entites (wip)

fix: fix info repo

chore: change person to user

feat: finished user repo

feat: create postgres repo

feat: implement role repo

feat: implement image repo

feat: start with routes queries

feat: update domain entities

feat: create migration for version 1

chore: backup full db init migration

feat: change seed

chore: rename sensor measurements to sensor data

feat: write sql queries

feat: change migration

feat: remove not used repos

feat: update domain entities

fix: change issues in migration

fix: fix issues in queries

feat: implement tree repo

feat: implement treecluster repo

WIP: restructure project

fix: remove old sevice logic

feat: implement sensor repo

feat: implement vehicle repo and run go fmt

feat: implement flowerbed repo

fix: fix rebase

feat: add demo data in seed

chore: run go fmt

chore: fix linter annotations

fix: update build and test pipeline

chore: update linter version in pipeline

chore: fix linter annotations and disable shadow and commented out code
hints

chore: fix more linter annotations

feat: update Makefile

chore: refactoring repositories

feat: put all repos together

chore: remove left over mongodb error definitions
@choffmann choffmann merged commit c6b7e8b into develop Aug 27, 2024
2 checks passed
@choffmann choffmann deleted the feature/sqlc branch August 27, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-reviewer Send notification in Discord
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include golang ORM
2 participants