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

cambios finales #1

Open
wants to merge 2 commits into
base: master
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ primera version (:
```
Metacello new
baseline:'Tienda';
repository: 'github://danteGiuliano/tienda-full:master/src'; load.
repository: 'github://danteGiuliano/tienda-full:produce/src'; load.
11 changes: 2 additions & 9 deletions src/TiendaAmazingShop/Cliente.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,11 @@ Cliente >> addSuscription:aSuscription [.
listaDeSuscripcion add:aSuscription.
]

{ #category : #'as yet unclassified' }
Cliente >> aplicarPromocion:unaPromocion [
|suscripcionComprada|
suscripcionComprada := listaDeSuscripcion at:1.
suscripcionComprada añadirPromo: unaPromocion.
listaDeSuscripcion at:1 put:suscripcionComprada.
]

{ #category : #'as yet unclassified' }
Cliente >> añadirContenido:unContenido [
listaContenidos add:unContenido.
colPago add:(Pago crearPago:unContenido precio deItem:unContenido ySuscripcion:(self getSuscripcionActiva)).

colPago add:(Pago crearPago:(unContenido precioDescuento:(self getSuscripcionActiva)) deItem:unContenido ySuscripcion:(self getSuscripcionActiva)).
(self getSuscripcionActiva) contenidoComprado
]

Expand Down
3 changes: 3 additions & 0 deletions src/TiendaAmazingShop/ComponenetCompraContenido.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
self call openInHand
"
Class {
#name : #ComponenetCompraContenido,
#superclass : #BorderedMorph,
Expand Down
3 changes: 3 additions & 0 deletions src/TiendaAmazingShop/ComponenetContenidoBusqueda.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
self call openInHand.
"
Class {
#name : #ComponenetContenidoBusqueda,
#superclass : #BorderedMorph,
Expand Down
8 changes: 8 additions & 0 deletions src/TiendaAmazingShop/ComponenetPromocion.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
self call openInHand
"
Class {
#name : #ComponenetPromocion,
#superclass : #BorderedMorph,
Expand All @@ -12,6 +15,11 @@ Class {
#category : #'TiendaAmazingShop-components tienda'
}

{ #category : #'ffi-calls' }
ComponenetPromocion class >> call [
^self new.
]

{ #category : #initialization }
ComponenetPromocion >> addButtom [
aplicar :=Button create:'APLICAR' size:60@30.
Expand Down
2 changes: 1 addition & 1 deletion src/TiendaAmazingShop/ComponenteClientePago.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Class {
'collecionPago',
'collecionBoton'
],
#category : #'TiendaAmazingShop-services'
#category : #'TiendaAmazingShop-components tienda'
}

{ #category : #operations }
Expand Down
12 changes: 12 additions & 0 deletions src/TiendaAmazingShop/Contenido.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,15 @@ fecha :=Date today yyyymmdd.
Contenido >> precio [
^precio.
]

{ #category : #accessing }
Contenido >> precioDescuento:unaSuscripcion [
|valorSuscripcion |
(unaSuscripcion sinSuscripcion )ifFalse:[
valorSuscripcion :=Control modelFuntionReturn:[:h| h obtainSuscripcion:unaSuscripcion getTipo].
^precio * (((valorSuscripcion obtenerDescuento: ( self class asString) )* unaSuscripcion descuento)/precio).
]
ifTrue:[
^precio.
]
]
5 changes: 5 additions & 0 deletions src/TiendaAmazingShop/Descuento.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ Descuento >> nombreRow: rowIndex [
yourself
]

{ #category : #'as yet unclassified' }
Descuento >> obtenerDescuento:selecion [
^diccionarioDescuento at:selecion.
]

{ #category : #'as yet unclassified' }
Descuento >> peliculaRow: rowIndex [
^ FTCellMorph new
Expand Down
2 changes: 1 addition & 1 deletion src/TiendaAmazingShop/Login.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fonde right:self right.
fonde color:Color white.
"Gif"

Helper addCenterMorph:(MorphGIF gifFromString:'recursos/fondo-login.gif') in:fonde.
Helper addCenterMorph:(MorphGIF gifFromString:'pharo-local/iceberg/danteGiuliano/tienda-full/src/recursos/fondo-login.gif') in:fonde.


]
Expand Down
8 changes: 4 additions & 4 deletions src/TiendaAmazingShop/Menu.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Helper border:exit aColor:Color white rad:3.

{ #category : #initialization }
Menu >> addFondoAnimado [
fonde :=MorphGIF gifFromString:'recursos/fondo.gif'.
fonde :=MorphGIF gifFromString:'pharo-local/iceberg/danteGiuliano/tienda-full/src/recursos/fondo.gif'.
fonde fullBounds.
self addMorph:fonde.
fonde center:self center.
Expand All @@ -65,9 +65,9 @@ menuSuscripcion :=CircleButton new extent:128@128.
menuCliente :=CircleButton new extent:128@128.
menuContenido :=CircleButton new extent:128@128.

menuSuscripcion icon:(Icon stringRoute:'recursos/suscripcion.png').
menuCliente icon:(Icon stringRoute:'recursos/cliente.png').
menuContenido icon:(Icon stringRoute:'recursos/contenido-pagado.png').
menuSuscripcion icon:(Icon stringRoute:'pharo-local/iceberg/danteGiuliano/tienda-full/src/recursos/suscripcion.png').
menuCliente icon:(Icon stringRoute:'pharo-local/iceberg/danteGiuliano/tienda-full/src/recursos/cliente.png').
menuContenido icon:(Icon stringRoute:'pharo-local/iceberg/danteGiuliano/tienda-full/src/recursos/contenido-pagado.png').
menuSuscripcion color:Theme morph.
menuCliente color:Theme morph.
menuContenido color:Theme morph.
Expand Down
5 changes: 5 additions & 0 deletions src/TiendaAmazingShop/Promocion.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ nuevaSuscripcion :=unaNuevaSuscripcion.
suscripcionBase :=unaSuscripcionBase.
]

{ #category : #'as yet unclassified' }
Promocion >> descuento [
^descuento asNumber.
]

{ #category : #'as yet unclassified' }
Promocion >> getCantidadArticulos [
^cantidad asNumber
Expand Down
28 changes: 19 additions & 9 deletions src/TiendaAmazingShop/SuscripcionComprada.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Class {
'fechaFin',
'nombreSuscripcion',
'contenidosComprados',
'promocion'
'promocion',
'suscripto'
],
#category : #'TiendaAmazingShop-model'
}
Expand Down Expand Up @@ -62,24 +63,18 @@ SuscripcionComprada >> añadirLista:unaLista [
listaDescuento :=unaLista.
fechaInicio :=Date today yyyymmdd.
fechaFin :=Date today onNextMonth yyyymmdd.
suscripto :=true.

]

{ #category : #'as yet unclassified' }
SuscripcionComprada >> añadirListaMySQL:unaLista yFechaInicio:unaFechaInicio yFechaFIN:unaFechaFin deNombre:unNombre [
listaDescuento :=unaLista.
fechaInicio :=unaFechaInicio.
fechaFin :=unaFechaFin.
nombreSuscripcion :=unNombre.
]

{ #category : #'as yet unclassified' }
SuscripcionComprada >> añadirListaMySQL:unaLista yFechaInicio:unaFechaInicio yFechaFIN:unaFechaFin deNombre:unNombre contenidosComprados:cantidad [
listaDescuento :=unaLista.
fechaInicio :=unaFechaInicio.
fechaFin :=unaFechaFin.
nombreSuscripcion :=unNombre.
contenidosComprados :=cantidad.
suscripto :=true.
]

{ #category : #'as yet unclassified' }
Expand All @@ -104,6 +99,15 @@ SuscripcionComprada >> contenidoComprado [
contenidosComprados :=contenidosComprados +1.
]

{ #category : #dataTable }
SuscripcionComprada >> descuento [
promocion ifNil:[
^1 asNumber .
]ifNotNil:[
promocion descuento asNumber.
]
]

{ #category : #'as yet unclassified' }
SuscripcionComprada >> getFechaInicio [
^fechaInicio .
Expand Down Expand Up @@ -160,8 +164,14 @@ SuscripcionComprada >> promocionAplicable:unaCantidad [

]

{ #category : #'as yet unclassified' }
SuscripcionComprada >> sinSuscripcion [
^(suscripto not).
]

{ #category : #'as yet unclassified' }
SuscripcionComprada >> sinSuscripcionActiva [
suscripto :=false.
nombreSuscripcion :='Sin Suscripcion'.
fechaInicio:=Date today.
fechaFin:='Usuario sin suscripcion'.
Expand Down