added pengirim and maps api
This commit is contained in:
32
server/models/kurir_model.js
Normal file
32
server/models/kurir_model.js
Normal file
@ -0,0 +1,32 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const pengaturanPengirimanSchema = new mongoose.Schema({
|
||||
id_kurir: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
required: true,
|
||||
},
|
||||
biaya_minimal: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
biaya_maksimal: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
biaya_per_kilo: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
created_at: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
},
|
||||
updated_at: {
|
||||
type: Date,
|
||||
default: Date.now
|
||||
}
|
||||
})
|
||||
|
||||
const pengaturanPengirimanModel = mongoose.model('tb_pengaturan_pengiriman', pengaturanPengirimanSchema , 'tb_pengaturan_pengiriman');
|
||||
|
||||
module.exports = {pengaturanPengirimanModel};
|
||||
27
server/models/peta_model.js
Normal file
27
server/models/peta_model.js
Normal file
@ -0,0 +1,27 @@
|
||||
const mongoose = require('mongoose');
|
||||
|
||||
const petaKecamatanSchema = new mongoose.Schema({
|
||||
kecamatan : {
|
||||
type: String,
|
||||
},
|
||||
polygon:{
|
||||
type: Array,
|
||||
}
|
||||
})
|
||||
|
||||
const petaKelurahanDesaSchema = new mongoose.Schema({
|
||||
kecamatan_id: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
},
|
||||
kelurahan_desa: {
|
||||
type: String,
|
||||
},
|
||||
polygon:{
|
||||
type: Array,
|
||||
}
|
||||
})
|
||||
|
||||
const petaKecamatanModel = mongoose.model('tb_kecamatan', petaKecamatanSchema , 'tb_kecamatan');
|
||||
const petaKelurahanDesaModel = mongoose.model('tb_kelurahan_desa', petaKelurahanDesaSchema , 'tb_kelurahan_desa');
|
||||
|
||||
module.exports = {petaKecamatanModel, petaKelurahanDesaModel};
|
||||
Reference in New Issue
Block a user