Skip to content

Commit aca3f69

Browse files
feat: update pass fields
1 parent f6934b9 commit aca3f69

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

model.pass/pass.json

-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"formatVersion": 1,
3-
"locations": [
4-
{
5-
"longitude": 2.371645,
6-
"latitude": 48.896370
7-
}
8-
],
93
"organizationName": "UCPA",
104
"description": "UCPA Reservation ticket",
115
"labelColor": "rgb(255, 255, 255)",

src/infrastructure/adapters/CertificatesAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CertificatesAdapter {
1111

1212
async getForPass() {
1313
if (this.cache.pass !== undefined) {
14-
return this.cache;
14+
return this.cache.pass;
1515
}
1616

1717
const signerCert = await this.fileAdapter.readFile(resolve(import.meta.dirname, '../../../certs/signerCert.pem'));

src/infrastructure/adapters/PassAdapter.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ class PassAdapter {
2929
logoText: title,
3030
webServiceURL: this.baseURL,
3131
authenticationToken: token,
32-
maxDistance: 100,
3332
relevantDate: start,
33+
maxDistance: 50,
34+
locations: [
35+
{
36+
latitude: 48.896370,
37+
longitude: 2.371645,
38+
},
39+
],
3440
semantics: {
3541
eventStartDate: start.toISOString(),
3642
eventEndDate: new Date(new Date(start).setHours(start.getHours() + 1)).toISOString(),
@@ -41,16 +47,17 @@ class PassAdapter {
4147

4248
this.pass.primaryFields.push(
4349
{
44-
key: 'date',
50+
key: 'event_date',
4551
label: 'date',
4652
value: start,
4753
dateStyle: 'PKDateStyleMedium',
4854
},
4955
{
50-
key: 'time',
56+
key: 'event_time',
5157
label: 'time',
52-
value: start,
58+
textAlignment: 'PKTextAlignmentRight',
5359
timeStyle: 'PKDateStyleShort',
60+
value: start,
5461
},
5562
);
5663

0 commit comments

Comments
 (0)