mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-10-05 05:07:56 +03:00
fix schema linkage
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import {Realm} from "realm";
|
||||
import {AmusementICVendor, ICType} from "../lib/iccard";
|
||||
|
||||
/**
|
||||
* Holds physical card information when a card is imported via NFC/FeliCa
|
||||
*/
|
||||
export class AMPhysicalCardData extends Realm.Object<AMPhysicalCardData> {
|
||||
|
||||
cardIDm: string;
|
||||
cardType: ICType;
|
||||
cardVendor: AmusementICVendor | null;
|
||||
|
||||
get isBootlegAmusementCard() {
|
||||
// real cards have an IDm manufacturer code of 012E (first two bytes of the IDm or in this case, the first 4 characters)
|
||||
return this.cardType === ICType.Amusement && !this.cardIDm.startsWith("012E");
|
||||
}
|
||||
|
||||
static schema: Realm.ObjectSchema = {
|
||||
name: "physicalCard",
|
||||
primaryKey: "cardIDm",
|
||||
|
||||
properties: {
|
||||
cardIDm: "string",
|
||||
cardType: "int",
|
||||
cardVendor: {type: "int", optional: true}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user