Skip to content

Commit

Permalink
feat: update pass fields
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentHardouin committed Oct 12, 2024
1 parent f6934b9 commit aca3f69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 0 additions & 6 deletions model.pass/pass.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"formatVersion": 1,
"locations": [
{
"longitude": 2.371645,
"latitude": 48.896370
}
],
"organizationName": "UCPA",
"description": "UCPA Reservation ticket",
"labelColor": "rgb(255, 255, 255)",
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/adapters/CertificatesAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CertificatesAdapter {

async getForPass() {
if (this.cache.pass !== undefined) {
return this.cache;
return this.cache.pass;
}

const signerCert = await this.fileAdapter.readFile(resolve(import.meta.dirname, '../../../certs/signerCert.pem'));
Expand Down
15 changes: 11 additions & 4 deletions src/infrastructure/adapters/PassAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ class PassAdapter {
logoText: title,
webServiceURL: this.baseURL,
authenticationToken: token,
maxDistance: 100,
relevantDate: start,
maxDistance: 50,
locations: [
{
latitude: 48.896370,
longitude: 2.371645,
},
],
semantics: {
eventStartDate: start.toISOString(),
eventEndDate: new Date(new Date(start).setHours(start.getHours() + 1)).toISOString(),
Expand All @@ -41,16 +47,17 @@ class PassAdapter {

this.pass.primaryFields.push(
{
key: 'date',
key: 'event_date',
label: 'date',
value: start,
dateStyle: 'PKDateStyleMedium',
},
{
key: 'time',
key: 'event_time',
label: 'time',
value: start,
textAlignment: 'PKTextAlignmentRight',
timeStyle: 'PKDateStyleShort',
value: start,
},
);

Expand Down

0 comments on commit aca3f69

Please sign in to comment.