Private
Public Access
falta terminar la parte de la entrega
This commit is contained in:
1 parent
3931d77c6b
commit
ee050fa0b3
6 files changed
+233
-39
No files matched your search
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:1068px;height:419px;background:#FFFFFF;" width="1068px" height="419px" viewBox="0 0 1068 419" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.10?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><!--class IPermisosComponent--><g class="entity" data-qualified-name="IPermisosComponent" id="ent0001" data-source-line="4"><rect x="7" y="7" width="483.126" height="80.197" fill="#F1F1F1" style="stroke:#181818;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="177.006" cy="23" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M173.303,17.297 L180.913,17.297 L180.913,19.188 L178.334,19.188 L178.334,26.609 L180.913,26.609 L180.913,28.5 L173.303,28.5 L173.303,26.609 L175.897,26.609 L175.897,19.188 L173.303,19.188 L173.303,17.297 Z " fill="#000"/><text x="197.506" y="28.083" fill="#000" font-size="14" textLength="134.613" font-style="italic">IPermisosComponent</text><line x1="8" y1="39" x2="489.126" y2="39" style="stroke:#181818;stroke-width:0.5;"/><line x1="8" y1="47" x2="489.126" y2="47" style="stroke:#181818;stroke-width:0.5;"/><text x="13" y="64.132" fill="#000" font-size="14" textLength="290.65">+Buscar(id: uint, visitados: map[uint]bool): bool</text><text x="13" y="80.23" fill="#000" font-size="14" textLength="471.126">+ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void</text></g><!--class Permiso--><g class="entity" data-qualified-name="Permiso" id="ent0002" data-source-line="9"><rect x="75" y="324" width="483.126" height="80.197" fill="#F1F1F1" style="stroke:#181818;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="286.641" cy="340" rx="11" ry="11" fill="#ADD1B2" style="stroke:#181818;stroke-width:1;"/><path d="M284.297,339.844 Q284.297,341.719 284.875,342.734 Q285.453,343.734 286.609,343.734 Q287.953,343.734 288.609,341.719 L290.875,342.141 Q289.766,345.672 286.594,345.672 Q284.25,345.672 283.031,344.188 Q281.813,342.703 281.813,339.844 Q281.813,334.125 286.516,334.125 Q288.063,334.125 289.094,334.938 Q290.141,335.75 290.641,337.359 L288.375,337.906 Q288.141,337.031 287.656,336.547 Q287.172,336.047 286.547,336.047 Q284.297,336.047 284.297,339.844 Z " fill="#000"/><text x="307.141" y="345.083" fill="#000" font-size="14" textLength="51.345">Permiso</text><line x1="76" y1="356" x2="557.126" y2="356" style="stroke:#181818;stroke-width:0.5;"/><line x1="76" y1="364" x2="557.126" y2="364" style="stroke:#181818;stroke-width:0.5;"/><text x="81" y="381.132" fill="#000" font-size="14" textLength="290.65">+Buscar(id: uint, visitados: map[uint]bool): bool</text><text x="81" y="397.23" fill="#000" font-size="14" textLength="471.126">+ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void</text></g><!--class Grupo--><g class="entity" data-qualified-name="Grupo" id="ent0003" data-source-line="14"><rect x="282" y="158" width="483.126" height="80.197" fill="#F1F1F1" style="stroke:#181818;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="499.858" cy="174" rx="11" ry="11" fill="#ADD1B2" style="stroke:#181818;stroke-width:1;"/><path d="M497.514,173.844 Q497.514,175.719 498.092,176.734 Q498.67,177.734 499.827,177.734 Q501.17,177.734 501.827,175.719 L504.092,176.141 Q502.983,179.672 499.811,179.672 Q497.467,179.672 496.249,178.188 Q495.03,176.703 495.03,173.844 Q495.03,168.125 499.733,168.125 Q501.28,168.125 502.311,168.938 Q503.358,169.75 503.858,171.359 L501.592,171.906 Q501.358,171.031 500.874,170.547 Q500.389,170.047 499.764,170.047 Q497.514,170.047 497.514,173.844 Z " fill="#000"/><text x="520.358" y="179.083" fill="#000" font-size="14" textLength="38.91">Grupo</text><line x1="283" y1="190" x2="764.126" y2="190" style="stroke:#181818;stroke-width:0.5;"/><line x1="283" y1="198" x2="764.126" y2="198" style="stroke:#181818;stroke-width:0.5;"/><text x="288" y="215.132" fill="#000" font-size="14" textLength="290.65">+Buscar(id: uint, visitados: map[uint]bool): bool</text><text x="288" y="231.23" fill="#000" font-size="14" textLength="471.126">+ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void</text></g><g class="entity" data-qualified-name="GMN8" id="ent0009" data-source-line="26"><path d="M593,329 L593,360 L558.02,364 L593,368 L593,398.795 A0,0 0 0 0 593,398.795 L759.971,398.795 A0,0 0 0 0 759.971,398.795 L759.971,339 L749.971,329 L593,329 A0,0 0 0 0 593,329" style="stroke:#181818;stroke-width:0.5;" fill="#FEFFDD"/><path d="M749.971,329 L749.971,339 L759.971,339 L749.971,329" style="stroke:#181818;stroke-width:0.5;" fill="#FEFFDD"/><text x="599" y="346.194" fill="#000" font-size="13" textLength="26.73" font-weight="700">Leaf</text><text x="599" y="361.143" fill="#000" font-size="13" textLength="135.846">Busca por su propio ID.</text><text x="599" y="376.091" fill="#000" font-size="13" textLength="145.971">Agrega su propio registro</text><text xLine truncated
|
||||
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" data-diagram-type="CLASS" style="width:2690px;height:835px;background:#FEFEFE;" width="2690px" height="835px" viewBox="0 0 2690 835" zoomAndPan="magnify" preserveAspectRatio="none" contentStyleType="text/css"><?plantuml 1.2026.10?><defs/><g font-family="sans-serif" lengthAdjust="spacing"><rect x="0" y="0" width="2690" height="835" fill="#FEFEFE" style="stroke:none;"/><!--class IRepositorio--><g class="entity" data-qualified-name="IRepositorio" id="ent0001" data-source-line="11"><rect x="1130" y="652" width="332.975" height="168.789" fill="#F1F1F1" style="stroke:#181818;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="1249.221" cy="668" rx="11" ry="11" fill="#B4A7E5" style="stroke:#181818;stroke-width:1;"/><path d="M1245.518,662.297 L1253.127,662.297 L1253.127,664.188 L1250.549,664.188 L1250.549,671.609 L1253.127,671.609 L1253.127,673.5 L1245.518,673.5 L1245.518,671.609 L1248.111,671.609 L1248.111,664.188 L1245.518,664.188 L1245.518,662.297 Z " fill="#000"/><text x="1269.721" y="673.083" fill="#000" font-size="14" textLength="74.703" font-style="italic">IRepositorio</text><rect x="1456.645" y="649" width="9.33" height="15.799" fill="#FFF" style="stroke:#181818;stroke-width:1;stroke-dasharray:2,2;"/><text x="1457.645" y="661.256" fill="#000" font-size="12" font-style="italic">T</text><line x1="1131" y1="684" x2="1461.975" y2="684" style="stroke:#181818;stroke-width:0.5;"/><text x="1136" y="701.132" fill="#000" font-size="14" textLength="166.127">+Guardar(entidad *T) error</text><text x="1136" y="717.23" fill="#000" font-size="14" textLength="173.879">+ObtenerTodos() ([]T, error)</text><text x="1136" y="733.329" fill="#000" font-size="14" textLength="205.782">+ObtenerPorID(id uint) (*T, error)</text><text x="1136" y="749.428" fill="#000" font-size="14" textLength="238.485">+Crear(entidad T, usuarioID uint) error</text><text x="1136" y="765.526" fill="#000" font-size="14" textLength="320.975">+Actualizar(entidad *T, input T, usuarioID uint) error</text><text x="1136" y="781.625" fill="#000" font-size="14" textLength="233.03">+Eliminar(id uint, usuarioID uint) error</text><text x="1136" y="797.724" fill="#000" font-size="14" textLength="210.485">+Baja(id uint, usuarioID uint) error</text><text x="1136" y="813.822" fill="#000" font-size="14" textLength="283.63">+Alta(entidad *T, input T, usuarioID uint) error</text></g><!--class RepositorioBase--><g class="entity" data-qualified-name="RepositorioBase" id="ent0002" data-source-line="26"><rect x="1130" y="319" width="332.975" height="273.381" fill="#F1F1F1" style="stroke:#181818;stroke-width:0.5;" rx="2.5" ry="2.5"/><ellipse cx="1235.21" cy="335" rx="11" ry="11" fill="#ADD1B2" style="stroke:#181818;stroke-width:1;"/><path d="M1232.867,334.844 Q1232.867,336.719 1233.445,337.734 Q1234.023,338.734 1235.179,338.734 Q1236.523,338.734 1237.179,336.719 L1239.445,337.141 Q1238.335,340.672 1235.164,340.672 Q1232.82,340.672 1231.601,339.188 Q1230.382,337.703 1230.382,334.844 Q1230.382,329.125 1235.085,329.125 Q1236.632,329.125 1237.664,329.938 Q1238.71,330.75 1239.21,332.359 L1236.945,332.906 Q1236.71,332.031 1236.226,331.547 Q1235.742,331.047 1235.117,331.047 Q1232.867,331.047 1232.867,334.844 Z " fill="#000"/><text x="1255.71" y="340.083" fill="#000" font-size="14" textLength="102.724">RepositorioBase</text><rect x="1456.645" y="316" width="9.33" height="15.799" fill="#FFF" style="stroke:#181818;stroke-width:1;stroke-dasharray:2,2;"/><text x="1457.645" y="328.256" fill="#000" font-size="12" font-style="italic">T</text><line x1="1131" y1="351" x2="1461.975" y2="351" style="stroke:#181818;stroke-width:0.5;"/><text x="1136" y="368.132" fill="#000" font-size="14" textLength="84.807">-db *gorm.DB</text><line x1="1131" y1="375.099" x2="1461.975" y2="375.099" style="stroke:#181818;stroke-width:0.5;"/><text x="1136" y="392.23" fill="#000" font-size="14" textLength="166.127">+Guardar(entidad *T) error</text><text x="1136" y="408.329" fill="#000" font-size="14" textLength="173.879">+ObtenerTodos() ([]T, error)</text><text x="1136" y="424.428" fill="#000" font-size="14" textLength="205.782">+ObtenerPorID(id uint) (*T, error)</text><text x="1136" y="440.526" fill="#000" font-size="14" textLength="238.485">+Crear(entidad T, usuarioID uint) error</text><text x="1136" y="456.625" fill="#000" font-size="14" textLength="320.975">+Actualizar(entidad *T, input T, usuarioID uint) error</text><text x="1136" y="472.724" fill="#000" font-size="14" textLength="233.03">+Eliminar(id uint, usuarioID uint) error</text><text x="1136" y="488.822" fill="#000" font-size="14" textLength="210.485">+Baja(id uint, usuarioID uint) error</text><text x="1136" y="504.921" fill="#000" font-size="14" textLength="283.63">+Alta(entidad *T, input T, usuarioID uint) error</text><text x="1136" y="521.02" fill="#000" font-size="14" textLength="82.469">-tabla() string</text><text x="1136" y="537.118" fill="#000" font-size=Line truncated
|
||||
|
After Width: | Height: | Size: 39 KiB |
@@ -0,0 +1,48 @@
|
||||
* composite
|
||||
#+begin_src plantuml :file ../imagenes/composite.svg
|
||||
@startuml
|
||||
skinparam classAttributeIconSize 0
|
||||
skinparam backgroundColor #FFFFFF
|
||||
|
||||
interface IPermisosComponent {
|
||||
+ Buscar(id: uint, visitados: map[uint]bool): bool
|
||||
+ ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void
|
||||
}
|
||||
|
||||
class Permiso {
|
||||
+ Buscar(id: uint, visitados: map[uint]bool): bool
|
||||
+ ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void
|
||||
}
|
||||
|
||||
class Grupo {
|
||||
+ Buscar(id: uint, visitados: map[uint]bool): bool
|
||||
+ ListarPermisos(permisos: map[uint]Permiso, visitados: map[uint]bool): void
|
||||
}
|
||||
|
||||
IPermisosComponent <|.. Permiso
|
||||
IPermisosComponent <|.. Grupo
|
||||
|
||||
Grupo --> "0..*" Permiso : Permisos
|
||||
Grupo --> "0..*" Grupo : Grupos
|
||||
|
||||
note right of Permiso
|
||||
,**Leaf**
|
||||
Busca por su propio ID.
|
||||
Agrega su propio registro
|
||||
al mapa de permisos.
|
||||
end note
|
||||
|
||||
note right of Grupo
|
||||
,**Composite**
|
||||
Recorre recursivamente
|
||||
los permisos y grupos hijos.
|
||||
|
||||
Utiliza visitados para
|
||||
evitar ciclos y repeticiones.
|
||||
end note
|
||||
|
||||
@enduml
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
[[file:../imagenes/composite.svg]]
|
||||
@@ -1,55 +1,202 @@
|
||||
#+BEGIN_SRC plantuml :file ../imagenes/repository.png
|
||||
#+BEGIN_SRC plantuml :file ../imagenes/repository.svg
|
||||
@startuml RepositoryPattern
|
||||
interface IRepositorio {
|
||||
+Guardar(*T) error
|
||||
skinparam backgroundColor #FEFEFE
|
||||
|
||||
skinparam classAttributeIconSize 0
|
||||
skinparam linetype ortho
|
||||
hide empty members
|
||||
|
||||
' ==================================================
|
||||
' INTERFAZ GENERICA
|
||||
' ==================================================
|
||||
|
||||
interface "IRepositorio<T>" as IRepositorio {
|
||||
+Guardar(entidad *T) error
|
||||
+ObtenerTodos() ([]T, error)
|
||||
+ObtenerPorID(id uint) (*T, error)
|
||||
+Crear(T, usuarioID uint) error
|
||||
+Actualizar(*T, input T, usuarioID uint) error
|
||||
+Crear(entidad T, usuarioID uint) error
|
||||
+Actualizar(entidad *T, input T, usuarioID uint) error
|
||||
+Eliminar(id uint, usuarioID uint) error
|
||||
+Alta(*T, input T, usuarioID uint) error
|
||||
+Baja(id uint, usuarioID uint) error
|
||||
+Alta(entidad *T, input T, usuarioID uint) error
|
||||
}
|
||||
|
||||
class RepositorioBase {
|
||||
' ==================================================
|
||||
' REPOSITORIO BASE
|
||||
' ==================================================
|
||||
|
||||
class "RepositorioBase<T>" as RepositorioBase {
|
||||
-db *gorm.DB
|
||||
+Guardar(*T) error
|
||||
+Guardar(entidad *T) error
|
||||
+ObtenerTodos() ([]T, error)
|
||||
+ObtenerPorID(id uint) (*T, error)
|
||||
+Crear(T, uint) error
|
||||
+Actualizar(*T, T, uint) error
|
||||
+Eliminar(uint, uint) error
|
||||
+Alta(*T, T, uint) error
|
||||
+Crear(entidad T, usuarioID uint) error
|
||||
+Actualizar(entidad *T, input T, usuarioID uint) error
|
||||
+Eliminar(id uint, usuarioID uint) error
|
||||
+Baja(id uint, usuarioID uint) error
|
||||
+Alta(entidad *T, input T, usuarioID uint) error
|
||||
-tabla() string
|
||||
-registrarLog(...)
|
||||
-nuevaEntidad<T>() T
|
||||
-destinoConsulta<T>(entidad *T) any
|
||||
-establecerEmpresaID(...)
|
||||
}
|
||||
|
||||
class RepositorioRepuesto {
|
||||
+AltaRepuesto(id uint, uid uint) (*models.Repuesto, error)
|
||||
}
|
||||
|
||||
class RepositorioLogs {
|
||||
+ObtenerPorPaginas(pag uint) ([]logs.Log, error)
|
||||
+CantPaginas() (int64, error)
|
||||
+ObtenerConFiltros(p int, f dto.BusquedaLogsDto) ([]logs.Log, error)
|
||||
+CantPaginasConFiltros(f dto.BusquedaLogsDto) (int64, error)
|
||||
RepositorioBase ..|> IRepositorio
|
||||
|
||||
' ==================================================
|
||||
' ALMACEN
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioAlmacen {
|
||||
+Listar()
|
||||
+BuscarPorCodigo(codigo string)
|
||||
}
|
||||
|
||||
class RepositorioUsuario {
|
||||
}
|
||||
class RepositorioPermiso {
|
||||
}
|
||||
class RepositorioGrupo {
|
||||
}
|
||||
class RepositorioMarcas {
|
||||
class repositorioAlmacen
|
||||
|
||||
RepositorioAlmacen --|> RepositorioBase : T = models.Almacen
|
||||
repositorioAlmacen ..|> RepositorioAlmacen
|
||||
|
||||
' ==================================================
|
||||
' CLIENTE
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioCliente {
|
||||
+Listar(q string)
|
||||
+BuscarPorCuit(cuit string)
|
||||
}
|
||||
|
||||
IRepositorio <|.. RepositorioBase
|
||||
RepositorioBase <|-- RepositorioRepuesto
|
||||
RepositorioBase <|-- RepositorioLogs
|
||||
RepositorioBase <|-- RepositorioUsuario
|
||||
RepositorioBase <|-- RepositorioPermiso
|
||||
RepositorioBase <|-- RepositorioGrupo
|
||||
RepositorioBase <|-- RepositorioMarcas
|
||||
class repositorioCliente
|
||||
|
||||
RepositorioCliente --|> RepositorioBase : T = models.Cliente
|
||||
repositorioCliente ..|> RepositorioCliente
|
||||
|
||||
' ==================================================
|
||||
' DEVOLUCION
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioDevolucion {
|
||||
+CrearConDetalles(...)
|
||||
+ListarPorFactura(facturaID uint)
|
||||
}
|
||||
|
||||
class repositorioDevolucion
|
||||
|
||||
RepositorioDevolucion --|> RepositorioBase : T = models.Devolucion
|
||||
repositorioDevolucion ..|> RepositorioDevolucion
|
||||
|
||||
' ==================================================
|
||||
' FACTURA
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioFactura {
|
||||
+Listar(filtros FiltrosFactura)
|
||||
+ObtenerConRelaciones(id uint)
|
||||
}
|
||||
|
||||
class repositorioFactura
|
||||
|
||||
RepositorioFactura --|> RepositorioBase : T = models.Factura
|
||||
repositorioFactura ..|> RepositorioFactura
|
||||
|
||||
' ==================================================
|
||||
' LOGS
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioLogs {
|
||||
+Crear(entidad *logs.Log, usuarioID uint)
|
||||
+ObtenerPorPaginas(pag uint)
|
||||
+CantPaginas()
|
||||
+ObtenerConFiltros(p int, f dto.BusquedaLogsDto)
|
||||
+CantPaginasConFiltros(f dto.BusquedaLogsDto)
|
||||
}
|
||||
|
||||
class repositorioLogs
|
||||
|
||||
RepositorioLogs --|> RepositorioBase : T = logs.Log
|
||||
repositorioLogs ..|> RepositorioLogs
|
||||
|
||||
' ==================================================
|
||||
' MARCAS
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioMarcas {
|
||||
+ObtenerPorNombre(nombre string)
|
||||
+CrearFaltante(marca models.Marca)
|
||||
}
|
||||
|
||||
class repositorioMarcas
|
||||
|
||||
RepositorioMarcas --|> RepositorioBase : T = models.Marca
|
||||
repositorioMarcas ..|> RepositorioMarcas
|
||||
|
||||
' ==================================================
|
||||
' PROVEEDOR
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioProveedor {
|
||||
+Listar(q string)
|
||||
+BuscarPorNombre(nombre string)
|
||||
}
|
||||
|
||||
class repositorioProveedor
|
||||
|
||||
RepositorioProveedor --|> RepositorioBase : T = models.Proveedor
|
||||
repositorioProveedor ..|> RepositorioProveedor
|
||||
|
||||
' ==================================================
|
||||
' REMITO
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioRemito {
|
||||
+CrearConDetalles(...)
|
||||
+ExisteNumeroProveedor(...)
|
||||
+ObtenerConDetalles(id uint)
|
||||
}
|
||||
|
||||
class repositorioRemito
|
||||
|
||||
RepositorioRemito --|> RepositorioBase : T = models.Remito
|
||||
repositorioRemito ..|> RepositorioRemito
|
||||
|
||||
' ==================================================
|
||||
' REPUESTO
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioRepuesto {
|
||||
+ObtenerTodosConMarca()
|
||||
+AltaRepuesto(id uint, uid uint)
|
||||
}
|
||||
|
||||
class repositorioRepuesto
|
||||
|
||||
RepositorioRepuesto --|> RepositorioBase : T = models.Repuesto
|
||||
repositorioRepuesto ..|> RepositorioRepuesto
|
||||
|
||||
' ==================================================
|
||||
' RESERVA
|
||||
' ==================================================
|
||||
|
||||
interface RepositorioReserva {
|
||||
+ListarActivas(filtros dto.FiltrosReservaQuery)
|
||||
+CrearTx(tx *gorm.DB, reserva *models.Reserva)
|
||||
+Liberar(tx *gorm.DB, id uint) (bool, error)
|
||||
+BloquearVencidas(tx *gorm.DB, ahora time.Time)
|
||||
+MarcarVencida(tx *gorm.DB, id uint) (bool, error)
|
||||
}
|
||||
|
||||
class repositorioReserva {
|
||||
-db *gorm.DB
|
||||
-empresaID uint
|
||||
}
|
||||
|
||||
RepositorioReserva --|> RepositorioBase : T = models.Reserva
|
||||
repositorioReserva ..|> RepositorioReserva
|
||||
|
||||
@enduml
|
||||
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS:
|
||||
[[file:../imagenes/repository.png]]
|
||||
[[file:../imagenes/repository.svg]]
|
||||
Binary file not shown.
Reference in new issue
Block a user