depo-yonetim/models/lokasyon.js

20 lines
433 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Lokasyon (depo / şube) modeli
const store = require('./store');
// Geçerli lokasyon mu kontrol et
function dogrula(veri) {
const hatalar = [];
if (!veri.ad || veri.ad.trim() === '') hatalar.push('Lokasyon adı zorunludur');
return hatalar;
}
function tumu() {
return store.oku('lokasyonlar');
}
function bul(id) {
return store.bulKoleksiyonda('lokasyonlar', Number(id));
}
module.exports = { dogrula, tumu, bul };