cargo-platform/cmd/api/internal/domain/subdistrict.go
2026-08-16 01:44:29 +07:00

38 lines
2.3 KiB
Go

// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package domain
import (
"time"
)
const TableNameSubdistrict = "subdistrict"
// Subdistrict mapped from table <subdistrict>
type Subdistrict struct {
ID string `gorm:"column:id;type:character(26);primaryKey;default:generate_ulid()" json:"id"`
Name *string `gorm:"column:name;type:character varying(255);index:subdistrit_name_idx,priority:1" json:"name"`
ProvinceID *string `gorm:"column:province_id;type:character(26);index:subdistrit_province_id_idx,priority:1" json:"province_id"`
CityID *string `gorm:"column:city_id;type:character(26);index:subdistrit_city_id_idx,priority:1" json:"city_id"`
DistrictID *string `gorm:"column:district_id;type:character(26);index:subdistrit_district_id_idx,priority:1" json:"district_id"`
CreatedBy *string `gorm:"column:created_by;type:character(26);index:subdistrit_created_by_idx,priority:1" json:"created_by"`
CreatedOn *time.Time `gorm:"column:created_on;type:timestamp without time zone" json:"created_on"`
UpdatedBy *string `gorm:"column:updated_by;type:character(26)" json:"updated_by"`
UpdatedOn *time.Time `gorm:"column:updated_on;type:timestamp without time zone" json:"updated_on"`
MerchantID *string `gorm:"column:merchant_id;type:character(26)" json:"merchant_id"`
PostalCodes_Relation []PostalCode `gorm:"foreignKey:subdistrict_id;references:id" json:"postal_codes_relation"`
Province_Relation Province `gorm:"foreignKey:province_id;references:id" json:"province_relation"`
City_Relation City `gorm:"foreignKey:city_id;references:id" json:"city_relation"`
District_Relation District `gorm:"foreignKey:district_id;references:id" json:"district_relation"`
Merchants_Relation []Merchant `gorm:"foreignKey:subdistrict_id;references:id" json:"merchants_relation"`
CreatedBy_Relation User `gorm:"foreignKey:created_by;references:id" json:"created_by_relation"`
Merchant_Relation Merchant `gorm:"foreignKey:merchant_id;references:id" json:"merchant_relation"`
}
// TableName Subdistrict's table name
func (*Subdistrict) TableName() string {
return TableNameSubdistrict
}