Skip to content

Commit

Permalink
added timezone object and endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Lasher committed Jan 30, 2024
1 parent dc20985 commit 6f98303
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion famis_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import {
SpaceClass,
SpaceSubCategory,
State,
SubSpace,
SubSpace, TimeZone,
Udf,
UdfField,
UnitOfMeasure, UpdateWatcher,
Expand Down Expand Up @@ -335,6 +335,18 @@ export class FamisClient {
return this.getAll<PayPeriod>(context, 'payperiods');
}

//region TimeZones
async getTimeZones(context: QueryContext): Promise<Result<TimeZone>> {
return this.getAll<TimeZone>(context, 'timezones');
}

async getTimeZone(id: number): Promise<TimeZone | null> {
const filter = `Id eq ${id}`;
const zoneResponse = await this.getTimeZones(new QueryContext().setFilter(filter));
return zoneResponse.first;
}
//endregion

// Assets
async getAssetClasses(context: QueryContext): Promise<Result<AssetClass>> {
return this.getAll<AssetClass>(context, 'assetclasses');
Expand Down
11 changes: 11 additions & 0 deletions model/famis_models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3309,3 +3309,14 @@ export interface Position {
UpdateDate: Date;
}

export interface TimeZone {
Id: number;
DisplayName: string;
StDesc: string;
StOffset: number;
DstDescription: string;
DstOffset: number;
TabOrder: number;
Default: boolean;
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facility360",
"version": "1.0.19",
"version": "1.0.20",
"description": "A Node based 360Facility client SDK",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 6f98303

Please sign in to comment.