Skip to content

Instantly share code, notes, and snippets.

@otienoelvis
otienoelvis / csv_to_flask.py
Created June 12, 2024 12:48 — forked from dasdachs/csv_to_flask.py
Upload, read and save the content of a csv file to your model
#!/usr/bin/env python
from io import TextIOWrapper
import csv
from flask import Flask, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
# Create Flaskk app, config the db and load the db object
# http://flask-sqlalchemy.pocoo.org/2.1/quickstart/#a-minimal-application
@otienoelvis
otienoelvis / qpv2p1-depl.yaml
Last active January 14, 2024 19:39
Odoo depl
apiVersion: apps/v1
kind: Deployment
metadata:
name: odoo-depl
spec:
replicas: 1
selector:
matchLabels:
app: odooappservices
template:
CREATE DEFINER=`tenziDB_admin`@`%` PROCEDURE `Sp_Get_Payables`(
businessId varchar(100),
date_now varchar(100),
date_30 varchar(100),
date_60 varchar(100),
date_90 varchar(100)
)
BEGIN
-- 30 days
SELECT
version: '3'
networks:
openhim:
services:
mongo-db:
container_name: mongo-db
image: mongo:4.0
networks:
- openhim
using System.ComponentModel.DataAnnotations;
namespace DAL.ViewModels;
public class StockInOutDto
{
[Required]
public string BusinessId { get; set; }
[Required]
public int StoredReleasedNo { get; set; }
@otienoelvis
otienoelvis / TestController.cs
Created August 13, 2023 12:03
TestController.cs
using Microsoft.AspNetCore.Mvc;
namespace ErrorNotification.Controllers;
[Route("api/[controller]/[action]")]
[ApiController]
public class TestController : ControllerBase
{
private readonly ILogger<TestController> _logger;
@otienoelvis
otienoelvis / appsettings.json
Created August 13, 2023 11:48
appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Serilog": {
"MinimumLevel": {
@otienoelvis
otienoelvis / Program.cs
Created August 13, 2023 11:46
Program.cs
using Serilog;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog((ctx, cfg) => cfg
.WriteTo.Console()
.ReadFrom.Configuration(ctx.Configuration));
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
@otienoelvis
otienoelvis / ItemModelDto.cs
Created August 9, 2023 08:27
ItemModelDto.cs
using System.ComponentModel.DataAnnotations;
namespace DAL.ViewModels;
public class ItemModelDto
{
[Required]
public string BusinessId { get; set; }
// [Required]
// public string Pin { get; set; }
using System.ComponentModel.DataAnnotations;
using DAL.ViewModels.Enums;
namespace DAL.ViewModels;
public class ReceiptModelDto
{
[Required]
public string businessId { get; set; }
[Required]