initial commit 2
This commit is contained in:
21
domain/entity/address.go
Normal file
21
domain/entity/address.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package entity
|
||||
|
||||
type Address struct {
|
||||
ID int64
|
||||
UUID string
|
||||
InternalID string
|
||||
Name string
|
||||
Address string
|
||||
AddressType Params
|
||||
Latitude float64
|
||||
Longitude float64
|
||||
Origin Params
|
||||
User User
|
||||
CreatedUser User
|
||||
}
|
||||
|
||||
type Params struct {
|
||||
ID int64
|
||||
Key string
|
||||
Name string
|
||||
}
|
||||
252
domain/entity/eligibility.go
Normal file
252
domain/entity/eligibility.go
Normal file
@@ -0,0 +1,252 @@
|
||||
package entity
|
||||
|
||||
type Interchange struct {
|
||||
ISA ISA
|
||||
Division Division
|
||||
}
|
||||
|
||||
type ISA struct {
|
||||
ISA01 string
|
||||
ISA02 string
|
||||
ISA03 string
|
||||
ISA04 string
|
||||
ISA05 string
|
||||
ISA06 string
|
||||
ISA07 string
|
||||
ISA08 string
|
||||
ISA09 string
|
||||
ISA10 string
|
||||
ISA11 string
|
||||
ISA12 string
|
||||
ISA13 string
|
||||
ISA14 string
|
||||
ISA15 string
|
||||
ISA16 string
|
||||
}
|
||||
|
||||
type Division struct {
|
||||
GS GS
|
||||
HealthCareEligibilityBenefitResponse HealthCareEligibilityBenefitResponse
|
||||
}
|
||||
|
||||
type GS struct {
|
||||
GS01 string
|
||||
GS02 string
|
||||
GS03 string
|
||||
GS04 string
|
||||
GS05 string
|
||||
GS06 string
|
||||
GS07 string
|
||||
GS08 string
|
||||
}
|
||||
|
||||
type HealthCareEligibilityBenefitResponse struct {
|
||||
ST0010 ST0010
|
||||
BHT0020 BHT0020
|
||||
LoopHL0030 LoopHL0030
|
||||
}
|
||||
|
||||
type ST0010 struct {
|
||||
ST01 string
|
||||
ST02 string
|
||||
ST03 string
|
||||
}
|
||||
|
||||
type BHT0020 struct {
|
||||
BHT01 string
|
||||
BHT02 string
|
||||
BHT03 string
|
||||
BHT04 string
|
||||
BHT05 string
|
||||
}
|
||||
|
||||
type LoopHL0030 struct {
|
||||
HL0030 HL0030
|
||||
LoopNM10060 LoopNM10060
|
||||
LoopHL0460 LoopHL0460
|
||||
}
|
||||
|
||||
type HL0030 struct {
|
||||
HL01 string
|
||||
HL02 string
|
||||
HL03 string
|
||||
HL04 string
|
||||
}
|
||||
|
||||
type LoopNM10060 struct {
|
||||
NM10060 NM10060
|
||||
}
|
||||
|
||||
type NM10060 struct {
|
||||
NM101 string
|
||||
NM102 string
|
||||
NM103 string
|
||||
NM104 string
|
||||
NM105 string
|
||||
NM106 string
|
||||
NM107 string
|
||||
NM108 string
|
||||
NM109 string
|
||||
}
|
||||
|
||||
type LoopHL0460 struct {
|
||||
HL0460 HL0460
|
||||
LoopNM10490 LoopNM10490
|
||||
LoopHL0890 LoopHL0890
|
||||
}
|
||||
|
||||
type HL0460 struct {
|
||||
HL01 string
|
||||
HL02 string
|
||||
HL03 string
|
||||
HL04 string
|
||||
}
|
||||
|
||||
type LoopNM10490 struct {
|
||||
NM10490 NM10490
|
||||
}
|
||||
|
||||
type NM10490 struct {
|
||||
NM101 string
|
||||
NM102 string
|
||||
NM103 string
|
||||
NM104 string
|
||||
NM105 string
|
||||
NM106 string
|
||||
NM107 string
|
||||
NM108 string
|
||||
NM109 string
|
||||
}
|
||||
|
||||
type LoopHL0890 struct {
|
||||
HL0890 HL0890
|
||||
TRN0900 TRN0900
|
||||
LoopNM10920 LoopNM10920
|
||||
}
|
||||
|
||||
type HL0890 struct {
|
||||
HL01 string
|
||||
HL02 string
|
||||
HL03 string
|
||||
HL04 string
|
||||
}
|
||||
|
||||
type TRN0900 struct {
|
||||
TRN01 string
|
||||
TRN02 string
|
||||
TRN03 string
|
||||
}
|
||||
|
||||
type LoopNM10920 struct {
|
||||
NM10920 NM10920
|
||||
REF0930 REF0930
|
||||
N30950 N30950
|
||||
N40960 N40960
|
||||
DMG1000 DMG1000
|
||||
DTP1030 DTP1030
|
||||
LoopEB1050 []LoopEB1050
|
||||
}
|
||||
|
||||
type NM10920 struct {
|
||||
NM101 string
|
||||
NM102 string
|
||||
NM103 string
|
||||
NM104 string
|
||||
NM105 string
|
||||
NM106 string
|
||||
NM107 string
|
||||
NM108 string
|
||||
NM109 string
|
||||
}
|
||||
|
||||
type REF0930 struct {
|
||||
REF01 string
|
||||
REF02 string
|
||||
REF03 string
|
||||
}
|
||||
|
||||
type N30950 struct {
|
||||
N301 string
|
||||
}
|
||||
|
||||
type N40960 struct {
|
||||
N401 string
|
||||
N402 string
|
||||
N403 string
|
||||
}
|
||||
|
||||
type DMG1000 struct {
|
||||
DMG01 string
|
||||
DMG02 string
|
||||
DMG03 string
|
||||
}
|
||||
|
||||
type DTP1030 struct {
|
||||
DTP01 string
|
||||
DTP02 string
|
||||
DTP03 string
|
||||
}
|
||||
|
||||
type LoopEB1050 struct {
|
||||
EB1050 EB1050
|
||||
REF1070 REF1070
|
||||
MSG1180 MSG1180
|
||||
LoopIII1190 LoopIII1190
|
||||
LS1260 LS1260
|
||||
LoopNM11270 LoopNM11270
|
||||
}
|
||||
|
||||
type EB1050 struct {
|
||||
EB01 string
|
||||
EB02 string
|
||||
EB03 string
|
||||
EB04 string
|
||||
EB05 string
|
||||
EB06 string
|
||||
EB07 string
|
||||
EB08 string
|
||||
EB09 string
|
||||
EB10 string
|
||||
EB11 string
|
||||
EB12 string
|
||||
}
|
||||
|
||||
type REF1070 struct {
|
||||
REF01 string
|
||||
REF02 string
|
||||
REF03 string
|
||||
}
|
||||
|
||||
type MSG1180 struct {
|
||||
MSG01 string
|
||||
}
|
||||
|
||||
type LS1260 struct {
|
||||
LS01 string
|
||||
}
|
||||
|
||||
type LoopIII1190 struct {
|
||||
III1190 III1190
|
||||
}
|
||||
|
||||
type III1190 struct {
|
||||
III01 string
|
||||
III02 string
|
||||
}
|
||||
|
||||
type LoopNM11270 struct {
|
||||
NM11270 NM11270
|
||||
PER1310 PER1310
|
||||
}
|
||||
|
||||
type NM11270 struct {
|
||||
NM101 string
|
||||
NM102 string
|
||||
NM103 string
|
||||
}
|
||||
|
||||
type PER1310 struct {
|
||||
PER01 string
|
||||
PER02 string
|
||||
PER03 string
|
||||
}
|
||||
20
domain/entity/notification.go
Normal file
20
domain/entity/notification.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type Notification struct {
|
||||
ID int64 `json:"-"`
|
||||
UUID string `json:"uuid"`
|
||||
From string `json:"to"`
|
||||
To string `json:"to"`
|
||||
Type string `json:"type"`
|
||||
TypeID int64 `json:"type_id"`
|
||||
Subject string `json:"subject"`
|
||||
Message string `json:"message"`
|
||||
MessageType string `json:"message_type"`
|
||||
Ride Ride `json:"ride"`
|
||||
User User `json:"user"`
|
||||
CreatedUser User `json:"created_user"`
|
||||
Created time.Time `json:"create_at"`
|
||||
Read bool `json:"read"`
|
||||
}
|
||||
68
domain/entity/organization.go
Normal file
68
domain/entity/organization.go
Normal file
@@ -0,0 +1,68 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type OrganizationType struct {
|
||||
ID int64 `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Key string `json:"key"`
|
||||
Description string `json:"desc"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID int64 `json:"-"`
|
||||
UUID string `json:"id"`
|
||||
Type OrganizationType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"desc"`
|
||||
ReferenceID int64 `json:"-"`
|
||||
ParentID int64 `json:"-"`
|
||||
Main bool `json:"main"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
Active bool `json:"active"`
|
||||
Blocked bool `json:"blocked"`
|
||||
Suspended bool `json:"suspended"`
|
||||
Author User `json:"author"`
|
||||
LastEditor User `json:"last_editor"`
|
||||
Contacts []OrganizationContact `json:"contacts"`
|
||||
Addresses []OrganizationAddress `json:"addresses"`
|
||||
ChildOrgs []Organization `json:"childs"`
|
||||
Parent *Organization `json:"parent"`
|
||||
}
|
||||
|
||||
type OrganizationContact struct {
|
||||
ID int64 `json:"-"`
|
||||
UUID string `json:"id"`
|
||||
Organization *Organization `json:"organization"`
|
||||
Type ContactType `json:"type"`
|
||||
Contact string `json:"contact"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"desc"`
|
||||
Created time.Time `json:"created"`
|
||||
CreatedUser User `json:"author"`
|
||||
Updated time.Time `json:"updated"`
|
||||
UpdatedUser User `json:"last_editor"`
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
|
||||
type OrganizationAddress struct {
|
||||
ID int64 `json:"-"`
|
||||
UUID string `json:"id"`
|
||||
Organization *Organization `json:"organization"`
|
||||
InternalID string `json:"internal_id"`
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Description string `json:"desc"`
|
||||
Latitude float64 `json:"lat"`
|
||||
Longitude float64 `json:"long"`
|
||||
Created time.Time `json:"created"`
|
||||
CreatedUser User `json:"author"`
|
||||
Updated time.Time `json:"updated"`
|
||||
UpdatedUser User `json:"last_editor"`
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
17
domain/entity/profile.go
Normal file
17
domain/entity/profile.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type Profile struct {
|
||||
ID int64 `json:"-"`
|
||||
Name string `json:"name"`
|
||||
Key string `json:"key"`
|
||||
Description string `json:"desc"`
|
||||
Created time.Time `json:"created"`
|
||||
Updated time.Time `json:"updated"`
|
||||
Active bool `json:"active"`
|
||||
Blocked bool `json:"blocked"`
|
||||
Suspended bool `json:"suspended"`
|
||||
Visible bool `json:"visible"`
|
||||
Organization Organization `json:"organization"`
|
||||
}
|
||||
126
domain/entity/provider.go
Normal file
126
domain/entity/provider.go
Normal file
@@ -0,0 +1,126 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Provider struct {
|
||||
ProviderID int64 `json:"-"`
|
||||
ProviderUUID string `json:"provider_uuid"`
|
||||
InternalID string `json:"internal_id"`
|
||||
InternalSuffixID string `json:"internal_suffix_id"`
|
||||
MukID string `json:"muk_id"`
|
||||
OrganizatioName string `json:"org_name"`
|
||||
Gender string `json:"gender"`
|
||||
AcceptNewPatients string `json:"accept_new_patients"`
|
||||
Name string `json:"name"`
|
||||
FirstName string `json:"first"`
|
||||
MiddleName string `json:"middle"`
|
||||
LastName string `json:"last"`
|
||||
Title string `json:"title"`
|
||||
Active bool `json:"active"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreateDate time.Time `json:"create_at"`
|
||||
UpdateDate time.Time `json:"update_at"`
|
||||
CreatedUser User `json:"created_user"`
|
||||
Keys []ProviderKey `json:"keys"`
|
||||
Address ProviderAddress `json:"address"`
|
||||
Distance float64 `json:"distance"`
|
||||
}
|
||||
|
||||
type ProviderKey struct {
|
||||
ProviderKeyID int64 `json:"-"`
|
||||
Provider Provider `json:"provider"`
|
||||
InternalID string `json:"internal_id"`
|
||||
InternalSuffixID string `json:"internal_suffix_id"`
|
||||
LocationSeqNumber string `json:"location_seq_number"`
|
||||
PlanCode string `json:"plan_code"`
|
||||
ProductID string `json:"product_id"`
|
||||
TreatmentCategoryCode string `json:"treatment_category_code"`
|
||||
Active bool `json:"active"`
|
||||
Enabled bool `json:"enabled"`
|
||||
CreateDate time.Time `json:"create_at"`
|
||||
UpdateDate time.Time `json:"update_at"`
|
||||
CreatedUser User `json:"created_user"`
|
||||
}
|
||||
|
||||
type ProviderAddress struct {
|
||||
StreetAddress1 string `json:"street_address_1"`
|
||||
StreetAddress2 string `json:"street_address_2"`
|
||||
CityName string `json:"city"`
|
||||
State string `json:"state"`
|
||||
ZipCode string `json:"zipcode"`
|
||||
Country string `json:"country"`
|
||||
Latitude float64 `json:"lat"`
|
||||
Longitude float64 `json:"long"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
}
|
||||
|
||||
type ProviderResponse struct {
|
||||
MukID string `json:"mukId"`
|
||||
FivePartKeyGroups []PartKeyGroup `json:"fivePartKeyGroups"`
|
||||
OrgName string `json:"orgName"`
|
||||
Gender string `json:"gender"`
|
||||
AcceptNewPatients string `json:"acceptNewPatients"`
|
||||
ProviderName string `json:"providerName"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
MiddleName string `json:"middleName"`
|
||||
ProviderTitle string `json:"providerTitle"`
|
||||
StreetName1 string `json:"streetName_1"`
|
||||
StreetName2 string `json:"streetName_2"`
|
||||
CityName string `json:"cityName"`
|
||||
State string `json:"state"`
|
||||
ZipCode string `json:"zipCode"`
|
||||
Country string `json:"country"`
|
||||
Latitude string `json:"latitude"`
|
||||
Longitude string `json:"longitude"`
|
||||
PhoneNumber string `json:"phoneNumber"`
|
||||
ProviderEntityName string `json:"providerEntityName"`
|
||||
ProviderEntityCode string `json:"providerEntityCode"`
|
||||
ProviderTypeCode []ProviderTypeCode `json:"providerTypeCode"`
|
||||
Distance string `json:"distance"`
|
||||
AvailabilityOfCost string `json:"availabilityOfCost"`
|
||||
TDDPhoneNumber string `json:"tddPhoneNumber"`
|
||||
ExtendedOfficeHours string `json:"extendedOfficeHours"`
|
||||
ProviderCountyCode string `json:"providerCountyCode"`
|
||||
ProviderCountyName string `json:"providerCountyName"`
|
||||
HospitalAffiliationNames []HospitalAffiliationNames `json:"hospitalAffiliationNames"`
|
||||
ProviderAffiliationNumber string `json:"providerAffiliationNumber"`
|
||||
ProviderAffiliationName string `json:"providerAffiliationName"`
|
||||
LanguagesSpoken []Languages `json:"languagesSpoken"`
|
||||
OfficeLanguagesSpoken []Languages `json:"officeLanguagesSpoken"`
|
||||
MedSchool string `json:"medSchool"`
|
||||
MedSchoolYear string `json:"medSchoolYear"`
|
||||
Internship string `json:"internship"`
|
||||
Residence string `json:"residency"`
|
||||
Specialty1 string `json:"specialty1"`
|
||||
Specialty2 string `json:"specialty2"`
|
||||
Specialty3 string `json:"specialty3"`
|
||||
Specialty4 string `json:"specialty4"`
|
||||
Certification1 string `json:"certification1"`
|
||||
Certification2 string `json:"certification2"`
|
||||
Certification3 string `json:"certification3"`
|
||||
Certification4 string `json:"certification4"`
|
||||
}
|
||||
|
||||
type HospitalAffiliationNames struct {
|
||||
HospAffProvOrgName string `json:"hospAffProvOrgName"`
|
||||
}
|
||||
|
||||
type Languages struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
type ProviderTypeCode struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
type PartKeyGroup struct {
|
||||
ProviderNum string `json:"providerNum"`
|
||||
ProviderNumSuffix string `json:"providerNumSuffix"`
|
||||
LocationSeqNum string `json:"locationSeqNum"`
|
||||
PlanCode string `json:"planCode"`
|
||||
ProductID string `json:"productId"`
|
||||
TreatmentCategoryCode string `json:"treatmentCategoryCode"`
|
||||
}
|
||||
116
domain/entity/ride.go
Normal file
116
domain/entity/ride.go
Normal file
@@ -0,0 +1,116 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//WebhookResponse has the data and events from the webhook
|
||||
type WebhookResponse struct {
|
||||
EventID string `json:"event_id,omitempty"`
|
||||
HREF string `json:"href,omitempty"`
|
||||
OccurredAt time.Time `json:"occurred_at,omitempty"`
|
||||
EventType string `json:"event_type,omitempty"`
|
||||
Ride Ride `json:"event,omitempty"`
|
||||
}
|
||||
|
||||
// Ride entity data
|
||||
type Ride struct {
|
||||
ID int64 `db:"ride_id" json:"-"`
|
||||
UUID string `db:"ride_uuid" json:"ride_uuid"`
|
||||
User User `db:"user" json:"user"`
|
||||
Status RideStatus `db:"status" json:"status"`
|
||||
Type RideType `db:"type" json:"type"`
|
||||
InternalID string `db:"internal_id" json:"internal_id"`
|
||||
RequestDate *time.Time `db:"request_date" json:"request_date"`
|
||||
RequestMiliseconds *int64 `db:"request_ms" json:"request_ms"`
|
||||
GenerateDate *time.Time `db:"generate_date" json:"generate_date"`
|
||||
GenerateMiliseconds *int64 `db:"generate_ms" json:"generate_ms"`
|
||||
Note string `db:"notes" json:"notes"`
|
||||
PrimetimePercentage string `db:"primetime_percentage" json:"primetime_percentage"`
|
||||
Passenger RidePassenger `db:"passenger" json:"passenger"`
|
||||
Driver RideDriver `db:"driver" json:"driver"`
|
||||
Vehicle RideVehicle `db:"vehicle" json:"vehicle"`
|
||||
Route RideRoute `db:"route" json:"route"`
|
||||
VisitDate *time.Time `db:"visit_date" json:"visit_date"`
|
||||
VisitTime *time.Time `db:"visit_time" json:"visit_time"`
|
||||
PickupTime *time.Time `db:"pickup_time" json:"pickup_time"`
|
||||
Created time.Time `db:"create_at" json:"create_at"`
|
||||
Updated time.Time `db:"update_at" json:"update_at"`
|
||||
Visit Visit `db:"visit" json:"visit"`
|
||||
CreatedUser User `db:"created_user" json:"created_user"`
|
||||
TripType TripType `db:"trip_type" json:"trip_type"`
|
||||
}
|
||||
|
||||
// RidePassenger entity data
|
||||
type RidePassenger struct {
|
||||
ID int64 `db:"ride_passenger_id" json:"-"`
|
||||
FirstName string `db:"first_name" json:"first_name"`
|
||||
LastName string `db:"last_name" json:"last_name"`
|
||||
ImageURL *string `db:"image_url" json:"image_url"`
|
||||
PhoneNumber string `db:"phone_number" json:"phone_number"`
|
||||
InternalID *string `db:"internal_id" json:"internal_id"`
|
||||
}
|
||||
|
||||
// RideStatus entity data
|
||||
type RideStatus struct {
|
||||
ID int64 `db:"ride_status_id" json:"-"`
|
||||
Key string `db:"key" json:"key"`
|
||||
Value string `db:"value" json:"value"`
|
||||
}
|
||||
|
||||
// RideStatus entity data
|
||||
type TripType struct {
|
||||
ID int64 `db:"trip_type_id" json:"-"`
|
||||
Key string `db:"trip_type_key" json:"key"`
|
||||
Value string `db:"trip_type" json:"value"`
|
||||
}
|
||||
|
||||
// RideType entity data
|
||||
type RideType struct {
|
||||
ID int64 `db:"ride_type_id" json:"-"`
|
||||
Key string `db:"key" json:"key"`
|
||||
Value string `db:"value" json:"value"`
|
||||
}
|
||||
|
||||
// RideRoute entity data
|
||||
type RideRoute struct {
|
||||
ID int64 `db:"ride_route_id" json:"-"`
|
||||
Origin Location `db:"origin" json:"origin"`
|
||||
Destination Location `db:"destination" json:"destination"`
|
||||
RouteKML *string `db:"route_kml" json:"route_kml"`
|
||||
Distance float64 `db:"distance" json:"distance"`
|
||||
Duration int64 `db:"duration" json:"duration"`
|
||||
ETA int64 `db:"eta" json:"eta"`
|
||||
Created time.Time `db:"create_at" json:"create_at"`
|
||||
Updated time.Time `db:"update_at" json:"update_at"`
|
||||
}
|
||||
|
||||
// Location entity data
|
||||
type Location struct {
|
||||
ID string `db:"id" json:"id"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Address string `db:"address" json:"address"`
|
||||
Latitude float64 `db:"lat" json:"lat"`
|
||||
Longitude float64 `db:"lng" json:"lng"`
|
||||
}
|
||||
|
||||
// RideDriver entity data
|
||||
type RideDriver struct {
|
||||
ID int64 `db:"ride_driver_id" json:"-"`
|
||||
Name string `db:"name" json:"name"`
|
||||
ImageURL *string `db:"image_url" json:"image_url"`
|
||||
PhoneNumber string `db:"phone_number" json:"phone_number"`
|
||||
Rating *string `db:"rating" json:"rating"`
|
||||
}
|
||||
|
||||
// RideVehicle entity data
|
||||
type RideVehicle struct {
|
||||
ID int64 `db:"ride_vehicle_id" json:"-"`
|
||||
Color string `db:"color" json:"color"`
|
||||
ImageURL string `db:"image_url" json:"image_url"`
|
||||
LicensePlate string `db:"license_plate" json:"license_plate"`
|
||||
LicensePlateState string `db:"license_plate_state" json:"license_plate_state"`
|
||||
Make string `db:"make" json:"make"`
|
||||
Model string `db:"model" json:"model"`
|
||||
Year int64 `db:"year" json:"year"`
|
||||
}
|
||||
55
domain/entity/user.go
Normal file
55
domain/entity/user.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"bitbucket.org/nemt/nemt-portal-api/infra/errors"
|
||||
)
|
||||
|
||||
// User entity data
|
||||
type User struct {
|
||||
ID int64 `db:"user_id" json:"-"`
|
||||
UUID string `db:"user_uuid" json:"uuid"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Member string `db:"member" json:"member"`
|
||||
BirthDate time.Time `db:"birth_date" json:"birthdate"`
|
||||
LoginID int64 `db:"login_id" json:"-"`
|
||||
LoginUUID string `db:"login_uuid" json:"loginuuid"`
|
||||
Email string `db:"email" json:"email"`
|
||||
PhoneNumber string `db:"phone_number" json:"phonenumber"`
|
||||
Pass string `db:"password" json:"pass"`
|
||||
LoginKey string `db:"login_key" json:"loginkey"`
|
||||
Gender string `db:"gender" json:"gender"`
|
||||
Active bool `db:"active" json:"active"`
|
||||
Created time.Time `db:"createat" json:"createat"`
|
||||
Updated time.Time `db:"updateat" json:"updateat"`
|
||||
Contacts []ContactInfo `db:"contacts" json:"contacts"`
|
||||
Rides []Ride `db:"rides" json:"rides"`
|
||||
Addresses []Address `db:"addresses" json:"addresses"`
|
||||
Profiles []Profile `json:"profiles,omitempty"`
|
||||
Types []OrganizationType `json:"types,omitempty"`
|
||||
Organizations []Organization `json:"organizations,omitempty"`
|
||||
}
|
||||
|
||||
type ContactInfo struct {
|
||||
ID int64 `db:"contact_id" json:"contact_id"`
|
||||
Type ContactType `db:"contact_type" json:"contact_type"`
|
||||
UserID int64 `db:"user_id" json:"-"`
|
||||
Value string `db:"value" json:"value"`
|
||||
}
|
||||
|
||||
type ContactType struct {
|
||||
ID int64 `db:"contact_type_id" json:"contact_type_id"`
|
||||
Key string `db:"contact_type_key" json:"contact_type_key"`
|
||||
Value string `db:"contact_type_value" json:"contact_type_value"`
|
||||
}
|
||||
|
||||
// Validate validates the user entity state
|
||||
func (entity *User) Validate() error {
|
||||
if strings.TrimSpace(entity.Name) == "" {
|
||||
return errors.NewValidationError("name", "Nome do usuário é obrigatório")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
35
domain/entity/visit.go
Normal file
35
domain/entity/visit.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// VisitStatus entity data
|
||||
type VisitStatus struct {
|
||||
ID int64 `db:"visit_status_id" json:"-"`
|
||||
Key string `db:"key" json:"key"`
|
||||
Value string `db:"value" json:"value"`
|
||||
}
|
||||
|
||||
// Visit entity data
|
||||
type Visit struct {
|
||||
ID int64 `db:"visit_id" json:"-"`
|
||||
UUID string `db:"visit_uuid" json:"-"`
|
||||
Status VisitStatus `db:"visit_status" json:"-"`
|
||||
User User `db:"user" json:"-"`
|
||||
VisitDuration int64 `db:"visit_duration" json:"-"`
|
||||
VisitDatetime time.Time `db:"visit_datetime" json:"-"`
|
||||
PickupDatetime time.Time `db:"pickup_datetime" json:"-"`
|
||||
Notes *string `db:"notes" json:"-"`
|
||||
PickupAddressID int64 `db:"pickup_address_id" json:"-"`
|
||||
DestinationAddressID int64 `db:"destination_address_id" json:"-"`
|
||||
Pickup Location `db:"pickup" json:"-"`
|
||||
Provider Provider `db:"provider" json:"-"`
|
||||
CreatedUser User `db:"created_user" json:"-"`
|
||||
Created time.Time `db:"created_date" json:"-"`
|
||||
Updated time.Time `db:"updated_date" json:"-"`
|
||||
ReturnDate *time.Time `db:"return_date" json:"-"`
|
||||
TripType TripType `db:"trip_type" json:"-"`
|
||||
ExternalID string `db:"visit_external_id" json:"-"`
|
||||
Rides []Ride `db:"rides" json:"-"`
|
||||
}
|
||||
Reference in New Issue
Block a user