Help us shape the future of Go! Take the 2026 Go Developer Survey

barang_masuk

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type BMRequest

type BMRequest struct {
	GudangID uint `json:"gudang_id" validate:"required"`
	// Tanggal: SENGAJA string "YYYY-MM-DD" (bukan time.Time langsung) —
	// form HTML <input type="date"> di frontend cuma kirim tanggal polos
	// tanpa jam/zona waktu (mis. "2026-08-10"), sedangkan JSON unmarshal
	// bawaan Go untuk time.Time WAJIB format RFC3339 penuh
	// ("2026-08-10T00:00:00Z"). Kalau field ini langsung time.Time,
	// c.BodyParser() SELALU gagal untuk payload dari form ini dengan
	// pesan "payload tidak valid" — bukan soal izin/permission sama
	// sekali, murni ketidakcocokan format tanggal. Diparse manual di
	// Create()/Update() pakai parseTanggalHarian().
	Tanggal string        `json:"tanggal" validate:"required"`
	Catatan string        `json:"catatan" validate:"max=255"`
	Items   []ItemRequest `json:"items" validate:"required,min=1,dive"`
}

type CompleteBMRequest added in v0.1.0

type CompleteBMRequest struct {
	Items []ItemSerialInput `json:"items"`
}

CompleteBMRequest — dikirim ke PATCH /barang-masuk/:id/selesai. Cukup body kosong ({} atau tanpa body sama sekali) untuk dokumen yang semua itemnya barang non-serial. Untuk item yang barangnya IsSerialized, wajib disertakan baris di sini dengan SerialNumbers sejumlah persis Qty item tersebut (lihat model.Barang.IsSerialized).

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(repo bmRepo.Repository, barangRepo barangRepo.Repository, gudangRepo gudangRepo.Repository,
	roleRepo role.Repository, jwtSvc *utils.JWTService,
	notifRepo notificationRepo.Repository) *Controller

func (*Controller) Batalkan

func (h *Controller) Batalkan(c *fiber.Ctx) error

Batalkan PATCH /barang-masuk/:id/batalkan

func (*Controller) Complete

func (h *Controller) Complete(c *fiber.Ctx) error

func (*Controller) Create

func (h *Controller) Create(c *fiber.Ctx) error

Create POST /barang-masuk — dibuat berstatus "draft"; stok & rak baru berubah setelah dokumen diselesaikan lewat Complete.

func (*Controller) Delete

func (h *Controller) Delete(c *fiber.Ctx) error

Delete DELETE /barang-masuk/:id — hanya boleh selama status draft.

func (*Controller) Detail

func (h *Controller) Detail(c *fiber.Ctx) error

Detail GET /barang-masuk/:id

func (*Controller) List

func (h *Controller) List(c *fiber.Ctx) error

List GET /barang-masuk?page=&limit=&search=&status=&gudang_id=&purchase_order_id=

func (*Controller) RegisterRoutes

func (h *Controller) RegisterRoutes(router fiber.Router)

func (*Controller) Summary

func (h *Controller) Summary(c *fiber.Ctx) error

Summary GET /barang-masuk/summary

func (*Controller) Update

func (h *Controller) Update(c *fiber.Ctx) error

Update PUT /barang-masuk/:id — hanya boleh selama status masih draft.

type ItemRequest

type ItemRequest struct {
	BarangID    uint  `json:"barang_id" validate:"required"`
	RakID       *uint `json:"rak_id"`
	Qty         int   `json:"qty" validate:"required,min=1"`
	HargaSatuan int64 `json:"harga_satuan" validate:"min=0"`
}

type ItemSerialInput added in v0.1.0

type ItemSerialInput struct {
	BarangMasukItemID uint     `json:"barang_masuk_item_id" validate:"required"`
	SerialNumbers     []string `json:"serial_numbers"`
}

type SummaryResponse

type SummaryResponse struct {
	TotalDokumen int64 `json:"total_dokumen"`
	Draft        int64 `json:"draft"`
	Selesai      int64 `json:"selesai"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL