diff --git a/platform/organization.go b/platform/organization.go index 5ef7bd58..d43e5132 100644 --- a/platform/organization.go +++ b/platform/organization.go @@ -46,28 +46,6 @@ func (o Organization) CountTrap(ctx context.Context) (uint, error) { } return uint(result), nil } -func (o Organization) HasServiceArea() bool { - return o.model.ServiceAreaGeometry.IsValue() -} -func (o Organization) IsCatchall() bool { - return o.model.IsCatchall -} -func (o Organization) MarshalJSON() ([]byte, error) { - to_marshal := map[string]any{} - to_marshal["id"] = o.ID - to_marshal["name"] = o.Name() - to_marshal["service_area"] = o.ServiceArea - return json.Marshal(to_marshal) -} -func (o Organization) Name() string { - return o.model.Name -} -func (o Organization) PhoneOffice() string { - return o.model.OfficePhone.GetOr("") -} -func (o Organization) IsSyncOngoing() bool { - return IsSyncOngoing(o.ID) -} func (o Organization) FieldseekerSyncLatest(ctx context.Context) (*models.FieldseekerSync, error) { sync, err := o.model.FieldseekerSyncs(sm.OrderBy("created").Desc()).One(ctx, db.PGInstance.BobDB) if err != nil { @@ -79,6 +57,32 @@ func (o Organization) FieldseekerSyncLatest(ctx context.Context) (*models.Fields return sync, nil } +func (o Organization) HasServiceArea() bool { + return o.model.ServiceAreaGeometry.IsValue() +} +func (o Organization) IsCatchall() bool { + return o.model.IsCatchall +} +func (o Organization) IsSyncOngoing() bool { + return IsSyncOngoing(o.ID) +} +func (o Organization) LobAddressID() string { + return o.model.LobAddressID.GetOr("") +} +func (o Organization) MarshalJSON() ([]byte, error) { + to_marshal := map[string]any{} + to_marshal["id"] = o.ID + to_marshal["name"] = o.Name() + to_marshal["service_area"] = o.ServiceArea + to_marshal["lob_address_id"] = o.model.LobAddressID + return json.Marshal(to_marshal) +} +func (o Organization) Name() string { + return o.model.Name +} +func (o Organization) PhoneOffice() string { + return o.model.OfficePhone.GetOr("") +} func (o Organization) ServiceRequestRecent(ctx context.Context) ([]*models.FieldseekerServicerequest, error) { results, err := o.model.Servicerequests(sm.OrderBy("creationdate").Desc(), sm.Limit(10)).All(ctx, db.PGInstance.BobDB) if err != nil { diff --git a/resource/session.go b/resource/session.go index 821708c5..0ca987ae 100644 --- a/resource/session.go +++ b/resource/session.go @@ -23,9 +23,10 @@ func Session(r *router) *sessionR { } type organization struct { - ID int32 `json:"id"` - Name string `json:"name"` - ServiceArea *types.ServiceArea `json:"service_area"` + ID int32 `json:"id"` + LobAddressID string `json:"lob_address_id"` + Name string `json:"name"` + ServiceArea *types.ServiceArea `json:"service_area"` } type session struct { @@ -89,9 +90,10 @@ func (res *sessionR) Get(ctx context.Context, r *http.Request, user platform.Use Review: counts.Review, }, Organization: organization{ - ID: user.Organization.ID, - Name: user.Organization.Name(), - ServiceArea: user.Organization.ServiceArea, + ID: user.Organization.ID, + LobAddressID: user.Organization.LobAddressID(), + Name: user.Organization.Name(), + ServiceArea: user.Organization.ServiceArea, }, Self: *u, URLs: sessionURL{ diff --git a/ts/components/ReviewSiteColumnAction.vue b/ts/components/ReviewSiteColumnAction.vue index 66d7cd0a..1e009089 100644 --- a/ts/components/ReviewSiteColumnAction.vue +++ b/ts/components/ReviewSiteColumnAction.vue @@ -4,19 +4,25 @@
select a site to see actions
-Set Lob Address ID
+ diff --git a/ts/type/api.ts b/ts/type/api.ts index 814aac2e..7a2d7212 100644 --- a/ts/type/api.ts +++ b/ts/type/api.ts @@ -739,6 +739,7 @@ export class Mailer { export interface Organization { id: number; name: string; + lob_address_id: string; service_area?: Bounds; } export interface UserNotificationCounts {