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

Projeto pratico - Maria Alice Guimaraes Carneiro #13

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .idea/libraries/Leiningen__clj_tuple_0_2_2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Leiningen__clojure_java_time_0_3_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Leiningen__org_clojure_data_csv_1_0_1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/Leiningen__prismatic_schema_1_1_12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
Projeto bancário para mergulhar no mundo da **programação funcional** com Clojure + Datomic!


Desenvolvido por *[COLOCAR NOME AQUI]* (*[COLOCAR SEU EMAIL AQUI]*).
Desenvolvido por *MARIA ALICE GUIMARÃES CARNEIRO* (*maria.carneiro@nubank.com.br*).
6 changes: 5 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]]
:dependencies [[org.clojure/clojure "1.11.1"]
[clojure.java-time "0.3.3"]
[org.clojure/data.csv "1.0.1"]
[prismatic/schema "1.1.12"]
[com.datomic/datomic-pro "1.0.6397"]]
:repl-options {:init-ns yes-she-codes.core})
6 changes: 0 additions & 6 deletions src/yes_she_codes/core.clj

This file was deleted.

58 changes: 58 additions & 0 deletions src/yes_she_codes/semana1/cartoes.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
(ns yes-she-codes.semana1.cartoes
(:require [yes-she-codes.db :as y.db]
[clojure.string :as s]
[yes-she-codes.logic :as y.logic]
[java-time :as t]))





(println "\n\n ---------------- testando data java time ---------------- ")
(println (t/format (t/year-month (str "2022-09"))))





(println "\n\n ---------------- novo cartao ---------------- ")
(defn novo-cartao
[numero cvv validade limite cliente]
(let [cc-info {:numero (y.logic/str-to-float numero)
:cvv cvv
:validade (t/format (t/year-month (str validade)))
:limite limite
:cliente (y.logic/str-to-float cliente)}
client-info (y.logic/validar-cliente cliente)]
(if (nil? client-info)
"cpf nao encontrado"
cc-info))
)
;aqui usamos a funcao str-to-float para transformar strings
;primeiro removemos os espacos ou pontos (. -) entre os numeros
;e depois transformamos a string em tipo long

(let [numero "1111 2222 3333 4444"
cvv 555
validade "2022-09"
limite 5.000
;cliente "114.918.436-16"
cliente "000.111.222-33"
]
(println (novo-cartao numero cvv validade limite cliente)))





(println "\n\n ---------------- lista cartoes ---------------- ")

(defn lista-cartoes
[]
(let [cartoes (y.logic/csv-reader "/Users/maria.carneiro/Documents/yes-she-codes-alura/yes-she-codes/src/yes_she_codes/csv/cartoes.csv")]
(println cartoes))
)

(lista-cartoes)


42 changes: 42 additions & 0 deletions src/yes_she_codes/semana1/clientes.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
(ns yes-she-codes.semana1.clientes
(:require [yes-she-codes.db :as y.db]
;[clojure.string :as s]
;[yes-she-codes.logic :as y.logic]
[java-time :as time]
[yes-she-codes.logic :as y.logic]
))





(println "\n\n ---------------- novo cliente ---------------- ")

(defn novo-cliente
[nome cpf email]
{:nome nome
:cpf cpf
:email email})

(let [nome "Gabriel"
cpf "114.918.436-16"
email "gabrielvcbessa@gmail.com"]
(println (novo-cliente nome cpf email)))





(println "\n\n ---------------- lista clientes ---------------- ")

(defn lista-clientes
[]
(let [clientes (y.logic/csv-reader "/Users/maria.carneiro/Documents/yes-she-codes-alura/yes-she-codes/src/yes_she_codes/csv/clientes.csv")]
(println clientes))
)

(lista-clientes)




Loading