update valadocs

This commit is contained in:
2019-01-06 18:44:25 -03:00
parent 393d9c3a3d
commit f7e52ad8f1
27 changed files with 693 additions and 20 deletions

View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Arrienda class based on the database table
*/
public class Arrienda : GLib.Object {
/**
* The price
*/
public uint precio { get; set; default = 0; }
/**
* The date the vehicle needs to be returned
*/
public string fecha_devolucion { get; set; default = ""; }
/**
* The vehicle
*/
public Vehiculo vehiculo { get; set; default = null; }
/**
* The compnay
*/
public Empresa empresa { get; set; default = null; }
/**
* Initialize the Arrienda class
* @param precio The price
* @param fecha_devolucion The date when the vehicle has to be returned
* @param vehiculo The Vehicle
* @param empresa The company
*/
public Arrienda (uint precio = 0, string fecha_devolucion = "", Vehiculo? vehiculo = null, Empresa? empresa = null) {
this.precio = precio;
this.fecha_devolucion = fecha_devolucion;
@@ -30,6 +52,11 @@ namespace LibSernatur {
this.empresa = empresa;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Arrienda
*/
public static Arrienda[]? get_all_arriendas(Database conn) {
var res = conn.exec ("
SELECT A.precio, A.fecha_devolucion,

View File

@@ -17,6 +17,9 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Asociado class based on the database table
*/
public class Asociado : GLib.Object {
public string fecha_llegada { get; set; default = ""; }
public string hora_llegada { get; set; default = ""; }
@@ -25,13 +28,29 @@ namespace LibSernatur {
public Tour tour { get; set; default = null; }
public Lugar lugar { get; set; default = null; }
/**
* Initialize the Asociado class
* @param fecha_llegada The date of arrival
* @param hora_llegada The time of arrival
* @param fecha_salida The date of departure
* @param hora_salida The time of departure
* @param tour The tour taken
* @param lugar The place visisted
*/
public Asociado (string fecha_llegada = "", string hora_llegada = "", string fecha_salida = "", string hora_salida = "", Tour? tour = null, Lugar? lugar = null) {
this.fecha_llegada = fecha_llegada;
this.hora_llegada = hora_llegada;
this.fecha_salida = fecha_salida;
this.hora_salida = hora_salida;
this.tour = tour;
this.lugar = lugar;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Asociado
*/
public static Asociado[]? get_all_asociados(Database conn) {
var res = conn.exec ("
SELECT A.fecha_llegada, A.hora_llegada, A.fecha_salida, A.hora_salida

View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Categoria class based on the database table
*/
public class Categoria : GLib.Object {
/**
* The id of the category
*/
public uint id_categoria { get; set; default = 0; }
/**
* The description of the category
*/
public string descripcion_categoria { get; set; default = ""; }
/**
* Initialize the Categoria class
* @param id_categoria The id of the category
* @param descripcion_categoria The description of the category
*/
public Categoria (uint id_categoria = 0, string descripcion_categoria = "") {
this.id_categoria = id_categoria;
this.descripcion_categoria = descripcion_categoria;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Categoria
*/
public static Categoria[]? get_all_categorias(Database conn) {
var res = conn.exec ("
SELECT id_categoria, descripcion_categoria FROM categoria

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Ciudad class based on the database table
*/
public class Ciudad : GLib.Object {
/**
* The id of the city
*/
public uint id_ciudad { get; set; default = 0; }
/**
* The name of the city
*/
public string nombre_ciudad { get; set; default = ""; }
/**
* The region
*/
public Region region { get; set; default = null; }
/**
* Initialize the Ciudad class
* @param id_ciudad The id of the city
* @param nombre_ciudad The name of the city
* @param region The region
* */
public Ciudad (uint id_ciudad = 0, string nombre_ciudad = "", Region? region = null) {
this.id_ciudad = id_ciudad;
this.nombre_ciudad = nombre_ciudad;
this.region = region;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Ciudad
*/
public static Ciudad[]? get_all_ciudades(Database conn) {
var res = conn.exec ("
SELECT C.id_ciudad, C.nombre_ciudad,

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The ContactoEmergencia class based on the database table
*/
public class ContactoEmergencia : GLib.Object {
/**
* The id of the contact
*/
public uint id_contacto { get; set; default = 0; }
/**
* The contact's phone number
*/
public uint telefono_emergencia { get; set; default = 0; }
/**
* The contact's name
*/
public string nombre_emergencia { get; set; default = ""; }
/**
* Initialize the ContactoEmergencia class
* @param id_contacto The id of the contact
* @param telefono_emergencia The contact's phone number
* @param nombre_emergencia The contact's name
*/
public ContactoEmergencia (uint id_contacto = 0, uint telefono_emergencia = 0, string nombre_emergencia = "") {
this.id_contacto = id_contacto;
this.telefono_emergencia = telefono_emergencia;
this.nombre_emergencia = nombre_emergencia;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of ContactoEmergencia
*/
public static ContactoEmergencia[]? get_all_contactos(Database conn) {
var res = conn.exec ("SELECT id_contacto, telefono_emergencia, nombre_emergencia FROM contacto_emergencia");
if (res.get_status () != ExecStatus.TUPLES_OK) {

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Descuento class based on the database table
*/
public class Descuento : GLib.Object {
/**
* The id of the discount
*/
public uint id_descuento { get; set; default = 0; }
/**
* The description of the discount
*/
public string descripcion_descuento { get; set; default = ""; }
/**
* The percentage of the discount
*/
public float porcentaje { get; set; default = 0; }
/**
* Initialize the Descuento class
* @param id_descuento The id of the discount
* @param descripcion_descuento The description of the discount
* @param porcentaje The percentage of the discount
*/
public Descuento (uint id_descuento = 0, string descripcion_descuento = "", float porcentaje = 0) {
this.id_descuento = id_descuento;
this.descripcion_descuento = descripcion_descuento;
this.porcentaje = porcentaje;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Descuento
*/
public static Descuento[]? get_all_descuentos(Database conn) {
var res = conn.exec ("
SELECT id_descuento, descripcion_descuento, porcentaje FROM descuento

View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Empresa class based on the database table
*/
public class Empresa : GLib.Object {
/**
* The RUT of the company
*/
public string rut_empresa { get; set; default = ""; }
/**
* The name of the company
*/
public string nombre_empresa { get; set; default = ""; }
/**
* The name of the contact in the company
*/
public string contacto { get; set; default = ""; }
/**
* The phone number of the contact
*/
public uint telefono { get; set; default = 0; }
/**
* Initialize the Empresa class
* @param rut_empresa The RUT of the company
* @param nombre_empresa The name of the company
* @param contacto The name of the contact in the company
* @param telefono The phone number of the contact
*/
public Empresa (string rut_empresa = "", string nombre_empresa = "", string contacto = "", uint telefono = 0) {
this.rut_empresa = rut_empresa;
this.nombre_empresa = nombre_empresa;
@@ -30,6 +52,11 @@ namespace LibSernatur {
this.telefono = telefono;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Empresa
*/
public static Empresa[]? get_all_empresas(Database conn) {
var res = conn.exec ("
SELECT rut_empresa, nombre_empresa, contacto, telefono FROM empresa

View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Enfermedad class based on the database table
*/
public class Enfermedad : GLib.Object {
/**
* The id of the illness
*/
public uint id_enfermedad { get; set; default = 0; }
/**
* The description of the illness
*/
public string descripcion_enfermedad { get; set; default = ""; }
/**
* Initialize the Enfermedad class
* @param id_enfermedad The id of the illness
* @param descripcion_enfermedad The description of the illness
*/
public Enfermedad (uint id_enfermedad = 0, string descripcion_enfermedad = "") {
this.id_enfermedad = id_enfermedad;
this.descripcion_enfermedad = descripcion_enfermedad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Enfermedad
*/
public static Enfermedad[]? get_all_enfermedades(Database conn) {
var res = conn.exec ("
SELECT id_enfermedad, descripcion_enfermedad FROM enfermedad

View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Esepcialidad class based on the database table
*/
public class Especialidad : GLib.Object {
/**
* The id of the specialty
*/
public uint id_especialidad { get; set; default = 0; }
/**
* The description of the specialty
*/
public string descripcion_especialidad { get; set; default = ""; }
/**
* Initialize the Especialidad class
* @param id_especialidad The specialty id
* @param descripcion_especialidad The description of the specialty
*/
public Especialidad (uint id_especialidad = 0, string descripcion_especialidad = "") {
this.id_especialidad = id_especialidad;
this.descripcion_especialidad = descripcion_especialidad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Especialidad
*/
public static Especialidad[]? get_all_especialidades(Database conn) {
var res = conn.exec ("
SELECT id_especialidad, descripcion_especialidad FROM especialidad

View File

@@ -17,13 +17,39 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Guia class based on the database table
*/
public class Guia : GLib.Object {
/**
* The RUT of the guide
*/
public string rut_guia { get; set; default = ""; }
/**
* The name of the guide
**/
public string nombre_guia { get; set; default = ""; }
/**
* The stree name
*/
public string calle { get; set; default = ""; }
/**
* The street number
*/
public uint numero { get; set; default = 0; }
/**
* The city
*/
public Ciudad ciudad { get; set; default = null; }
/**
* Initialize the Guia class
* @param rut_guia The RUT of the guide
* @param nombre_guia The name of the guide
* @param calle The street name
* @param numero The street number
* @param ciudad The city
*/
public Guia (string rut_guia = "", string nombre_guia = "", string calle = "", uint numero = 0, Ciudad? ciudad = null) {
this.rut_guia = rut_guia;
this.nombre_guia = nombre_guia;
@@ -32,6 +58,11 @@ namespace LibSernatur {
this.ciudad = ciudad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Guia
*/
public static Guia[]? get_all_guias(Database conn) {
var res = conn.exec ("
SELECT G.rut_guia, G.nombre_guia, G.calle, G.numero,

View File

@@ -17,13 +17,39 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Lugar class based on the database table
*/
public class Lugar : GLib.Object {
/**
* The id of the place
*/
public uint id_lugar { get; set; default = 0; }
/**
* The name of the place
*/
public string nombre_lugar { get; set; default = ""; }
/**
* The cost to enter
*/
public uint valor_entrada { get; set; default = 0; }
/**
* The level of difficulty
*/
public uint nivel { get; set; default = 0; }
/**
* The city
*/
public Ciudad ciudad { get; set; default = null; }
/**
* Initialize the Lugar class
* @param id_lugar The id of the place
* @param nombre_lugar The name of the place
* @param valor_entrada The cost to enter
* @param nivel The level of difficulty
* @param ciudad The city
*/
public Lugar (uint id_lugar = 0, string nombre_lugar = "", uint valor_entrada = 0, uint nivel = 0, Ciudad? ciudad = null) {
this.id_lugar = id_lugar;
this.nombre_lugar = nombre_lugar;
@@ -32,6 +58,11 @@ namespace LibSernatur {
this.ciudad = ciudad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Lugar
*/
public static Lugar[]? get_all_lugares(Database conn) {
var res = conn.exec ("
SELECT L.id_lugar, L.nombre_lugar, L.valor_entrada, L.nivel,

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Participa class based on the database table
*/
public class Participa : GLib.Object {
/**
* The tour
*/
public Tour tour { get; set; default = null; }
/**
* The guide
*/
public Guia guia { get; set; default = null; }
/**
* The category
*/
public Categoria categoria { get; set; default = null; }
/**
* Initialize the Participa class
* @param tour The tour
* @param guia The guide
* @param categoria The category
*/
public Participa (Tour? tour = null, Guia? guia = null, Categoria? categoria = null) {
this.tour = tour;
this.guia = guia;
this.categoria = categoria;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Participa
*/
public static Participa[]? get_all_participas(Database conn) {
var res = conn.exec ("
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Posee class based on the database table
*/
public class Posee : GLib.Object {
/**
* The specialty level
*/
public uint nivel_especialidad { get; set; default = 0; }
/**
* The guide
*/
public Guia guia { get; set; default = null; }
/**
* The speciality
*/
public Especialidad especialidad { get; set; default = null; }
/**
* Initialize the Posee class
* @param nivel_especialidad The specialty level
* @param guia The guide
* @param especialidad The specialty
*/
public Posee (uint nivel_especialidad = 0, Guia? guia = null, Especialidad? especialidad = null) {
this.nivel_especialidad = nivel_especialidad;
this.guia = guia;
this.especialidad = especialidad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Posee
*/
public static Posee[]? get_all_posees(Database conn) {
var res = conn.exec ("
SELECT P.nivel_especialidad,

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Realiza class based on the database table
*/
public class Realiza : GLib.Object {
/**
* The tour
*/
public Tour tour { get; set; default = null; }
/**
* The tourist
*/
public Turista turista { get; set; default = null; }
/**
* The discount
*/
public Descuento descuento { get; set; default = null; }
/**
* Initialize the Realiza class
* @param tour The tour
* @param turista The tourist
* @param descuento The discount
*/
public Realiza (Tour? tour = null, Turista? turista = null, Descuento? descuento = null) {
this.tour = tour;
this.turista = turista;
this.descuento = descuento;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Realiza
*/
public static Realiza[]? get_all_realizas(Database conn) {
var res = conn.exec ("
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Region class based on the database table
*/
public class Region : GLib.Object {
/**
* The id of the region
*/
public uint id_region { get; set; default = 0; }
/**
* The name of the region
*/
public string nombre_region { get; set; default = ""; }
/**
* Initialize the Region class
* @param id_region The region id
* @param nombre_region The region name
*/
public Region (uint id_region = 0, string nombre_region = "") {
this.id_region = id_region;
this.nombre_region = nombre_region;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Region
*/
public static Region[]? get_all_regiones(Database conn) {
var res = conn.exec ("
SELECT id_region, nombre_region FROM region

View File

@@ -17,17 +17,40 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The RequerirAuto class based on the database table
*/
public class RequerirAuto : GLib.Object {
/**
* The chofer
*/
public string chofer { get; set; default = ""; }
/**
* The tour
*/
public Tour tour { get; set; default = null; }
/**
* The vehicle
*/
public Vehiculo vehiculo { get; set; default = null; }
/**
* Initialize the RequerirAuto class
* @param chofer The chofer
* @param tour The tour
* @param vehiculo The vehicle
*/
public RequerirAuto (string chofer = "", Tour? tour = null, Vehiculo? vehiculo = null) {
this.chofer = chofer;
this.tour = tour;
this.vehiculo = vehiculo;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of RequerirAuto
*/
public static RequerirAuto[]? get_all_requerir_autos(Database conn) {
var res = conn.exec ("
SELECT R.chofer,

View File

@@ -17,15 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The TieneEnfermedad class based on the database table
*/
public class TieneEnfermedad : GLib.Object {
/**
* The tourist
*/
public Turista turista { get; set; default = null; }
/**
* The illness
*/
public Enfermedad enfermedad { get; set; default = null; }
/**
* Initialize the TieneEnfermedad class
* @param turista The tourist
* @param enfermedad The illness
*/
public TieneEnfermedad (Turista? turista = null, Enfermedad? enfermedad = null) {
this.turista = turista;
this.enfermedad = enfermedad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of TieneEnfermedad
*/
public static TieneEnfermedad[]? get_all_tiene_enfermedades(Database conn) {
var res = conn.exec ("
SELECT T.rut_turista, T.nombre_turista, T.fecha_nacimento,

View File

@@ -17,14 +17,44 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Tour class based on the database table
*/
public class Tour : GLib.Object {
/**
* The tour id
*/
public uint id_tour { get; set; default = 0; }
/**
* The tour name
*/
public string nombre_tour { get; set; default = ""; }
/**
* The individual cost
*/
public uint costo_indiv { get; set; default = 0; }
/**
* The group cost
*/
public uint costo_grupal { get; set; default = 0; }
/**
* The minimum number of people
*/
public uint minima_personas { get; set; default = 0; }
/**
* The city
*/
public Ciudad ciudad { get; set; default = null; }
/**
* Initialize the Tour class
* @param id_tour The tour id
* @param nombre_tour The tour name
* @param costo_indiv The individual cost
* @param costo_grupal The group cost
* @param minima_personas The minimum number of people
* @param ciudad The city
*/
public Tour (uint id_tour = 0, string nombre_tour = "", uint costo_indiv = 0, uint costo_grupal = 0, uint minima_personas = 0, Ciudad? ciudad = null) {
this.id_tour = id_tour;
this.nombre_tour = nombre_tour;
@@ -34,6 +64,11 @@ namespace LibSernatur {
this.ciudad = ciudad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Tour
*/
public static Tour[]? get_all_tours(Database conn) {
var res = conn.exec ("
SELECT T.id_tour, T.nombre_tour, T.costo_indiv, T.costo_grupal, T.minima_personas,

View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Turista class based on the database table
*/
public class Turista : GLib.Object {
/**
* The RUT of the tourist
*/
public string rut_turista { get; set; default = ""; }
/**
* The tourist name
*/
public string nombre_turista { get; set; default = ""; }
/**
* The birth date of the tourist
*/
public string fecha_nacimento { get; set; default = ""; }
/**
* The emergency contact
*/
public ContactoEmergencia contacto_emergencia { get; set; default = null; }
/**
* Initilize the Turista class
* @param rut_turista The RUT of the tourist
* @param nombre_turista The tourist name
* @param fecha_nacimento The birth date of the tourist
* @param contacto_emergencia The emergency contact
*/
public Turista (string rut_turista = "", string nombre_turista = "", string fecha_nacimento = "", ContactoEmergencia? contacto_emergencia = null) {
this.rut_turista = rut_turista;
this.nombre_turista = nombre_turista;
@@ -30,6 +52,12 @@ namespace LibSernatur {
this.contacto_emergencia = contacto_emergencia;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Turista
*/
public static Turista[]? get_all_turistas(Database conn) {
var res = conn.exec ("
SELECT T.rut_turista, T.nombre_turista, T.fecha_nacimento,

View File

@@ -17,12 +17,34 @@ namespace LibSernatur {
using Postgres;
using Wrapper;
/**
* The Vehiculo class based on the database table
*/
public class Vehiculo : GLib.Object {
/**
* The license plate
*/
public string patente { get; set; default = ""; }
/**
* The year of the vehicle
*/
public uint ano_vehiculo { get; set; default = 0; }
/**
* The make of the vehicle
*/
public string marca { get; set; default = ""; }
/**
* The capacity of the vehicle
*/
public uint capacidad { get; set; default = 0; }
/**
* Initialize the Vehiculo class
* @param patente The license plate
* @param ano_vehiculo The year of the vehicle
* @param marca The make of the vehicle
* @param capacidad The capacity of the vehicle
*/
public Vehiculo (string patente = "", uint ano_vehiculo = 0, string marca = "", uint capacidad = 0) {
this.patente = patente;
this.ano_vehiculo = ano_vehiculo;
@@ -30,6 +52,11 @@ namespace LibSernatur {
this.capacidad = capacidad;
}
/**
* Get all tuples and fields from database
* @param conn The database connection to use
* @return Returns an array of Vehiculo
*/
public static Vehiculo[]? get_all_vehiculos(Database conn) {
var res = conn.exec ("
SELECT patente, ano_vehiculo, marca, capacidad FROM vehiculo