Skip to content

Commit

Permalink
Primeiro commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoCalvo committed Sep 25, 2024
0 parents commit d2cd497
Show file tree
Hide file tree
Showing 16 changed files with 656 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.csv
*.db
*.log
*.sqlite3
*.env
2 changes: 2 additions & 0 deletions data/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- delete from customers;
SELECT * FROM transaction_products;
97 changes: 97 additions & 0 deletions docs/db.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<mxfile host="65bd71144e">
<diagram id="Pn1LC5pktDaY1Y8K6Cm3" name="Page-1">
<mxGraphModel dx="143" dy="476" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="customer" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="40" y="150" width="140" height="270" as="geometry"/>
</mxCell>
<mxCell id="3" value="UUID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="Nome" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="60" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="codCPF" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="TwitchID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="120" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="YouTubeID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="150" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="9" value="BlueskyID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="180" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="8" value="nrPoints" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="210" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="descEmail" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="2">
<mxGeometry y="240" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="11" value="transaction" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="260" y="150" width="140" height="180" as="geometry"/>
</mxCell>
<mxCell id="12" value="UUID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="11">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="13" value="idCustomer" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="11">
<mxGeometry y="60" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="14" value="dtTransaction" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="11">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="15" value="vlPoints" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="11">
<mxGeometry y="120" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="20" value="descSysOrigin" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="11">
<mxGeometry y="150" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="21" style="edgeStyle=elbowEdgeStyle;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="3" target="13">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="22" value="transaction_cart" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="470" y="150" width="140" height="180" as="geometry"/>
</mxCell>
<mxCell id="23" value="UUID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="22">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="24" value="idTransaction" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="22">
<mxGeometry y="60" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="25" value="codProduct" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="22">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="26" value="qtdProduct" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="22">
<mxGeometry y="120" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="27" value="vlProduct" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="22">
<mxGeometry y="150" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="28" style="edgeStyle=elbowEdgeStyle;html=1;" edge="1" parent="1" source="12" target="24">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="29" value="product" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="670" y="150" width="140" height="150" as="geometry"/>
</mxCell>
<mxCell id="30" value="UUID" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="29">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="descProductName" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="29">
<mxGeometry y="60" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="32" value="descProductDescription" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="29">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="33" value="descProductCategory" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="29">
<mxGeometry y="120" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="35" style="edgeStyle=elbowEdgeStyle;html=1;" edge="1" parent="1" source="30" target="25">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
11 changes: 11 additions & 0 deletions points/db/db.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package db

import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)

func OpenDBConnection() (*gorm.DB, error) {
db, err := gorm.Open(sqlite.Open("../data/database.db"), &gorm.Config{})
return db, err
}
42 changes: 42 additions & 0 deletions points/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module points

go 1.23.1

require (
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
gorm.io/driver/sqlite v1.5.6
gorm.io/gorm v1.25.12
)

require (
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit d2cd497

Please sign in to comment.